
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 分