# codebase-doctor [Health: Active]

**Category:** 🔒 Security  
**Repository:** https://github.com/subhajitlucky/codebase-doctor  
**GitHub Stars:** 0  
**npm Downloads (last month):** 497  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/codebase-doctor

## Description
Read-only codebase audits for coding agents: secrets, RLS, deps, review verdicts. No writes.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "codebase-doctor": {
    "command": "npx",
    "args": ["-y","codebase-doctor"]
  }
}
```

## Documentation

## What codebase-doctor does

codebase-doctor provides read-only checks for repositories handled by coding agents. Its audit scope includes committed secrets, secret history, dependency issues, unsafe Dockerfiles, workflow injection, RLS mistakes, accessibility regressions, broken imports, and related source-level findings. The server is intended for verification rather than remediation: findings tell an authorized human or external coding agent what to fix, while the audit itself does not write to the repository.

Each finding includes supporting evidence, and reports include coverage information describing checks that were skipped or only partially completed. This distinction matters when interpreting a clean result: incomplete coverage is reported instead of being presented as a clean audit.

## How it works

The audit pipeline builds a source graph and examines the working tree, Git changes, and—when relevant—repository history. Changed-scope audits can compare the merge base with a selected base reference, while review mode narrows findings to added diff lines so unrelated older issues do not determine a pull-request verdict.

Secret-history analysis examines up to the most recent 200 commits across all branches without checking out, rewriting, or executing repository content. Matched secret values are withheld from findings, fingerprints, errors, and reports, including SARIF output. Deleted secrets can therefore remain visible as historical exposure without revealing their contents.

Review results use the verdicts `NO_CHANGES`, `APPROVE`, `COMMENT`, or `REQUEST_CHANGES`. Baseline comparison can limit gating to findings that are new in the diff. An empty diff produces `NO_CHANGES`, rather than treating the review as an approval.

## Setup and configuration

The package can be run without a separate installation:

```bash
npx -y codebase-doctor audit .
```

It can also be installed globally with `npm install -g codebase-doctor`. Common commands include `audit`, `review`, `verify`, `bisect`, and `demo`. Audits support text, JSON, SARIF, brief, and HTML output; reviews additionally support Markdown and GitHub workflow annotations.

Useful controls include `--changed`, `--base`, `--exclude`, `--fail-on`, `--require-complete`, `--baseline`, and `--timeout`. PostgreSQL catalog inspection is opt-in with `--with-database`, and OSV advisory lookup for lockfile packages is opt-in with `--with-advisories`. Database checks can be limited by schema and statement timeout.

## Tools and capabilities

- Audit a full repository or the scope affected by Git changes.
- Review pull-request changes and emit a machine-readable verdict.
- Detect private-key material, provider-token patterns, paired AWS credentials, credential-bearing URLs, and high-confidence sensitive assignments.
- Inspect dependency lockfiles for npm, pnpm, Yarn, Bun, Poetry, and uv projects.
- Check SQL RLS configuration, with optional live PostgreSQL catalog access.
- Compare a report with a baseline and verify whether fixes landed.
- Produce JSON, SARIF, HTML, brief, Markdown, or GitHub workflow output.
- Write coverage receipts and optionally sign them with an Ed25519 private key.

## Limitations and notes

Secret detection is precision-first rather than exhaustive. A Git-ignored `.env` file is not treated as a finding solely because it exists, while a tracked file containing a real credential can be reported. Review scope can omit findings on unchanged lines unless `--all-findings` is used; a full audit still reports them.

Incomplete coverage should be treated as an operational condition, not as evidence that the repository is clean. The `--require-complete` option makes an incomplete audit exit with status 2. Review exit status 1 requests changes, while status 2 indicates an operational failure and never represents a clean result.

The `demo` command creates a disposable Git fixture containing a secret and broken import, audits it, shows the blast radius, and exits 1 to demonstrate the CI gate. It does not touch files outside its temporary directory.

_Full upstream README: https://allmcps.com/mcp/codebase-doctor/readme_

