
VS Code MCP Server
VS Code extension exposing the editor's file, symbol, diagnostics and shell capabilities to MCP clients.
Add to your client
Copy the config for your MCP client and paste it into its config file.
Paste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"vs-code-mcp-server": {
"command": "npx",
"args": [
"mcp-remote@next",
"http://localhost:3000/mcp"
]
}
}
}Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Visual Studio Code
- The VS Code MCP Server extension installed (from the Marketplace, or cloned and built with npm install && npm run compile)
- Server enabled via the status bar item
- An MCP client capable of connecting over streamable HTTP (e.g. via npx mcp-remote)
About VS Code MCP Server
A VS Code extension that implements an MCP-compliant server, exposing VS Code's filesystem, editing, language-intelligence (symbols, diagnostics), and integrated-terminal capabilities to AI models and other MCP clients over streamable HTTP. It runs locally on a configurable port and is toggled via a status bar item. Ideal for augmenting coding agents with VS Code-specific symbol and outline tools without tool duplication.
Tools & capabilities (12)
list_files_codeLists files and directories in your workspace. Parameters: path; recursive (optional).
read_file_codeReads file contents. Parameters: path; encoding (optional, default utf-8); maxCharacters (optional, default 100,000).
move_file_codeMoves a file or directory to a new location using VS Code's WorkspaceEdit API (with import refactoring). Parameters: sourcePath; targetPath; overwrite (optional, default false).
rename_file_codeRenames a file or directory using VS Code's WorkspaceEdit API with automatic reference updates. Parameters: filePath; newName; overwrite (optional, default false).
copy_file_codeCopies a file (files only, not directories) to a new location using VS Code's file system API. Parameters: sourcePath; targetPath; overwrite (optional, default false).
create_file_codeCreates a new file using VS Code's WorkspaceEdit API. Parameters: path; content; overwrite (optional, default false); ignoreIfExists (optional, default false).
replace_lines_codeReplaces specific lines in a file. Parameters: path; startLine (1-based, inclusive); endLine (1-based, inclusive); content; originalCode (for validation).
get_diagnostics_codeChecks for warnings and errors in your workspace. Parameters: path (optional, whole workspace if omitted); severities (optional, array; 0=Error,1=Warning,2=Information,3=Hint; default [0,1]); format (optional, 'text' or 'json', default 'text'); includeSource (optional, default true).
search_symbols_codeSearches for symbols (functions, classes, variables, etc.) across the workspace. Parameters: query; maxResults (optional, default 10).
get_symbol_definition_codeGets definition information (type info, documentation, source, code context, symbol range) for a symbol in a file. Parameters: path; line; symbol.
get_document_symbols_codeGets a hierarchical outline of all symbols in a file (like VS Code's Outline view), with positions, kinds, and summary statistics. Parameters: path; maxDepth (optional).
execute_shell_command_codeExecutes a shell command in the VS Code integrated terminal with shell integration and returns its output. Parameters: command; cwd (optional, default '.').
What this server can do
VS Code MCP Server provides tools for these capabilities — tap one to see every MCP server that does the same:
When to use it
- Letting Claude or another MCP client read, edit, create, move, rename, and copy files in your VS Code workspace
- Extending Claude Code with VS Code-specific symbol search and document outlines without duplicating existing file/edit tools
- Running code-quality and diagnostics checks before committing changes
- Exploring an unfamiliar codebase context-efficiently via symbol outlines and definitions instead of reading whole files
- Executing CLI, build, or git commands through the integrated terminal for an AI agent
Security notes
The extension can execute shell commands in the integrated terminal, which is a potential security risk. Use only with MCP clients you trust and do not expose the port to any network. By design the server only works locally (default host 127.0.0.1). MCP authentication is not implemented because the auth spec is still in flux, so there is no built-in access control.
VS Code MCP Server FAQ
How do I connect an MCP client to the server?
First enable the server by clicking its status bar item in VS Code. Then point clients at http://localhost:3000/mcp (or http://[your-host]:3000/mcp for a custom host). For Claude Desktop, add an mcpServers entry running npx mcp-remote@next against that URL.
Does it use SSE or HTTP transport?
It uses the streamable HTTP API, not the SSE API.
Is it secure?
It can execute shell commands, so there is a security risk. Use it only with trusted MCP clients and never expose the port to a network. It works locally only (default 127.0.0.1) and does not implement MCP authentication yet, since that spec is still in flux.
Can I limit which tools are available?
Yes. The vscode-mcp-server.enabledTools setting configures which tool categories (file, edit, shell, diagnostics, symbol) are enabled — handy for agents that already have file/edit capabilities and only need symbol tools.
Does it support multiple workspaces?
No. Currently only a single workspace is supported, and the extension only works locally to avoid exposing your VS Code instance to the network.
How do I change the port or host?
Use the vscode-mcp-server.port (default 3000) and vscode-mcp-server.host (default 127.0.0.1) settings; vscode-mcp-server.defaultEnabled controls whether the server starts enabled on VS Code startup.
Alternatives to VS Code MCP Server
Compare all alternatives →Microsoft's official browser-automation MCP using Playwright's accessibility tree (no vision model).
Up-to-date, version-specific library documentation injected into your coding agent.
LSP-powered coding agent toolkit: semantic symbol search, references and structural edits.
Compare VS Code MCP Server with: