Get Started
Integrating the Pieces MCP with Claude Code brings your workflow context directly into the Claude Code CLI and VS Code extension. Claude Code is Anthropic's developer-focused AI tool for coding tasks. Setup is simple: add Pieces via the CLI, and it's automatically available in the extension.
Prerequisites
There are two prerequisites for integrating Pieces with Claude Code as an MCP—an active instance of PiecesOS and the fully-enabled Long-Term Memory engine.
Installing PiecesOS & Configuring Permissions
Follow the instructions below for a detailed guide on setting up and configuring PiecesOS to correctly pass captured workflow context to the Pieces MCP server.
Setting Up Claude Code
There are two ways to set up Pieces MCP for Claude Code: use the Pieces CLI for automatic configuration, or add the server manually via the Claude CLI.
Method 1: CLI Install (Recommended)
The Pieces CLI can automatically configure Pieces MCP for Claude Code—no manual config editing required.
```bash
pieces mcp setup
```
Method 2: Manual Setup via Claude CLI
Claude Code supports adding MCP servers via the CLI. Servers added via claude mcp add are automatically available in the Claude Code VS Code extension—no additional setup needed.
Local Setup (Streamable HTTP — recommended)
Run in your terminal:
claude mcp add --transport http pieces http://localhost:39300/model_context_protocol/2025-03-26/mcp
Local Setup (SSE)
claude mcp add --transport sse pieces http://localhost:39300/model_context_protocol/2024-11-05/sse
Project-Scoped Setup
To make Pieces MCP available only for the current project (stored in .mcp.json at project root):
claude mcp add --transport http --scope project pieces http://localhost:39300/model_context_protocol/2025-03-26/mcp
Managing Servers
# List all configured servers
claude mcp list
# Remove a server
claude mcp remove pieces
# Show server details
claude mcp get pieces
Using Pieces MCP Server in Claude Code
Once integrated, you can utilize Pieces LTM directly in Claude Code.
Updating
To update the URL, remove and re-add the server:
claude mcp remove pieces
claude mcp add --transport http pieces https://NEW_URL/model_context_protocol/2025-03-26/mcp
Troubleshooting
If you're experiencing issues integrating Pieces MCP with Claude Code:
Verify PiecesOS Status: Ensure PiecesOS is actively running on your system. Test with:
curl http://localhost:39300/.well-known/versionTransport Error: Try switching between
--transport httpand--transport sse.VS Code Extension Not Seeing Tools: Restart VS Code after adding via CLI.
Config Location: User scope uses
~/.claude.json; project scope uses.mcp.jsonat project root.
You're now set to enhance your Claude Code workflow with powerful context retrieval through Pieces MCP. Happy coding!