LeanWarp
OfficialThis server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
LeanWarp is hosted Lean 4 for formal verification. It checks and verifies proofs
on workers that stay warm between edits, against a Lean release and the libraries
your project pins. This SDK is how you and your agents use it: the leanwarp
command, an MCP server and a Python library.
Get started · Agent setup · Reference · HTTP API · Documentation · Website
What it does
Operation | What you get | CLI |
Check | Lean's errors and warnings for a file; |
|
Inspect | Lean’s goals and hypotheses at a tactic or proof hole. |
|
Try tactics | Several tactics from the same captured goal: which close it, which leave goals, which fail. The file is not edited. |
|
Verify | Whether a declaration proves exactly the statement you give, checked by Lean's kernel. |
|
Holes | Every |
|
Suggest | A tactic that closes a hole, accepted only if nothing else changes and the proof gains no unproved lemma or extra axiom. |
|
Sorry to lemma | The proof of each theorem that still has a |
|
Have to lemma | Each named |
|
Simplify proofs | Theorem proofs replaced by shorter tactic proofs that still check. |
|
Repair proofs | Try tactics on |
|
Declarations | The declarations a file adds, with their types and dependencies. |
|
Check files | Up to 64 files checked in one operation. |
|
Verify batch | Up to 64 inline proofs checked in one operation, without uploading them as files; each result keeps its |
|
For a hole-free proof in Main.lean, inspect the start of exact on line 2.
example (h : True) : True := by
exact hleanwarp inspect Main.lean --line 2 --column 3 shows the goal True and
the hypothesis h : True. A goal_status of no_goals means the selected
tactic state has no remaining goals. With omitted, the goals did not fit
and context_omitted.goal_contexts gives their count.
A per-tactic timeout above 60,000 ms is capped at 60,000 ms. Tactic trials default to 30 seconds plus the sum of those tactic budgets and 100 ms, rounded up and bounded to 120–600 seconds. An explicit operation limit shorter than the sum scales down the per-tactic budgets.
The reference
lists every command and option; leanwarp skill --reference prints it.
LeanWarp returns a rewritten file only after checking it: no errors, every statement unchanged, nothing added but the reported lemmas, and every theorem a repair or simplification edits complete, with no axiom beyond Lean's own.
Related MCP server: lean-mcp
Install in two steps
1. Install. In a terminal, with uv:
uv tool install leanwarp && leanwarp setupThis installs the leanwarp command and its MCP server from
PyPI. leanwarp setup adds the LeanWarp
skill and MCP server to Claude Code, Codex and Cursor where they are installed,
and the skill to ~/.agents/skills if that folder exists; leanwarp setup --remove takes them out again. It runs on Linux, macOS and WSL, with Python
3.10 to 3.14. You don't need Lean installed: LeanWarp runs Lean and Mathlib for
you.
Or paste this into your agent:
Install LeanWarp: run
uv tool install leanwarp && leanwarp setup, then ask me to sign in.
Already have LeanWarp 0.2 from GitHub? Its leanwarp-sdk tool owns the
leanwarp command, so replace it instead:
uv tool uninstall leanwarp-sdk && uv tool install leanwarp && leanwarp setup2. Sign in, in your own terminal:
leanwarp auth loginIt opens the dashboard to create an API key; paste the key at the hidden prompt. Never paste it into an agent conversation. Then restart your agent.
When a new release is out, results include update_available; run
leanwarp update to upgrade and refresh the installed skills.
Quick start
From your Lean project or one of the examples:
leanwarp doctor # which environment this project runs on
leanwarp connect # create the project's workspace
leanwarp check LeanWarpExample.leanIf a command returns success: null (exit 3), run leanwarp wait until it
finishes before submitting another operation. Then verify:
leanwarp verify LeanWarpExample.lean \
--declaration add_zero_example --target '∀ n : Nat, n + 0 = n'Wait for that operation to finish too, then run leanwarp stop when you are done.
Every command prints one JSON object. Results start with success: true when
the check passed or the proof was verified, false when it did not, and null
while the work is still running, in which case run leanwarp wait. decided is
false when there was no verdict (a timeout, or a check LeanWarp could not
complete): retry it rather than changing the proof. The exit code says the same
thing: 0 passed, 1 did not pass, 2 the command failed, 3 still running,
4 no verdict.
In CI, leanwarp connect --ephemeral, leanwarp check --all and, always last,
leanwarp stop --delete check every file and leave nothing behind; see the
GitHub Actions recipe.
Use with an agent
Give your agent the project directory and this instruction:
Run
leanwarp skilland follow it. Use LeanWarp to check this Lean project and verify proofs against their intended statements. Reuse the workspace while you edit, and runleanwarp stopwhen you are done.
For MCP clients, add the server leanwarp --project /absolute/path/to/project mcp,
or uvx leanwarp --project /absolute/path/to/project mcp
without installing. It uses the same key and project state as the CLI. See agent setup.
Keep API keys out of prompts, source files and tool arguments.
Your project and its environment
LeanWarp uploads only your .lean files. Lean, Mathlib and every other
dependency come from an environment: a Lean release with pinned libraries,
already built on LeanWarp's workers. Run leanwarp environments to list them.
leanwarp files lists what would upload; patterns in .gitignore and
.leanwarpignore leave files out.
leanwarp connect picks the environment for you:
If your project's
lean-toolchainandlake-manifest.jsonmatch an environment, it uses that one, so results agree with your local build.If your project has neither file, as with a folder of
.leanfiles, it uses the only served environment, or the newest served stable Lean release when there are several.If they match no environment, it stops and lists the ones available. Run
leanwarp connect --environment NAMEto check your files there anyway; they then compile against that environment's Lean and Mathlib.
To start a new project, copy one of the examples, which match the environments LeanWarp serves.
Lean versions and libraries
The LeanWarp engine supports every stable Lean 4 release from 4.26.0, with the
Lake libraries a project locks. The hosted service runs it in the environments
listed on the website, which today pair
Lean with Mathlib. Each one is built and tested before it is served, so your first
check starts from compiled libraries. If your project needs another Lean release
or library, open an issue with its lean-toolchain and
lake-manifest.json.
Billing
You pay from prepaid credit, billed by the second while a worker runs. Run
leanwarp resources to see the published worker's starting minute price, whether
charges depend on usage, startup credit hold and idle timeout. LeanWarp selects
the worker. Use leanwarp connect --max-spend 2 to create a workspace with a $2
cap, or edit an existing cap in the dashboard. Reconnecting without a cap keeps
the saved cap.
When the worker uses usage billing, CPU and RAM charges increase independently above their reserved baselines. The starting rate is a paid minimum while the worker runs, including idle time. Bursting depends on available host capacity. Otherwise, the listed minute rate applies for the time the worker runs. Existing workspaces keep their saved billing terms.
A worker starts with your first operation and stays warm between calls. Run
leanwarp stop when finished; closing the SDK client or your terminal does not
stop it. Unused held credit is released once shutdown and final usage are confirmed.
Stopping keeps your uploaded files and
completed results; the next operation reconstructs the worker. Set a spending cap
for each workspace in the dashboard.
LeanWarp is in beta. For more capacity, larger workers, higher limits or a custom
setup for your team, email contact@isagoge.in or tell us with leanwarp feedback.
Concepts
Term | Meaning |
Environment | A Lean release with pinned libraries, prebuilt on LeanWarp, such as |
Workspace | Your project's files on LeanWarp. One per project; creating it starts no compute. |
Worker | The machine that runs Lean for a workspace. It starts on demand and stays warm. |
Operation | One request, such as a check or a verification, and its result. |
Revision | A numbered version of the workspace's files. Each result names the one it checked. |
Receipt | The part of a verification result that records exactly what was checked. |
Documentation
Start here | Reference |
The agent instructions ship with the package: leanwarp skill prints the
workflow and leanwarp skill --reference the full reference. Run
leanwarp --help or leanwarp COMMAND --help for arguments.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Lean 4 MCP server: compile, prove theorems, and formalize math with Mathlib.
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Paid remote MCP for LLM security scans, jailbreak checks, analytics, checkout, and readiness.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server for agentic interaction with the Lean theorem prover via LSP, providing tools for understanding, analyzing, and interacting with Lean projects.2123MIT
- AlicenseNot gradedqualityDmaintenanceEnables verification of Lean 4 mathematical proofs via MCP tools, allowing AI clients to compile and check theorems with Mathlib.2MIT
- FlicenseAqualityDmaintenanceA calibrated faithfulness screen for informal↔Lean 4 statement pairs, served over MCP. It provides deterministic checks and deep LLM-based analysis to help draft Lean statements.27-
- AlicenseNot gradedqualityBmaintenanceEnables AI-driven formal proof search in Lean 4 by submitting theorems with sorry placeholders and running parallel LLM agents whose proposed edits are verified by the Lean compiler until a machine-checked proof is produced. Also provides Mathlib theorem search and job/attempt management tools.3MIT