The VSCode MCP Server extension enables AI assistants to access your VSCode environment's diagnostic information through the Model Context Protocol (MCP). This server provides contextual data from your workspace to help AI assistants deliver more informed responses about your code.
Install the VSCode MCP Server extension either through the Visual Studio Code Marketplace or by using a local VSIX file:
# Press Ctrl+Shift+P (or Cmd+Shift+P on macOS)
# Type "Extensions: Install from VSIX..."
# Select the .vsix file
After installation, reload VSCode using the "Developer: Reload Window" command from the Command Palette.
Since Claude Desktop only supports stdio transport, but the MCP server uses SSE transport, you'll need to use a proxy:
Install MCP Proxy using one of these methods:
# Option 1: With uv (recommended)
uv tool install mcp-proxy
# Option 2: With pipx
pipx install mcp-proxy
Configure Claude Desktop:
{
"mcpServers": {
"vscode": {
"command": "mcp-proxy",
"args": ["http://127.0.0.1:6010/sse"]
}
}
}
Restart Claude Desktop:
The MCP Server starts automatically by default, but you can manage it manually:
If the default port (6010) is unavailable, you can change it:
Using the Command Palette:
Using VSCode Settings:
If you prefer to start the MCP server manually:
The VSCode MCP Server provides several tools that AI assistants can use:
You can manually test if the server is working using curl:
Establish an SSE Connection:
curl -N http://127.0.0.1:6010/sse
You should see output including a session ID:
event: endpoint
data: /messages?sessionId=your-session-id
Send an Initialization Request:
curl -X POST "http://127.0.0.1:6010/messages?sessionId=your-session-id" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "initialize",
"id": 0,
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {
"roots": { "listChanged": true }
},
"clientInfo": {
"name": "mcp",
"version": "0.1.0"
},
"workspace": {
"folders": []
}
}
}'
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.