mcpField
V
VSCode as MCP Server

VSCode as MCP Server

Local
github.com/acomaguDeveloper Tools124Updated 54w ago

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

  1. 01Review code changes with diffs
  2. 02Forward live diagnostics
  3. 03Run integrated terminal commands
  4. 04Manage debug sessions
  5. 05Preview URLs in VSCode
  6. 06Switch between VSCode windows

Use cases

  1. 01Review and accept or reject generated edits
  2. 02Send type errors for immediate correction
  3. 03Run commands during coding tasks
  4. 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.

mcp.json · Universal config
{
"mcpServers": {
"vscode-as": {
"command": "npx",
"args": [
"-y",
"vscode-as-mcp-server"
]
}
}
}
Run commandnpx -y vscode-as-mcp-server

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmvscode-as-mcp-server

Tools

10

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
commandstringYesThe command to execute
customCwdstringNoOptional custom working directory for command execution
potentiallyDestructivebooleanNoFlag 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.
backgroundbooleanNoFlag 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.
timeoutnumberNoTimeout 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 README

VSCode as MCP Server

Marketplace

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.

Code editing diff

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

Preview tool

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

Instance switching

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

  1. Install the extension from the VSCode Marketplace.

  2. 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"]
        }
      }
    }
    
  3. Check the MCP server status in the bottom-right VSCode status bar:

    • (Server icon): Server is running
    • ∅: Click to start the server

Server status indicator

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

Markdown supported

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.