# LeanWarp

The LeanWarp MCP server for Claude Code checks Lean 4 proofs and reports errors, warnings, and proof goals. An agent can call it while working on formal proofs in a Lean project.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 7 repo stars
- Author: Isagoge-Labs
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Isagoge-Labs/LeanWarp-SDK
- Updated: 2026-11-16
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/mcp/leanwarp

## What it does

LeanWarp checks Lean files and uses Lean's kernel to test whether a declaration proves a supplied statement. It can also show goals and local context at a proof position, test tactics, and locate `sorry` and `?_` holes. Batch operations cover files and inline proofs.

Lean and Mathlib run on hosted workers, so a local Lean installation is not required. Only `.lean` files are uploaded; libraries come from an environment with pinned versions. The service requires a LeanWarp API key and `uvx`. Create the key through the dashboard, and keep it out of agent conversations.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `LEANWARP_API_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env LEANWARP_API_KEY=<LEANWARP_API_KEY> --transport stdio leanwarp -- uvx leanwarp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from leanwarp <command>

### Codex

**Platform CLI**
```bash
codex mcp add leanwarp --env LEANWARP_API_KEY=<LEANWARP_API_KEY> -- uvx leanwarp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from leanwarp <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "leanwarp": {
            "command": "uvx",
            "args": [
                "leanwarp"
            ],
            "env": {
                "LEANWARP_API_KEY": "<LEANWARP_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from leanwarp <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "leanwarp": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "leanwarp"
            ],
            "env": {
                "LEANWARP_API_KEY": "<LEANWARP_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from leanwarp <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e LEANWARP_API_KEY=<LEANWARP_API_KEY> leanwarp uvx leanwarp
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from leanwarp <command>

## When to use it
- check a Lean file for errors and warnings
- inspect proof goals and local context
- verify a declaration against a target statement
- locate `sorry` and `?_` holes
- test several tactics against one captured goal

## Example prompts
- Check `Proofs.lean` and report Lean errors.
- Show the goals and local context at line 12 in `Proofs.lean`.
- Verify that `add_zero_example` proves `∀ n : Nat, n + 0 = n`.

## Similar
- [writing-lean-proofs](https://affpapa.org/en/nevibecode/skills/writing-lean-proofs.md) — skill · 1800 installs
- [natural-transformations](https://affpapa.org/en/nevibecode/skills/natural-transformations.md) — skill · ★ 3951 repo stars
- [loogle-search](https://affpapa.org/en/nevibecode/skills/loogle-search.md) — skill · 489 installs
- [lean-formalize](https://affpapa.org/en/nevibecode/skills/lean-formalize.md) — skill · 103 installs
- [create-formal-verification-skill](https://affpapa.org/en/nevibecode/skills/create-formal-verification-skill.md) — skill · 6200 installs
- [check_lean-and-lean-tools](https://affpapa.org/en/nevibecode/skills/check-lean-and-lean-tools.md) — skill · ★ 171 repo stars

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
