/ Каталог / Песочница / mcp-language-server
● Сообщество isaacphi ⚡ Сразу

mcp-language-server

автор isaacphi · isaacphi/mcp-language-server

Give your agent real LSP semantics — go-to-definition, references, rename, diagnostics — via any stdio language server.

isaacphi/mcp-language-server is a Go binary that bridges MCP to any stdio LSP (gopls, rust-analyzer, pyright, typescript-language-server, clangd). Agents get symbol-accurate operations instead of text-search approximations.

Зачем использовать

Ключевые функции

Живое демо

Как выглядит на практике

language-server.replay ▶ готово
0/0

Установка

Выберите клиент

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "language-server": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/isaacphi/mcp-language-server"
      ],
      "_inferred": true
    }
  }
}

Откройте Claude Desktop → Settings → Developer → Edit Config. Перезапустите после сохранения.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "language-server": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/isaacphi/mcp-language-server"
      ],
      "_inferred": true
    }
  }
}

Cursor использует ту же схему mcpServers, что и Claude Desktop. Конфиг проекта приоритетнее глобального.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "language-server": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/isaacphi/mcp-language-server"
      ],
      "_inferred": true
    }
  }
}

Щёлкните значок MCP Servers на боковой панели Cline, затем "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "language-server": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/isaacphi/mcp-language-server"
      ],
      "_inferred": true
    }
  }
}

Тот же формат, что и Claude Desktop. Перезапустите Windsurf для применения.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "language-server",
      "command": "TODO",
      "args": [
        "See README: https://github.com/isaacphi/mcp-language-server"
      ]
    }
  ]
}

Continue использует массив объектов серверов, а не map.

~/.config/zed/settings.json
{
  "context_servers": {
    "language-server": {
      "command": {
        "path": "TODO",
        "args": [
          "See README: https://github.com/isaacphi/mcp-language-server"
        ]
      }
    }
  }
}

Добавьте в context_servers. Zed перезагружается автоматически.

claude mcp add language-server -- TODO 'See README: https://github.com/isaacphi/mcp-language-server'

Однострочная команда. Проверить: claude mcp list. Удалить: claude mcp remove.

Сценарии использования

Реальные сценарии: mcp-language-server

How to rename a symbol safely across a repo

👤 Polyglot devs using agents ⏱ ~15 min intermediate

Когда использовать: You want a rename that understands scope, not a find-replace.

Предварительные требования
  • Go installed — brew install go
  • The LSP for your language — gopls: go install golang.org/x/tools/gopls@latest; pyright: pip install pyright; etc.
  • Install the MCP — go install github.com/isaacphi/mcp-language-server@latest
Поток
  1. Start the MCP pointed at your workspace + LSP
    Add MCP config: command=mcp-language-server, args=['--workspace','.','--lsp','gopls'].✓ Скопировано
    → Tools appear
  2. Find references first
    references for symbol 'LegacyAuth' in file auth.go.✓ Скопировано
    → Precise cross-repo references
  3. Rename
    rename_symbol 'LegacyAuth' -> 'Auth' at the definition site.✓ Скопировано
    → All callsites updated correctly

Итог: Semantically-correct rename across the repo.

Подводные камни
  • Agent falls back to text find-replace when the tool fails — Verify diagnostics after rename — compile errors mean the LSP refused and the agent cheated
Сочетать с: github

How to let the agent navigate like you do in an IDE

👤 Agent users tired of re-grepping ⏱ ~10 min beginner

Когда использовать: Agent keeps reading whole files to find one function.

Поток
  1. Query definition
    definition for 'computeTax' in src/billing.ts.✓ Скопировано
    → Exact file:line location
  2. Pull diagnostics
    diagnostics for the current file.✓ Скопировано
    → Red squigglies from the LSP

Итог: Agent navigates like an IDE user.

Подводные камни
  • LSP not initialized — slow first call — Warm up with a list of files in the workspace; pyright especially is slow to index
Сочетать с: contextplus

How to run multiple LSPs for a polyglot monorepo

👤 Devs on Go+TS+Python monorepos ⏱ ~25 min advanced

Когда использовать: You want semantic ops in every language.

Поток
  1. Register one MCP per LSP
    Add 3 MCP entries: lsp-go (gopls), lsp-ts (tsserver), lsp-py (pyright), each scoped to its workspace subfolder.✓ Скопировано
    → 3 sets of language-specific tools
  2. Use them in turn
    For TypeScript questions use lsp-ts:definition; for Go use lsp-go:definition.✓ Скопировано
    → Correct semantics per language

Итог: Semantically-aware navigation across all languages.

Подводные камни
  • Agent forgets which MCP handles which language — Rename tool prefixes descriptively and mention in your project memory

Комбинации

Сочетайте с другими MCP — эффект x10

language-server + contextplus

Combine LSP navigation with semantic/embedding search for broader queries

Use language-server's references for exact usages of computeTax, then contextplus semantic search to find conceptually-related functions.✓ Скопировано
language-server + github

Rename + commit + PR

Rename LegacyAuth to Auth via the LSP, commit to a new branch, open a PR.✓ Скопировано

Инструменты

Что предоставляет этот MCP

ИнструментВходные данныеКогда вызыватьСтоимость
definition file: str, symbol_or_position Jump to declaration free (local LSP)
references file: str, symbol_or_position Find usages free
diagnostics file: str Check errors/warnings free
hover file, position Type info / docs for a symbol free
rename_symbol file, position, new_name Safe rename free
edit_file file, edits LSP-validated edit free

Стоимость и лимиты

Во что обходится

Квота API
None — local LSP
Токенов на вызов
Small — LSP responses are compact
Деньги
Free
Совет
Use LSP-backed tools before embedding search — often cheaper and more precise.

Безопасность

Права, секреты, радиус поражения

Минимальные скоупы: Filesystem read/write to the workspace
Хранение учётных данных: None
Исходящий трафик: Localhost only; LSP runs in-process
Никогда не давайте: Don't point it at workspaces with secrets — LSPs sometimes index them

Устранение неполадок

Частые ошибки и исправления

tool returns 'LSP not ready'

First call triggers initialization — retry after 2-5 seconds, or warm up with a hover call.

gopls: 'no packages found'

Point workspace at the module root (where go.mod is), not a subfolder.

Проверить: go env GOMOD
pyright slow on big repos

Configure pyrightconfig.json to exclude vendored dirs.

rename_symbol reports success but compile still fails

Rename touched a string literal or reflection-based code the LSP can't see. Check grep for the old name.

Альтернативы

mcp-language-server в сравнении

АльтернативаКогда использоватьКомпромисс
Context+You want embedding + memory graph rather than LSP semanticsNot as precise on rename/references
Serena MCPYou want LSP with higher-level refactorsDifferent setup; Python-based

Ещё

Ресурсы

📖 Читать официальный README на GitHub

🐙 Открытые задачи

🔍 Все 400+ MCP-серверов и Skills