Switching between a modern AI-first editor and a terminal-based agent exposes an annoying reality in software engineering: AI assistants are completely amnesiac across tool boundaries. When you debug a nasty race condition in the terminal using Claude Code, find the fix, and switch over to Cursor to refactor the surrounding service architecture, Cursor knows nothing about what you just did. You end up copying stack traces, pasting snippet links, and re-explaining the bug.
At 365Finds, we consider manual context-shuffling across coding assistants an embarrassing tax on developer focus. Anthropic designed the Model Context Protocol (MCP) precisely to break these data silos, and Pieces took a radical engineering step: it sunsetted its fragile, standalone IDE plugins entirely to bet the house on a native local MCP server.
PiecesOS runs locally as a background daemon, hosting your Long-Term Memory (LTM) engine. By registering this single engine into both Cursor and Claude Code via MCP, both tools tap into the same persistent, cross-application memory pool. Here is how Pieces exposes its MCP server, how to configure both clients, and how to verify that your cross-tool memory pipeline actually works.
The Cross-Tool Silo and the Pieces MCP Mechanism
Most coding assistants operate exclusively inside their immediate context window. Cursor inspects your open files and indexed repository embeddings. Claude Code inspects the directory where you launched your terminal session. Neither assistant knows what you researched on Stack Overflow twenty minutes ago, what snippet you saved in your library last Tuesday, or what debugging conclusion Claude Code reached five minutes before you opened Cursor.
Pieces solves this fragmentation by running a local system service called PiecesOS (by default on port 39300). Inside PiecesOS sits the Long-Term Memory engine (LTM-2.7), which passively monitors and organizes developer activity—code snippets, visited technical documentation, git interactions, and architectural discussions.
Instead of requiring individual editor plugins that inevitably break on editor updates, PiecesOS exposes a standards-compliant MCP server directly over HTTP/SSE. Through the standardized tool ask_pieces_ltm, any connected client can query your local knowledge base.
+-------------------------------------------------------------+
| PiecesOS (localhost:39300) |
| +-----------------------------------------------------+ |
| | Long-Term Memory Engine (LTM-2.7) | |
| | (Snippets, Debug Logs, Docs, Browser History) | |
| +-----------------------------------------------------+ |
| ^ ^ |
| | MCP Tool: ask_pieces_ltm | |
+---------|-------------------------------------------|-------+
| |
Streamable HTTP Streamable HTTP
| |
+---------------------+ +---------------------+
| Cursor IDE | | Claude Code |
| (Agent Mode / Chat) | | (Terminal CLI & |
| ~/.cursor/mcp.json| | VS Code Extension)|
+---------------------+ +---------------------+
When you prompt Cursor or Claude Code, the assistant invokes ask_pieces_ltm under the hood, retrieves relevant snippets or past troubleshooting steps, and injects that historical context into its working context. At 365Finds, we appreciate that this architecture is local-first: your indexed workflow data stays on your own machine rather than being uploaded to an external vector database.
Prerequisites: Preparing PiecesOS and Long-Term Memory
Before editing configuration files, you must ensure that PiecesOS is running and that its LTM engine is capturing context.
- Launch PiecesOS: Verify that PiecesOS is running in the background. On macOS or Linux, test the health endpoint via your terminal:
If it returns a valid response, PiecesOS is active.curl http://localhost:39300/.well-known/health - Enable Long-Term Memory (LTM): Open the Pieces Desktop App or click the PiecesOS Quick Menu in your OS menu bar/system tray. Navigate to settings and ensure that Long-Term Memory (LTM-2.7) is toggled On. If LTM is disabled, the MCP server will run, but
ask_pieces_ltmwill return empty memory payloads. - Confirm the MCP Endpoint: The standard streamable HTTP endpoint exposed by PiecesOS is:
If porthttp://localhost:39300/model_context_protocol/2025-03-26/mcp39300is occupied on your machine, PiecesOS may dynamically bind to a subsequent port such as39301. Check the exact endpoint in Pieces Desktop underSettings->Model Context Protocol (MCP).
Configuring Cursor with Pieces MCP
Cursor supports MCP servers natively. You can configure it via the Pieces Desktop App one-click button, the Pieces CLI, or by editing Cursor's configuration file manually.
Option A: One-Click Setup via Pieces Desktop
- Open the Pieces Desktop App.
- Click your user profile in the upper corner, hover over Settings, and select MCP.
- Under the MCP Connections section, locate Cursor and click Connect.
- Pieces writes the connection entry directly into Cursor's configuration file. Restart Cursor once complete.
Option B: Manual Configuration via mcp.json
If you prefer explicit version-controlled or global configuration, edit Cursor's JSON settings directly:
- Open Cursor and navigate to Cursor Settings -> MCP. Alternatively, open the configuration file directly:
- Global config:
~/.cursor/mcp.json - Project-level override:
.cursor/mcp.json(inside your project root)
- Global config:
- Add the
Piecesserver definition undermcpServers:
{
"mcpServers": {
"Pieces": {
"url": "http://localhost:39300/model_context_protocol/2025-03-26/mcp"
}
}
}
- Save the file. In Cursor Settings under MCP, click the refresh button. You should see a green status dot next to Pieces, confirming a successful connection.
- Crucial Cursor Setting: To allow Cursor to actually call the Pieces MCP server, switch your chat panel mode to Agent mode (using
⌘+ion macOS orCtrl+ion Windows/Linux). Standard "Ask" or inline chat modes do not execute tool calls.
Configuring Claude Code via CLI
Claude Code manages its Model Context Protocol integrations through the claude mcp command suite. Any server added to Claude Code CLI is automatically recognized by both the terminal session and the Claude Code VS Code extension.
1. Global User-Scope Setup (Recommended)
To make your Pieces memory available across every directory and project you run Claude Code in, add the server under the user scope:
claude mcp add --scope user pieces --transport http http://localhost:39300/model_context_protocol/2025-03-26/mcp
2. Project-Scope Setup
If you only want Pieces active within a specific project repository, use the project scope, which saves the entry to .mcp.json in your repository root:
claude mcp add --scope project pieces --transport http http://localhost:39300/model_context_protocol/2025-03-26/mcp
3. Alternative SSE Transport
If your Claude Code environment encounters streaming negotiation issues over HTTP, switch to the Server-Sent Events (SSE) endpoint:
claude mcp add --transport sse pieces http://localhost:39300/model_context_protocol/2024-11-05/sse
4. Verifying and Managing Claude Code MCP Servers
To confirm that Claude Code has registered Pieces, run:
claude mcp list
You should see pieces listed with its active URL and transport type. To inspect details or remove the server, use:
# View server status and registered tools
claude mcp get pieces
# Remove server if needing reconfiguration
claude mcp remove pieces
End-to-End Verification: Testing the Shared Memory Pipeline
Once both Cursor and Claude Code are wired to PiecesOS, test that knowledge captured in one context flows seamlessly to the other.
| Test Phase | Tool Used | Action / Prompt | Expected Result |
|---|---|---|---|
| 1. Memory Capture | Browser / Pieces Desktop | Save an authentication middleware snippet or investigate an issue with an auth error log. | Pieces LTM indexes the snippet and debug note locally. |
| 2. Terminal Query | Claude Code CLI | Run claude and prompt: "Based on the auth middleware fix I looked into earlier, what header was causing the failure?" | Claude Code executes ask_pieces_ltm and returns the exact header from your Pieces memory. |
| 3. IDE Refactor | Cursor (Agent Mode) | Open your project, open Composer/Agent (⌘+i), and prompt: "Implement the auth header fix we verified in Claude Code according to my Pieces memory." | Cursor invokes ask_pieces_ltm, pulls the same solution, and modifies your local source file without manual copy-pasting. |
365Finds Implementation Judgment and Pitfalls
At 365Finds, our assessment of Pieces' MCP implementation is decidedly favorable. Abandoning brittle, IDE-specific extensions in favor of a unified local MCP daemon is the cleanest architectural pattern we have seen in the developer context space.
However, teams should be aware of three practical operational friction points:
- Port Drift: While PiecesOS defaults to
39300, running local Docker containers or microservices that bind to high 39000s ports can force PiecesOS to shift to39301or39302. If your Cursor MCP green dot turns red or Claude Code returns connection refused, check the Quick Menu first before suspecting an MCP protocol bug. - Agent Mode Enforcement in Cursor: Many developers leave Cursor in standard chat or edit mode and wonder why Pieces context never appears. Cursor strictly isolates MCP tool calls to Agent mode.
- Background Daemon Footprint: PiecesOS is a full native service running background semantic indexing. On resource-constrained development machines, monitor its memory footprint, particularly during initial indexing of large code snippet libraries.
By connecting both Cursor and Claude Code to PiecesOS through MCP, you replace fragmented copy-paste workflows with a single, synchronized local memory layer.