MCP Language Server
MCP 语言服务器
这是一个运行语言服务器并向 LLM 开放的MCP服务器。它不是 MCP 的语言服务器,无论 MCP 是什么。
演示
mcp-language-server通过为启用 MCP 的客户端提供访问语义工具(如获取定义、引用、重命名和诊断)来帮助它们更轻松地导航代码库。

Related MCP server: karellen-lsp-mcp
设置
安装 Go :按照https://golang.org/doc/install上的说明进行操作
安装或更新此服务器:
go install github.com/isaacphi/mcp-language-server@latest安装语言服务器:按照以下指南之一进行操作
配置您的 MCP 客户端:请按照以下指南之一进行操作
<p><strong>Note</strong>:</p>
<ul>
<li>Replace <code>/path/to/your/clangd_binary</code> with the actual path to your clangd executable.</li>
<li><code>--compile-commands-dir</code> should point to the directory containing your <code>compile_commands.json</code> file (e.g., <code>./build</code>, <code>./cmake-build-debug</code>).</li>
<li>Ensure <code>compile_commands.json</code> is generated for your project for clangd to work effectively.</li>
</ul>工具
definition:从代码库中检索任何符号(函数、类型、常量等)的完整源代码定义。references:在整个代码库中定位符号的所有用法和引用。diagnostics:提供特定文件的诊断信息,包括警告和错误。hover:显示给定位置的文档、类型提示或其他悬停信息。rename_symbol:在项目中重命名符号。edit_file:允许根据行号对文件进行多项文本编辑。与基于搜索和替换的编辑工具相比,它提供了一种更可靠、更经济的文件编辑方式。
关于
此代码库使用gopls编辑的代码来处理 LSP 通信。详情请参阅 ATTRIBUTION。此处所有内容均受 BSD 风格许可证的保护。
mcp-go用于 MCP 通信。感谢您的服务。
这是测试版软件。如果您遇到任何问题或有任何建议,请通过创建问题来告知我。
贡献
请保持 PR 规模较小,并优先开放 Issues 以应对任何实质性问题。AI 漏洞只要经过测试、检查,且问题不大,就没问题。
设置
克隆仓库:
git clone https://github.com/isaacphi/mcp-language-server.git
cd mcp-language-server为了方便起见,包含了一个justfile :
just -l
Available recipes:
build # Build
check # Run code audit checks
fmt # Format code
generate # Generate LSP types and methods
help # Help
install # Install locally
snapshot # Update snapshot tests
test # Run tests配置您的 Claude Desktop(或类似桌面)以使用本地二进制文件:
{
"mcpServers": {
"language-server": {
"command": "/full/path/to/your/clone/mcp-language-server/mcp-language-server",
"args": [
"--workspace",
"/path/to/workspace",
"--lsp",
"language-server-executable"
],
"env": {
"LOG_LEVEL": "DEBUG"
}
}
}
}进行更改后重建。
日志记录
将LOG_LEVEL环境变量设置为 DEBUG 可将所有组件的详细日志记录到 stderr,包括往返于语言服务器的消息以及语言服务器的日志。
LSP 交互
internal/lsp/methods.go包含用于调用所连接的语言服务器的生成代码。internal/protocol/tsprotocol.go包含 LSP 类型的生成代码。我从gopls的源代码中借鉴了这些代码。感谢您的服务。LSP 允许语言服务器为相同的方法返回不同的类型。Go 语言不支持这种做法,因此在
internal/protocol/interfaces.go中引入了一些不太好用的变通方法。
本地开发和快照测试
有一个快照测试套件,可以更轻松地测试工具的更改。它们在模拟工作区上运行真实的语言服务器,并捕获输出和日志。
您需要在本地安装语言服务器才能运行它们。这里有针对 Go、Rust、Python 和 TypeScript 的测试。
integrationtests/
├── tests/ # Tests are in this folder
├── snapshots/ # Snapshots of tool outputs
├── test-output/ # Gitignored folder showing the final state of each workspace and logs after each test run
└── workspaces/ # Mock workspaces that the tools run on要更新快照,请运行UPDATE_SNAPSHOTS=true go test ./integrationtests/...
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityBmaintenanceExposes Language Server Protocol (LSP) tools such as diagnostics, goto definition, find references, symbols, and rename as a stdio MCP server.6MIT

karellen-lsp-mcpofficial
Alicense-qualityDmaintenanceProvides LLM clients with structured code intelligence through LSP servers, enabling queries for definitions, references, call hierarchies, and more.1Apache 2.0- Alicense-qualityDmaintenanceProvides AI agents with language-aware code analysis through the Language Server Protocol, enabling tasks like getting code insights and diagnostics.20192MIT
- Alicense-qualityDmaintenanceExposes type-aware code navigation and fast file search to AI agents via language servers, enabling definitions, references, symbols, and file lookup without reading entire codebases.3,043MIT
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Enterprise code intelligence for M&A, security audits, and tech debt. Hosted server with 200k free.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/isaacphi/mcp-language-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server