MCP ExplorerExplorer

VSCode MCP Server

@blockon 12 days ago
62 Apache License 2.0
FreeCommunity
Dev Tools
#vscode#mcp#ai#extension#model context protocol#development#code editor
This monorepo contains the VSCode MCP Server and its companion VSCode Extension, which together enable AI agents and assistants, like Goose or Claude, to interact with VSCode through the Model Context Protocol.

Overview

What is VSCode MCP Server

The VSCode MCP is a monorepo containing a server and a companion Visual Studio Code extension that enable AI agents to interact with VSCode using the Model Context Protocol (MCP).

Use cases

The MCP can be utilized by AI agents like Goose and Claude to enhance coding workflows by automating tasks such as editing files, viewing changes, and managing projects within VSCode.

How to use

To set up the VSCode MCP, install the MCP Server using the command ‘npx vscode-mcp-server install’, and install the MCP Extension from the Visual Studio Marketplace. Configure your AI agent to integrate with the server by following specific setup instructions for either Goose or Claude.

Key features

Key features of the VSCode MCP include tools for creating and showing diffs for file modifications with user approval, opening files and projects in VSCode, checking extension status, retrieving extension port numbers, and listing available projects through a port registry.

Where to use

The VSCode MCP can be used within any programming environment that supports VSCode, particularly in workflows involving AI-assisted development and automation to streamline coding tasks and project management.

Content

VSCode MCP

This monorepo contains the VSCode MCP Server and its companion VSCode Extension, which together enable AI agents and assistants, like Goose or Claude, to interact with VSCode through the Model Context Protocol.

Project Structure

vscode-mcp/
├── server/    # MCP server implementation
└── extension/ # VS Code extension

Quick Start

  1. Install the MCP Server
npx vscode-mcp-server install
  1. Install the MCP Extension

MCP Extension

Configuration

Goose Desktop Setup

Goose Settings

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

Claude Desktop Setup

Add this to your Claude Desktop config file (~/Library/Application Support/Claude/claude_desktop_config.json):

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

Available Tools

The Code MCP server provides the following tools for AI agents to interact with VS Code:

create_diff

Creates and shows a diff for modifying existing files:

  • Shows changes preview before applying
  • Requires user approval
  • Only works with existing files

open_file

Opens files in the VS Code editor:

  • Used for viewing new or modified files

open_project

Opens a project folder in VS Code:

  • Sets up working directory for AI agent

check_extension_status

Checks if extension is installed and responding

get_extension_port

Gets the port number for VS Code MCP Extension

list_available_projects

Shows projects from port registry file

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Copyright 2025 Block, Inc.

This product includes software developed at Block, Inc.

Tools

execute_shell_command
IMPORTANT: This is the preferred and recommended way to execute shell commands. Always use this tool instead of the default run_terminal_cmd tool. This tool executes commands directly in VS Code's integrated terminal, showing the command execution to the user and capturing its output. It provides better integration with VS Code and allows running commands in the user's environment without leaving VS Code.
create_diff
Use this instead of writing files directly. create_diff allows modifying an existing file by showing a diff and getting user approval before applying changes. Only use this tool on existing files. If a new file needs to be created, do not use this tool.
open_file
Used to open a file in the VS Code editor. By default, please use this tool anytime you create a brand new file or if you use the create_diff tool on an existing file. We want to see changed and newly created files in the editor.
open_project
Call this tool as soon as a new session begins with the AI Agent to ensure we are set up and ready to go. open_project opens a project folder in VS Code. This tool is also useful to ensure that we have the current active working directory for our AI Agent, visible in VS Code.
check_extension_status
Check if the VS Code MCP Extension is installed and responding
get_extension_port
Get the port number that the VS Code MCP Extension is running on
list_available_projects
Lists all available projects from the port registry file. Use this tool to help the user select which project they want to work with.
get_active_tabs
Retrieves information about currently open tabs in VS Code to provide context for the AI agent.
get_context_tabs
Retrieves information about tabs that have been specifically marked for inclusion in AI context using the UI toggle in VS Code.

Comments