formal-proof-mcp
MCP server that provides six verification tools (Lean proof checking, axiom audit, bound, gridlock check, certificate verification, residency check) with honest status reporting (ok/failed/unavailable) to prevent agents from claiming unchecked proofs passed.
README
formal-proof-mcp
Your agent says it proved the theorem. Did anything actually check?
Six verification tools over the Model Context Protocol, with one invariant running through all of them:
A result that was not checked is never returned as a result that passed.
pip install formal-proof-mcp
Why this exists
Coding agents are fluent about correctness. They will tell you a proof went through, a bound holds, a graph is deadlock-free — and the failure mode is not that they lie, it is that nothing on the other end ever ran. A missing Lean toolchain, an uninstalled dependency, an empty input: each returns something, and "something" reads as success.
So every response here carries status, and the three values are kept strictly apart:
| status | meaning |
|---|---|
ok |
the check ran and passed |
failed |
the check ran and failed — with the real error attached, for the repair loop |
unavailable |
the check could not run. Explicitly not a pass. |
An agent that reads "no Lean toolchain installed" as "no errors found" will confidently assert a proof it never checked. This server makes that confusion impossible to express.
The check that matters most
lake build exits 0 on a development riddled with sorry. Lean accepts the placeholder, compiles
happily, and reports success. Compiling is necessary and nowhere near sufficient — only
#print axioms reveals what a theorem actually rests on:
$ formal-proof-mcp --selftest
ok clean axioms accepted
ok sorryAx caught
ok empty audit FAILS rather than passing quietly
ok 0-of-250 bounded at ~1.2%
ok acyclic graph certified
ok cycle caught with its path
ok non-decreasing rank caught
ok unknown tool fails loudly
ok tools/list returns all six
lean toolchain: present
selftest passed.
Note line 3. An axiom audit over empty input fails. A coverage tool that cannot cover anything must never pass quietly — that is how an entire corpus goes unaudited while CI stays green.
Install
pip install formal-proof-mcp # zero dependencies
pip install "formal-proof-mcp[siblings]" # adds cert_verify and residency_check
30-second quickstart
formal-proof-mcp --selftest # prove each tool actually fires
formal-proof-mcp --list-tools # the ten tools
formal-proof-mcp # serve MCP over stdio
Wire it into Claude Desktop or Cursor:
{
"mcpServers": {
"formal-proof": { "command": "formal-proof-mcp" }
}
}
The ten tools
| tool | what it answers |
|---|---|
lean_check |
Does this Lean 4 source compile? On failure, returns the compiler's own error so the agent repairs its proof instead of asserting one. |
axiom_audit |
What does the theorem actually rest on? Catches sorryAx and anything outside the allowlist. |
bound |
What does a k-of-n record support? Exact one-sided Clopper–Pearson. "It passed every time" is not a bound. |
gridlock_check |
Can this wait-for relation wedge? Returns the actual cycle, and optionally checks a strictly decreasing rank. |
cert_verify |
Is this signoff-cert/v1 certificate real, with its false-pass bound recomputed from the evidence? |
residency_check |
Could a cross-tenant cache probe on this model even be interpreted? |
Added in 0.2 — the rest of the portfolio
Each of these delegates to a sibling package. If that package is not installed the result is
unavailable, never ok — an agent reading "not installed" as "checked and fine" is the exact
failure this server exists to prevent, and a missing optional dependency is the likeliest way to
produce it. There is a test that blocks the import and asserts the status.
| tool | question | needs |
|---|---|---|
prereg_check |
can this experiment's decision rule come out both ways? | preregister |
state_floor |
how many states must the system distinguish? | floorgen |
gate_count |
exactly how many states does removing this check admit? | gatecount |
evidence_audit |
run every applicable verifier over a tree, aggregate to one verdict | evidence |
pip install "formal-proof-mcp[portfolio]" # the server plus all four
prereg_check is the one to reach for first. An agent about to run an experiment can be told,
before it burns a GPU hour, that its rule cannot fail:
{"decision_rule": "argmax_flips > 0",
"metrics": {"argmax_flips": {"type": "integer", "lo": 0, "hi": 0}}}
{"status": "failed", "verdict": "UNFALSIFIABLE",
"explanation": "THE FINDING CAN NEVER BE REPORTED. ... The run is guaranteed to return the null
before any data is collected."}
Worked example — driving it the way a client does
Pipe JSON-RPC in, read JSON-RPC out:
$ printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"gridlock_check",
"arguments":{"edges":[["a","b"],["b","c"],["c","a"]]}}}' \
| formal-proof-mcp
initialize -> {'name': 'formal-proof-mcp', 'version': '0.1.0'} 2024-11-05
id=2 isError=True status=failed wait-for cycle: a -> b -> c -> a
And the audit that catches an assumed theorem:
id=2 isError=True status=failed
1 theorem(s) depend on sorryAx: these are ASSUMED, not proved, and the development
still compiles
isError is how the agent learns a check failed rather than merely returned, and the cycle
comes back as a path so the answer is actionable rather than a bare boolean.
Honest limits
lean_checkneeds a Lean toolchain. Without one it returnsunavailable, never a pass. Install via elan.cert_verifyandresidency_checkdelegate tosignoff-certandkvleak. Absent, they reportunavailablewith thepip installline — they never fake a verdict.- The axiom allowlist is a policy choice, not a law.
Classical.choiceis permitted by default; tighten it with theallowedargument if your development is constructive. gridlock_checkreasons about the graph you hand it. It cannot know whether that graph faithfully models your system, which is the part only you can supply.- No auto-repair loop is included. The server returns the compiler error; the retry is the agent's to run. An earlier draft of this README promised a bounded repair loop, which the code does not implement — the error trace is what ships.
- No SDK, by design. MCP is JSON-RPC 2.0 over stdio; implementing it directly keeps the dependency count at zero and the whole transport auditable in one short file.
The commercial edition
This server verifies and reports. It does not gate.
The gate corpus, the automated repair mechanisms, and the certificate-issuing faucet are the
licensed offering — an operator who wants a failed check to block a deploy is performing the
step this package deliberately does not. See CLAIMS-MAP.md for exactly where
that line sits.
Reading is free. Enforcing is licensed.
Licence
Apache-2.0 · CLEAN — exposes a toolchain and reports; implements no filed apparatus.
<!-- HONEST-SCOPE -->
Honest scope — what a passing run proves, and what it does not
The two halves are inseparable. A tool that states only the first half is marketing.
It proves:
- whether Lean source compiles, and what axioms a theorem actually rests on (including
sorryAx) - whether a wait-for graph can wedge, and an exact k-of-n bound
- explicitly, when a check COULD NOT RUN —
unavailableis never merged intook
It does NOT prove:
- that a theorem says what its name or docstring suggests.
#print axiomsproves the dependency set is clean, never that the statement is the one you wanted - that a passing
lake buildmeans anything — a development full ofsorrycompiles and exits 0 - anything when the toolchain is absent; it reports
unavailableand stops
Full CLI reference, generated from --help: docs/CLI.md
<!-- /HONEST-SCOPE -->
<!-- PORTFOLIO -->
The rest of the portfolio
24 artifacts, one idea: a measurement you cannot check is a press release. Every tool here reports; none of them gates.
Tools
abstain-bench |
how often does a verifier pass input it could not check? |
evidence |
run the whole portfolio over your repo — the weakest leg, never the mean |
floorgen |
what must your system remember? an exact lower bound |
formal-proof-mcp |
a proof kernel for your coding agent ← you are here |
gatecount |
exactly how many states does removing this check admit? |
gridlock |
certify a wait-for relation cannot wedge |
honestbench |
measure your CI's escape rate |
kvleak |
cross-tenant leak scanner |
kvprobe |
model-substitution detector with a measured FPR |
preregister |
refuses to seal a plan whose conclusion is already fixed |
proof-to-code-drift |
fail the build when the proof stops matching |
sf-verify |
re-derive admission decisions offline |
signoff-cert |
certificates that carry their own false-pass bound |
tokencount |
a token count both parties can recompute |
Benchmarks — each recomputes one of our own published numbers from its certificate
illusion-bench |
how many broken kernels does your oracle admit? |
kv-reuse-econ-bench |
recompute our economics headline |
llm-tenant-isolation-bench |
recompute our isolation figures |
Datasets
abstain-corpus |
32 inputs a verifier must NOT pass |
kv-reuse-econ-traces |
per-workload reuse accounting + the closed form |
kv-tenant-isolation-bench |
isolation observations, uninterpretable rows included |
llm-precision-fingerprints |
precision-labelled logprobs with a negative control |
Try it in a browser — no install, no GPU
negative-results-atlas |
ten claims we took back |
tenant-leak-demo |
the residency calculator |
wait-for-visualiser |
paste a wait-for graph, see the cycle |
The commercial edition
Everything above is measure-only and Apache-2.0: it tells you what is true and never acts on it. The enforcement side — binding a partition key at the admission decision, the compiled gate corpus, and the certificate-issuing faucet — is covered by filed patents and licensed separately.
Reading is free. Enforcing is licensed. <!-- /PORTFOLIO -->
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。