
UK Break Clause Analyzer
io.github.Ankur-stockheads由 GitHub 帳號 Ankur-stockheads 發布v0.1.1更新於 Oct 24, 2026
Assess UK lease tenant break clauses with grounded citations and a measured hallucination rate.
概覽
評估英國商業租賃中承租人中斷條款能否行使,提供有原文依據的引用與結論,並附人工複核關卡。
- 可以做什麼
- 提供四個工具:extract_break_clause 回傳中斷條款及其逐字原文片段;check_conditions 依四項條件清單(通知時間、通知方式、租金欠繳、交還空置占有)逐項給出通過、不通過或不確定;find_citation 回傳精確的支撐原文或 NOT_FOUND;assess_validity 彙整結論,附校準說明與強制人工複核關卡。每項斷言的條件都必須由從原文切出的逐字片段支撐,真正含糊之處交由人工判斷而非猜測。
- 適用情境
- 適合審閱合成或公開的英國商業租賃承租人中斷條款,需要結構化、有引用依據的清單與明確的不確定性提示,而不是自由發揮的答案。它僅作決策支援,不構成法律意見,範圍刻意收窄:僅限承租人中斷條款、四項先決條件、合成或公開資料。
- 執行需求
- 以 PyPI 套件(uk-break-clause-analyzer-mcp)形式透過 uvx 在本機以 stdio 執行,僅支援桌面用戶端。選用密鑰 ANTHROPIC_API_KEY 用於即時 LLM 擷取與推理;未設定時伺服器以純啟發式回退模式執行,仍可回應。未宣告其他帳號或憑證。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 UK Break Clause Analyzer,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
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.
來源:README.md,提交 148e698
工具
0版本歷史
1- v0.1.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分