godoc-mcp is a Model Context Protocol (MCP) server that provides efficient access to Go documentation. It helps LLMs understand Go projects by providing direct access to package documentation without needing to read entire source files. godoc-mcp can vastly improve the performance of using LLMs to develop in Go by substantially reducing the number of tokens needed to understand and make use of Go
Add this skill
npx mdskills install mrjoshuak/godoc-mcpWell-documented Go documentation server with efficient token usage and comprehensive setup instructions
godoc-mcp is a Model Context Protocol (MCP) server that provides efficient access to Go documentation. It helps LLMs understand Go projects by providing direct access to package documentation without needing to read entire source files. godoc-mcp can vastly improve the performance of using LLMs to develop in Go by substantially reducing the number of tokens needed to understand and make use of Go packages.
go install github.com/mrjoshuak/godoc-mcp@latest
In a sentence: godoc-mcp provides a more token efficient way for LLMs to understand Go projects.
Traditional file-reading approaches require LLMs to process entire source files often many files to understand a single package. godoc-mcp provides several advantages:
godoc-mcp a fast and efficient tool for Go developmentWith godoc-mcp, a LLM can get precisely the information it needs without having to read entire source files. Here are the different levels of detail that an LLM can get.
This makes godoc-mcp an essential tool for Go developers using LLMs by enabling LLMs to understand significantly more, and in more detail, about the context than previously possible in any programming language.
The server will:
go doc from the working directory)In addition to providing documentation while working on coding tasks. godoc-mcp can also be used to explore Go projects and packages. Here are some examples for general prompting:
"I'm looking at a Go project at /path/to/some/project. What packages does it contain and what do they do?"
"What interfaces does the io package provide? I'm particularly interested in anything related to reading."
"I need to implement the io.Reader interface. Show me its documentation and any related types I should know about."
"Show me the documentation for the Resource type in the /path/to/some/project. I need to understand how to create and use it."
"I'm in /path/to/some/project which uses github.com/gorilla/mux. Show me the documentation for the Router type."
"What methods are available on the http.Request type? I'm working with standard library HTTP handlers."
"Explain how to configure the Server type in the /path/to/project/server package."
"I'm in a new Go project directory and see multiple packages. Can you show me what each one does?"
godoc-mcp supports three transport modes:
# Default stdio mode
godoc-mcp
# SSE mode on port 8080
godoc-mcp --transport sse --addr :8080
# Streamable HTTP mode
godoc-mcp --transport http --addr :9090
docker pull ghcr.io/mrjoshuak/godoc-mcp:latest
For use with Docker MCP Gateway, add to your MCP configuration:
{
"mcpServers": {
"godoc": {
"command": "docker",
"args": ["run", "-i", "--rm", "ghcr.io/mrjoshuak/godoc-mcp:latest"]
}
}
}
To access local project documentation, mount your project directory and use /workspace as the working_dir parameter:
{
"mcpServers": {
"godoc": {
"command": "docker",
"args": ["run", "-i", "--rm", "-v", "/path/to/project:/workspace", "ghcr.io/mrjoshuak/godoc-mcp:latest"]
}
}
}
To run with SSE transport via Docker:
docker run --rm -p 8080:8080 ghcr.io/mrjoshuak/godoc-mcp:latest --transport sse --addr :8080
claude mcp add godoc-mcp -- godoc-mcp
To add to the Claude desktop app, edit your MCP config:
{
"mcpServers": {
"godoc": {
"command": "godoc-mcp"
}
}
}
If go doc can't find your Go installation, add environment variables:
{
"mcpServers": {
"godoc": {
"command": "godoc-mcp",
"env": {
"GOPATH": "/path/to/go",
"GOMODCACHE": "/path/to/go/pkg/mod"
}
}
}
}
When connected to an MCP-capable LLM (like Claude), godoc-mcp provides the get_doc tool with the following parameters:
path (required): Path to the Go package or file (import path or file path)target (optional): Specific symbol to document (function, type, etc.)cmd_flags (optional): Additional go doc command flags (allowed: -all, -src, -u, -short, -c)working_dir (optional): Working directory for module-aware documentation (if not provided, a temporary project will be created automatically)page (optional): Page number for paginated results (default: 1)page_size (optional): Lines per page, 100-5000 (default: 1000)This project is licensed under the MIT License - see the LICENSE file for details.
Install via CLI
npx mdskills install mrjoshuak/godoc-mcpGodoc MCP is a free, open-source AI agent skill. godoc-mcp is a Model Context Protocol (MCP) server that provides efficient access to Go documentation. It helps LLMs understand Go projects by providing direct access to package documentation without needing to read entire source files. godoc-mcp can vastly improve the performance of using LLMs to develop in Go by substantially reducing the number of tokens needed to understand and make use of Go
Install Godoc MCP with a single command:
npx mdskills install mrjoshuak/godoc-mcpThis downloads the skill files into your project and your AI agent picks them up automatically.
Godoc MCP works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Gemini Cli, Amp, Roo Code, Goose. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.