
thomasgazzoni/vsc-mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
This project provides tools that expose Language Server Protocol (LSP) functionality as MCP (Model Context Protocol) tools
Обзор
This project provides tools that expose Language Server Protocol (LSP) functionality as tools. It enables AI clients to programmatically analyze and edit code through standardized MCP tool calls. It started as a simple project focused on coding only with TypeScript, then evolved to a full-featured MCP server that supports any language supported by VS Code. Full details about latest changes and migration to headless VC Code can be found here VSC-MCP can run in two modes: - : It spawn a local typescript-language-server to provide LSP support ONLY for TypeScript/JavaScript. - : Leverages a headless VS Code port by Gitpod, namely OpenVSCode Server, running in Docker to provide richer LSP support, for any languages supported by VC Code like Rust, Go, C#, Python, etc. - : Avoids the hassle of launching separate local language servers for each language. - : Inherits VS Code's extension support and APIs for advanced language features.
README
Показан фрагмент оригинального README. Открыть оригинал.
VSC-MCP
This project provides tools that expose Language Server Protocol (LSP) functionality as MCP (Model Context Protocol) tools. It enables AI clients to programmatically analyze and edit code through standardized MCP tool calls.
It started as a simple project focused on coding only with TypeScript, then evolved to a full-featured MCP server that supports any language supported by VS Code.
Full details about latest changes and migration to headless VC Code can be found here
Docker Mode & VS Code LSP Integration
VSC-MCP can run in two modes:
- Standalone Mode: It spawn a local typescript-language-server to provide LSP support ONLY for TypeScript/JavaScript.
- Docker Mode: Leverages a headless VS Code port by Gitpod, namely OpenVSCode Server, running in Docker to provide richer LSP support, for any languages supported by VC Code like Rust, Go, C#, Python, etc.
Why Docker Mode?
- Unified LSP: Avoids the hassle of launching separate local language servers for each language.
- Rich Extension Ecosystem: Inherits VS Code’s extension support and APIs for advanced language features.
- Live Editing: Open http://localhost:3000 to watch edits in real time as your AI agent interacts with MCP.
- Works without IDE: we can write and analyze code without opening any IDE.
How It Works
- OpenVSCode Server runs inside Docker, exposing port
3000(IDE UI) and5007(LSP bridge). - Required VS Code extensions are pre-installed (e.g., rust-analyzer, pyright, eslint, and the VSC-MCP extension).
- The VSC-MCP extension creates a WebSocket channel between MCP and the VS Code back-end.
- File I/O tools use direct access; LSP tools use VS Code’s internal language servers.
Installation
Prerequisites
Setup
- Clone the repository and
cdinto it. - Install dependencies
bun install - Build and start OpenVSCode Server (mount your project into the container)
PROJECT_PATH=/path/to/your/project docker-compose up - Register MCP in your AI client (example
settings.json){ "mcpServers": { "vsc-mcp": { "command": "bun", "args": ["/src/index.ts"], "env": { "USE_VSCODE_LSP": "true", "LOG_DIR": "/logs", "ALLOWED_DIRECTORIES": "/path/to/your/project" } } } }
Environment Variables
| Variable | Purpose |
Установка
npx -y repomix --mcpКонфигурация
{
"mcpServers": {
"vsc-mcp": {
"command": "bun",
"args": ["<vsc_mcp_cloned_dir>/src/index.ts"],
"env": {
"USE_VSCODE_LSP": "true",
"LOG_DIR": "<vsc_mcp_cloned_dir>/logs",
"ALLOWED_DIRECTORIES": "/path/to/your/project"
}
}
}
}