What is VSC-MCP?
VSC-MCP is an MCP server that exposes Language Server Protocol (LSP) functionality as MCP tools, enabling AI clients to programmatically analyze and edit code. It supports any language that VS Code supports, through either a local TypeScript-only language server or a Docker‑based headless VS Code instance.
How to use VSC-MCP?
Clone the repository, install dependencies with bun install, and start the OpenVSCode Server using PROJECT_PATH=/path/to/your/project docker-compose up. Register the MCP server in your AI client’s configuration (e.g., Claude Desktop) with environment variables USE_VSCODE_LSP, ALLOWED_DIRECTORIES, and LOG_DIR. In standalone mode, set USE_VSCODE_LSP to false; in Docker mode, set it to true.
Key features of VSC-MCP
- Exposes LSP functionality (diagnostics, references, symbol editing) as MCP tools
- Two modes: standalone (TypeScript/JavaScript only) and Docker (any VS Code language)
- Live editing via web UI at
http://localhost:3000
- Security: workspace directory restriction and
ALLOWED_DIRECTORIES environment variable
- Tools:
edit_symbol, read_symbol, read_file, write_file, search_replace_file, get_errors, find_references
- Integrates with VS Code extension ecosystem for rich language support
Use cases of VSC-MCP
- Chat with an AI agent to analyze and edit code without opening an IDE
- Programmatically edit symbols (functions, classes, methods) using LSP
- Read and write files, perform search-and-replace with whitespace‑insensitive matching
- Fetch code diagnostics and find references for refactoring and code understanding
- Support multi-language projects (Rust, Go, C#, Python, etc.) via Docker mode
评论