A Model Context Protocol (MCP) server for VS Code integration, enabling AI agents like Goose or Claude to interact with VS Code.
- File diffing
- Opening files
- more to come
You can install the Code MCP Server using npx:
npx vscode-mcp-server install
This command will:
- Check your operating system compatibility (Windows/macOS)
- Install the server
- Generate a Goose install URL that you can copy and paste it into a browser to easily istall the Goose Extension.
If you want to test the package locally before publishing to npm, you can use npm pack
:
-
Clone the repository and navigate to the server directory:
git clone https://github.com/block/code-mcp.git cd code-mcp/server
-
Create a tarball of the package:
npm pack
This will create a file like
vscode-mcp-server-X.X.X.tgz
in the current directory. -
Install the package globally from the local tarball:
npm install -g ./vscode-mcp-server-X.X.X.tgz
Once installed, you can configure your AI assistant to use this server. The server provides various tools for interacting with VS Code, including:
- Opening files
- Creating Diffs of file changes that require Accept/Reject
After installation, you'll need to configure your AI assistant to use this server.
- ID:
vscode-mcp-server
- Name:
VSCode MCP Server
- Description:
Allows interaction with VSCode through the Model Context Protocol
- Command:
npx vscode-mcp-server
Add the following to your Claude Desktop configuration file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"vscode-mcp-server": {
"command": "npx",
"args": ["vscode-mcp-server"],
"env": {}
}
}
}
For other AI assistants that support the Model Context Protocol, refer to their documentation for how to configure external MCP servers. You'll typically need to provide:
- The command
npx vscode-mcp-server
- Any required environment variables
- release.yml: Automatically creates a new release when you push to the main branch with conventional commit messages
- npm-publish.yml: Automatically publishes to npm when a new release is created
To use these workflows:
- Push your changes to GitHub with conventional commit messages (e.g., "feat: add install command")
- The release workflow will create a new release with an incremented version
- The npm-publish workflow will then publish the new version to npm
You'll need to add an npm token to your GitHub repository secrets:
- Generate an npm token: npm token create
- Add the token to your GitHub repository secrets as npm_token
Update the version
npm version patch/minor/major
Publish
npm publish