Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/sandraschi/leanforge-mcp/agents-mdgit clone --depth 1 https://github.com/sandraschi/leanforge-mcpWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01078 | $0.01078 |
| Opus 5 | $0.00539 | $0.00539 |
| Sonnet 5 | $0.00216 | $0.00216 |
| Haiku 4.5 | $0.00108 | $0.00108 |
Grade A, and why
leanforge-mcp AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 110 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md -- leanforge-mcp
Agent protocols for Cursor, Windsurf, Claude Code, and any agentic IDE working in this repo.
Stack
- Language: Python 3.11+, FastMCP >= 3.2.0
- Package manager: uv
- Lean: Lean 4 via elan, Mathlib4
- Config: TOML via
tomllib(stdlib, Python 3.11+) - Persistence: SQLite via
aiosqlite - Linting: Ruff (formatter + linter)
- Tests: pytest + pytest-asyncio
Repo layout
leanforge-mcp\
├── src\
│ ├── core\
│ │ ├── agent.py # Subagent loop: LLM propose → Lean compile → repeat
│ │ ├── config.py # TOML config loader + dataclasses
│ │ ├── job_manager.py # SQLite job queue, status tracking
│ │ ├── lean_client.py # Lean 4 subprocess wrapper
│ │ └── llm_client.py # Multi-tier LLM client (Ollama / OpenAI-compat / Anthropic)
│ ├── tools\
│ │ ├── submit.py # submit_theorem, submit_lean_file
│ │ ├── status.py # get_proof_status, list_attempts, list_jobs, validate_lean
│ │ ├── control.py # cancel_job
│ │ └── mathlib.py # get_mathlib_search
│ ├── lean\
│ │ └── templates\ # .lean file templates for common theorem shapes
│ └── server.py # FastMCP server entry point + main()
├── tests\
│ └── test_pipeline.py # End-to-end pipeline tests
├── docs\
│ ├── ARCHITECTURE.md
│ ├── LEAN_PRIMER.md
│ └── BENCHMARK_RESULTS.md
├── data\ # SQLite DB lives here (gitignored)
├── logs\ # Log files (gitignored)
├── workspace\ # Temp Lean files per job (gitignored)
├── config.example.toml
├── config.toml # Local config (gitignored)
├── pyproject.toml
├── start.ps1
├── glama.json
├── llms.txt
├── AGENTS.md
├── CLAUDE.md
└── README.md
Critical rules
Lean subprocess
lean_client.pyshells out viaasyncio.create_subprocess_exec-- nevershell=True- Lean path must come from config; never hardcode
- Capture both stdout and stderr; Lean emits errors to stderr
- Timeout every compile call (default 30s); Lean can hang on malformed input
lean --stdinis faster thanlake buildfor single-theorem proofs -- use it
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 110 lines · 1,078 tokens per session scan A 4186cb9cc31c
leanforge-mcp AGENTS.md is an instructions file published in the GitHub repository sandraschi/leanforge-mcp (0 stars, last pushed yesterday), licensed MIT. It adds 1,078 tokens to every session, about $0.0054 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
formal CLAUDE.md
Instructions for yamafaktory/formal, covering formal, rust, the files that judge changes, hints and lean.
VCVio AGENTS.md
Instructions for Verified-zkEVM/VCVio, covering vcvio — ai agent guide, fast start, attribution, headers, and docstrings, module scopes and what this project is.
lean-interact CLAUDE.md
Instructions for nasqret/lean-interact, covering claude.md — operating instructions for this repository, 0. start of every session, 1. the formalization loop, turn length, and deferred bookkeeping and when the proof is the interesting part.
verified-polygon-intersection CLAUDE.md
Instructions for schildep/verified-polygon-intersection, covering guideline on placement of definitions/theorems, network access and bash commands.
LeanProbe AGENTS.md
Instructions for epfl-lara/LeanProbe, covering agents.md, working on this repo and the bundled skill.
VCVio CLAUDE.md
Instructions for Verified-zkEVM/VCVio, a project described as: A Lean library for machine-checked cryptographic proofs.