TV

thomasgazzoni/vsc-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

33 stars 2 forks 品質 51 トレンド 11

このプロジェクトでは、MCP(モデルコンテキストプロトコル)ツールとして言語サーバープロトコル(LSP)機能を公開するツールを提供しています

概要

このプロジェクトでは、言語サーバープロトコル(LSP)機能をツールとして公開するツールを提供しています。 標準化されたMCPツール呼び出しにより、AIクライアントがコードをプログラム的に解析および編集することができます。 TypeScript でのみコーディングに焦点を当てたシンプルなプロジェクトとして始まり、VS コードでサポートされている言語をサポートするフル機能の MCP サーバーに進化しました。 最新の変更とヘッドレスVCコードへの移行に関する詳細は、こちらをご覧ください。 VSC-MCP は 2 つのモードで実行できます: - : TypeScript/JavaScript 専用の LSP サポートを提供するローカル型スクリプト言語サーバーをスプーンします。 - : ヘッドレスVSコードポートをGitpod、すなわちOpenVSCode Serverによってレバレッジし、Dockerで実行して、Rust、Go、C#、PythonなどのVCコードでサポートされている言語に対して、より豊かなLSPサポートを提供します。 - : 各言語ごとに別のローカル言語サーバーを起動する手間を避けます。 - : 高度な言語機能のVSコードの拡張サポートとAPIを継承します.

概要(AI 翻訳)

このプロジェクトは、**MCP (モデルコンテキストプロトコル)**ツールとして、言語サーバープロトコル(LSP)機能を公開するツールを提供します。 標準化されたMCPツール呼び出しにより、AIクライアントがコードをプログラム的に解析および編集することができます。

TypeScript でのみコーディングに焦点を当てたシンプルなプロジェクトとして始まり、VS コードでサポートされている言語をサポートするフル機能の MCP サーバーに進化しました。

最新の変更とヘッドレスVCコードへの移行に関する詳細は、こちらをご覧ください。

# Docker モード & VS コード LSP 統合

VSC-MCP は 2 つのモードで実行できます。 -Standalone Mode: TypeScript/JavaScriptのみのLSPサポートを提供するローカル型スクリプト言語サーバーを発足しました。

  • Docker Mode:Gitpod、すなわちOpenVSCode ServerによってヘッドレスVSコードポートをレバレッジし、Dockerで実行して、Rust、Go、C#、PythonなどのVCコードでサポートされている言語に対して、より豊かなLSPサポートを提供します。

Docker モードの理由

  • Unified LSP: 各言語ごとに別のローカル言語サーバーを起動する手間を避けます。
  • リッチエクステンションエコシステム:VSコードの拡張サポートと高度な言語機能のAPI.

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

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 |

GitHub で README 全文を見る

インストール

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