Get the FREE Ultimate OpenClaw Setup Guide →

vscode

MCP server to expose VS Code editing features to an LLM for AI coding

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio juehang-vscode-mcp-server npx -y vscode-mcp-server \
  --env PORT="3000"

How to use

This MCP server exposes the Visual Studio Code workspace as a set of MCP tools that AI models and other MCP clients can interact with. It provides capabilities to list and read files, move, rename, and copy items, search and inspect code symbols, view hover information and definitions, create new files, perform line-level edits, and run shell commands in the integrated terminal. The server is designed to let Claude-like assistants work directly inside a local VS Code workspace, enabling workflow-driven exploration, refactoring, and code modification through the MCP protocol. Use the toolset to explore the project structure, inspect symbol definitions, and apply changes with controlled edits. When interacting with the workspace, you can list files, read contents, search for symbols across the project, and then drill down into specific files to read or modify content. Remember to run diagnostics after changes to surface any issues in real time.

How to install

Prerequisites:

  • Node.js and npm installed on your machine
  • VS Code installed (for the extension) or the workspace you want to expose via MCP

Installation steps:

  1. Install the MCP server package (via npm or clone the repository):
  2. Build/compile if required by the project: npm run compile
  3. Run the MCP server (example using npm package): npx vscode-mcp-server
  4. Ensure the server is listening on the expected port (default 3000) and accessible by MCP clients.
  5. Configure your MCP client to point to http://localhost:3000/mcp using an MCP configuration similar to: { "mcpServers": { "vscode-mcp-server": { "command": "npx", "args": ["-y", "vscode-mcp-server"] } } }

Additional notes

Tips and considerations:

  • Security: The extension can execute shell commands, so run only with trusted MCP clients and consider binding the server to a localhost interface or implementing authentication when available.
  • Port configuration: If 3000 is in use, adjust the PORT environment variable accordingly and ensure clients point to the correct URL.
  • Extensions and workspace state: Since this MCP server exposes VS Code workspace capabilities, ensure the workspace is in a healthy state (no pending tasks or unsaved changes) when performing edits.
  • Resources and limits: Be mindful of large files or heavy operations; the MCP tools include max character limits for reads and may require chunked handling for big files.
  • Documentation: The available tools mirror VS Code capabilities (file ops, symbol search/definitions, editing, terminal commands). Use list_files_code and read_file_code first to understand context before performing edits.

Related MCP Servers

Sponsor this space

Reach thousands of developers