quarry-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@quarry-mcpsearch the corpus for Poisson"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
quarry-mcp
An MCP (Model Context Protocol) server for querying a Lean 4 proof corpus registry.
Installation
pip install -e .Related MCP server: Atlas
Usage
Server
Run the MCP server over stdio:
quarry-mcp --db PATH/to/quarry-fixture.sqlite serveOr via Python module:
python -m quarry_mcp --db PATH/to/quarry-fixture.sqlite serveCLI Tool
One-shot tool invocation:
quarry-mcp --db PATH/to/quarry-fixture.sqlite call quarry.search '{"query": "Poisson"}'Tools
quarry.search— Full-text or hash searchquarry.get— Get declaration by IDquarry.closure— Compute dependency/dependent closurequarry.similar— Find similar declarationsquarry.stats— Get corpus statistics
License
MIT
Proof management web interface
The web workspace adds a browser UI over the same Quarry schema. It has no additional dependencies.
python3 -m quarry_mcp.web --db fixtures/quarry-fixture.sqlite --state ./quarry-workspace.sqlite --port 8791Open http://127.0.0.1:8791. To browse a remote registry, run the web app on
that machine and forward its loopback port over SSH:
ssh -N -L 8791:127.0.0.1:8791 user@remote-hostSearch real declarations by name or statement; filter by source package and declaration kind, with pagination.
Inspect full statements, source revision links, recorded axioms, module names, authorship, and direct dependencies/dependents (up to 100 in each direction). Missing external declarations are explicitly labelled.
Save declarations, maintain notes, and register local proofs with statement, source, module, and toolchain metadata.
Export a JSON selection manifest including pinned corpus IDs, source revisions encoded in IDs, toolchains, statement hashes, notes, and review blockers. This is not a Lake lockfile and does not install packages. Mixed Lean/Mathlib selections require porting and re-verification.
The corpus is opened with SQLite mode=ro; management data lives in the separate --state SQLite file. Back up that file to preserve registrations and notes. New registrations always remain unverified. “Recorded sorry-free” means only that the extractor recorded no sorryAx and no nonstandard axioms; the app does not run Lean, execute submitted source, audit transitive dependencies, or independently validate corpus-level verification claims. The importer currently attaches a Navier–Stokes comparator claim to Mathlib too, so the UI deliberately labels those as source-provided claims.
The server listens only on loopback and is intended for a private SSH workspace. It checks Host and requires a same-origin token on mutations. It is not a public multi-user service. Local drafts stay registered when removed from the selection; find them in Registrations and save them again at any time.
Run the integration tests (requires permission to bind a temporary localhost port):
python3 -m unittest tests.test_web -v
node --check quarry_mcp/static/app.jsThis server cannot be deployed
Maintenance
Related MCP Connectors
Ask a codebase what calls what: search, blast radius, paths between symbols, and diffs.
Ingest and search LogsLoom logs from coding agents.
Turn a GitHub repo or docs site into agent-ready context: pack it or search it, over MCP.
Resolve, search and verify legal citations against the official sources, with provenance.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables 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.23268,888 PyPI513MIT
- AlicenseNot gradedqualityAmaintenanceLocal-first MCP server for querying multi-repo engineering documentation artifacts from a SQLite corpus.7 npmAGPL 3.0
- AlicenseBqualityBmaintenanceProvides read-only hybrid RAG search and discovery over a local-first AI knowledge corpus, enabling semantic and keyword search, browse, digest, and status tools.4PolyForm Noncommercial 1.0.0
- AlicenseNot gradedqualityBmaintenanceEnables auditing formal libraries (Lean 4/Mathlib and Metamath) to trace axiom dependencies, find theorems resting on sorry or compiler trust, and analyze the impact of changes.106 PyPI2Apache 2.0