MCP LSP 转到
模型上下文协议 (MCP) 服务器允许像 Claude 这样的 AI 助手与 Go 的语言服务器协议 (LSP) 交互并受益于高级 Go 代码分析功能。
概述
该 MCP 服务器可帮助 AI 助手:
使用 LSP 分析 Go 代码
导航至定义并查找参考
检查代码诊断
获取符号的悬停信息
获取完成建议
建筑学
该项目使用mark3labs/mcp-go库实现模型上下文协议 (MCP)。MCP 集成实现了 AI 助手与 Go 工具之间的无缝通信。
该服务器通过语言服务器协议(LSP)与 Go 的官方语言服务器gopls进行通信。
特征
LSP 集成:连接到 Go 的语言服务器协议进行代码分析
代码导航:在代码中查找定义和引用
代码质量:获取诊断和错误
高级信息:悬停信息和完成建议
项目结构
安装
添加到光标
MCP 工具
MCP 服务器提供以下工具:
工具 | 描述 |
| 导航到符号的定义 |
| 查找对符号的所有引用 |
| 获取文件诊断信息 |
| 获取有关符号的详细信息 |
| 获取某个位置的完成建议 |
| 分析 Go 代码的测试覆盖率 |
使用示例
将服务器与支持 MCP 的 AI 助手一起使用:
发展
先决条件
Go 1.24 或更高版本
gopls 已安装(
go install golang.org/x/tools/gopls@latest)
执照
Apache 许可证 2.0
Related MCP Servers
- Asecurity-licenseAqualityA Model Context Protocol (MCP) server that allows AI agents like Claude to interact with the Aligo SMS API to send text messages and retrieve related information.Last updated -1MIT License
- Asecurity-licenseAqualityA Model Context Protocol (MCP) server for LeetCode that enables AI assistants to access LeetCode problems, user information, and contest data.Last updated -7432MIT License
- Asecurity-licenseAqualityA foundation for building custom local Model Context Protocol (MCP) servers that provide tools accessible to AI assistants like Cursor or Claude Desktop.Last updated -130MIT License
- Asecurity-licenseAqualityA Model Context Protocol (MCP) server that allows Claude AI to interact with custom tools, enabling extension of Claude's capabilities through the MCP framework.Last updated -
Appeared in Searches
- Tips for Naming Variables and Functions in Go Programming Language
- MCP tools or platforms for code editing
- Resources and Guidance for Analyzing Linux Kernel Source Code
- Tools for Analyzing Code Structure and Logic to Create Flowcharts and Diagrams
- MCP-OpenGrok: A Source Code Search and Cross-Reference Tool