
jonrad/lsp-mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
jonrad/lsp-mcp — это кандидат-сервер MCP, импортированный из https://github.com/jonrad/lsp-mcp.
Обзор
jonrad/lsp-mcp — это кандидат-сервер MCP, импортированный из https://github.com/jonrad/lsp-mcp.
Обзор (машинный перевод)
Сервер Model Context Protocol (MCP), который предоставляет LLM/AI-агентам возможности сервера протокола языка (LSP). Это даёт ИИ возможность получать языкоориентированный контекст из кодовой базы.
- LSP MCP
- Пример
- Предупреждение
- Особенности
- Быстрый старт
- Claude Desktop
- Использование Docker (рекомендуется)
- Использование NPX
- Курсор
- Клиент MCP CLI
- Азбука (Введение)
- Что такое MCP?
- Что такое LSP?
- Разработка
- Зависимости
- Решения
- Дорожная карта
- Ссылки
Пример
Ввод:
Выход:
Предупреждение
Это происходит в штате цветных людей.
Особенности
- Несколько LSP (поддержка нескольких языков программирования) одновременно, см. пример конфигурации
- Динамически генерирует поддерживаемый метод LSP из схемы LSP JSON, см. схему json
Быстрый старт
Клод Десктоп
Использование Docker (Рекомендуемо)
Измените claude_desktop_config.json (как описано в MCP Docs) следующим образом:
Скорее всего, вы захотите поделиться некоторыми файлами с контейнером, передав Docker -v /local_dir:/remote_dir. Затем можно спросить у Клода о файлах в /remote_dir/ .
Использование NPX
Примечание: Claude Desktop кажется капризным с NPX.
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
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"]
}
}
}