Labsco
MCP SERVER

CodeClone

by orenlab

Make an agent declare what it will change, compute the structural blast radius, then verify the real patch against that declaration.

Code Intelligence & Repository Indexing
Summary
It catches scope creep at the boundary, not in the final diff.

By the time a narrow task has spread into shared helpers and public APIs, the diff looks intentional. Declaring the intent first and comparing it to the real patch is what makes that visible. Two things to know going in: the MCP surface is prerelease, and the baseline is a governance artefact — regenerating it to make a failing check pass is exactly the misuse the project warns against.

What it is

A deterministic structural analysis and change-control surface for Python repositories, exposed over MCP. It does not generate code and it does not ask a model whether a change is safe: it runs one canonical analysis — clones, complexity, coupling, cohesion, dead code, module map, API inventory — and compares a declared intent against the patch that actually arrived. Findings come from repository facts, and analysis state, memory and receipts stay local with no hosted service.

What you get
  • A full deterministic analysis registered as the session's run, or a fast pass over changed files only from a path list or a git ref — `analyze_repository`, `analyze_changed_paths`
  • The pre-edit half of the controlled change: intent recorded, concurrent edits checked, blast radius computed, and an authoritative `edit_allowed` result with the patch budget — `start_controlled_change`
  • The post-edit half: hygiene checks, scope verification, contract validation and claims review, returning a receipt and clearing the intent if accepted — `finish_controlled_change`
  • The risk boundary for a set of files on its own — direct dependents, clone cohort members, coverage gaps, do-not-touch paths — with no new analysis run — `get_blast_radius`
  • A production-first triage view, hotlists, and finding groups with filters — `get_production_triage`, `list_hotspots`, `list_findings`
  • Narrower reads when you want one family: `check_clones`, `check_cohesion`, `check_complexity`, `check_coupling`, `check_dead_code`, plus `get_finding` and `get_remediation`
  • Bounded implementation context for named paths or `module:symbol` names — module dependencies, public surface, callers, cache origin — without re-analysing — `get_implementation_context`
  • Durable audit artefacts that replay exactly as created — `create_review_receipt`, `get_review_receipt`, `get_patch_trail`, `get_blast_artifact`
  • Review prose checked against the report's own semantics, catching a report-only signal described as a CI failure or known baseline debt described as new — `validate_review_claims`
  • Gate evaluation, PR summaries, run comparison and reviewed-finding bookkeeping — `evaluate_gates`, `generate_pr_summary`, `compare_runs`, `mark_finding_reviewed`, `list_reviewed_findings`, `clear_session_runs`
Requirements

Python 3.10 or newer. The analysis CLI runs with no install — `uvx codeclone@latest .` — but the MCP control surface is in the 2.1 alpha prerelease: `uv tool install --prerelease allow "codeclone[mcp]"`, then `codeclone-mcp --transport stdio`. It exposes 38 MCP tools. Every tool requires an absolute repository root; a relative `'.'` is rejected outright. Before gating agents or CI, run `codeclone setup status`, `codeclone setup plan` and `codeclone setup apply` to check the project configuration and gitignore hygiene. Record a baseline with `codeclone . --update-baseline` and commit it — that is what separates new regressions from debt that was already there.

Setup effort

One command — uv tool install --prerelease allow "codeclone[mcp]"