About VSCode as MCP Server
A VSCode extension that exposes editor, terminal, debugging, and preview functions to coding agents through MCP. It supports reviewing proposed edits and forwarding live diagnostics.
Key features
- 01Review code changes with diffs
- 02Forward live diagnostics
- 03Run integrated terminal commands
- 04Manage debug sessions
- 05Preview URLs in VSCode
- 06Switch between VSCode windows
Use cases
- 01Review and accept or reject generated edits
- 02Send type errors for immediate correction
- 03Run commands during coding tasks
- 04Open a local app preview in VSCode
MCP support
Runs VSCode as an MCP server, exposing editing, terminal, diagnostics, debugging, and preview tools to MCP clients. Experimental relay can expose built-in MCP servers from VSCode 1.99.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
10Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| command | string | Yes | The command to execute |
| customCwd | string | No | Optional custom working directory for command execution |
| potentiallyDestructive | boolean | No | Flag indicating if the command is potentially destructive or modifying. Default is true. Set to false for read-only commands (like grep, find, ls) to skip user confirmation. Commands that could modify files or system state should keep this as true. Note: User can override this behavior with the mcpServer.confirmNonDestructiveCommands setting. |
| background | boolean | No | Flag indicating if the command should run in the background without waiting for completion. When true, the tool will return immediately after starting the command. Default is false, which means the tool will wait for command completion. |
| timeout | number | No | Timeout in milliseconds after which the command execution will be considered complete for reporting purposes. Does not actually terminate the command. Default is 300000 (5 minutes). |
Details
From the project READMEVSCode as MCP Server
A VSCode extension that turns your VSCode into an MCP server, enabling advanced coding assistance from MCP clients like Claude Desktop.
Key Features
Code Editing Support
- Review proposed code changes from an LLM through diffs, allowing you to accept, reject, or provide feedback.
- Real-time diagnostic messages (e.g., type errors) sent instantly to the LLM for immediate corrections.

Terminal Operations
- Execute commands within VSCode’s integrated terminal (supports background/foreground execution, and timeout settings).
Preview Tools
- Preview URLs directly within VSCode’s built-in browser (e.g., automatically opens browser preview after starting a Vite server).

Multi-instance Switching
- Easily switch the MCP server between multiple open VSCode windows.(Just by clicking the status bar item)

Relay Functionality (Experimental)
- Relay and expose built-in MCP servers introduced in VSCode 1.99 externally.
- Allows external access to tools provided by other MCP extensions, such as GitHub Copilot.
Available Built-in Tools
- execute_command: Execute commands in VSCode’s integrated terminal
- code_checker: Retrieve current diagnostics for your code
- focus_editor: Focus specific locations within files
- list_debug_sessions / start_debug_session / restart_debug_session / stop_debug_session: Manage debug sessions
- text_editor: File operations (view, replace, create, insert, undo)
- list_directory: List directory contents in a tree format
- get_terminal_output: Fetch output from a specified terminal
- list_vscode_commands / execute_vscode_command: List and execute arbitrary VSCode commands
- preview_url: Open URLs within VSCode’s integrated browser
Installation & Setup
-
Install the extension from the VSCode Marketplace.
-
Configure your MCP client:
- Using mcp-installer: You can simply instruct it to "install the vscode-as-mcp-server MCP server".
- Other clients like Claude Desktop: Add the following to your configuration file (
claude_desktop_config.json):
{ "mcpServers": { "vscode": { "command": "npx", "args": ["vscode-as-mcp-server"] } } } -
Check the MCP server status in the bottom-right VSCode status bar:
- (Server icon): Server is running
- ∅: Click to start the server

Motivation
This extension was developed to mitigate high costs associated with metered coding tools (like Roo Code and Cursor). It's an affordable, self-hosted alternative built directly into VSCode.
Bug reports and feedback are very welcome! 🙇
Future Roadmap
- Ability to select which built-in MCP servers to expose
- WebView-based approval UI (similar to Roo Code)
- Integration with VSCode's file history (Timeline)
- Instant toggling of auto-approvals and tool activation/deactivation
- Customizable server port configuration
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.