Model Context Protocol (MCP) server that exposes Go package documentation in a token-efficient, LLM-friendly format.
https://github.com/mrjoshuak/godoc-mcpYou're working with an LLM on Go code, and every time it needs to understand a package, it has to read entire source files just to figure out the API. Your token budget disappears fast, and the context gets cluttered with implementation details when all you needed was clean documentation.
godoc-mcp fixes this by giving your LLM direct access to Go's official documentation without the source code noise.
When you ask an LLM to help with Go development, it typically needs to read complete source files to understand package APIs. A simple question about http.Request methods could burn hundreds of tokens on implementation details you don't need.
This MCP server changes the game: instead of reading source files, your LLM gets precisely the documentation it needs. Ask about the io.Reader interface? You get just the interface documentation. Need to understand a custom type in your project? Just that type's docs, nothing else.
Surgical Documentation Access: Target exactly what you need - a single function, type, or entire package documentation without source code bloat.
Smart Package Discovery: Point it at any directory and it intelligently maps out your Go project structure, showing available packages without reading every file.
Universal Package Support: Works seamlessly with standard library, third-party packages, and your local code. No manual module setup required.
Token Budget Preservation: A typical package exploration that might cost 2000+ tokens now uses under 200.
Instead of this token-heavy approach:
"Read all files in ./internal/auth and tell me what interfaces it exposes"
You get surgical precision:
"Show me the exported interfaces in ./internal/auth"
Need to implement an interface? Get just the interface definition:
"Show me the io.Reader interface documentation"
Exploring a new codebase? Map it efficiently:
"What packages does this project contain and what do they do?"
Working with third-party libraries? Access their docs instantly:
"Show me the Router type documentation from gorilla/mux"
Drop it into your Claude desktop configuration:
{
"mcpServers": {
"godoc": {
"command": "/path/to/godoc-mcp",
"args": [],
"env": {
"GOPATH": "/path/to/go",
"GOMODCACHE": "/path/to/go/pkg/mod"
}
}
}
}
The server automatically handles module context, temporary projects for external packages, and cleanup. No manual go mod setup required.
Get granular with specific symbols:
get_doc path="fmt" target="Printf"get_doc path="./internal" cmd_flags="-u"get_doc path="net/http" target="Server" cmd_flags="-src"get_doc path="encoding/json" cmd_flags="-all"go install github.com/mrjoshuak/godoc-mcp@latest
This isn't just another documentation tool - it's a fundamental shift in how LLMs interact with Go codebases. Instead of burning tokens on implementation details, you get focused, official documentation that helps LLMs understand your code architecture without the noise.
Your token budget will thank you, and your LLM conversations will be more focused and productive. Give your AI assistant the precise information it needs to help you build better Go applications.