GoDoctor is a Model Context Protocol (MCP) server and CLI extension for Go development. It provides structured tools to help coding agents navigate, edit, build, and test Go codebases safely.
GoDoctor ships as a Gemini CLI-compatible extension. Install using the gemini command (included with Antigravity CLI), then import into agy:
# Step 1: install the extension (downloads the pre-compiled binary from the GitHub release)
gemini extensions install https://github.com/danicat/godoctor
# Step 2: import into Antigravity CLI
agy plugin import geminiAfter import, GoDoctor is active in all future agy sessions. Skills, hooks, and the MCP server are all registered automatically.
gemini extensions install https://github.com/danicat/godoctor- Install the binary globally:
go install github.com/danicat/godoctor/cmd/godoctor@latest
- Register the MCP server:
claude mcp add --transport stdio --scope user godoctor -- godoctor
- Append agent instructions to your project:
godoctor --agents >> CLAUDE.md
Once installed, GoDoctor runs automatically in the background of your agent-compatible client. The client agent will discover and call the exposed tools during Go programming tasks.
To manually print system instructions for an LLM agent:
godoctor --agentsTo see the list of active tools:
godoctor --list-toolsWhen running inside the Antigravity or Gemini CLI, GoDoctor intercepts standard terminal commands (such as go build, cat, or sed) and raw file tools when they operate on Go source files (.go). It redirects the agent to GoDoctor's specialized tools (smart_build, smart_read, and smart_edit). Non-Go files (Python, TypeScript, Markdown, etc.) are unaffected and pass through normally. This prevents syntax errors and conserves context window tokens.
| Flag | Description | Default |
|---|---|---|
--allow |
Comma-separated whitelist of tools to enable. | "" |
--disable |
Comma-separated list of tools to disable. | "" |
--listen |
Address for HTTP transport (defaults to standard input/output). | "" |
--list-tools |
Prints all registered tools and exits. | false |
--agents |
Prints system instructions for LLM agents and exits. | false |
--version |
Prints the version and exits. | false |
GoDoctor provides tools divided into four functional areas:
list_fileslists files in the workspace while avoiding version control directories.smart_readreads files, extracts code outlines, and appends definitions of referenced types. Powered by a high-performance persistent backgroundgoplsdaemon over a stateful JSON-RPC session, delivering type-tags in milliseconds.describe_symbolprovides semantic detail for any symbol, including declaration signatures, comments, and references, querying the shared backgroundgoplsprocess instantly.
smart_edithandles atomic modifications across multiple files. It formats the code and automatically rolls back changes if the compiler detects a syntax error.
smart_buildmanages module tidying, code modernization, formatting, compiling, testing, and linting.add_dependencyinstalls Go modules and pulls their documentation.read_docsfetches API documentation for packages and symbols.
mutation_testruns Selene mutation tests to check test coverage quality.test_queryqueries test results and coverage data using SQL.
Build the project from source using the Makefile:
git clone https://github.com/danicat/godoctor.git
cd godoctor
make buildThis compiles the server binary to bin/godoctor.
To install the binary globally to your $GOPATH/bin:
make installRun the test suite:
make testTo run tests and generate a coverage report:
make test-covRun the compiled binary directly to test behavior:
./bin/godoctorCheck active tools:
./bin/godoctor --list-toolsGoDoctor relies on Git tags for versioning. Build versions are dynamically injected at compile time using git describe.
To release a new version:
-
Update the version string in
gemini-extension.json:make bump-version VERSION=0.16.2
-
Commit the manifest changes:
git add gemini-extension.json git commit -m "chore: bump version to 0.16.2" -
Create and push a new Git tag:
git tag v0.16.2 git push origin v0.16.2
The release pipeline will automatically run GoReleaser when a new tag is pushed.
To test the GoReleaser configuration locally, generate a snapshot release:
make snapshotApache 2.0