
jonrad/lsp-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
jonrad/lsp-mcp は、https://github.com/jonrad/lsp-mcp. からインポートされた MCP サーバー候補です。
概要
jonrad/lsp-mcp は、https://github.com/jonrad/lsp-mcp. からインポートされた MCP サーバー候補です。
概要(AI 翻訳)
LLM/AIエージェントに言語サーバープロトコル(LSP)サーバーの機能を提供するモデルコンテキストプロトコル(MCP)サーバーです。これによりAIはコードベースから言語認識コンテキストを取得する能力を持ちます。
- LSP MCP
- 例
- 警告
- 特徴
- クイックスタート
- クロードデスクトップ
- Dockerの使用(推奨)
- NPXの使用
- カーソル
- MCP CLIクライアント
- ABC(序文)
- MCPとは何ですか?
- LSPとは何ですか?
- 開発
- 依存関係
- 判決
- ロードマップ
- 参考文献
例
入力:
アウトプット:
警告
これは有色人種の州での話です。
特徴
- 複数のLSP(複数プログラミング言語サポート)を同時に実行する場合、サンプル設定を参照してください
- LSP JSON スキーマからサポートされるLSPメソッドを動的に生成(jsonスキーマを参照)
クイックスタート
クロードデスクトップ
Docker 使用(推奨)
claude_desktop_config.json(MCPドキュメントで説明されている通り)を以下で修正します:
コンテナとファイルを共有するために、docker -v /local_dir:/remote_dirを渡すと良いでしょう。その後、Claudeに/remote_dir/ のファイルについて尋ねることができます。
NPXの使用
注:Claude DesktopはNPX対応が難しいようです。
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
LSP MCP
An Model Context Protocol (MCP) server that provides LLMs/AI Agents with the capabilities of a language server protocol (LSP) server. This gives the AI the ability to get language aware context from the codebase.
Example
Input:
Use lsp to give me insights into the following typescript code:
let foo = "bar";
function x() {
let foo = 123;
console.log(foo);
}
x();
console.log(foo);
Output:
I'll use LSP (Language Server Protocol) to analyze your TypeScript code. Let me break down what's happening:
Here's what the code does and the insights from LSP analysis:
1. Variable Shadowing:
There are two variables named foo:
A global foo (string type) initialized with the value "bar"
A local foo (number type) inside the function x() initialized with the value 123
2. Execution Flow:
First, the global foo is declared and assigned the value "bar"
When function x() is called, the local foo variable is declared and assigned 123
The console.log(foo) inside the function outputs 123 (the local variable)
After the function finishes, console.log(foo) outputs "bar" (the global variable)
3. Scope Isolation:
The LSP confirms that TypeScript correctly identifies the different types:
The global foo is a string type
The local foo inside the function is a number type
Changes to the local foo don't affect the global foo
This is a classic example of variable shadowing in JavaScript/TypeScript, where a local variable with the same name as a global variable takes precedence within its scope.
Warning
This is in a POC state.
Features
- Multiple LSPs (Multiple programming language support) at the same time, see sample config
- Dynamically generates supported LSP method from LSP JSON Schema, see json schema
Quick Start
Claude Desktop
Using Docker (Recommended)
Modify claude_desktop_config.json (As described in the MCP Docs) with the following:
{
"mcpServers": {
"lsp": {
"command": "docker",
"args": ["run", "-i", "--rm", "docker.io/jonrad/lsp-mcp:0.3.1"]
}
}
}
インストール
docker run -i --rm docker.io/jonrad/lsp-mcp:0.3.1設定
{
"mcpServers": {
"lsp": {
"command": "docker",
"args": ["run", "-i", "--rm", "docker.io/jonrad/lsp-mcp:0.3.1"]
}
}
}