Codebase Doctor is a model-independent, full-codebase auditor for developers and coding agents.
- ✓Open-source license (MIT)
- ✓Actively maintained (<30d)
- ✓Clear description
- ✓Topics declared
- ✓Documented (README)
claude mcp add codebase-doctor -- npx -y codebase-doctor{
"mcpServers": {
"codebase-doctor": {
"command": "npx",
"args": ["-y", "codebase-doctor"]
}
}
}MCP Servers overview
# Codebase Doctor
[](https://www.npmjs.com/package/codebase-doctor)
[](https://www.npmjs.com/package/codebase-doctor)
[](https://github.com/subhajitlucky/codebase-doctor/actions/workflows/ci.yml)
**It finds the thing, and it never guesses.**
> **Models build. Codebase Doctor verifies.**
Most repository scanners fail in one of two ways: they flood you with false positives, or they silently skip the hard case and report "clean." Codebase Doctor does neither. Every finding carries evidence, every audit reports what it *couldn't* analyze, and a clean run means the scope was actually checked.
```bash
npx -y codebase-doctor audit . --changed --format brief
```
```txt
codebase-doctor brief
scope=full findings=1 shown=1 coverage=incomplete
[high] security/secrets/provider-token test/unit/audits/ai/agent-surface.test.ts:83 —
Have an authorized human or external coding agent remove the value and rotate it,
then rerun the audit.
coverage-limitations: validation: skipped, database: skipped, security: partial,
performance: unsupported
```
That last line is the point. Most tools print findings and stop. This one tells you what it *didn't* check, every single run.
---
## Why this exists
Coding agents ship code faster than review can keep up. The failure isn't that agents can't write code — it's that nothing **verifies** what they wrote before it merges.
Codebase Doctor is that verification step. It builds a source graph, scans for committed secrets, dependency drift, unsafe Dockerfiles, workflow injection, RLS mistakes, and accessibility regressions — then tells you exactly what it could not verify.
## Install
```bash
npx -y codebase-doctor audit . # no install
npm install -g codebase-doctor # global
```
## Quick start
```bash
codebase-doctor audit . --json # full audit
codebase-doctor audit . --changed --json # just my diff
codebase-doctor audit . --changed --base main --json # PR review
codebase-doctor audit . --format sarif # GitHub code scanning
codebase-doctor verify . --baseline before.json # confirm fixes landed
```

## Options
```text
--run-checks Permit configured validation commands
--changed Audit Git changes and their affected scope (implied by review)
--base <ref> Compare changed scope from the merge base with this ref
--json Emit schema-versioned JSON
--format <format> Output format: text, json, sarif, or brief (review adds markdown, github)
--all-findings Review only: include findings outside the changed lines
--output <file> Review only: write the report to a file as well as stdout
--exclude <glob> Exclude a repository-relative path glob; repeatable
--baseline <path> Compare with a prior Codebase Doctor JSON report
--timeout <ms> Per-command timeout (default: 120000)
--fail-on <severity> info|low|medium|high|critical|none (default: high)
--require-complete Exit 2 when audit coverage is incomplete
--max-findings <n> Cap brief output (default: 100)
--with-database Permit live PostgreSQL catalog access
--with-advisories Opt-in OSV advisory lookup over lockfile packages
--database-schema Schema to inspect; repeatable (default: public)
--database-timeout Catalog statement timeout in ms (default: 10000)
```
## Code review
`review` is the pull-request command. It always audits changed scope, narrows
findings to added diff lines, and prints a verdict — `APPROVE`, `COMMENT`, or
`REQUEST_CHANGES` — so unrelated old issues never fail a PR:
```bash
codebase-doctor review . --base origin/main --format markdown > review.md
codebase-doctor review . --base origin/main --format github
codebase-doctor review . --format json # includes a machine-readable review envelope
```
- `--format markdown` renders a PR-comment-ready body with the verdict,
findings, source impact, and coverage limitations.
- `--format github` emits `::error` / `::warning` / `::notice` workflow
commands that annotate pull-request diffs inline from Actions logs, with no
network access.
- A finding on an unchanged line is out of scope for the verdict and counted
as omitted; the full `audit` still reports it. `--all-findings` disables
narrowing, and `--output <file>` writes the report to a file as well as
stdout.
- With `--baseline`, only *new* findings in the diff gate the verdict.
- Exit `1` means the review requests changes; exit `2` is an operational
failure, never a clean result. Inspect coverage before calling the reviewed
diff verified or clean.
## GitHub Action
```yaml
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@v4
- uses: subhajitlucky/codebase-doctor@v0.1.10
with:
format: sarif
upload: "true"
fail-on: high
```
Findings appear in the Security tab. See [docs/github-action.md](docs/github-action.md).
---
## What it checks
### Secrets — working tree and history
Precision-first and not exhaustive: it detects private-key material, provider-token shapes, paired AWS credentials, credential-bearing URLs, and high-confidence sensitive assignments. A Git-ignored `.env` is normal storage and is **not** a finding; a tracked one containing a real credential is.
`security/secrets-history` catches the case that matters most: a secret committed and later deleted from the working tree, so a rotated-looking repo doesn't hide an exposure. It inspects the most recent 200 commits across all branches without ever checking out, rewriting, or executing repository content.
**Matched values are withheld from every finding, fingerprint, error, and report.** Codebase Doctor never prints your secrets — including in its own SARIF. An external authorized human or agent must remediate the shareable content and rotate or revoke the credential, then rerun the same audit.
### Dependencies
`security/dependencies` is read-only and offline. Lockfile-aware for npm lockfile versions 2 and 3, pnpm (v5+), Yarn (classic and Berry), and Bun. Python and other ecosystems remain explicitly unsupported rather than receiving guessed findings.
Rule families: `security/dependencies/missing-lockfile`, `security/dependencies/manifest-lock-drift`, `security/dependencies/insecure-source`, `security/dependencies/mutable-git-source`, `security/dependencies/missing-integrity`, `security/dependencies/workspace-registry-resolution`, `security/dependencies/competing-npm-lockfiles`, and `security/dependencies/competing-lockfiles`.
A normal semver range such as `^5.0.0` is **not** a finding when the lock agrees. Raw dependency specifications and resolved URLs are withheld from reports and never enter a fingerprint. An external authorized human or agent must correct the metadata and rerun the same scope. Inspect coverage before calling the dependency graph clean or verified.
It never invokes npm, another package manager, a shell, an installer, or a lifecycle script, and makes no network request. It makes no CVE or advisory claim on its own.
`--with-advisories` performs one bounded OSV lookup against resolved packages. Only names, versions, and ecosystems leave the machine.
### Source impact — what breaks if I change this file
`repository/source-graph` uses a real syntax parser (never executes your code) to build a static import graph across **JS/TS, Python, Go, Java, and Rust**. In changed mode it walks reverse edges and reports a deterministic shortest impact path from each changed file.
Changed mode is mixed-scope per doctor, not a universal file filter: Project Doctor structural rules run with the full repository snapshot and may report findings outside changed paths for manifests, lockfiles, workspaces, and test visibility. Configured validation check plans are built from full project topology and then filtered to `affectedProjectIds`. Static SQL selects affected migration streams and replays full current history for every selected stream. Live database remains a full observed schema-set audit only with separately requested `--with-database`. Zero changed findings is not a full clean result.
`repository/source-graph` recognizes static `import`, re-export, type-only import, literal `require`, and literal dynamic import edges across JavaScript and TypeScript (plus Python, Go, Java, and Rust) with a real syntax parser that never executes repository code. Cycles are valid topology, not findings, and this module is finding-free by design.
A separate precision-first `repository/source-integrity` Doctor emits only the `source/import-target-missing` rule, keeping topology limitations from becoming guessed bugs. It diagnoses only four proof classes: an explicit relative target with a supported source extension; a single deterministic alias whose configured target explicitly names a supported source file; a unique workspace package whose explicit entry names a supported source file; and an internal Go package under a module path without a `replace` directive.
Extensionless, JSON, custom-loader, conditional, ambiguous, external, and dynamic references and cycles are not findings. It does not check named exports or validate that a referenced export name exists.
Full mode examines all qualifying edges; changed mode examines changed importers and complete reverse-impacted importers. A deleted or renamed target selects its unchanged importer.
It emits at most 1,000 findings per audit and reports partial coverage whenever that ceiling or any upstream graph limitation applies. Partial coverage is not a clean source-integrity result. Raw import specifiers and source text are withheld from findings, which expose only normalized paths,What people ask about codebase-doctor
What is subhajitlucky/codebase-doctor?
+
subhajitlucky/codebase-doctor is mcp servers for the Claude AI ecosystem. Codebase Doctor is a model-independent, full-codebase auditor for developers and coding agents. It has 0 GitHub stars and its last recorded update is dated 2026-10-05.
How do I install codebase-doctor?
+
You can install codebase-doctor by cloning the repository (https://github.com/subhajitlucky/codebase-doctor) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is subhajitlucky/codebase-doctor safe to use?
+
Our security agent has analyzed subhajitlucky/codebase-doctor and assigned a Trust Score of 95/100 (tier: Verified). See the full breakdown of passed checks and flags on this page.
Who maintains subhajitlucky/codebase-doctor?
+
subhajitlucky/codebase-doctor is maintained by subhajitlucky. The last recorded GitHub activity is dated 2026-10-05, with 0 open issues.
Are there alternatives to codebase-doctor?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy codebase-doctor to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/subhajitlucky-codebase-doctor)<a href="https://claudewave.com/repo/subhajitlucky-codebase-doctor"><img src="https://claudewave.com/api/badge/subhajitlucky-codebase-doctor" alt="Featured on ClaudeWave: subhajitlucky/codebase-doctor" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
The fastest path to AI-powered full stack observability, even for lean teams.