icon for mcp server

VSCode

STDIO

VSCode MCP server connecting AI assistants with real-time VSCode context and LSP information

VSCode MCP

VSCode MCP

Connect VSCode with MCP (Model Context Protocol) for enhanced AI assistant capabilities

Design MotivationAvailable ToolsInstallationArchitectureLicense

MCP Badge CI PRs Welcome Github Open Issues LICENSE

Overview

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.

Design Motivation

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 checking
  • eslint . - Code style checking
  • npm run build - Project building

These 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 fast diagnostics (get-diagnostics) - Replace time-consuming type checking and lint commands
  • Access real-time type information (get-hover) - Get accurate type definitions without compilation
  • Navigate code efficiently (get-definition, get-references) - Understand code structure and dependencies

Core Advantages

  1. Real-time: Leverage VSCode's LSP for real-time code state without executing slow commands
  2. Accuracy: Precise analysis based on language servers, more reliable than static analysis
  3. Efficiency: Significantly reduce AI coding agent wait times
  4. Integration: Deep integration with VSCode ecosystem, supporting multiple languages and extensions

Available Tools

VSCode MCP provides the following tools through the MCP protocol:

ToolDescriptionParameters
execute_commandExecute VSCode commands with argumentscommand, args?
get_commandsGet all available VSCode commands in workspaceinclude_internal?, filter?, category?, limit?
get_definitionGet symbol definition locationsuri, line, character
get_diagnosticsGet diagnostic information with Git integrationuris (array, empty = all git modified files)
get_hoversGet hover information for multiple positionspositions (array), includeAllHovers?
get_referencesGet symbol reference locationsuri, line, character, includeDeclaration?
get_signature_helpGet function signature helpuri, line, character
health_checkTest connection and get extension statusNone
highlight_codeOpen file and highlight specific code sectionsuri, ranges (array with line numbers, messages, types, colors), showEditor?, timeout?
open_diffOpen diff editor to compare files or textbefore?, after?, beforeText?, afterText?, beforeLabel?, afterLabel?, language?
open_filesOpen multiple files with optional editor displayfiles (array with uri and showEditor?)
rename_symbolRename symbols across all files in workspaceuri, line, character, newName
request_inputRequest simple text input from userprompt, 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.

Installation

🚨 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.

Step 1: Install VSCode Extension

Install the VSCode MCP Bridge extension using ID: YuTengjing.vscode-mcp-bridge

Install VSCode Extension

Or search for "VSCode MCP Bridge" in the VSCode Extensions marketplace.

Step 2: Install MCP Server

Install in Cursor ✅ Tested

Click the button to install

Install MCP Server

Or install manually

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"] } } }
Install in VS Code

Install in VS Code

Install in VS Code Insiders

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.

Install in Windsurf

Follow Windsurf MCP documentation. Use following configuration:

{ "mcpServers": { "vscode-mcp": { "command": "npx", "args": ["@vscode-mcp/vscode-mcp-server@latest"] } } }

Architecture

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

Communication Flow

  1. MCP Client sends requests via JSON-RPC over stdio
  2. MCP Server translates requests to TypeScript function calls
  3. IPC Layer handles type-safe communication and validation
  4. Unix Socket provides fast, local-only communication
  5. VSCode Extension executes operations using VSCode APIs
  6. LSP Integration provides real-time code analysis and navigation

Multi-Workspace Support

Each VSCode workspace gets its own socket connection:

  • /Users/user/frontend/tmp/vscode-mcp-a1b2c3d4.sock
  • /Users/user/backend/tmp/vscode-mcp-e5f6g7h8.sock

How It Works

Once installed and configured, VSCode MCP works seamlessly with MCP-compatible clients:

  1. VSCode Extension: Runs in your VSCode instance and provides access to LSP data
  2. MCP Server: Translates MCP protocol calls to VSCode extension requests
  3. Socket Communication: Uses Unix sockets for fast, local-only communication
  4. AI Integration: MCP clients can access real-time code context through standard tools

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.

License

This project is licensed under the Anti 996 License.

Be the First to Experience MCP Now