vsc
This project provides tools that expose Language Server Protocol (LSP) functionality as MCP (Model Context Protocol) tools
claude mcp add --transport stdio thomasgazzoni-vsc-mcp bun <vsc_mcp_cloned_dir>/src/index.ts \ --env LOG_DIR="<vsc_mcp_cloned_dir>/logs" \ --env USE_VSCODE_LSP="true" \ --env ALLOWED_DIRECTORIES="/path/to/your/project"
How to use
VSC-MCP exposes VS Code LSP capabilities via MCP, enabling an AI client to analyze and edit code across languages supported by VS Code. In Docker mode it leverages a headless OpenVSCode Server to provide rich language features and extensions, while in standalone mode it can run a local TypeScript/JavaScript language server for faster, language-specific tooling. The server exposes tools such as reading, editing, and inspecting code through LSP-backed operations, and supports file I/O with security restrictions.
To use it, register the MCP in your AI client configuration (examples show how to configure vsc-mcp). The available tools include edit_symbol, read_symbol, read_file, write_file, search_replace_file, get_errors, and find_references. When enabled with USE_VSCODE_LSP=true, the MCP forwards LSP requests to the OpenVSCode Server (port 5007) and uses VS Code’s language servers for richer capabilities. You can watch live edits in real time via the OpenVSCode UI (hosted at port 3000) and leverage VS Code extensions preinstalled in the container.
Typical workflows involve locating a symbol with read_symbol, modifying it with edit_symbol, inspecting diagnostics with get_errors, or applying repository-wide changes with search_replace_file and find_references. Ensure ALLOWED_DIRECTORIES restricts file access to your project paths for security.
How to install
Prerequisites:
- Docker (for running OpenVSCode Server in Docker mode)
- Bun (for running the MCP server)
Setup steps:
-
Clone the repository and navigate into it git clone https://example.com/thomasgazzoni-vsc-mcp.git cd thomasgazzoni-vsc-mcp
-
Install dependencies with Bun bun install
-
Build and start the OpenVSCode Server in Docker mode (mount your project into the container) PROJECT_PATH=/path/to/your/project docker-compose up
-
Register the MCP in your AI client (example for settings.json) { "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" } } } }
Notes:
- If you run in standalone mode, set USE_VSCODE_LSP to false (default) to use a local TypeScript language server.
- Ensure the environment variable ALLOWED_DIRECTORIES restricts file I/O to your project for security.
Additional notes
Tips and caveats:
- Docker Workspace Restriction: Start the container with PROJECT_PATH set to your project to limit file access to that workspace.
- Path restrictions: ALLOWED_DIRECTORIES accepts a comma-separated list of directories; without this, MCP may default to the current working directory.
- The vsc-mcp server relies on bun to execute src/index.ts; ensure Bun is installed and available in your PATH.
- If you encounter issues connecting to port 5007 for LSP, verify OpenVSCode Server started correctly inside Docker and that the port mappings are available to your MCP host.
- You can mix commands in your AI client config to support multiple MCP servers or switch between Docker-backed VS Code LSP and standalone modes depending on the project needs.
Related MCP Servers
ghost
A Model Context Protocol (MCP) server for interacting with Ghost CMS through LLM interfaces like Claude. Allow you to control your Ghost blog by simply asking Claude etc.
mcp-memory-keeper
MCP server for persistent context management in AI coding assistants
mcp -amazon
🛍📦 Unofficial Amazon Model Context Protocol Server (MCP) - Search products and purchase directly from Claude AI! ✨
mcp-web-search-tool
A MCP server providing real-time web search capabilities to any AI model.
mcp -webscan
A Model Context Protocol (MCP) server for web content scanning and analysis. This server provides tools for fetching, analyzing, and extracting information from web pages.
vscode-context
MCP Server to Connect with VS Code IDE