# LeanWarp

> LeanWarp is an MCP server for developer tools. Check and verify Lean 4 proofs against Mathlib on hosted, warm workers. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Free trial
- **Platforms:** CLI, API
- **Website:** https://isagoge.in/leanwarp
- **Repository:** https://github.com/isagoge-labs/leanwarp-sdk
- **MCP Registry name:** io.github.Isagoge-Labs/leanwarp
- **Categories:** developer tools, AI models and LLM tooling
- **Listing updated:** 2026-11-14

## About

LeanWarp runs Lean 4 and Mathlib for you, so an agent can work on a proof without a local Lean install. Workers stay warm between edits, and a draft check reuses Lean's work on the unchanged part of the file.

The loop is check, inspect, try tactics and verify. Verify asks Lean's kernel whether a declaration proves exactly the statement you give; proofs using `sorry`, `admit` or new axioms fail. For longer proofs, `holes` lists every `sorry` and `?_`, `suggest` finds a tactic that closes one without breaking anything else, and `sorry2lemma` moves each unfinished proof into its own named lemma. Batch commands check up to 64 files or inline proofs at once.

It installs from PyPI with `uv tool install leanwarp && leanwarp setup`, which adds the skill and MCP server to Claude Code, Codex and Cursor, then `leanwarp auth login` for an API key. Proof simplification, `have` extraction and batch repair are listed as coming soon. The product is in beta.

## Features

- **Warm draft checks:** Reuses Lean's work on unchanged parts of a file while you edit.
- **Try tactics:** Tests several tactics on one goal without editing the file.
- **Statement verification:** Kernel check that a proof proves exactly the stated theorem, rejecting sorry, admit and new axioms.
- **Hole tools:** Lists holes, suggests closing tactics and splits proofs into lemmas.
- **Batch checks:** Up to 64 files or inline proofs per operation.
- **CLI, MCP, Python, HTTP:** The same operations are available four ways.

## Good for

- Let an agent iterate on a Mathlib proof without installing Lean
- Confirm a finished proof matches the exact statement
- Split a long unfinished proof into named lemmas
- Verify many proof attempts in one batch

## Install

### Claude Code (Terminal)

```sh
claude mcp add leanwarp --env LEANWARP_API_KEY='<LEANWARP_API_KEY>' -- uvx leanwarp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "leanwarp": {
      "command": "uvx",
      "args": [
        "leanwarp"
      ],
      "env": {
        "LEANWARP_API_KEY": "<LEANWARP_API_KEY>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "leanwarp": {
      "command": "uvx",
      "args": [
        "leanwarp"
      ],
      "env": {
        "LEANWARP_API_KEY": "<LEANWARP_API_KEY>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "leanwarp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "leanwarp"
      ],
      "env": {
        "LEANWARP_API_KEY": "<LEANWARP_API_KEY>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "leanwarp": {
      "command": "uvx",
      "args": [
        "leanwarp"
      ],
      "env": {
        "LEANWARP_API_KEY": "<LEANWARP_API_KEY>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "leanwarp": {
      "command": "uvx",
      "args": [
        "leanwarp"
      ],
      "env": {
        "LEANWARP_API_KEY": "<LEANWARP_API_KEY>"
      }
    }
  }
}
```

## Tools

- `check`: Compile a file and return Lean's errors and warnings
- `inspect`: Show the goal and local context at a position
- `try-tactics`: Try several tactics on the same goal without editing the file
- `verify`: Check a declaration proves exactly the given statement
- `holes`: List every sorry and ?_ in a file
- `suggest`: Find a tactic that closes a hole
- `sorry2lemma`: Move unfinished proofs into named lemmas
- `declarations`: List declarations a file adds with types and dependencies

## FAQ

### Do I need Lean installed?

No. LeanWarp runs Lean and Mathlib for you.

### How do I sign in?

Run `leanwarp auth login` in your own terminal and paste the key from the dashboard; the README says never to paste it into an agent conversation.

### What does it cost?

New accounts get $10 of free credit during the launch offer; other pricing is on the website.

### Which systems does it run on?

Linux, macOS and WSL.

### Is LeanWarp free?

LeanWarp is a paid product with a free trial.

### How do I add LeanWarp to Claude Code?

Run this command in your terminal: claude mcp add leanwarp --env LEANWARP_API_KEY='<LEANWARP_API_KEY>' -- uvx leanwarp

### What are the best alternatives to LeanWarp?

The closest alternatives to LeanWarp are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/leanwarp
