home / mcp / vs code mcp server

VS Code MCP Server

Provides VS Code interaction via the Model Context Protocol, enabling agents to open files, view diffs, manage projects, and check extension status.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "block-vscode-mcp": {
      "command": "npx",
      "args": [
        "vscode-mcp-server"
      ]
    }
  }
}

You can run the VS Code MCP Server locally to enable AI agents and assistants to interact with VS Code through the Model Context Protocol. It provides a standard set of actions for editing, browsing, and coordinating projects inside the editor.

How to use

You use an MCP client to communicate with the VS Code MCP Server. Start the server locally, then connect your AI agent or assistant through the MCP channel. You can perform actions such as opening files, inspecting or editing diffs, opening projects, and checking the extension status. The server exposes a defined set of tools that the agent can call, and it coordinates with the VS Code extension to apply changes safely.

How to install

Prerequisites: you need Node.js and npm (or npx) installed on your machine. Verify with node -v and npm -v.

Install the MCP Server locally using the following command.

npx vscode-mcp-server install

Install the MCP Extension to enable VS Code integration. Follow the extension’s installation steps as you normally would for extensions in your environment.

Configuration and usage notes

Goose Desktop setup defines an MCP server entry that runs the server via a standard command. You can configure the Goose Desktop to connect to the server with the following identifier and command.

ID: code-mcp
Name: VS Code
Description: Allows interaction with VS Code through the Model Context Protocol
Command: npx vscode-mcp-server

Claude Desktop requires a configuration block that points to the MCP server command. Add the following to the Claude desktop config file (path shown for reference).

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

Configuration examples

Use these snippets to ensure your client can launch and connect to the MCP server. The Goose and Claude examples illustrate how to wire the server into desktop assistants.

Troubleshooting and notes

If you encounter issues starting the server, ensure Node.js and npm are installed and that the npx command is available. Check that the server process is running and that the client points to the correct command and arguments as shown in the Goose and Claude configurations.

Available tools

create_diff

Creates and shows a diff for modifying existing files, previews changes before applying, requires user approval, and only works with existing files.

open_file

Opens files in the VS Code editor for viewing new or modified files.

open_project

Opens a project folder in VS Code and sets up the working directory for the AI agent.

check_extension_status

Checks if the VS Code MCP Extension is installed and responding.

get_extension_port

Retrieves the port number used by the VS Code MCP Extension.

list_available_projects

Lists projects registered in the port registry file.