Skip to content
hegner123Public

About

MCP server exposing the pkg.go.dev API for searching and inspecting Go modules, packages, symbols, versions, and vulnerabilities.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

pkgsite

An MCP (Model Context Protocol) server that exposes the pkg.go.dev v1beta API, letting an AI agent search and inspect Go modules, packages, symbols, versions, and vulnerabilities. It also runs as a standalone CLI for quick queries and debugging.

Features

  • Eight focused MCP tools, one per pkg.go.dev endpoint:
    • pkgsite_search — search packages (optionally by symbol)
    • pkgsite_module — module metadata, optionally with licenses and README
    • pkgsite_package — package metadata and rendered documentation (text/html/markdown)
    • pkgsite_packages — packages within a module
    • pkgsite_symbols — exported symbols of a package
    • pkgsite_versions — module version history
    • pkgsite_imported_by — packages that import a given package
    • pkgsite_vulns — known vulnerabilities from the Go vulnerability database
  • Stdio JSON-RPC transport, ready to drop into any MCP client.
  • CLI mode for the same queries from a shell.
  • Zero third-party dependencies (standard library only).
  • Hard 30-second timeout on every request, with the API's error body (including its fix suggestions) surfaced on failure.

Installation

go install github.com/hegner123/pkgsite@latest

Or build from source:

git clone https://github.com/hegner123/pkgsite
cd pkgsite
just build      # go build -o pkgsite && codesign -s - pkgsite
just install    # builds, then sudo cp pkgsite /usr/local/bin/

Usage

As an MCP server

Register it with your MCP client. For Claude Code:

claude mcp add --transport stdio --scope user pkgsite -- /usr/local/bin/pkgsite

Or via a project .mcp.json:

{
  "mcpServers": {
    "pkgsite": {
      "command": "pkgsite"
    }
  }
}

Running pkgsite with no arguments starts the stdio MCP server.

As a CLI

pkgsite --cli <operation> [--key value | --key=value | --flag]

Examples:

# Search for packages
pkgsite --cli search --q "yaml parser" --limit 2

# Module metadata at the latest version
pkgsite --cli module --path github.com/spf13/cobra --version latest

# Package documentation as text
pkgsite --cli package --path encoding/json --doc text

# Version history
pkgsite --cli versions --path github.com/spf13/cobra --limit 3

Each call prints the API's raw JSON response to stdout. Errors go to stderr with a non-zero exit code.

License

Released under the MIT License.

About

MCP server exposing the pkg.go.dev API for searching and inspecting Go modules, packages, symbols, versions, and vulnerabilities.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages