
UK Break Clause Analyzer
io.github.Ankur-stockheadsPublished by GitHub account Ankur-stockheadsv0.1.1Updated Oct 24, 2026
Assess UK lease tenant break clauses with grounded citations and a measured hallucination rate.
Overview
Assesses whether a UK commercial-lease tenant break clause can be exercised, returning grounded citations and a verdict with human-verify gates.
- What you can do
- Exposes four tools: extract_break_clause returns the break clause with its verbatim source span; check_conditions runs a four-condition checklist (notice timing, notice correctness, rent arrears, vacant possession) with pass, fail or uncertain per item; find_citation returns exact supporting text or NOT_FOUND; assess_validity aggregates a verdict with a calibration note and mandatory human-verify gates. Every asserted condition must be backed by a verbatim span sliced from the source, and genuinely ambiguous points are routed to a human rather than guessed.
- When to use it
- Useful for reviewing synthetic or public UK commercial-lease tenant break clauses where you want a structured, citation-grounded checklist and an explicit uncertainty signal instead of a free-form answer. It is decision-support only, not legal advice, and is deliberately narrow: tenant break clauses, four conditions precedent, synthetic or public data.
- Requirements
- Runs locally over stdio as a PyPI package (uk-break-clause-analyzer-mcp) launched with uvx; desktop client only. The optional secret ANTHROPIC_API_KEY enables live LLM extraction and reasoning; without it the server runs in a heuristic-only fallback mode and still responds. No other accounts or credentials are declared.
Installation
In SourceWeft
- Open UK Break Clause Analyzer in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
UK Break Clause Analyzer (MCP)
A self-evaluating MCP server that assesses whether a UK commercial-lease tenant break clause can actually be exercised — and publishes its own measured hallucination rate.
⚖️ Decision-support only — NOT legal advice. Built on a deliberately simplified, non-proprietary ruleset over synthetic data. A qualified solicitor must verify any real decision.
The £2m full stop
In 2012, a tenant served a valid break notice to walk away from a lease — but on the break date they hadn't paid one quarter's rent that had fallen due a few weeks earlier. The break failed. They were bound to the lease (and its rent) for years. No drama, no bad faith — just one unmet condition precedent that everyone missed until it was too late.
Break clauses are unforgiving like that. Whether a tenant can actually leave turns on a short checklist — notice served in time, notice served correctly, no rent arrears, vacant possession given — and getting any one wrong is catastrophic. It is exactly the kind of task you might hand to an LLM... if you could trust it not to confidently invent the answer.
This project is about earning that trust, and measuring it. It is not a clever parser. It is a reliability harness: every claim is grounded to verbatim source text or it isn't made, genuinely-ambiguous cases are routed to a human instead of guessed, and the whole thing ships with an eval that publishes how often it lies.
The edge
- Grounded — every asserted condition is backed by a verbatim source span. If
the system can't find the text, it returns
NOT_FOUND; it never invents a quote. A deterministic gate slices the span out of the source, so it can't echo hallucinated text. - Calibrated — when the lease genuinely doesn't settle a point, the answer is
AMBIGUOUS — human verify, not a coin-flip. Abstaining honestly is a feature. - Self-evaluating — a pytest harness scores extraction accuracy, citation faithfulness, hallucination rate, and calibration against 24 labelled cases.
- Reasons + verifies — the LLM only proposes; deterministic code disposes (grounds every quote, does the date arithmetic, applies the vacant-possession legal test, aggregates the verdict).
The headline number
See report/report.md for the full eval (all four metrics,
per-model comparison, confusion matrix, caught-hallucination examples).
The committed report is the heuristic baseline (it runs with no API key) — and it already tells the core story: the grounding gate drives ungrounded (fabricated) hallucinations to zero, while a non-reasoning baseline still misgrounds and never abstains on the genuinely-ambiguous cases. That gap is exactly what a calibrated LLM is meant to close:
How it works
The trust boundary is structural: the deterministic core/ package physically
cannot import the llm/ package (enforced by a test). "The LLM proposes,
deterministic code disposes" is a property of the codebase, not a discipline.
The four MCP tools (each does one thing)
Quickstart (clone to running in under 2 minutes)
No ANTHROPIC_API_KEY is required for any of the above — the eval falls back to the
heuristic baseline and is fully reproducible. Set the key (and --record) to
measure the real Claude models.
Your Anthropic API key
The key is only needed for live LLM extraction (the eval --record step and the
server's real mode). Everything else runs without one.
- Never commit it.
.envis git-ignored and the cassettes redact thex-api-keyheader. - For local commands, either export it or use a
.envfile: - For an MCP client, put it in the server config's
envblock (below).
Run the MCP server
Claude Desktop — add to claude_desktop_config.json (use the absolute path to
your clone so it runs from the project):
Claude Code — one command:
Without a key the server still runs and responds — it uses the heuristic baseline and says so. Every tool response carries the decision-support disclaimer.
Reproducible evals (cassettes)
temperature=0 is not a determinism guarantee from the API, so reproducibility
comes from recorded cassettes (VCR.py). scripts/run_eval.py --record records one
cassette set per model with the x-api-key header redacted; re-running without
--record replays them with no key in seconds. See
eval/cassettes/README.md.
Layout
Methodology & honesty
The metric definitions are pre-registered in
docs/METHODOLOGY.md before any model is run, so the
headline number can't be defined after the fact to look good. The hallucination
rate counts misgrounding and overconfidence — not just fabrication — precisely
because a grounding gate makes fabrication trivially zero. The scorer uses no LLM
judge; it is validated against a gold oracle and deliberately-broken systems in
tests/test_harness.py.
Scope (deliberately narrow)
Tenant break clauses only · four conditions precedent · synthetic/public data only · decision-support, not legal advice. Other lease provisions, landlord breaks, real client data, and a production engine are explicitly out of scope.
Built as a reliability-engineering artifact. The eval is the point.
Source: README.md at commit 148e698
Tools
0Version history
1- v0.1.1LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts