paperproof-mcp
MCP server for inspecting the full structure of a Lean proof.
MCP server that compactly shows how hypotheses and goals change throughout your Lean proof. Meant as a companion for lean-lsp-mcp.
Works immediately - no Paperproof dependency, no lakefile edit, no rebuild (so, same requirements as lean-lsp-mcp).
Setup
Claude Code
claude mcp add -s user paperproof uvx paperproof-mcp
VSCode
Add to mcp.json:
{
"servers": {
"paperproof": { "type": "stdio", "command": "uvx", "args": ["paperproof-mcp"] }
}
}
Tools
Tool: lean_proof_structure
The most compact representation of a full Lean proof. Only shows the diffs, uses nesting to denote scope.
| option | default | meaning |
|---|---|---|
file_path |
(required) | absolute path to a .lean file |
line |
(required) | 1-based line of the theorem, or any line inside its proof |
include_theorems |
false |
all lemma signatures for the lemmas used in this proof |
Returns { theorem_name, proof_tree, used_theorems }. The proof_tree:
{
"goal": "s ∩ t = t ∩ s",
"initialHyps": ["s: Set ℕ", "t: Set ℕ"],
"tactics": [
{
"tactic": "ext x",
"newHyps": ["x: ℕ"],
"newGoal": "x ∈ s ∩ t ↔ x ∈ t ∩ s"
},
{
"tactic": "apply Iff.intro",
"newSubgoals": [
{
"goal": "x ∈ s ∩ t → x ∈ t ∩ s",
"newHyps": [],
"tactics": [
{"tactic": "intro h1", "newHyps": ["h1: x ∈ s ∩ t"], "newGoal": "x ∈ t ∩ s"},
{"tactic": "rw [Set.mem_inter_iff]", "newHyps": ["h1: x ∈ s ∧ x ∈ t"]},
{"tactic": "rw [and_comm]", "newHyps": ["h1: x ∈ t ∧ x ∈ s"]},
{"tactic": "exact h1", "closed": true}
]
},
{
"goal": "x ∈ t ∩ s → x ∈ s ∩ t",
"newHyps": [],
"tactics": [
{"tactic": "intro h2", "newHyps": ["h2: x ∈ t ∩ s"], "newGoal": "x ∈ s ∩ t"},
{"tactic": "rw [Set.mem_inter_iff]", "newHyps": ["h2: x ∈ t ∧ x ∈ s"]},
{"tactic": "rw [and_comm]", "newHyps": ["h2: x ∈ s ∧ x ∈ t"]},
{"tactic": "exact h2", "closed": true}
]
}
]
}
]
}
Tool: lean_proof_steps
Returns before&after goal state per tactic, like Lean's infoview.
| option | default | meaning |
|---|---|---|
file_path |
(required) | absolute path to a .lean file |
line |
(required) | 1-based line of the theorem, or any line inside its proof |
include_theorems |
false |
all lemma signatures for the lemmas used in this proof |
Returns { theorem_name, proof_tree, used_theorems }. The proof_tree:
{
"initialHyps": ["s: Set ℕ", "t: Set ℕ"],
"tactics": [
{
"tactic": "ext x",
"beforeGoals": [{"goal": "s ∩ t = t ∩ s", "hyps": []}],
"afterGoals": [{"goal": "x ∈ s ∩ t ↔ x ∈ t ∩ s", "hyps": ["x: ℕ"]}]
},
{
"tactic": "apply Iff.intro",
"beforeGoals": [{"goal": "x ∈ s ∩ t ↔ x ∈ t ∩ s", "hyps": ["x: ℕ"]}],
"afterGoals": [
{"goal": "x ∈ s ∩ t → x ∈ t ∩ s", "hyps": ["x: ℕ"]},
{"goal": "x ∈ t ∩ s → x ∈ s ∩ t", "hyps": ["x: ℕ"]}
]
},
{
"tactic": "intro h1",
"beforeGoals": [{"goal": "x ∈ s ∩ t → x ∈ t ∩ s", "hyps": ["x: ℕ"]}],
"afterGoals": [{"goal": "x ∈ t ∩ s", "hyps": ["x: ℕ", "h1: x ∈ s ∩ t"]}]
},
{
"tactic": "rw [Set.mem_inter_iff]",
"beforeGoals": [{"goal": "x ∈ t ∩ s", "hyps": ["x: ℕ", "h1: x ∈ s ∩ t"]}],
"afterGoals": [{"goal": "x ∈ t ∩ s", "hyps": ["x: ℕ", "h1: x ∈ s ∧ x ∈ t"]}]
},
{
"tactic": "rw [and_comm]",
"beforeGoals": [{"goal": "x ∈ t ∩ s", "hyps": ["x: ℕ", "h1: x ∈ s ∧ x ∈ t"]}],
"afterGoals": [{"goal": "x ∈ t ∩ s", "hyps": ["x: ℕ", "h1: x ∈ t ∧ x ∈ s"]}]
},
{
"tactic": "exact h1",
"beforeGoals": [{"goal": "x ∈ t ∩ s", "hyps": ["x: ℕ", "h1: x ∈ t ∧ x ∈ s"]}],
"afterGoals": []
},
{
"tactic": "intro h2",
"beforeGoals": [{"goal": "x ∈ t ∩ s → x ∈ s ∩ t", "hyps": ["x: ℕ"]}],
"afterGoals": [{"goal": "x ∈ s ∩ t", "hyps": ["x: ℕ", "h2: x ∈ t ∩ s"]}]
},
{
"tactic": "rw [Set.mem_inter_iff]",
"beforeGoals": [{"goal": "x ∈ s ∩ t", "hyps": ["x: ℕ", "h2: x ∈ t ∩ s"]}],
"afterGoals": [{"goal": "x ∈ s ∩ t", "hyps": ["x: ℕ", "h2: x ∈ t ∧ x ∈ s"]}]
},
{
"tactic": "rw [and_comm]",
"beforeGoals": [{"goal": "x ∈ s ∩ t", "hyps": ["x: ℕ", "h2: x ∈ t ∧ x ∈ s"]}],
"afterGoals": [{"goal": "x ∈ s ∩ t", "hyps": ["x: ℕ", "h2: x ∈ s ∧ x ∈ t"]}]
},
{
"tactic": "exact h2",
"beforeGoals": [{"goal": "x ∈ s ∩ t", "hyps": ["x: ℕ", "h2: x ∈ s ∧ x ∈ t"]}],
"afterGoals": []
}
]
}
Option: used_theorems
With include_theorems: true (on either tool), used_theorems is a list of the lemmas the proof uses:
"used_theorems": [
"theorem Set.mem_inter_iff: ∀ {α : Type u} (x : α) (a b : Set α), x ∈ a ∩ b ↔ x ∈ a ∧ x ∈ b",
"theorem and_comm: ∀ {a b : Prop}, a ∧ b ↔ b ∧ a",
"theorem Iff.intro: ∀ {a b : Prop}, (a → b) → (b → a) → (a ↔ b)"
]
Metadata
Release files for paperproof-mcp 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| paperproof_mcp-0.2.5.tar.gz | 24.6 kB | Without provenance | Details for paperproof_mcp-0.2.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| paperproof_mcp-0.2.5-py3-none-any.whl | Python 3 | none | any | Details for paperproof_mcp-0.2.5-py3-none-any.whl |
Total release size: 59.8 kB
Release files / paperproof_mcp-0.2.5.tar.gz
| Download URL | paperproof_mcp-0.2.5.tar.gz |
|---|---|
| Size | 24.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c5345e9dd9e2746bb59b86c0cd0f3c8a9dc6e6070b7f2e4f305f79178b34673
|
|
BLAKE2b-256 checksum How to use checksums |
92c8b2664533ab12413fa05a95ec23ca0161b6f14bdf50cc94e0496c93568657
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.4
|
Release files / paperproof_mcp-0.2.5-py3-none-any.whl
| Download URL | paperproof_mcp-0.2.5-py3-none-any.whl |
|---|---|
| Size | 35.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
26a0b9769763c5eb5339f569a6d5f65a9831ae440a99755116694a365afbaa7f
|
|
BLAKE2b-256 checksum How to use checksums |
2cc5d4fa92ee0c1014fba698f772a4a32096ac021e1ffc5a8581e4430ea2e3d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.4
|
Security for paperproof-mcp 0.2.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.