home / mcp / vs code mcp server
MCP server to expose VS Code editing features to an LLM for AI coding
Configuration
View docs{
"mcpServers": {
"juehang-vscode-mcp-server": {
"url": "http://localhost:3000/mcp"
}
}
}You can run a Visual Studio Code MCP Server locally to expose your workspace to AI models and other MCP clients. It lets you list, read, edit, and navigate your codebase, run shell commands in a controlled terminal, and get real-time diagnostics—all through a standardized MCP interface.
Connect an MCP client to the server URL http://localhost:3000/mcp. Once connected, you can explore your workspace by listing files, read file contents, and perform edits through the MCP tools. You can search for symbols across the project, view symbol definitions and hover information, and check for diagnostics to catch errors or warnings. You can also execute shell commands in the integrated terminal and toggle the MCP server on or off from the status bar.
Prerequisites: ensure you have Node.js and npm installed, and you are running VS Code.
Step 1: Install the extension from the Marketplace within VS Code.
Step 2: If you prefer building from source, clone the project, install dependencies, and compile.
Step 3: Open VS Code, ensure the MCP server is enabled, and look for the status bar item to start the server.
Server runs locally by default on port 3000. You can enable or disable the server via a status bar item. The server exposes a range of tools for file operations, edits, diagnostics, symbol tooling, and shell execution. Use the MCP URL http://localhost:3000/mcp to connect clients. If you customize host/port, point clients to the updated URL.
Environment variables are not required by default for the server, but you can configure them if you extend functionality. Ensure you trust your MCP client when enabling shell execution, as it can pose security risks if the port is exposed unintentionally.
If the server fails to start, verify that port 3000 is not in use and that VS Code has permission to run the extension. Check diagnostics for errors and ensure the server is enabled via the status bar item. When making changes to files, re-check diagnostics to confirm there are no new issues.
Lists files and directories in your workspace from a given path, enabling exploration of the project structure.
Reads contents of a file with specified encoding and optional maximum character limit.
Moves a file or directory using VS Code's WorkspaceEdit API, preserving references during refactoring.
Renames a file or directory and updates references accordingly.
Copies a file to a new location, with optional overwrite control.
Creates a new file using VS Code's WorkspaceEdit API with optional overwrite behavior.
Replaces a specific range of lines in a file with new content.
Checks for warnings and errors in the workspace, with optional filtering by path and severity.
Searches for symbols across the workspace by name, returning matching results.
Retrieves definition information for a given symbol, including type and docs.
Provides an outline of all symbols in a file, including structure and positions.
Executes a shell command in the integrated terminal with optional working directory.