Skip to content

Latest commit

 

History

History
130 lines (94 loc) · 3.1 KB

File metadata and controls

130 lines (94 loc) · 3.1 KB

Connecting Pieces MCP to VS Code

Tool type: Code editor (desktop) Website: code.visualstudio.com Transport support: stdio, SSE (legacy), Streamable HTTP


Config File Location

Scope Path
Workspace .vscode/mcp.json in your project root
User (global) Via Settings > search "MCP Servers"

JSON Format

VS Code uses a servers root key (not mcpServers). The transport type is set with a type field.

Local Setup (Streamable HTTP — recommended)

Recommended when PiecesOS and VS Code are on the same machine.

{
  "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"
    }
  }
}

Local Setup (stdio)

{
  "servers": {
    "pieces": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "some-mcp-package"],
      "env": {}
    }
  }
}

Remote Setup (ngrok)

Use this when VS Code is running on a different machine from PiecesOS. For setup, see: Connecting to PiecesOS from the Outside World via Ngrok.

{
  "servers": {
    "pieces": {
      "type": "http",
      "url": "https://YOUR_NGROK_URL.ngrok.app/model_context_protocol/2025-03-26/mcp"
    }
  }
}

Adding via Command Palette

  1. Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
  2. Search for "MCP: Add Server"
  3. Select HTTP or SSE as the transport type
  4. Enter the Pieces MCP URL
  5. Name it "pieces"

Updating

To update the URL: edit .vscode/mcp.json and save. VS Code picks up changes without a restart.

To update via Command Palette: "MCP: Edit Server" > select "pieces" > update the URL.


Verification

  1. Open Command Palette and run "MCP: List Servers"
  2. Confirm "pieces" shows as connected
  3. Open GitHub Copilot Chat and ask about available MCP tools

Troubleshooting

Issue Solution
Server not connecting Check that PiecesOS is running and the port is correct
type field not recognized Update VS Code to latest; MCP support requires recent versions
Tools not visible in Copilot Ensure the GitHub Copilot Chat extension is installed and active
Config at wrong location The file must be .vscode/mcp.json (not .cursor/mcp.json or mcp.json at root)

Related Guides


  ← Back to All Agent Setup Guides