
mcp-gopls
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.
README
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
.
├── cmd
│ └── mcp-gopls # Application entry point
├── pkg
│ ├── lsp # LSP client to communicate with gopls
│ │ ├── client # LSP client implementation
│ │ └── protocol # LSP protocol types and features
│ ├── server # MCP server
│ └── tools # MCP tools exposing LSP features
Installation
go install github.com/hloiseaufcms/mcp-gopls/cmd/mcp-gopls@latest
Add to Cursor
{
"mcpServers": {
"mcp-gopls": {
"command": "mcp-gopls"
}
}
}
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:
# Ask the AI to get information about the code
Can you find the definition of the `ServeStdio` function in this project?
# Ask for diagnostics
Are there any errors in my main.go file?
# Ask for information about a symbol
What does the Context.WithTimeout function do in Go?
Development
git clone https://github.com/hloiseaufcms/mcp-gopls.git
cd mcp-gopls
go mod tidy
go build -o mcp-gopls cmd/mcp-gopls/main.go
./mcp-gopls
Prerequisites
- Go 1.24 or higher
- gopls installed (
go install golang.org/x/tools/gopls@latest
)
License
Apache License 2.0
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.