MCP server that reverse-engineers a locked rebuild spec from an existing app.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
An MCP server that reverse-engineers a trustworthy rebuild spec β a locked CLAUDE.md,
.claude/ config, and a mutation-tested test suite β out of an existing app, so any coding
agent can rebuild it cleanly against that spec instead of guessing.
It does not rebuild the app. It produces the spec, contracts, and tests a coding agent consumes to do that separately. This boundary is deliberate β see Why below.
Validated against a real app. The core loop (ingest, resolve cases, generate spec) has been tested end-to-end against a real, messy repo with two independent fresh-agent handoffs on two model tiers, plus a mutation-tested test suite. docs/v0-findings.md covers what worked, what broke, and what's still open.
Prior research (AgentModernize, arXiv:2605.17535) found that a rebuild pipeline scores 0% behavioral equivalence with no verified feedback loop, and only 9β19% with a coarse one. The bet behind this tool: locking interface contracts before running tests, plus a strict one-test-at-a-time retry loop instead of batch regeneration, does meaningfully better.
The riskiest part of any such pipeline is silently validating a bug as intentional β four sources of evidence can quietly agree on the same mistake with nobody ever having said why. So the single non-negotiable rule in this tool: auto-resolving an ambiguity requires both signal agreement and an affirmative signal that someone actually decided (a stated comment, a TODO admitting a bug, or a direct human answer). Silent agreement alone β code and observed behavior simply matching, with no one ever having said why β always becomes a question, never an auto-resolution, no matter how high the apparent confidence.
Six MCP tools, run from inside a normal Claude Code (or any MCP-compatible) session:
| Tool | What it does |
|---|---|
ingest_repo(path) | Static analysis only, no LLM call: routes, package.json, build config (via AST, never executed), existing tests, and structural-smell detectors (e.g. a client-side-only credential check with no server-side verification) that surface real ambiguity even when nobody ever commented on it. |
crawl_site(url) | Headless Playwright crawl of reachable routes, with progress notifications so long crawls don't get killed as unresponsive. |
flag_known_bug(description) | Free text, stored verbatim. Always overrides auto-resolve for anything it matches β the cheapest, most authoritative signal in the system. |
get_case_queue() / resolve_case(id, decision) | The ambiguity queue. Surfaces open questions via MCP elicitation when the client supports it; resolve_case is always available as a scripted fallback. |
generate_spec() | Only callable once the case queue is empty. Writes CLAUDE.md, .claude/rules/, .claude/settings.json (hooks that mechanically enforce the discipline β see below), spec/contracts/*.md, tests/visible/ + tests/held-out/, and kickoff-prompt.txt to a clean sibling <repo>-rebuild/ directory β never into the original repo. Runs a real mutation check before finalizing tests: deliberately breaks the original code and confirms each generated test actually catches it, downgrading any that don't. |
crawl_site needs Chromium (npx playwright install chromium, step 2 below) β it isn't bundled with the server, including when installed via Smithery, so run it once first or the tool will fail.
A comparison run across two model tiers found that a weaker model will happily read
CLAUDE.md, understand "only build what's currently failing, don't batch-regenerate," and
then quietly violate it anyway β because nothing checked it. Two rules in this tool are now
enforced by real hooks, not prose, for exactly that reason:
spec/ is locked. A PreToolUse hook blocks any edit under spec/.generate_spec writes
spec/untested-contracts.json (every route/contract with no covering test), and a second
PreToolUse hook blocks writes to anything on that list β the same enforcement shape as the
spec/-edit block, closing a gap that used to be advisory only.A PostToolUse hook runs the visible test suite after every edit.

Available on npm:
Also available via Homebrew:
Requires Node 20.12+ (set in package.json engines). To run from source instead, clone the
repo, npm install, and use npm start.
Then add it as an MCP server. In Claude Code, from the project you want to rebuild:
(or add this to your ~/.claude.json / project .mcp.json):
Then in a session. The first call, ingest_repo, runs instantly with zero setup: static
analysis only, no browser, no Chromium, no LLM call. Run it on any app to confirm the server
is alive before committing to the full workflow:
This writes a clean some-app-rebuild/ sibling directory. cd into it, start a fresh
Claude Code session (nothing else should be in scope), and paste the contents of its
kickoff-prompt.txt.
If this looks useful, a star helps other developers find it.
The full lifecycle, in order β each step's actual behavior, not just the call signature.
Static analysis only β no LLM call, nothing executed. Parses package.json, route files
(Express and Next.js App Router today β see scope),
build config (Tailwind/Vite/Next, via AST, never executed), existing tests, and scans for
comment/TODO signals plus structural smells (e.g. a hardcoded client-side credential check with
no server-side verification β the kind of thing nobody ever comments on, which is exactly why
it needs its own detector rather than relying on comments existing). Everything lands in
<repo>/.dossier/ β this tool's own scratch state, inside the original repo, never shared or
uploaded anywhere. You'll get back a summary:
openCases here already reflects reconciliation β comment/TODO signals and structural smells
that didn't auto-resolve become case-queue entries automatically.
If routes comes back 0, check for a monorepoHint field before assuming the app has none β
ingest_repo needs to be pointed at the actual app directory, not a monorepo's root wrapper
(a package.json with apps/*/packages/* next to it, common with Turborepo/Nx/workspace
layouts, including ones that never actually declare a workspaces field). The hint lists real
candidate directories found under apps//packages/ so you don't have to hunt for the real app
yourself β re-run ingest_repo pointed at one of those instead.
If your client supports MCP elicitation, you can skip the manual re-run entirely: pass
interactive: true and, when a monorepo root with candidates is detected, ingest_repo asks
which one is the real app and ingests it directly β it never silently guesses on its own, the
same way get_case_queue's interactive mode always asks rather than resolving anything without
you. Declining, an unsupported client, or an answer that isn't one of the real candidates all
fall back to the plain hint above, unchanged.
Only useful if the app is actually running somewhere. Headless Playwright crawl of reachable routes, emitting progress notifications periodically β long crawls get auto-backgrounded by most MCP clients, and a silent multi-minute call risks being killed as unresponsive without them.
This step is the only one that needs a browser. crawl_site drives headless Chromium, which
isn't bundled with the server (including via Smithery), so run npx playwright install chromium
once first or the tool will fail. Skip it and the rest of the workflow still works. ingest_repo,
resolve_case, and generate_spec need no browser at all.
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/rebuild-dossier)<a href="https://allmcps.com/mcp/rebuild-dossier"><img src="https://allmcps.com/api/badge/rebuild-dossier?style=directory" alt="Rebuild Dossier on AllMCPs" /></a>