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.
- 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 READMEpkgsite_package— package metadata and rendered documentation (text/html/markdown)pkgsite_packages— packages within a modulepkgsite_symbols— exported symbols of a packagepkgsite_versions— module version historypkgsite_imported_by— packages that import a given packagepkgsite_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.
go install github.com/hegner123/pkgsite@latestOr 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/Register it with your MCP client. For Claude Code:
claude mcp add --transport stdio --scope user pkgsite -- /usr/local/bin/pkgsiteOr via a project .mcp.json:
{
"mcpServers": {
"pkgsite": {
"command": "pkgsite"
}
}
}Running pkgsite with no arguments starts the stdio MCP server.
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 3Each call prints the API's raw JSON response to stdout. Errors go to stderr with a non-zero exit code.
Released under the MIT License.