gospect-mcp

backendArchitect/gospect-mcp Checked 36 minutes ago

Go-only, report-first code scanner exposed as an MCP server.

Think of it as an MRI for your Go code: a deep, non-invasive scan that gives you a diagnosis, not a tool that quietly rewrites things. 🌐 See it in action β†’ backendarchitect.github.io/gospect-mcp You get a list of problems, most important first β€” each with the exact file and line. No config, no setup, no changes to your code.

Summary extracted from the README.

gospect-mcp

Go License MCP GitHub Marketplace MCP Market CI Release

Find the real bugs in your Go code β€” and only the real ones.

gospect reads your code with the actual Go compiler, points at genuine problems β€” nil crashes, leaks, unchecked errors β€” and never changes anything unless you ask.

Think of it as an MRI for your Go code: a deep, non-invasive scan that gives you a diagnosis, not a tool that quietly rewrites things.

gospect-mcp scanning a Go service and reporting real bugs

🌐 See it in action β†’ backendarchitect.github.io/gospect-mcp

Why people use it

  • βœ… Real, not guessed. Every finding is backed by the Go toolchain β€” a fact, not an AI's hunch.
  • 🩺 Read-only by default. It reports problems; it never edits your code unless you run a fix on purpose.
  • πŸ”Œ Works everywhere. A command-line tool, a GitHub Action for CI, and an MCP server your AI editor (Claude Code, Cursor, …) can call.

Try it in 30 seconds

# 1. install (macOS / Linux)
brew install backendArchitect/tap/gospect-mcp

# 2. scan any Go project
gospect-mcp scan /path/to/your/project ./...

You get a list of problems, most important first β€” each with the exact file and line. No config, no setup, no changes to your code.

Don't want to install anything? Run it in Docker:

docker run --rm -v "$PWD":/work ghcr.io/backendarchitect/gospect-mcp scan ./...

More install options are below.


What it finds

By default, only genuine bugs β€” the kind that crash or leak:

  • 🐞 nil pointer dereferences, forgotten context cancels, unclosed HTTP bodies, Printf format mistakes, lost sync/atomic updates, sort.Slice misuse, and ~15 more β€” plus panic("not implemented") stubs.

That's deliberate: run it on real code and you get a short list of real problems, not hundreds of style nits. Want the opinionated hygiene checks too β€” unchecked errors, TODOs, complexity hotspots, an outdated go.mod, or spelling typos in comments and function names? Add -pedantic. Go even deeper with -staticcheck (~100 more checks).

Everything is ranked by severity (bugs first). The full detector list is here β†’


Three ways to use it

1. As a command β€” scan your project and read the report:

gospect-mcp scan ./my-project                 # full report (JSON)
gospect-mcp scan -format text -min-severity high ./my-project   # just the serious stuff, readable

2. In your AI editor β€” let Claude Code, Cursor, and friends call it:

claude mcp add gospect gospect-mcp

Your assistant runs the scan and reasons over the results. Because gospect is read-only, it can't change your code unless you explicitly ask. (Other editors β†’)

3. In CI β€” fail a pull request that introduces a real bug, and comment the findings on the PR:

# .github/workflows/gospect.yml
- uses: backendArchitect/gospect-mcp@v1
  with:
    fail-on: high     # fail the build on any high-severity bug
    comment: true     # post the findings as a PR comment

Copy-paste workflow: examples/gospect.yml Β· more CI options: USAGE.md


Fixing (optional, always opt-in)

gospect finds problems; it doesn't fix them β€” unless you run the separate fix command. Even then it's careful: it makes one change, re-checks that the bug is gone and your code still builds, and undoes the change if anything's off.

gospect-mcp fix -safe .               # safe, mechanical fixes β€” no AI involved
gospect-mcp fix -detector nilness .   # or let your AI agent fix it, then verify

How the safety net works, agent options, and the guarded MCP fix tool: USAGE.md β†’ Fixing.


Install

Method Command
Homebrew (macOS/Linux) brew install backendArchitect/tap/gospect-mcp
Script (macOS/Linux) curl -fsSL https://raw.githubusercontent.com/backendArchitect/gospect-mcp/main/install.sh | bash
Windows (PowerShell) irm https://raw.githubusercontent.com/backendArchitect/gospect-mcp/main/install.ps1 | iex
Docker docker run --rm -v "$PWD":/work ghcr.io/backendarchitect/gospect-mcp scan ./...
Go go install github.com/backendArchitect/gospect-mcp@latest
pre-commit add the repo to .pre-commit-config.yaml with - id: gospect

No Go toolchain? No problem. The prebuilt binaries and the Docker image need nothing installed. Only the build-from-source paths β€” go install, and Homebrew/pre-commit (which compile it) β€” need Go 1.26+ (Homebrew installs its own Go automatically).

Prebuilt binaries (Linux/macOS/Windows Β· amd64 & arm64) are on the Releases page. Run gospect-mcp help for every command and flag. Building from source and all distribution channels: packaging/.


Learn more

In one line: gospect is a report-first, Go-only code scanner β€” a command, a CI gate, and an MCP server. It reports genuine bugs backed by the real Go toolchain, and never touches your code unless you ask.

License

MIT