Skip to main content
Glama

lsp-mcp

Blackwell Systems CI LSP 3.17 Languages License

언어 인텔리전스를 위한 가장 완벽한 MCP 서버입니다. 탐색, 진단, 리팩토링 및 포맷팅을 다루는 22개의 도구를 제공합니다. 7개 언어에 대해 CI 검증을 거쳤으며, LSP 3.17 사양을 직접 준수하여 구축되었습니다.

일반적인 MCP-LSP 브리지와 달리, lsp-mcp는 지속적인 언어 서버 세션을 유지합니다. 에이전트는 호출 간에 컨텍스트를 잊어버리는 콜드 스타트 방식의 스텁이 아니라, 실시간 진단 및 파일 간 인식을 갖춘 완전히 인덱싱된 작업 공간에서 작동합니다.

lsp-mcp를 선택해야 하는 이유

lsp-mcp

일반적인 대안

언어 (CI 검증됨)

7

1–2

도구

22

3–5

LSP 사양 준수

3.17, 사양에 맞춰 구축

임시 구현

연결 모델

지속적

요청별 연결

파일 간 참조

거의 없음

실시간 진단 구독

테스트 커버리지

76% 문장, 86% 함수

거의 테스트되지 않음

Related MCP server: LSP MCP

빠른 시작

{
  "mcpServers": {
    "lsp": {
      "type": "stdio",
      "command": "npx",
      "args": ["blackwell-systems/LSP-MCP", "<language-id>", "<path-to-lsp-binary>", "<lsp-args>"]
    }
  }
}

TypeScript:

{ "args": ["blackwell-systems/LSP-MCP", "typescript", "typescript-language-server", "--stdio"] }

Go:

{ "args": ["blackwell-systems/LSP-MCP", "go", "gopls"] }

Rust:

{ "args": ["blackwell-systems/LSP-MCP", "rust", "rust-analyzer"] }

다중 언어 지원

아래의 모든 언어는 모든 CI 실행 시 통합 테스트를 거칩니다. start_lsp, open_document, get_diagnostics, get_info_on_location 모두 실제 언어 서버 바이너리를 기준으로 검증되었습니다:

언어

서버

설치

TypeScript / JavaScript

typescript-language-server

npm i -g typescript-language-server typescript

Python

pyright-langserver

npm i -g pyright

Go

gopls

go install golang.org/x/tools/gopls@latest

Rust

rust-analyzer

rustup component add rust-analyzer

Java

jdtls

eclipse.jdt.ls 스냅샷

C / C++

clangd

apt install clangd / brew install llvm

PHP

intelephense

npm i -g intelephense

도구

모든 도구는 먼저 start_lsp가 호출되어야 합니다.

세션

도구

설명

start_lsp

프로젝트 루트와 함께 언어 서버 시작

restart_lsp_server

MCP 서버를 재시작하지 않고 서버 재시작

open_document

추적을 위해 파일 열기 (위치 쿼리 전 필수)

close_document

파일 추적 중지

분석

도구

설명

get_diagnostics

오류 및 경고 — 전체 프로젝트의 경우 file_path 생략

get_info_on_location

특정 위치의 호버 정보 (타입 시그니처, 문서)

get_completions

특정 위치의 코드 완성 제안

get_signature_help

호출 지점의 함수 시그니처 및 활성 매개변수

get_code_actions

범위에 대한 빠른 수정 및 리팩토링

get_document_symbols

파일 내 모든 심볼 (함수, 클래스, 변수)

get_workspace_symbols

작업 공간 전체에서 이름으로 심볼 검색

탐색

도구

설명

get_references

작업 공간 전체에서 심볼에 대한 모든 참조

go_to_definition

심볼이 정의된 곳으로 이동

go_to_type_definition

심볼의 타입 정의로 이동

go_to_implementation

인터페이스나 추상 메서드의 모든 구현으로 이동

go_to_declaration

심볼의 선언으로 이동 (정의와 구분됨 — 예: C/C++ 헤더)

