
Lsp Mcp
io.github.theUpsider由 GitHub 帳號 theUpsider 發布v0.1.6更新於 Oct 27, 2026
Universal LSP MCP server
概覽
本機 MCP 伺服器,讓助理取得語言伺服器協定能力:跨 13 種語言的定義跳轉、參考查找、符號、診斷、重新命名與格式化。
- 可以做什麼
- 程式碼導覽:跳至定義、型別定義與實作,並在指定位置找出所有參考。
- 符號瀏覽:列出檔案內符號,並在整個工作區搜尋符號。
- 程式碼檢查:取得單一檔案或整個工作區的錯誤與警告,並查看語言伺服器狀態。
- 程式碼修改:重新命名符號、列出或套用程式碼動作、格式化整份文件或指定範圍。
- 專案初始化:設定工作區根目錄,自動偵測語言,也可預先指定要預熱的語言。
- 適用情境
- 適合需要助理以接近編譯器的精確度處理真實程式碼庫、而非純文字搜尋的情境:在大型專案中導覽、編輯後檢查診斷訊息,或對 Python、TypeScript、Go、Rust、Java、C/C++ 等支援語言執行安全重新命名與格式化。
- 執行需求
- 以本機 Node.js 程序執行,透過 npm 安裝(npx 或全域安裝),且必須與原始碼位於同一台機器,因為語言伺服器需要直接存取檔案系統。需要已安裝或可自動安裝對應的語言伺服器(pyright、gopls、rust-analyzer、clangd 等)。選用環境變數 LSP_MCP_LOG_LEVEL 可控制日誌等級。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Lsp Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Universal LSP MCP Server
One MCP server to rule all Language Servers — automatic language detection, zero-config setup.
[License: Apache-2.0] [npm version] [Node.js] [Platform]
Overview
A Model Context Protocol (MCP) server that gives language models access to Language Server Protocol (LSP) functionality across all major programming languages. Unlike existing LSP-MCP servers, this project supports 13 languages out of the box with zero manual configuration — it automatically detects your codebase, selects the right language server, and exposes all LSP operations through a stable, language-independent tool interface.
Supported Languages
Features
- 🔍 Automatic Language Detection — Scans project root for language markers (
package.json,Cargo.toml,go.mod, etc.) - 🔄 Auto Language Server Selection — Hardcoded mapping with fallback servers; installs missing LSPs automatically
- 🤖 Hands-Free Initialization — Clients that support MCP Roots auto-initialize on connect —
lsp_initdisappears from the tool list once all servers start cleanly - 💾 Cross-Session Persistence — Initialized workspaces and their ready languages are remembered across server restarts
- 🔁 Graceful Degradation —
lsp_initreappears if a previously-working server starts failing (e.g. language added, binary missing) - 🛠 12 LSP Tools — Definition, references, symbols, diagnostics, rename, code actions, formatting, and more
- 📝 Read & Write Operations — Both inspection and modification of code via LSP
- 🌐 Polyglot Support — Multiple language servers run simultaneously in the same project
- 📋 Hybrid Responses — Human-readable
textfield + raw LSP data inrawfield - 🔌 MCP Stdio Protocol — Works with any MCP-compatible client
- ⚡ Zero Config — Install and run, no per-language setup required
Installation
Important: Install
lsp-mcpon the same machine where your code lives. The language servers it manages need direct filesystem access to your codebase — they cannot work over a remote connection or on a different machine than your source files.
Quickstart
VS Code / Cursor
Add to your workspace .vscode/mcp.json (recommended — ensures the server runs on the same machine as your code, including SSH remotes, WSL, and Dev Containers):
Why workspace config? VS Code runs servers defined in
.vscode/mcp.jsonwherever the workspace lives. Servers defined in your user profile always run locally — which breaks LSP when your code is on a remote machine.
CLI
The server starts with no active project. Most clients auto-initialize when they support the MCP Roots protocol (VS Code, Copilot, etc.), but lsp_init remains available as a manual override.
For clients without Roots support, the first action the model must take is calling lsp_init:
lsp_init will:
- Scan the root for language markers and start matching language servers (best-effort)
- Disappear from the tool list when you called it explicitly — subsequent calls to any LSP tool trigger lazy server startup for that file's language if no server was detected at init time
- Return health status for all servers that were started eagerly
Optional: pre-warm specific languages (skips detection, faster cold start):
Persistence: Once initialized, the workspace configuration (detected languages) is saved to your OS-standard config directory (~/.config/lsp-mcp/ on Linux, ~/Library/Application Support/lsp-mcp/ on macOS, %APPDATA%\lsp-mcp\ on Windows). On subsequent server startups, the MCP server will automatically reconnect using the last-known root, so you rarely need to call lsp_init again.
Re-emergence: If a language server that was previously healthy fails to start (e.g. you added a new language or removed a binary), lsp_init will reappear in the tool list, signaling the model should re-initialize.
Available Tools
Read-Only Tools
Write Tools
Configuration
Setup Scripts
Two helper scripts are included for setting up a development environment:
setup-languages-ubuntu24.sh— Installs all language runtimes, compilers, and toolchains on Ubuntu 24.04 (Python, Node.js, Java, Go, Rust, Ruby, PHP, Kotlin, Swift, etc.)setup-lsp.sh— Installs all language servers (pyright, typescript-language-server, omnisharp, jdtls, gopls, rust-analyzer, clangd, solargraph, intelephense, kotlin-language-server)
Troubleshooting
Language server not found
If a language server cannot be auto-installed, the server logs a structured error and continues running for other languages. Manually install the missing server:
Server not detecting language
Ensure your project root contains a language marker file (e.g., package.json for TypeScript, Cargo.toml for Rust). The server scans the directory passed to lsp_init for these markers.
High memory usage
Each language server runs as a separate process. For large projects with many languages, consider limiting the workspace or using LSP_MCP_LOG_LEVEL=info to monitor server health.
Architecture
License
來源:README.md,提交 c8ad53f
工具
0版本歷史
1- v0.1.6最新Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。