
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-hover
) - Get accurate type definitions without compilationget-definition
, get-references
) - Understand code structure and dependenciesVSCode MCP provides the following tools through the MCP protocol:
Tool | Description | Parameters |
---|---|---|
execute_command | Execute VSCode commands with arguments | command , args? |
get_commands | Get all available VSCode commands in workspace | include_internal? , filter? , category? , limit? |
get_definition | Get symbol definition locations | uri , line , character |
get_diagnostics | Get diagnostic information with Git integration | uris (array, empty = all git modified files) |
get_hovers | Get hover information for multiple positions | positions (array), includeAllHovers? |
get_references | Get symbol reference locations | uri , line , character , includeDeclaration? |
get_signature_help | Get function signature help | uri , line , character |
health_check | Test connection and get extension status | None |
highlight_code | Open file and highlight specific code sections | uri , ranges (array with line numbers, messages, types, colors), showEditor? , timeout? |
open_diff | Open diff editor to compare files or text | before? , after? , beforeText? , afterText? , beforeLabel? , afterLabel? , language? |
open_files | Open multiple files with optional editor display | files (array with uri and showEditor? ) |
rename_symbol | Rename symbols across all files in workspace | uri , line , character , newName |
request_input | Request simple text input from user | prompt , placeholder? , title? , password? , validateInput? |
⚠️ 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.
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.
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"] } } }
You can also install the VSCode MCP server using the VS Code CLI:
# For VS Code code --add-mcp '{"name":"vscode-mcp","command":"npx","args":["@vscode-mcp/vscode-mcp-server@latest"]}'
After installation, the VSCode MCP server will be available for use with your GitHub Copilot agent in VS Code.
Follow Windsurf MCP documentation. Use following configuration:
{ "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.