Get Started
Integrating the Pieces MCP with Visual Studio Code brings your workflow context directly into your editor. With this integration, your AI assistant can access past implementations, similar code, and historical debugging context—without searching through commits or notes.
Prerequisites
There are two prerequisites for integrating Pieces with VS Code as an MCP—an active instance of PiecesOS and the fully-enabled Long-Term Memory engine.
If you do not have PiecesOS, you can download it alongside the [Pieces Desktop App](/products/desktop/download) or [install it standalone](/products/core-dependencies/pieces-os/manual-installation#manual-download--installation) here.
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.
Getting the MCP Endpoint for PiecesOS
To use Pieces MCP with VS Code, you'll need the MCP endpoint from PiecesOS. VS Code supports Streamable HTTP (recommended) or SSE.
Streamable HTTP (recommended):
http://localhost:39300/model_context_protocol/2025-03-26/mcp
SSE (legacy):
http://localhost:39300/model_context_protocol/2024-11-05/sse
To find the current MCP endpoint with the active instance of PiecesOS, open the PiecesOS Quick Menu and expand the Model Context Protocol (MCP) Servers tab. You can copy the endpoint, which includes the active port number.
You can also find this in the Pieces Desktop App by opening Settings and clicking Model Context Protocol (MCP).
Setting Up VS Code
There are two ways to set up Pieces MCP for VS Code: use the Pieces CLI for automatic configuration, or configure manually.
One-Click Install
Install Pieces MCP in VS Code with a single click. Ensure PiecesOS is running and Long-Term Memory is enabled before clicking.
Method 1: CLI Install (Recommended)
The Pieces CLI can automatically configure Pieces MCP for VS Code—no manual config editing required.
```bash
pieces mcp setup
```
Method 2: Manual Configuration
VS Code uses a servers root key (not mcpServers) in its MCP configuration. The transport type is set with a type field.
Config File Location
| Scope | Path |
|---|---|
| Workspace | .vscode/mcp.json in your project root |
| User (global) | Via Settings > search "MCP Servers" |
Local Setup (Streamable HTTP — recommended)
Add or edit .vscode/mcp.json in your project root:
{
"servers": {
"pieces": {
"type": "http",
"url": "http://localhost:39300/model_context_protocol/2025-03-26/mcp"
}
}
}
Local Setup (SSE — legacy)
{
"servers": {
"pieces": {
"type": "sse",
"url": "http://localhost:39300/model_context_protocol/2024-11-05/sse"
}
}
}
Adding via Command Palette
Using Pieces MCP Server in VS Code
Once integrated, you can utilize Pieces LTM directly in VS Code through extensions that support MCP, such as GitHub Copilot Chat.
Updating
To update the URL, edit .vscode/mcp.json and save. VS Code picks up changes without a restart. You can also use MCP: Edit Server in the Command Palette to update the URL for the pieces server.
Troubleshooting
If you're experiencing issues integrating Pieces MCP with VS Code:
Verify PiecesOS Status: Ensure PiecesOS is actively running on your system.
Confirm LTM Engine Activation: Make sure the Long-Term Memory Engine (LTM-2.7) is enabled in PiecesOS.
Check Config Location: The file must be
.vscode/mcp.json(not.cursor/mcp.jsonormcp.jsonat root).Verify Transport Type: Use
type: "http"for Streamable HTTP ortype: "sse"for SSE. Ensure you're using the correctserverskey (notmcpServers).Tools Not Visible: Ensure your MCP-enabled extension (e.g., GitHub Copilot Chat) is installed and active. Run MCP: List Servers to confirm
piecesshows as connected.
You're now set to enhance your VS Code workflow with powerful context retrieval through Pieces MCP. Happy coding!