리팩토링

도구

설명

rename_symbol

작업 공간 전체에서 심볼 이름을 변경하기 위한 WorkspaceEdit 가져오기

prepare_rename

커밋 전 이름 변경 가능 여부 검증

format_document

파일에 대한 TextEdit[] 포맷팅 편집 가져오기

apply_edit

디스크에 WorkspaceEdit 적용 (rename_symbol 또는 format_document와 함께 사용)

execute_command

서버 측 명령 실행 (예: 코드 액션에서)

유틸리티

도구

설명

set_log_level

런타임에 로그 상세 수준 변경

권장 에이전트 워크플로우:

start_lsp(root_dir="/your/project")
open_document(file_path=..., language_id=...)
get_diagnostics()                          # whole project, no file_path
get_info_on_location(...) / get_references(...)
close_document(...)

언어 ID: typescript, typescriptreact, javascript, javascriptreact, python, go, rust, java, c, cpp, php

리소스

진단 리소스는 실시간 구독을 지원합니다. 진단 정보가 변경되면 서버가 notifications/resources/updated를 전송합니다.

스킴

설명

lsp-diagnostics://

열려 있는 모든 파일

lsp-diagnostics:///path/to/file

특정 파일 (구독 가능)

lsp-hover:///path/to/file?line=N&column=N&language_id=X

위치 호버

lsp-completions:///path/to/file?line=N&column=N&language_id=X

위치 코드 완성

LSP 3.17 준수

lsp-mcp는 LSP 3.17 사양을 직접 구현하며 실제 언어 서버와의 통합 테스트를 통해 검증되었습니다. 커버리지 포함 사항:

  • 전체 수명 주기 (initializeinitializedshutdown) 및 정상적인 SIGINT/SIGTERM 처리

  • 진행 상황 프로토콜 — 작업 공간 준비 감지는 참조를 보내기 전에 모든 $/progress 토큰이 완료될 때까지 대기

  • 서버 시작 요청 (workspace/configuration, window/workDoneProgress/create, 동적 등록) — 모두 올바르게 응답하여 이러한 응답에 작업 공간 로딩을 의존하는 서버의 차단을 해제

  • 올바른 JSON-RPC 프레이밍, 오류 코드 처리, 호버/완성/코드 액션/진단 전반에 걸친 응답 형태 정규화

전체 메서드 커버리지 매트릭스 및 사양 섹션 참조는 docs/lsp-conformance.md를 확인하세요.

확장 기능

언어별 확장 기능은 도구, 프롬프트, 리소스 핸들러를 추가하며 시작 시 언어 ID에 따라 자동으로 로드됩니다.

확장 기능을 추가하려면 src/extensions/<language-id>.ts를 생성하고 getToolHandlers, getToolDefinitions, getResourceHandlers, getSubscriptionHandlers, getPromptDefinitions, getPromptHandlers 중 일부를 구현하세요. 모든 기능은 언어 ID별로 네임스페이스가 지정됩니다.

개발

git clone https://github.com/blackwell-systems/LSP-MCP.git
cd LSP-MCP && npm install && npm run build
npm test                   # all unit test suites
npm run test:multi-lang    # 7-language integration test (requires language servers)

커버리지: 약 76% 문장, 약 86% 함수. MCP 트래픽을 검사하려면: claude --mcp-debug.

라이선스

MIT

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides AI agents with language-aware code analysis through the Language Server Protocol, enabling tasks like getting code insights and diagnostics.
    6 npm
    191
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Exposes Language Server Protocol (LSP) functionality as Model Context Protocol (MCP) tools, enabling AI clients to programmatically analyze and edit code in any language supported by VS Code.
    5 npm
    33
    MIT
  • A
    license
    A
    quality
    F
    maintenance
    Provides C++ code intelligence tools for AI agents via the Model Context Protocol, enabling symbol navigation, type information, and diagnostics.
    9
    48
    Mozilla Public 2.0