Skip to main content
Glama

MCP Language Server

MCP 言語サーバー

これは、言語サーバーを実行し、LLMに公開するMCPサーバーです。MCP用の言語サーバーではありません。MCP用の言語サーバーが何であれ。

デモ

mcp-language-server定義の取得、参照、名前の変更、診断などのセマンティック ツールへのアクセスを提供することで、MCP 対応クライアントがコードベースをより簡単にナビゲートできるようにします。

デモ

設定

  1. Go をインストールします: https://golang.org/doc/installの指示に従ってください
  2. このサーバーをインストールまたは更新します: go install github.com/isaacphi/mcp-language-server@latest
  3. 言語サーバーをインストールする:以下のいずれかのガイドに従ってください
  4. MCPクライアントを構成する:以下のいずれかのガイドに従ってください
<p><strong>Note</strong>:</p> <ul> <li>Replace <code>/path/to/your/clangd_binary</code> with the actual path to your clangd executable.</li> <li><code>--compile-commands-dir</code> should point to the directory containing your <code>compile_commands.json</code> file (e.g., <code>./build</code>, <code>./cmake-build-debug</code>).</li> <li>Ensure <code>compile_commands.json</code> is generated for your project for clangd to work effectively.</li> </ul>

ツール

  • definition : コードベースから任意のシンボル (関数、型、定数など) の完全なソース コード定義を取得します。
  • references : コードベース全体でシンボルのすべての使用箇所と参照を見つけます。
  • diagnostics : 警告やエラーなど、特定のファイルの診断情報を提供します。
  • hover : 特定の場所のドキュメント、入力ヒント、その他のホバー情報を表示します。
  • rename_symbol : プロジェクト全体のシンボルの名前を変更します。
  • edit_file : 行番号に基づいてファイル内の複数のテキストを編集できます。検索・置換ベースの編集ツールと比較して、より信頼性が高く、コンテキストに基づいたファイル編集方法を提供します。

について

このコードベースは、LSP通信を処理するためにgoplsのコードを編集して使用しています。詳細は帰属を参照してください。ここに掲載されているすべてのものは、寛容なBSDスタイルのライセンスで保護されています。

MCP通信にはmcp-goを利用しております。ご利用ありがとうございます。

これはベータ版ソフトウェアです。何か問題が発生した場合や、ご意見・ご提案がございましたら、問題を作成してお知らせください。

貢献

PR は小規模にとどめ、実質的な問題の場合はまず Issue をオープンにしてください。テスト済みでチェックに合格し、問題がない限り、AI の雑多な内容でも問題ありません。

設定

リポジトリをクローンします:

git clone https://github.com/isaacphi/mcp-language-server.git cd mcp-language-server

便宜上、 justfileが含まれています。

just -l Available recipes: build # Build check # Run code audit checks fmt # Format code generate # Generate LSP types and methods help # Help install # Install locally snapshot # Update snapshot tests test # Run tests

ローカルバイナリを使用するように Claude Desktop (または同様のもの) を構成します。

{ "mcpServers": { "language-server": { "command": "/full/path/to/your/clone/mcp-language-server/mcp-language-server", "args": [ "--workspace", "/path/to/workspace", "--lsp", "language-server-executable" ], "env": { "LOG_LEVEL": "DEBUG" } } } }

変更後に再構築します。

ログ記録

LOG_LEVEL環境変数を DEBUG に設定すると、言語サーバーとの間のメッセージや言語サーバーのログを含むすべてのコンポーネントの stderr への詳細なログ記録が有効になります。

LSPインタラクション

  • internal/lsp/methods.goには、接続された言語サーバーへの呼び出しを行うために生成されたコードが含まれています。
  • internal/protocol/tsprotocol.goには、LSPタイプ用の生成コードが含まれています。これはgoplsのソースコードから拝借したものです。ご協力ありがとうございます。
  • LSPでは、言語サーバーが同じメソッドに対して異なる型を返すことができます。Goではこれが好ましくないため、 internal/protocol/interfaces.goにいくつかの厄介な回避策が用意されています。

ローカル開発とスナップショットテスト

ツールの変更を簡単にテストできるスナップショットテストスイートがあります。これらのテストスイートでは、模擬ワークスペース上で実際の言語サーバーを実行し、出力とログをキャプチャします。

実行するには、ローカルに言語サーバーをインストールする必要があります。Go、Rust、Python、TypeScriptのテストがあります。

integrationtests/ ├── tests/ # Tests are in this folder ├── snapshots/ # Snapshots of tool outputs ├── test-output/ # Gitignored folder showing the final state of each workspace and logs after each test run └── workspaces/ # Mock workspaces that the tools run on

スナップショットを更新するには、 UPDATE_SNAPSHOTS=true go test ./integrationtests/...実行します。

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

言語サーバーを実行し、サーバーと通信するためのツールを提供します。言語サーバーは、型の正確な理解、関係の理解、正確なシンボル参照の提供など、LLMがしばしば困難に感じるタスクに優れています。

  1. デモ
    1. 設定
      1. ツール
        1. について
          1. 貢献
            1. 設定
            2. ログ記録
            3. LSPインタラクション
            4. ローカル開発とスナップショットテスト

          Related MCP Servers

          • -
            security
            A
            license
            -
            quality
            This is a server that lets your LLMs (like Claude) talk directly to your BigQuery data! Think of it as a friendly translator that sits between your AI assistant and your database, making sure they can chat securely and efficiently.
            Last updated -
            1
            241
            81
            JavaScript
            MIT License
          • A
            security
            A
            license
            A
            quality
            This server enables LLMs to retrieve and process content from web pages, converting HTML to markdown for easier consumption.
            Last updated -
            1
            54,491
            JavaScript
            MIT License
            • Linux
            • Apple
          • -
            security
            F
            license
            -
            quality
            A TypeScript-based server that provides a memory system for Large Language Models (LLMs), allowing users to interact with multiple LLM providers while maintaining conversation history and offering tools for managing providers and model configurations.
            Last updated -
            20
            JavaScript
            • Apple
          • -
            security
            F
            license
            -
            quality
            This server provides an API to query Large Language Models using context from local files, supporting various models and file types for context-aware responses.
            Last updated -
            1
            TypeScript

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/isaacphi/mcp-language-server'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server