Lean Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Lean Mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
MCP server and client for Lean 4 + Mathlib formal theorem verification.
Exposes the Lean 4 compiler as an MCP tool (verify_lean_theorem) via stdio transport, allowing any MCP-compatible AI client (OpenCode, Claude Desktop, Cursor, etc.) to verify mathematical proofs.
lake build completed)pip install lean-mcpOr install from source:
git clone https://github.com/KrystianYCSilva/lean-mcp.git
cd lean-mcp
pip install -e .Run the MCP server (stdio transport):
LEAN_PROJECT_PATH=/path/to/your/lean4/project lean-mcp-serverimport asyncio
from lean_mcp.client import LeanMCPClient
async def main():
async with LeanMCPClient() as client:
await client.connect(lean_project_path="/path/to/lean4/project")
result = await client.verify(
"theorem modus_ponens (P Q : Prop) (hp : P) (hpq : P -> Q) : Q := hpq hp"
)
print(result) # [QED] Compilacao bem-sucedida. Nenhum erro. Prova completa.
asyncio.run(main())Add to your MCP client configuration:
{
"mcpServers": {
"lean-mcp": {
"command": "lean-mcp-server",
"env": {
"LEAN_PROJECT_PATH": "/absolute/path/to/lean4/project"
}
}
}
}verify_lean_theorem| Parameter | Type | Required | Description |
|---|---|---|---|
lean_code | string | yes | Lean 4 code to compile. If no import is present, import Mathlib is prepended automatically. |
timeout | int | no | Compilation timeout in seconds (default: 120). |
| Prefix | Meaning |
|---|---|
[QED] | Proof compiles successfully (returncode 0, no output). |
[FEEDBACK DO COMPILADOR] | Compilation error — includes compiler output for debugging. |
[ERRO_SISTEMA] | Infrastructure failure (timeout, lake not found, etc.). |
MCP Client (any)
|
| stdio (JSON-RPC)
v
lean_mcp/server.py Tool: verify_lean_theorem
|
| subprocess (lake env lean)
v
Lean 4 + Mathlib Formal verifier| Variable | Required | Description |
|---|---|---|
LEAN_PROJECT_PATH | yes | Absolute path to the Lean 4 project directory containing lakefile.toml. |
MIT
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.