Skip to main content
Glama
README.md
<div align="center">

<p>
  <a href="README.md"><strong>English</strong></a> · <a href="README.ru.md">Русский</a>
</p>

<img src="assets/hero-banner.svg" alt="blast-radius-mcp hero banner" width="900" />

<br/><br/>

![Tests](https://img.shields.io/badge/tests-node%3Atest%20passing-248A3D?style=flat-square)
![Zero Dependencies](https://img.shields.io/badge/dependencies-0%20npm%20packages-0071E3?style=flat-square)
![Node.js >= 22.5](https://img.shields.io/badge/node-%3E%3D22.5.0-6E6E73?style=flat-square)
![License MIT](https://img.shields.io/badge/license-MIT-6E6E73?style=flat-square)

**Codebase archaeology MCP: static import graph, Git temporal co-change coupling, revert warnings, and affected test discovery.**

Works with Claude Code, Cursor, Windsurf, Codex CLI, and Antigravity.

</div>

Editing one function without knowing which callers, implicit config partners, or tests depend on it causes silent regressions. Grep catches direct symbol names, while missing transitive callers and files that have no static import link yet repeatedly change in the same commits.

`blast-radius-mcp` combines static import resolution (JS/TS, Python, Go, Rust) with bounded Git commit mining cached in `node:sqlite`, returning a compact impact brief in ~350 tokens.

## Quick start

Requires Node.js `>= 22.5.0` and `git`.

```bash
# Inspect callers, co-changes, revert history, and tests for a file
npx -y github:keenfolk1-lgtm/blast-radius-mcp check src/auth.mjs --symbol verifyToken

# Inspect all files currently touched in git diff
npx -y github:keenfolk1-lgtm/blast-radius-mcp diff

# Rank the most unstable files by churn, fixes, and reverts
npx -y github:keenfolk1-lgtm/blast-radius-mcp hotspots --limit 10
```

### MCP server registration

```bash
claude mcp add blast-radius -- npx -y github:keenfolk1-lgtm/blast-radius-mcp serve
```

Or add to `mcp.json`:

```json
{
  "mcpServers": {
    "blast-radius": {
      "command": "npx",
      "args": ["-y", "github:keenfolk1-lgtm/blast-radius-mcp", "serve"]
    }
  }
}
```

## Example output

Running `blast-radius check src/auth.mjs --symbol verifyToken` on a repository with coupled auth/session commits and a prior revert:

```markdown
### Blast Radius: `src/auth.mjs` (symbol `verifyToken`)
- Risk tier: **HIGH** (7 commits, 1 fixes, 1 reverts, 1 author(s))
- Static dependents (depth <= 2): `src/session.mjs` (hop 1), `src/routes.mjs` (hop 2)
- Symbol `verifyToken` references: `src/session.mjs`:L1,2
- Git co-changed files: `src/session.mjs` (83%, 5/6 commits)
- Recent incident history:
  - [revert] `9f4a1c2` (2026-11-23): revert: rollback token cache race
  - [fix] `3d81e04` (2026-11-23): fix: refresh token clock skew
- Affected tests: `test/routes.test.mjs`
```

Bulk formatting commits touching more than 25 files are excluded automatically from co-change coupling so repo-wide lint passes do not pollute coupling scores. Parsed Git history is cached per `(repo_root, head_sha)` in SQLite WAL mode and invalidates whenever `HEAD` moves.

## MCP tools

| Tool | Purpose |
| --- | --- |
| `blast_radius` | Returns risk tier, static dependents (including TS `@/` aliases and `go.mod` packages), symbol references, Git co-changes, incidents, and tests. |
| `diff_blast_radius` | Runs blast-radius impact analysis across every tracked file changed in `git diff`. |
| `co_changed_files` | Lists files edited together in Git history, excluding bulk commits (>25 files). |
| `repo_hotspots` | Ranks files by total touches, bugfix commits (`fix`/`bugfix`/`hotfix`), and reverts. |
| `affected_tests` | Maps target files, transitive dependents, and same-package `*_test.go` suites to tests to run. |

## Limitations

Static import parsing resolves relative paths, `tsconfig.json` / `@/` aliases, and `go.mod` module imports (JS/TS/Vue/Svelte, Python, Go, Rust), skipping dynamic computed `require(expr)`. Temporal coupling depends on local Git history depth (`--depth` on shallow clones limits results unless `fetch-depth: 0` is used).

## License

[MIT](LICENSE)

Related tools: [mcp-diet](https://github.com/keenfolk1-lgtm/mcp-diet) · [skill-guard](https://github.com/keenfolk1-lgtm/skill-guard) · [flight-recorder-mcp](https://github.com/keenfolk1-lgtm/flight-recorder-mcp) · [agent-undo](https://github.com/keenfolk1-lgtm/agent-undo) · [de-slop](https://github.com/keenfolk1-lgtm/de-slop)