gopls
MCP server for golang projects development: Expand AI Code Agent ability boundary to have a semantic understanding and determinisic information for golang projects.
claude mcp add --transport stdio xieyuschen-gopls-mcp npx -y xieyuschen-gopls-mcp \ --env PORT="8000" \ --env GOPLS_LOG_LEVEL="info" \ --env GOPLS_USE_GOPLSDIAL="false"
How to use
gopls-mcp brings the language-aware capabilities of the Go language server gopls directly into your MCP workflow. Instead of returning long strings of code or generic search results, it provides precise language constructs, definitions, references, and navigation information that are scientifically accurate and contextually relevant for the code you’re inspecting. Use it to retrieve definitions, locate references, or perform code navigation tasks that your LLM can leverage to reason about Go code with high fidelity. The server is designed to supply structured language data rather than plain text, enabling your agent to reason with the program structure, types, and symbol relationships more effectively.
To use it, start the MCP server and interact with the provided endpoints through your usual MCP client. Send requests that specify Go symbols or code locations, and expect responses that emphasize exact definitions, type information, and navigation pointers. The tool is especially useful when analyzing Go projects, refactoring code, or exploring large codebases where precise symbol resolution and references are critical for correct inferences by your AI agent.
How to install
Prerequisites:
- Node.js and npm (or pnpm) installed on your system
- Internet access to fetch the MCP server package
Option A: Run with npx (no installation required)
- Ensure Node.js and npm are installed.
- Start the MCP server via npx: npx -y xieyuschen-gopls-mcp
Option B: Install globally via npm (repeatable install)
- Ensure Node.js and npm are installed.
- Install the MCP package globally: npm install -g xieyuschen-gopls-mcp
- Run the server locally (adjust as needed for your environment): npx -y xieyuschen-gopls-mcp
Option C: Use with a package manager other than npm If you prefer yarn or pnpm, install the corresponding adapter and run the equivalent command to fetch and run the xieyuschen-gopls-mcp package.
Note: The server is a wrapper around gopls functionality delivered via an MCP-compatible interface. Ensure your environment has network access to fetch dependencies during initial setup.
Additional notes
Tips and caveats:
- Environment variables: PORT selects the listening port; GOPLS_LOG_LEVEL controls verbosity. Adjust these in the mcp_config.env object if you need different behavior.
- Performance: gopls-mcp is designed for fast, language-aware responses. For very large codebases, ensure sufficient resources (CPU and memory) to avoid timeouts.
- Compatibility: This MCP server is a fork/variant of gopls. It aims to preserve the language features of gopls while exposing a clean MCP interface; it may differ slightly from upstream in edge cases.
- Troubleshooting: If the server fails to start, check that the port is not in use, and verify Node.js/npm versions are compatible with the package. Review logs for any gopls-specific initialization errors.
- Security: Do not expose the MCP server to untrusted networks without appropriate authentication and access controls.
Related MCP Servers
kindly-web-search
Kindly Web Search MCP Server: Web search + robust content retrieval for AI coding tools (Claude Code, Codex, Cursor, GitHub Copilot, Gemini, etc.) and AI agents (Claude Desktop, OpenClaw, etc.). Supports Serper, Tavily, and SearXNG.
ida-headless
Headless IDA Pro binary analysis via Model Context Protocol
mcp-catalog -example
Go MCP server example for AI-agent workflows with tools, resources, and prompts.
statelessagent
Your AI forgets everything between sessions. SAME fixes that. Local-first, no API keys, single binary.
timebound-iam
An MCP Server that sits between your agent and AWS STS and issues temporary credentials scoped to specific AWS Services
backlog
Help coding agents and developers to keep track of a project's backlog by storing tasks as markdown in git.