Can be integrated with Ollama as a tool provider, allowing Ollama to access Go LSP features through the MCP protocol.
MCP LSP Go
A Model Context Protocol (MCP) server that allows AI assistants like Claude to interact with Go's Language Server Protocol (LSP) and benefit from advanced Go code analysis features.
Overview
This MCP server helps AI assistants to:
- Use LSP to analyze Go code
- Navigate to definitions and find references
- Check code diagnostics
- Get hover information for symbols
- Get completion suggestions
Architecture
This project uses the mark3labs/mcp-go library to implement the Model Context Protocol. The MCP integration enables seamless communication between AI assistants and Go tools.
The server communicates with gopls, the official language server for Go, via the Language Server Protocol (LSP).
Features
- LSP Integration: Connection to Go's Language Server Protocol for code analysis
- Code Navigation: Finding definitions and references in the code
- Code Quality: Getting diagnostics and errors
- Advanced Information: Hover information and completion suggestions
Project Structure
Installation
Add to Cursor
MCP Tools
The MCP server provides the following tools:
Tool | Description |
---|---|
go_to_definition | Navigate to the definition of a symbol |
find_references | Find all references to a symbol |
check_diagnostics | Get diagnostics for a file |
get_hover_info | Get detailed information about a symbol |
get_completion | Get completion suggestions at a position |
analyze_coverage | Analyze test coverage for Go code |
Usage Example
Using the server with AI assistants that support MCP:
Development
Prerequisites
- Go 1.24 or higher
- gopls installed (
go install golang.org/x/tools/gopls@latest
)
License
Apache License 2.0
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A Model Context Protocol (MCP) server that allows AI assistants like Claude to interact with Go's Language Server Protocol (LSP) and benefit from advanced Go code analysis features.
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP (Model Context Protocol) server that integrates with the ArgoCD API, enabling AI assistants and large language models to manage ArgoCD applications and resources through natural language interactions.Last updated -1010PythonMIT License
- AsecurityAlicenseAqualityA 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 -1JavaScriptMIT License
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server for LeetCode that enables AI assistants to access LeetCode problems, user information, and contest data.Last updated -71018TypeScriptMIT License
- AsecurityAlicenseAqualityA foundation for building custom local Model Context Protocol (MCP) servers that provide tools accessible to AI assistants like Cursor or Claude Desktop.Last updated -125TypeScriptMIT License