Token导航 LogoToken导航TokenDH.com
MCP Language Server logo
AI代理未说明官方级别未说明来源级核验

MCP Language Server

MCP Server

MCP语言服务器是一个为LLM提供语言服务器协议支持的服务器,帮助客户端更轻松地导航代码库,提供定义、引用、重命名和诊断等语义工具。

工具数

0

提示词数

0

GitHub Stars

1,526

资源数

0
代码导航GoClaude开发工具Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

isaacphi

提供方

isaacphi

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

MCP语言服务器

![Go Tests](https://github.com/isaacphi/mcp-language-server/actions/workflows/go.yml) ![Go Report Card](https://goreportcard.com/report/github.com/isaacphi/mcp-language-server) ![GoDoc](https://pkg.go.dev/github.com/isaacphi/mcp-language-server) ](https://github.com/isaacphi/mcp-language-server/blob/main/go.mod)

演示

mcp-language-server 通过为启用MCP的客户端提供获取定义、引用、重命名和诊断等语义工具,帮助他们更轻松地浏览代码库。

Demo

设置

  1. 安装Go:遵循以下说明
  2. 安装或更新此服务器: go install github.com/isaacphi/mcp-language-server@latest
  3. 安装语言服务器: _遵循以下指南之一_
  4. 配置您的MCP客户端: _遵循以下指南之一_

Go (gopls)

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

Configure your MCP client: This will be different but similar for each client. For Claude Desktop, add the following to ~/Library/Application\ Support/Claude/claude_desktop_config.json

{ "mcpServers": { "language-server": { "command": "mcp-language-server", "args": ["--workspace", "/Users/you/dev/yourproject/", "--lsp", "gopls"], "env": { "PATH": "/opt/homebrew/bin:/Users/you/go/bin", "GOPATH": "/users/you/go", "GOCACHE": "/users/you/Library/Caches/go-build", "GOMODCACHE": "/Users/you/go/pkg/mod" } } } }

Note: Not all clients will need these environment variables. For Claude Desktop you will need to update the environment variables above based on your machine and username:

PATH needs to contain the path to go and to gopls. Get this with echo $(which go):$(which gopls)

GOPATH, GOCACHE, and GOMODCACHE may be different on your machine. These are the defaults.

Rust (rust-analyzer)

Install rust-analyzer: rustup component add rust-analyzer

Configure your MCP client: This will be different but similar for each client. For Claude Desktop, add the following to ~/Library/Application\ Support/Claude/claude_desktop_config.json

{ "mcpServers": { "language-server": { "command": "mcp-language-server", "args": [ "--workspace", "/Users/you/dev/yourproject/", "--lsp", "rust-analyzer" ] } } }

Python (pyright)

Install pyright: npm install -g pyright

Configure your MCP client: This will be different but similar for each client. For Claude Desktop, add the following to ~/Library/Application\ Support/Claude/claude_desktop_config.json

{ "mcpServers": { "language-server": { "command": "mcp-language-server", "args": [ "--workspace", "/Users/you/dev/yourproject/", "--lsp", "pyright-langserver", "--", "--stdio" ] } } }

Typescript (typescript-language-server)

Install typescript-language-server: npm install -g typescript typescript-language-server

Configure your MCP client: This will be different but similar for each client. For Claude Desktop, add the following to ~/Library/Application\ Support/Claude/claude_desktop_config.json

{ "mcpServers": { "language-server": { "command": "mcp-language-server", "args": [ "--workspace", "/Users/you/dev/yourproject/", "--lsp", "typescript-language-server", "--", "--stdio" ] } } }

C/C++ (clangd)

Install clangd: Download prebuilt binaries from the official LLVM releases page or install via your system's package manager (e.g., apt install clangd, brew install clangd).

Configure your MCP client: This will be different but similar for each client. For Claude Desktop, add the following to ~/Library/Application\\ Support/Claude/claude_desktop_config.json

{ "mcpServers": { "language-server": { "command": "mcp-language-server", "args": [ "--workspace", "/Users/you/dev/yourproject/", "--lsp", "/path/to/your/clangd_binary", "--", "--compile-commands-dir=/path/to/yourproject/build_or_compile_commands_dir" ] } } }


Note:

  
Replace /path/to/your/clangd_binary with the actual path to your clangd executable.

  
--compile-commands-dir should point to the directory containing your compile_commands.json file (e.g., ./build, ./cmake-build-debug).

  
Ensure compile_commands.json is generated for your project for clangd to work effectively.

Other

I have only tested this repo with the servers above but it should be compatible with many more. Note:

The language server must communicate over stdio.

Any aruments after -- are sent as arguments to the language server.

Any env variables are passed on to the language server.

工具

  • definition:从代码库中检索任何符号(函数、类型、常量等)的完整源代码定义。
  • references:在整个代码库中查找符号的所有用法和引用。
  • diagnostics:提供特定文件的诊断信息,包括警告和错误。
  • hover:显示给定位置的文档、键入提示或其他悬停信息。
  • rename_symbol:重命名项目中的符号。
  • edit_file:允许根据行号对文件进行多次文本编辑。与基于搜索和替换的编辑工具相比,提供了一种更可靠、更经济的编辑文件的方法。

关于

此代码库使用来自的编辑代码 gopls 以处理LSP通信。详细信息请参见属性。这里的所有内容都包含在宽松的BSD风格许可证中。

mcp走 用于MCP通信。谢谢你的服务。

这是测试版软件。如果您遇到任何问题或有任何建议,请通过创建问题告诉我。

贡献

对于任何实质性的问题,请先保持PR的小规模和开放性。只要经过测试,通过检查,气味不太难闻,人工智能就可以。

设置

克隆仓库:

git clone https://github.com/isaacphi/mcp-language-server.git
cd mcp-language-server

A. 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/...

目录标签

目录标签

代码导航GoClaude开发工具语言服务器本地部署语义分析LLM集成

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP