
VSCode
STDIOVSCode MCP server connecting AI assistants with real-time VSCode context and LSP information
VSCode MCP server connecting AI assistants with real-time VSCode context and LSP information
Connect VSCode with MCP (Model Context Protocol) for enhanced AI assistant capabilities
Design Motivation • Available Tools • Installation • Architecture • License
VSCode MCP is a comprehensive monorepo solution that enables MCP (Model Context Protocol) clients to access rich VSCode context information in real-time. This project bridges the gap between AI assistants and your development environment, providing accurate code analysis, diagnostics, and intelligent code navigation.
VSCode MCP Bridge primarily serves AI IDEs (like Cursor) and AI coding agents, helping them develop and analyze code more efficiently.
Traditional AI coding agents often need to execute time-consuming commands when validating code modifications:
tsc --noEmit
- TypeScript type checkingeslint .
- Code style checkingnpm run build
- Project buildingThese commands run slowly in large projects, severely impacting AI development efficiency. VSCode MCP Bridge provides real-time LSP (Language Server Protocol) information, allowing AI agents to:
get-diagnostics
) - Replace time-consuming type checking and lint commandsget-symbol-lsp-info
) - Get definition, hover, signatures, and type info in one callget-references
) - Understand code structure and dependencies with usage contextcall-agent
) - Integrate with built-in AI assistants like Cursor Composer, GitHub Copilot, and othersVSCode MCP provides the following tools through the MCP protocol:
Tool | Description | Parameters |
---|---|---|
call_agent | Call IDE's AI agent with prompts and context | workspace_path , prompt , files? , images? , model? , mode? , ide_type? |
execute_command | ⚠️ Execute VSCode commands with JSON string arguments | workspace_path , command , args? (JSON string of arguments array) |
get_symbol_lsp_info | Get comprehensive LSP info (definition, hover, signatures, etc.) | workspace_path , uri , symbol , codeSnippet? , infoType? |
get_diagnostics | Get real-time diagnostics, replace slow tsc/eslint | workspace_path , uris? , sources? , severities? |
get_references | Find symbol references with usage context code | workspace_path , uri , symbol , codeSnippet? , includeDeclaration? , usageCodeLineRange? |
health_check | Test connection to VSCode MCP Bridge extension | workspace_path |
list_workspaces | List all available VSCode workspaces | clean_zombie_sockets? , include_details? , test_connection? |
open_files | Open multiple files with optional editor display | workspace_path , files (array with uri and showEditor? ) |
rename_symbol | ⚠️ Rename symbols across all files in workspace | workspace_path , uri , symbol , codeSnippet? , newName |
⚠️ Security Warning: The
execute_command
tool can execute arbitrary VSCode commands and potentially trigger dangerous operations. Use with extreme caution and only with trusted AI models.
The call_agent
tool enables seamless integration between external AI assistants and IDE-native AI agents. This creates a powerful collaborative AI ecosystem where different AI agents can work together on complex coding tasks.
Supported IDEs:
Supported AI Agents:
Key Features:
All tools require the workspace_path
parameter to target specific VSCode instances.
🚨 IMPORTANT: Before installing the MCP server, you must first install the VSCode MCP Bridge extension in your VSCode instance. The extension is required for the MCP server to communicate with VSCode.
Install the VSCode MCP Bridge extension using ID: YuTengjing.vscode-mcp-bridge
Or search for "VSCode MCP Bridge" in the VSCode Extensions marketplace.
Claude Code (claude.ai/code) provides built-in MCP support. Simply run:
claude mcp add vscode-mcp -- npx -y @vscode-mcp/vscode-mcp-server@latest
This command will automatically configure the MCP server in your Claude Code environment.
The execute_command
tool is currently not compatible with Gemini 2.5 Pro in Cursor due to potential security restrictions. If you plan to use Gemini 2.5 Pro, it is highly recommended to disable this tool to prevent any issues.
You can disable it by adding a command-line argument to the MCP server configuration in Cursor's settings.
Cursor Settings
-> Tools & Integrations
.vscode-mcp
server configuration and click Edit
.args
array, add the following argument: "--disable-tools=execute_command"
{ "mcpServers": { "vscode-mcp": { "command": "npx", "args": ["@vscode-mcp/vscode-mcp-server@latest", "--disable-tools=execute_command"] } } }
This will prevent the execute_command
tool from being registered with the server, ensuring compatibility with Gemini 2.5 Pro.
Go to Cursor Settings
-> Tools & Integrations
-> New MCP Server
. Name to your liking, use command
type with the command npx @vscode-mcp/vscode-mcp-server@latest
. You can also verify config or add command line arguments via clicking Edit
.
{ "mcpServers": { "vscode-mcp": { "command": "npx", "args": ["@vscode-mcp/vscode-mcp-server@latest"] } } }
VSCode MCP follows a modular architecture with three main components communicating through Unix sockets:
graph TB subgraph "MCP Client" Client[AI Assistant<br/>Cursor/Claude/etc] end subgraph "vscode-mcp-server" Server[MCP Server<br/>Protocol Implementation] end subgraph "vscode-mcp-ipc" IPC[IPC Layer<br/>Type-safe Communication] Socket[Unix Socket<br/>Cross-platform] end subgraph "VSCode Instance" Extension[VSCode Extension<br/>vscode-mcp-bridge] LSP[Language Server Protocol] API[VSCode API] end Client <-->|JSON-RPC<br/>stdio| Server Server <-->|TypeScript<br/>Function Calls| IPC IPC <-->|JSON<br/>Unix Socket| Socket Socket <-->|Local Connection| Extension Extension <-->|Extension API| API Extension <-->|Diagnostics<br/>Navigation| LSP classDef client fill:#e1f5fe classDef server fill:#f3e5f5 classDef ipc fill:#e8f5e8 classDef vscode fill:#fff3e0 class Client client class Server server class IPC,Socket ipc class Extension,LSP,API vscode
Each VSCode workspace gets its own socket connection:
/Users/user/frontend
→ /tmp/vscode-mcp-a1b2c3d4.sock
/Users/user/backend
→ /tmp/vscode-mcp-e5f6g7h8.sock
Once installed and configured, VSCode MCP works seamlessly with MCP-compatible clients:
The system operates transparently - MCP clients use standard tool calls, and VSCode MCP handles all the complexity of communicating with VSCode's APIs.
All tools require the workspace_path
parameter to target specific VSCode instances. Each VSCode workspace gets its own socket connection for multi-window support.
This project is licensed under the Anti 996 License.