Skip to main content
Glama

lean-mcp

MCP connector for the Lean theorem prover.

Tool

What it does

lean_check

Checks a project, a file or one declaration against the pinned toolchain. Returns a proof receipt: checker_id, toolchain_version, declaration, artifact_digest, axioms, has_sorry, verdict. A sorry fails the receipt. Axioms come from #print axioms.

lean_extract

Lists the declarations (theorem, definition, structure, inductive, instance), their dependency edges and the module imports of a project, read by Lean itself.

Settings

Variable

Meaning

LEAN_WORKSPACE_ROOT

Required. Every project path must resolve inside it.

LEAN_TIMEOUT_S

Per-call time limit in seconds. Default 600.

LAKE_BIN

The lake executable. Default lake.

LEAN_TOOLCHAIN

Optional pinned Lean version. Default: the project's lean-toolchain file.

Install the Lean toolchain with elan on the host that runs the connector. Project code runs only inside the bounded subprocess.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      A
      maintenance
      Enables LLM agents to interact with the Lean theorem prover through the Language Server Protocol, providing tools for analyzing Lean projects, accessing diagnostics, goal states, documentation, and searching for theorems using both local and external search services.
      22
      81,428 PyPI
      559
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables querying a Lean 4 proof corpus registry using tools for full-text/hash search, declaration lookup, dependency closure, similarity, and corpus statistics.
      MIT