LeanWarp

io.github.Isagoge-Labs由 GitHub 帳號 Isagoge-Labs 發布v0.2.5更新於 Nov 6, 2026

Check and verify Lean 4 proofs on hosted, warm Lean and Mathlib workers.

概覽

AI 產生的概覽

LeanWarp 在託管的常駐 Lean 與 Mathlib 工作節點上檢查與驗證 Lean 4 證明,讓助理不必在本機安裝 Lean 就能編譯、檢視與修補證明。

可以做什麼
  • 檢查 Lean 檔案並回報錯誤與警告,包含重用未變更部分結果的草稿檢查,以及一次最多 64 個檔案的批次檢查
  • 檢視證明中某個位置的目标與區域上下文,並對擷取到的目标嘗試多個策略而不修改檔案
  • 驗證某個宣告是否恰好證明了給定的命題,也支援一次最多 64 條內嵌證明的批次驗證
  • 找出檔案中所有 sorry 與 ?_ 空洞,並建議能補上空洞的策略
  • 把含 sorry 的證明移入新的具名引理,並列出檔案新增的宣告及其型別與相依關係
適用情境
適合助理處理 Lean 4 形式化證明、需要針對 Mathlib 等固定函式庫做真正的核心檢查,又不想在本機架設 Lean 環境的情況。也適合反覆修改證明時,藉由常駐工作節點讓結果與專案鎖定的工具鏈一致。
執行需求
以本機 stdio 程序執行,透過 uv 從 PyPI 安裝(uv tool install leanwarp)或以 uvx 直接執行;支援 Linux、macOS 與 WSL。需透過 LEANWARP_API_KEY 環境變數提供 LeanWarp API 金鑰,可用命令列登入取得。需傳入專案目錄路徑,並需要連線至託管服務的網路。工作節點時間需預付額度。
安裝前請注意
付費服務:工作節點執行期間依秒數從預付額度扣款,閒置時間也計費,建議為每個工作區設定消費上限並在完成後停止節點。API 金鑰屬於機密,不要放進提示詞、原始檔或工具參數。專案的 .lean 檔案會上傳到 LeanWarp 伺服器,連線前請檢查忽略規則。部分命令會把建議的策略或引理寫入檔案。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 LeanWarp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[LeanWarp by Isagoge Labs]

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

OperationWhat you getCLI
CheckLean's errors and warnings for a file; --draft reuses Lean's work on the unchanged part while you edit.leanwarp check
InspectThe goals and local context at a position in a proof.leanwarp inspect
Try tacticsSeveral tactics from the same captured goal: which close it, which leave goals, which fail. The file is not edited.leanwarp try-tactics
VerifyWhether a declaration proves exactly the statement you give, checked by Lean's kernel.leanwarp verify
HolesEvery sorry and ?_ in a file, with its position, and the goals of the first 16.leanwarp holes
SuggestA tactic that closes a hole, accepted only if nothing else changes and the proof gains no unproved lemma or extra axiom. apply writes it into the file.leanwarp suggest, leanwarp apply
Sorry to lemmaThe proof of each theorem that still has a sorry moved into a new named lemma the theorem then uses; the lemma keeps its sorry. apply writes it.leanwarp sorry2lemma
DeclarationsThe declarations a file adds, with their types and dependencies.leanwarp declarations
Check filesUp to 64 files checked in one operation.leanwarp check-files
Verify batchUp to 64 inline proofs checked in one operation, without uploading them as files; each result keeps its custom_id.leanwarp verify-batch

The reference lists every command and option; leanwarp skill --reference prints it.

Coming soon

These are planned and not available yet:

  • Proof simplification: replace a proof with a shorter one that still checks.
  • have extraction: lift named have blocks into top-level lemmas.
  • Batch repair: fill several holes in one operation.

Install in two steps

1. Install. In a terminal, with uv:

sh
uv tool install leanwarp && leanwarp setup

This 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. It runs on Linux, macOS and WSL. 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:

sh
uv tool uninstall leanwarp-sdk && uv tool install leanwarp && leanwarp setup

2. Sign in, in your own terminal:

sh
leanwarp auth login

It 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:

sh
leanwarp doctor              # which environment this project runs onleanwarp connect             # create the project's workspaceleanwarp check LeanWarpExample.lean

If a command returns success: null (exit 3), run leanwarp wait until it finishes before submitting another operation. Then verify:

sh
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. The exit code says the same thing: 0 passed, 1 did not pass, 2 the command failed, 3 still running.

Use with an agent

Give your agent the project directory and this instruction:

Run leanwarp skill and follow it. Use LeanWarp to check this Lean project and verify proofs against their intended statements. Reuse the workspace while you edit, and run leanwarp stop when 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-toolchain and lake-manifest.json match an environment, it uses that one, so results agree with your local build.
  • If your project has neither file, as with a folder of .lean files, 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 NAME to 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.

Concepts

TermMeaning
EnvironmentA Lean release with pinned libraries, prebuilt on LeanWarp, such as lean-4.35-mathlib.
WorkspaceYour project's files on LeanWarp. One per project; creating it starts no compute.
WorkerThe machine that runs Lean for a workspace. It starts on demand and stays warm.
OperationOne request, such as a check or a verification, and its result.
RevisionA numbered version of the workspace's files. Each result names the one it checked.
ReceiptThe part of a verification result that records exactly what was checked.

Documentation

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.

來源:README.md,提交 00e43fe

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:軟體包安裝失敗。

版本歷史

1
  1. v0.2.5最新Nov 6, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分