VSCode MCP Server
About
A VSCode extension that acts as an MCP server, providing access to diagnostic tools and debug session management.
Details
- Author
- cspatil8
- Categories
- Developer Tools
Jump to
Setup
Install VSCode MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/cspatil8/chpatil-vscode-mcp-extension
Follow the installation instructions in the repository README, then restart your MCP client.
TheVSCode MCP Serveris a VSCode extension that acts as a Model Context Protocol (MCP) server integrated directly within VSCode. Its primary purpose is to expose a coding diagnostic tool—namely, thecode_checker—which aggregates diagnostic messages (similar to those displayed in VSCode’s Problems panel) and makes them accessible to an external AI assistant via Server-Sent Events (SSE). This allows your assistant to invoke MCP methods and retrieve timely diagnostic information from your workspace.
-
Automatic Startup:The extension activates automatically on VSCode startup (using"activationEvents": [""]inpackage.json), ensuring the MCP server is always running without manual intervention.
MCP Server Integration:Built using the MCP TypeScript SDK (@modelcontextprotocol/sdk), the extension instantiates an MCP server that registers diagnostic tools and handles MCP protocol messages.
Diagnostic Tool (code_checker):The registeredcode_checkertool collects diagnostics from VSCode’s built-in language services, filtering out files without errors. When invoked, it returns a formatted JSON object containing diagnostic information (only for files with issues).
Focus Editor Tool (focus_editor): Opens a specific file in the VSCode editor and navigates to a designated line and column. Useful for bringing files into visual focus for the user but does not include file content in the tool call result.
Search Symbol Tool (search_symbol): Searches for symbols in the workspace, using "Go to Definition" primarily, with a fallback to text search (similar to Ctrl+Shift+F). Can optionally open the results in the editor using thefocus_editortool.
Debug Session Management Tools:The extension provides tools to manage VSCode debug sessions directly using MCP:
- list_debug_sessions: Retrieve all active debug sessions in the workspace.
- start_debug_session: Start a new debug session with the provided configuration.
- stop_debug_session: Stop debug sessions matching a specific session name.
- restart_debug_session: Restart a debug session by stopping it and then starting it with the provided configuration (new!).
SSE Communication:An Express-based HTTP server runs on a configurable port (default: 6010) and dynamically handles port conflicts. It exposes:
- AGET/sseendpoint to establish a long-lived Server-Sent Events (SSE) connection. If the default port (6010) is unavailable, users can configure a new one via their VSCode settings (see Dynamic Port Configuration below).
- APOST/messagesendpoint for receiving MCP messages from external clients (such as your AI assistant). Special care is taken to handle the request body properly—thanks to passing the already-parsedreq.bodyto avoid stream-related errors.
Verbose Logging:All activity, including server startup, SSE connection status, and message handling events, is logged to an output channel named"VSCode MCP Server"to aid debugging and transparency.
Using the Extension from Claude Desktop (MCP Client)
To use the VSCode MCP Server with Claude Desktop, you need to configure Claude Desktop to connect to the MCP server running in VSCode. Since the implementation of the MCP server uses SSE transport, and Claude Desktop only supports stdio transport, you need to use amcp-proxyto bridge the communication between the two.
-
Open Claude Desktop and navigate to theFile>Settings>Developertab.
ClickEdit Configto open the config file, launch your desired editor to modify the config file contents.
Add a new entry tomcpServerswith the following details:
{ "mcpServers": { "vscode": { "command": "mcp-proxy", "args": ["http://127.0.0.1:6010/sse"] } } }
- Youmustrestart Claude Desktop for the changes to take effect by using theFile>Exitoption.
- NOTE: This is different than just closing the window or usingFile>Close, which leaves the application running in the background.
- After existing and then starting again, Claude Desktop should now be able to connect to the MCP server running in VSCode.
The MCP Server status can now be managed directly from the Command Palette:
- Stop MCP Server(mcpServer.stopServer): Stops the currently running MCP Server.
- Start MCP Server(mcpServer.startServer): Starts the server on the configured or next available port.
These commands help manage server lifecycle dynamically, without requiring a VSCode restart.
If the port is already in use, the extension will suggest the next available port and apply it dynamically. Logs reflecting the selected port can be found in theMCP Server Logsoutput channel.
Users can configure or change the MCP Server's port at runtime using the Command Palette:
- Open the Command Palette (Ctrl+Shift+PorCmd+Shift+Pon macOS).
- Search forSet MCP Server Port.
- Enter the desired port number in the input box and confirm.
The server will dynamically restart on the newly selected port, and the configuration will be updated for future sessions.
The HTTP server port can also be set via VSCode settings:
- Open VSCode settings (File > Preferences > SettingsorCtrl+,).
- Search formcpServer.port.
- Set your desired port number.
- Restart VSCode for the changes to take effect.
The MCP Server starts automatically on VSCode activation by default. To disable this feature:
- Open VSCode settings (File > Preferences > SettingsorCtrl+,).
- Search formcpServer.startOnActivate.
- Toggle the setting tofalse.
This can be useful if you prefer to start the server manually using theStart MCP Servercommand.
Steps for developing and debugging the extension, source code available atGitHub.
-
Clone the Repository:Clone the Semantic Workbench repository to your local machine:
git clone https://github.com/microsoft/semanticworkbench.git
cd semanticworkbench/mcp-servers/mcp-server-vscode
Install Dependencies:Ensure you have Node.js (v16 or higher) and pnpm installed. Then, from the project directory, run:
Package the Extension:To package the extension, execute:
This will generate a.vsixfile in the project root.
Launch your main VSCode (outside the Extension Development Host).
- Press Ctrl+Shift+P (or Cmd+Shift+P on macOS) to open the Command Palette.
- Type and select "Extensions: Install from VSIX...".
- Navigate to and select the generated .vsix file.
After installation, reload VSCode (via "Developer: Reload Window" from the Command Palette) and verify that the extension is active. Check the "MCP Server Logs" output channel to see logs confirming that the MCP server has started and is listening on the configured port (default: 6010, or the next available one).
-
Start Debugging:Open the project in VSCode, then pressF5to launch the Extension Development Host. This will automatically activate the extension based on the"activationEvents": [""]setting.
MCP Server Operation:On activation, the extension:
- Starts the MCP server which registers thecode_checkertool.
- Sets up an Express HTTP server on port6010with:
- GET/sse:To establish an SSE connection (external clients connect here).
- POST/messages:To process incoming MCP protocol messages.
Launch your main VSCode (outside the Extension Development Host).
- Press Ctrl+Shift+P (or Cmd+Shift+P on macOS) to open the Command Palette.
- Type and select "Extensions: Install from VSIX...".
- Navigate to and select the generated .vsix file.
After installation, reload VSCode (via "Developer: Reload Window" from the Command Palette) and verify that the extension is active. Check the "MCP Server Logs" output channel to see logs confirming that the MCP server has started and is listening on port 6010.
event: endpoint data: /messages?sessionId=your-session-id
In Terminal 2, using the session ID obtained from Terminal 1 (if needed), send a POST request (include any required fields such as workspace if necessary):
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": [] } } }'
If everything is configured correctly, the MCP server should process your initialization message without errors.
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
A stateful LSP runtime for AI agents: warm language server sessions with 50+ tools for go-to-definition, find-references, diagnostics, rename, and more across 30+ languages.
MCP server for the Brainfuck programming language that allows your favourite LLM to debug Brainfuck programs.
Diagnoses token waste in Claude Code sessions with 6 anomaly types and severity scoring. Fully local.
MCP server that gives coding agents program-analysis primitives — data flow, call graphs, taint analysis — so they reason from ground truth instead of grep-and-guess. (same as the GitHub About — keeps your messaging consistent across the web).
An MCP service that equips your workspace with a complete set of AI-accessible development tools for reading, editing, executing, and managing code.
Fennara MCP connects AI agents like Codex, Cursor, Claude Code, and Claude Desktop to Godot-aware tools for real Godot projects. It focuses on feedback from Godot: GDScript diagnostics, scene validation, runtime errors, scene inspection, node properties, screenshots, SemanticSearch, and patch-and-rerun workflows.
Search verified engineering fixes by error message or technology. Step-by-step solutions with trust scores, built for developers and AI agents.
LSP-Claw is an MCP server that lets an AI agent safely build, run, and debug Lua/LSP web apps inside a controlled Mako/Xedge/BAS lab, including on embedded or RTOS devices.
Integrates with Language Server Protocol (LSP) to provide features like code completion, diagnostics, and hover information.
Visual Studio extension with 20 Roslyn-powered MCP tools for AI assistants. Semantic code navigation, symbol search, inheritance, call graphs, safe rename, build/test.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





