================== /// MCP /// /// VSC /// ================== [server:online] [protocol:ready]
vscode-mcp-server
by juehang
VS Code extension that turns your local VS Code instance into a Model Context Protocol (MCP) server, exposing file, edit, diagnostics, symbol-search and shell tools to LLM clients such as Claude.
list_files_code
List files and directories in the current VS Code workspace
read_file_code
Read the contents of a file with optional encoding and size limits
create_file_code
Create a new file (optionally overwrite or ignore if it exists) using VS Code's WorkspaceEdit API
replace_lines_code
Replace specific line ranges in a file with new content, validating against original code
get_diagnostics_code
Retrieve errors and warnings (diagnostics) for a file or the entire workspace
search_symbols_code
Search for symbols (functions, classes, variables, etc.) across the workspace by name
get_symbol_definition_code
Fetch definition, type info, and documentation for a symbol at a given file and line
get_document_symbols_code
Return a hierarchical outline of all symbols within a file
execute_shell_command_code
Run a shell command in the integrated VS Code terminal
Installation
git clone https://github.com/juehang/vscode-mcp-server.git
cd vscode-mcp-server
npm install # or: pnpm install / yarn install
npm run build # normally calls `tsc -p .`
# .env or shell variables
PORT=3000 # TCP port the MCP server listens on
VSCODE_BINARY=/path/to/code # custom VS Code executable
OPENAI_API_KEY=xxx # if the server proxies LLM calls
npm start # shorthand for `node dist/index.js`
open http://localhost:3000/health # should return OK/200
The server is now reachable by any MCP-compatible client or LLM agent.