TV

thomasgazzoni/vsc-mcp

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

33 stars 2 forks Качество 51 Тренд 11

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

  1. OpenVSCode Server runs inside Docker, exposing port 3000 (IDE UI) and 5007 (LSP bridge).
  2. Required VS Code extensions are pre-installed (e.g., rust-analyzer, pyright, eslint, and the VSC-MCP extension).
  3. The VSC-MCP extension creates a WebSocket channel between MCP and the VS Code back-end.
  4. File I/O tools use direct access; LSP tools use VS Code’s internal language servers.

Installation

Prerequisites

  • Docker (for running the VS Code server)
  • Bun (for launching MCP)

Setup

  1. Clone the repository and cd into it.
  2. Install dependencies
    bun install
    
  3. Build and start OpenVSCode Server (mount your project into the container)
    PROJECT_PATH=/path/to/your/project docker-compose up
    
  4. 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 |

Открыть полный README на GitHub

Установка

npx -y repomix --mcp
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "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" } } } }