VSCode as MCP Server

by acomagu

434 downloads
Not rated
GitHub

About

Expose VSCode features such as file viewing and editing as MCP, enabling advanced AI-assisted coding directly from tools like Claude Desktop

Details

Author
acomagu
Downloads
434
Categories
Developer Tools

- Review and accept/reject code changes via diffs
- Real-time diagnostic messages sent to the LLM
- Execute commands in VSCode’s integrated terminal
- Preview URLs in VSCode’s built-in browser
- Switch MCP server between multiple VSCode windows
- Relay external access to built-in MCP servers (experimental)

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name VSCode as MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install the extension from the VSCode Marketplace. Configure your MCP client using npx vscode-as-mcp-server in the client’s config file (e.g., claude_desktop_config.json) or use mcp-installer. The server status appears in the VSCode status bar; click to start if not running.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "vscode as mcp server": {
            "vscode": {
                "command": "npx",
                "args": [
                    "vscode-as-mcp-server"
                ]
            }
        }
    }
}

McpServers

{
    "vscode": {
        "command": "npx",
        "args": [
            "vscode-as-mcp-server"
        ]
    }
}

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

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.