Lean Agentic logo

Lean Agentic

MCP tools for dependent-type theorem construction, hash-consing benchmarks, and AgentDB theorem search and learning.

Install Lean Agentic

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "lean-agentic": {
      "command": "npx",
      "args": [
        "-y",
        "lean-agentic"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

npx -y lean-agentic

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

lean-agentic exposes theorem-proving and AgentDB operations through an MCP server launched with its npm CLI. Its ten tools create basic dependent-type terms, inspect arena allocation and equality performance, store theorems, search them semantically, and learn proof patterns. The package also provides MCP resources for runtime and database status plus prompts for theorem proving and pattern learning. Reach for lean-agentic when an agent needs theorem-oriented operations together with persistent, searchable proof history.

Use cases

  • Create basic dependent-type terms for an agent workflow
  • Benchmark hash-consed term equality and arena allocation
  • Store theorem statements and proofs for later retrieval
  • Search for semantically related theorems
  • Analyze successful proof strategies with learned patterns

Key features

  • Ten MCP tools for theorem construction and AgentDB operations
  • Lean4-style dependent type support
  • Hash-consed terms with arena statistics
  • Semantic theorem search with vector embeddings
  • Persistent JSON-backed theorem storage
  • ReasoningBank pattern learning and MCP prompts

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

14/14 checks healthy over the last 30d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 16d ago via OSV.dev · lean-agentic (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars63Stargazers on the source repository.
npm downloads702Package downloads in the last 30 days.
Last commit24d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.

How Lean Agentic works

What lean-agentic does

lean-agentic combines a Lean4-style dependent type system with an MCP interface for agent workflows. The npm package exposes ten MCP tools: five for constructing and inspecting theorem terms, and five for managing theorem data through AgentDB. It also includes three MCP resources and two prompts for exposing runtime state and guiding theorem-related interactions.

The core term model supports dependent types, universe polymorphism, bidirectional type checking, implicit arguments, inductive types, recursors, pattern matching, and proof-carrying code. The implementation uses hash-consed terms so identical terms can share an allocation and compare by identifier. The project describes this representation as reducing memory use and accelerating equality checks.

How it works

Install the npm package globally or run it through npx. Start the MCP process with npx lean-agentic mcp start, then register that command with an MCP client. Claude Code can add it with claude mcp add lean-agentic npx lean-agentic mcp start.

The core tools create an identity function or De Bruijn-indexed variable, run equality benchmarks, demonstrate hash-consing, and report arena allocation statistics. AgentDB tools initialize a database, persist theorem records containing fields such as type, statement, proof, and strategy, perform semantic searches, analyze learned proof patterns, and return database statistics.

AgentDB persistence uses a JSON database with automatic saving. The command-line interface also includes an interactive REPL, a demonstration command, benchmarks, and separate AgentDB commands for initialization, storage, search, learning, and statistics.

Tools and capabilities

The ten MCP tools are:

  • create_identity: creates the identity term λx:Type. x.
  • create_variable: creates a De Bruijn-indexed variable from a numeric index.
  • demonstrate_hash_consing: reports a hash-consing performance comparison.
  • benchmark_equality: produces timing data for term comparisons.
  • get_arena_stats: returns arena memory, allocation, and deduplication data.
  • agentdb_init: initializes AgentDB, optionally using a database path.
  • agentdb_store_theorem: stores a theorem and its vector embedding.
  • agentdb_search_theorems: finds similar theorems using a query and optional result limit.
  • agentdb_learn_patterns: returns learned patterns, confidence values, and success rates.
  • agentdb_get_stats: reports theorem counts, success rate, storage size, and theorem types.

The MCP resources are arena://stats, system://info, and agentdb://status. The available prompts are theorem_proving for theorem-proving guidance and pattern_learning for ReasoningBank learning strategies.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Lean Agentic

lean-agentic is an MCP server that connects AI clients to a Lean4-style dependent-type theorem system and AgentDB. Its main tools create identity and variable terms, benchmark hash-consed equality, inspect arena statistics, store and search theorems, learn proof patterns, and report database statistics.

Install it globally with `npm install -g lean-agentic` or run it with npx. Start the MCP process using `npx lean-agentic mcp start`.

Add it with `claude mcp add lean-agentic npx lean-agentic mcp start`. The server's theorem and AgentDB tools then become available for use in Claude Code.

Yes. Initialize AgentDB, store theorem records, and call `agentdb_search_theorems` with a query and optional limit. Results include similar theorems and similarity scores.

AgentDB stores theorem records with vector embeddings, supports semantic similarity search, and provides pattern learning through ReasoningBank. Its statistics tool reports counts, success rates, storage size, and theorem types.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewLean Agentic AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/lean-agentic?style=directory)](https://allmcps.com/mcp/lean-agentic)
HTML Embed
<a href="https://allmcps.com/mcp/lean-agentic"><img src="https://allmcps.com/api/badge/lean-agentic?style=directory" alt="Lean Agentic on AllMCPs" /></a>