MCPSERV.CLUB
yikakia

GoDoc MCP Server

MCP Server

Search Go packages and expose docs via Model Context Protocol

Stale(55)
30stars
0views
Updated 18 days ago

About

The GoDoc MCP Server retrieves information from pkg.go.dev, providing package search results and detailed documentation to LLMs over stdio. It supports caching, subpackage queries, and is intended for integration into AI-powered development tools.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

Godoc MCP Server Demo

The godoc‑mcp‑server is a lightweight Model Context Protocol (MCP) endpoint that exposes Go package metadata and documentation from pkg.go.dev to AI assistants. By turning the public Go module index into a searchable, structured API, it lets language models retrieve accurate import paths, package descriptions, and usage examples without manual lookup. This eliminates the need for developers to manually browse documentation sites or copy code snippets, streamlining knowledge retrieval during coding sessions.

At its core, the server offers two primary tools:

  • searchPackage – queries pkg.go.dev for packages that match a keyword, returning a list of matching import paths along with the number of other packages that depend on each result.
  • getPackageInfo – retrieves detailed information for a specified import path, including the package’s synopsis, full documentation, and available subpackages. The tool also supports optional parameters that guide the format of the response to match downstream tools’ expectations, ensuring seamless chaining of MCP calls.

The server is intentionally minimalistic but highly efficient. It runs over standard I/O, making it trivial to embed in existing AI workflows or to pipe directly into a language model’s prompt. A local cache is maintained so that repeated queries for the same package do not trigger redundant network requests, improving response times and reducing load on pkg.go.dev. Continuous integration pipelines automatically build releases for multiple platforms, ensuring that developers can quickly deploy the server on Windows, macOS, or Linux environments.

Typical use cases include:

  • Code Generation – an AI assistant can ask the user for a desired functionality, search for relevant Go packages, and then pull in documentation to synthesize correct import statements and usage examples.
  • Learning & Onboarding – new developers can query the server to discover idiomatic packages for common tasks (e.g., HTTP servers, testing frameworks) and receive concise explanations.
  • Documentation Automation – build tools can query the server to validate that all referenced packages in a project are still available and up‑to‑date, flagging deprecations automatically.

Because the MCP interface is declarative, developers can compose complex workflows by chaining results into , and then feed those outputs directly into prompt templates or other tools. The server’s clear, parameter‑rich descriptions help the language model understand how to combine subpackage names with parent import paths, reducing mis‑calls and improving overall reliability.

In short, the godoc‑mcp‑server turns Go’s rich documentation ecosystem into a first‑class AI data source, enabling developers to leverage up‑to‑date package information instantly within any AI‑augmented coding environment.