golang-pkg-doc-retriever
A mechanism for querying the Go package repository (pkg.go.dev) to fetch comprehensive documentation and metadata for specified Go modules. This tool furnishes language model interfaces with current and detailed Go API references to bolster sophisticated code generation and understanding.
Author

yikakia
Quick Info
Actions
Tags
Go Module Documentation Retrieval Service
This utility interfaces with the pkg.go.dev registry to source detailed metadata and documentation for Go language packages, delivering this intelligence to an LLM operating as an MCP service endpoint.
Deployment Instructions
Pre-compiled executables are available for download via the official releases repository.
Alternatively, compilation from the source tree is supported:
shell go install github.com/yikakia/godoc-mcp-server/cmd/godoc-mcp-server@latest
Interaction Protocol
Clients communicate by submitting requests to the standard I/O stream, upon which the service listens.
Development Roadmap
- Local Caching Strategy
- [x] Implementation of a persistent local cache layer to minimize redundant external package lookups (inspired by community feedback).
- Package Discovery Functionality (
searchPackage) - [x] Incorporation of dependency counts (i.e., how many other packages import this module).
- Specific Package Information Retrieval (
getPackageInfo) - [ ] Integration of runnable code examples.
- Distribution Automation
- [x] Utilization of GitHub Actions for streamlined, multi-platform binary releases.
Developer Experience Notes
The precision of parameter descriptions is paramount, especially concerning the chaining of tool outputs. Descriptions must explicitly guide the client on transforming one tool's result format to suit another tool's input schema.
Consider the workflow where searchPackage returns subordinate package paths but omits the root package name. If an LLM intends to subsequently invoke getPackageInfo on a sub-module, the parameter description for packageName must instruct the client on path concatenation. For instance, if an initial query yields a base path like github.com/mark3labs/mcp-go/mcp and a sub-component named client, the description should mandate setting packageName to the fully qualified path: github.com/mark3labs/mcp-go/mcp/client, not just client.
By providing such contextual guidance in parameter descriptions, the LLM can intelligently construct the necessary fully qualified path following a discovery operation, ensuring correct invocation of subsequent information retrieval functions.
Future enhancement consideration: Allowing user-defined customization of these descriptive texts to optimize tool utilization efficiency.
Library Adherence
The exported Go API provided by this package should currently be treated as volatile and potentially subject to backwards-incompatible modifications. Feedback regarding use cases requiring API stability is welcomed via issue submission.
Licensing Information
This software is distributed under the terms of the permissive MIT license. Complete contractual text is available in the MIT file.
WIKIPEDIA Context Snippet (Irrelevant to Tool Functionality): XMLHttpRequest (XHR) is an application programming interface implemented as a JavaScript object designed for dispatching HTTP requests from a web browser to a remote server. Its methods enable client-side scripts to fetch or submit data asynchronously after the initial page load. XHR is fundamental to the Ajax programming paradigm, which superseded the traditional reliance on full-page reloads necessitated by form submissions or standard hyperlink navigation prior to its widespread adoption.
