Lean Directory
Provides tools and API access for Lean formal-verification resources on Solana, including live mint checks via RPC, program attestation and badge status, and transaction firewall checks for Solana transactions.
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
Lean Directory
The permissionless API for Lean on Solana. Lean Directory lists Lean 4 formal-verification tools for Solana and serves them as JSON at lean.directory. Seven core libraries live in this repository and are built and kernel-checked on every commit. Other Lean projects for Solana are indexed from GitHub. The same API runs live checks on mints, deployed programs and unsigned transactions, and an MCP server exposes all of it to agents.
No API key, no sign-up. Anyone can add a tool with a pull request: see Add a tool.
Lean Directory is independent and not affiliated with the Lean FRO or the Solana Foundation.
Quick start
# Find a library
curl "https://lean.directory/v1/tools?q=vault"
# Read its kernel check: build result, theorem count, axioms, sorry count, source hashes
curl https://lean.directory/v1/tools/vault-specs/verify
# Scaffold a Lean 4 project pinned to the checked libraries, then build it
npx lean-solana init full
cd leansvm-full && lake buildlake build needs Lean 4 through elan. The project pins its own toolchain.
Related MCP server: Lockstep
Tools
Tool | Where | What it checks | What it does not check |
|
| That your plain-Rust logic functions refine a Lean Directory spec (six VaultSpecs, two ShareMath and three AmmMath constant-product obligations). Charon and Aeneas translate the crate and the Lean kernel checks one refinement theorem per obligation | Anchor glue, Borsh decoding, CPI, the sBPF compiler. Charon, Aeneas and the Lean kernel are trusted. The Aeneas Lean library needs Mathlib; the core libraries do not |
Program badge |
| OtterSec verified-build status, the live ProgramData hash and upgrade authority, and whether a CI-reproduced attestation matches the deployed bytecode | The link from source to proof is checked by CI, not proven. A self-attested or unbound record never shows green |
Transaction firewall |
| Decodes a legacy or v0 transaction and checks its top-level instructions against a policy. The policy evaluator's rules are proven in | CPI inner instructions. Signer balance, |
Live mint check |
| SPL Token and Token-2022 mint facts, extension and fee-config flags, computed by a JS mirror of MintProof from the RPC node's answer | The live answer is not kernel-checked unless you compile the |
Share and AMM maths |
| Vault share rounding and the first-depositor bound; constant-product and CLMM rounding pinned to Raydium sources at recorded commits | That a deployed program uses these formulas |
MCP server |
| Eight tools over the registry and the three live checks above, each description ending with its trust limit | Same limits as the tools it calls |
There are 0 attested programs today. registry/programs.index.json lists every submitted program: an entry with a CI record has ciReproduced: true, and a submission CI has not reproduced (record: null) is listed with ciReproduced: false and never raises a status. Only ciReproduced: true entries count toward stats.attestedPrograms. To submit one, see registry/CONTRIBUTING-PROGRAM.md.
API (CORS-open)
Base URL https://lean.directory. Defined in apps/workbench/src/worker.mjs.
Endpoint | Returns |
| Registry discovery: |
| All tools. Filter with |
| One tool: manifest, |
| The tool's |
| Starter repo as a |
| Release changes between two versions, a |
| Submission schema plus the acceptance rules ( |
| Live mint facts, |
| Submitted program attestations, each with |
| Program status, verified-build evidence, upgrade authority and attestation binding |
| Status badge naming the proven scope and whether the program is upgradeable |
| Whether each live dependency passed the external monitor's last check, and when. A check that has not run recently is |
| Firewall verdict |
| MCP Streamable HTTP (stateless). |
The site also serves GET /api/health, GET /api/packages, the legacy GET /api/inspect?mint= (same handler as /v1/mint) and four POST /api/* demo routes. Request bodies are capped as they stream: 64 KB for API routes and 128 KB for /mcp. See docs/CONTRACTS.md.
Counts (tools, theorems, Lean files, attested programs) are computed by scripts/build-registry.mjs. Read them from GET /v1 (stats) or registry/index.json.
CLI
The CLI is lean-solana (packages/cli). It carries a copy of the registry, so the registry commands work offline.
npx lean-solana init svm-model --dir ./my-svm-proof # scaffold a starter (template defaults to full)
npx lean-solana list # every tool (flags: --tier, --category, --json)
npx lean-solana verify borsh-lean # a tool's kernel check
npx lean-solana diff vault-specs --from 0.1.0 --to 0.2.0
npx lean-solana mint <mint-address> # live mint facts over RPC (--rpc <url> overrides the public endpoint)
npx lean-solana program <programId> # program status (SOLANA_RPC_URL overrides the public endpoint)
npx lean-solana firewall <base64-tx> # top-level instruction check, no network
npx lean-solana prove ./crate --spec share-math # refinement check (needs the prove toolchain: prove doctor, prove setup)
npx -y lean-solana mcp # MCP over stdioinit also takes --name, --force, --json and --api https://lean.directory (fetch the starter from the live API instead of the bundled registry).
From a checkout, run the same commands with node packages/cli/bin/leansvm.mjs. node packages/cli/pack.mjs builds the npm package into packages/cli/npm/; a test packs it, extracts it outside the repo and runs each subcommand from there.
Core packages (tier: "core")
Each library has a lean-toolchain pinned to leanprover/lean4:v4.36.0, no Mathlib dependency, and passes the repo's sorry and custom axiom scan. npm run build:registry runs lake build and #print axioms on every public theorem and records the result in registry/index.json. The build fails if any theorem uses an axiom other than Classical.choice, Quot.sound and propext, so native_decide is not accepted.
Package | Lean files | Theorems | Tests | Purpose |
3 | 19 | 17 | Account model, rent formula ( | |
3 | 25 | 16 | Borsh little-endian | |
6 | 37 | 59 | SPL Mint (82 bytes), Token-2022 TLV extensions and transfer-fee schedules, pump.fun bonding curve and | |
6 | 28 | 20 | TokenVault, FeeSplitter, Escrow, TimeLockVault, multi-step traces, Anchor | |
8 | 46 | 64 | MoneyMath, Slippage, Lease, Transaction, Reconciliation, WireFormat and Firewall proofs, static JS/TS money-bug scanner, transaction firewall | |
5 | 17 | 26 | Virtual-offset vault share maths, reference | |
5 | 25 | 25 | Constant-product and CLMM maths pinned to Raydium CP-Swap and CLMM | |
none | none | 43 |
| |
none | none | 44 | MCP tool table, HTTP and stdio transports | |
none | none | 9 | The CLI and its npm pack | |
none | none | 122 | Cloudflare Worker (API, |
Lean file and theorem totals for the seven libraries: 36 files, 197 theorems. Lean counts come from scripts/build-registry.mjs; test counts come from node --test in each package during npm test. The mint-proof total includes 1 live mainnet test and the prove total includes 15 live pipeline tests; they are skipped unless MINT_PROOF_LIVE=1 or LEANSVM_PROVE_LIVE=1 is set. scripts/test/registry.test.mjs adds 11 registry tests.
Ecosystem index (tier: "ecosystem")
External GitHub projects listed in registry/ecosystem.json with verification.status: "indexed-external". They are not built or audited here. Details in docs/ECOSYSTEM-TOOLS.md, live list at /v1/tools?tier=ecosystem.
Solana runtime and clients:
solana-foundation/leanprover-solanalib,QEDGen/qedsvm,MidTermDev/lean-Solana-client,dennj/solana-leanRust-to-Lean pipelines:
AeneasVerif/aeneas,AeneasVerif/charon,Certora/lusterna,QEDGen/solana-skillsCryptography and ZK:
Beneficial-AI-Foundation/curve25519-dalek-lean-verify,Verified-zkEVM/VCVio,reilabs/proven-zk
Add a tool
Lean Directory is permissionless: tools are added by pull request, and CI checks every one.
Ecosystem listing: your Lean project stays in your own repository. Add one entry to
registry/ecosystem.json. About 10 minutes.Core library: the library lives in
packages/<slug>and every public theorem is kernel-checked on every build.Program attestation: submit inputs in
registry/programs/<programId>.json; CI builds the program, rerunsproveand writes the result. Seeregistry/CONTRIBUTING-PROGRAM.md.
The full guide, with a template entry, the acceptance rules and the review steps, is in registry/CONTRIBUTING-TOOL.md. To suggest a tool without writing the entry, open an issue.
Run locally
Requires Node 20.11+ (CI uses Node 24) and Lean 4 through elan; each package pins its toolchain.
npm test # sorry/axiom scan, lake build per library, vault mutation check, node --test per package
npm run build:registry # rebuilds registry/index.* and programs.index.*; runs lake build
npm run check:registry # fails if the committed registry differs from a fresh build (CI runs this)
node apps/workbench/scripts/dev-server.mjs # http://127.0.0.1:4321 (PORT env overrides)Documentation
License
MIT, see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Solana SPL/Token-2022 rug forensics and deterministic Solana payment receipt verification MCP.
Search verified Lean theorems, retrieve proofs and dependencies, and submit new results for review.
70 non-custodial MCP tools: $0-gas Solana & Lean 4 + nanoda proof bounties, A2A inbox & games.
Solscan MCP — Solana block-explorer + network analytics
Related MCP Servers
- AlicenseBqualityDmaintenanceMCP server for agentic interaction with the Lean theorem prover via LSP, providing tools for understanding, analyzing, and interacting with Lean projects.2123MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents and people to coordinate Lean 4 formalization work by exposing the harness over MCP: derive open/claimed/closed theorem nodes from the compiled environment, lock approved statements, record claims and logs, and run memory-capped build, proof-check, and audit jobs.MIT

LeanWarpofficial
AlicenseNot gradedqualityBmaintenanceEnables MCP clients such as Claude Code, Codex and Cursor to check and verify Lean 4 proofs, inspect goals at a position, try tactics, list holes, and extract declarations against hosted Lean releases with pinned libraries. Edits are checked on warm remote workers that reuse Lean's work between calls, so agents can iterate on proofs against their intended statements.7MIT- AlicenseNot gradedqualityBmaintenanceEnables MCP-compatible agents to inspect and search the archived Lean 4 corpus, verify Honest Ledger claims, read or author MDX papers and journal chapters with validation and dry-run previews, audit links/KaTeX/JSON shards, and trigger static builds over stdio or Streamable HTTP.MIT