mrjoshuak/godoc-mcp logo

mrjoshuak/godoc-mcp

Free

Token 高效的 Go 文档服务器,为 AI 助手提供对包文档和类型的智能访问,无需读取整个源文件。

FreeFree tier
Type
Open Source

About mrjoshuak/godoc-mcp

godoc-mcp is a Model Context Protocol (MCP) server that provides efficient access to Go documentation. It helps LLMs understand Go projects by offering structured documentation instead of requiring full source-file dumps, drastically reducing token usage. The server supports local and import paths, automatically sets up module context for third-party packages, and provides multiple levels of detail (exported symbols, full package docs, source code). It is designed to work alongside other MCP servers and does not require an internet connection for local documentation.

Key Features

Token Efficiency: Returns only essential documentation, significantly reducing token usage for LLMs
Structured Information: Provides official Go package documentation in a consistent, well-structured format
Project Navigation: Smart handling of multi-package projects helps LLMs understand project structure
Flexible Path Support: Supports local file paths (e.g., '/full/path/to/mypackage') and import paths (e.g., 'io', 'github.com/user/repo')
Automatic Module Context: Creates temporary Go projects when needed, no manual module setup required
Multiple Detail Levels: Can return documentation for one exported symbol, complete source for a symbol, all exported symbols (concise), all symbols including unexported, full package documentation, or entire package source
Performance Optimized: Built-in caching and optimized token usage for fast and efficient access
Local Operation: Does not require internet access to retrieve Go documentation
Integration Ready: Works alongside other MCP servers for combined high-level and detailed analysis

Pros & Cons

Pros
  • Dramatically reduces token usage compared to reading entire Go source files
  • Provides structured and consistent documentation output
  • Supports both local and remote (import) package paths seamlessly
  • Automatic module setup for third-party packages without manual intervention
  • Caches results for performance; no internet needed for local docs
  • Open source and free to use
  • Works as an MCP server, compatible with MCP-compatible LLM tools
Cons
  • Limited to the Go programming language only
  • Requires the Go toolchain to be installed on the system
  • May not cover documentation for projects with unconventional build systems or incomplete go.mod files
  • Performance dependent on the speed of the go doc command

Best For

AI coding agents developing Go projects needing to understand package APIs without reading full source filesGo developers using LLM-based tools to get quick, token-efficient documentation for standard library and third-party packagesNavigating and analyzing multi-package Go projects with an LLM assistantReducing token costs when using LLMs for Go code generation, review, or refactoring

FAQ

What problem does godoc-mcp solve?
It reduces the token usage required for LLMs to understand Go packages by providing structured documentation instead of requiring the LLM to read entire source files.
How does godoc-mcp differ from just reading Go source files?
Traditional approaches require LLMs to process entire source files, often many files for one package. godoc-mcp returns only the essential documentation (symbols, comments, signatures) in a structured format, drastically cutting token consumption.
Can godoc-mcp access third-party packages?
Yes, it supports import paths (e.g., 'github.com/user/repo') and automatically sets up module context by creating temporary Go projects when needed.
Does godoc-mcp require internet access?
No, it works locally without an internet connection for accessing documentation of packages already present on the system.
What kinds of information can godoc-mcp retrieve?
It can retrieve documentation for one exported symbol, the complete source for a symbol, all exported symbols (concise docs), all symbols including unexported, full package documentation, or the entire package source.