MCP Language Server
MCP 言語サーバー
これは、言語サーバーを実行し、LLMに公開するMCPサーバーです。MCP用の言語サーバーではありません。MCP用の言語サーバーが何であれ。
デモ
mcp-language-server定義の取得、参照、名前の変更、診断などのセマンティック ツールへのアクセスを提供することで、MCP 対応クライアントがコードベースをより簡単にナビゲートできるようにします。

Related MCP server: LSP MCP
設定
Go をインストールします: https://golang.org/doc/installの指示に従ってください
このサーバーをインストールまたは更新します:
go install github.com/isaacphi/mcp-language-server@latest言語サーバーをインストールする:以下のいずれかのガイドに従ってください
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/...実行します。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Lean 4 MCP server: compile, prove theorems, and formalize math with Mathlib.
Ask a codebase what calls what: search, blast radius, paths between symbols, and diffs.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
AlicenseNot gradedqualityBmaintenanceProvides LLM clients with structured code intelligence through LSP servers, enabling queries for definitions, references, call hierarchies, and more.3Apache 2.0- AlicenseNot gradedqualityDmaintenanceProvides AI agents with language-aware code analysis through the Language Server Protocol, enabling tasks like getting code insights and diagnostics.194MIT
- AlicenseNot gradedqualityDmaintenanceWraps the CodeQL Language Server Protocol to enable LLM agents to write CodeQL queries with intelligent code completion, hover information, and other language features.9MIT
- AlicenseBqualityDmaintenanceWraps the Eclipse JDT Language Server to enable AI assistants to understand Java codebases, search symbols, navigate definitions/references, and read third-party .class files.7ISC