# lean-agentic [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/agenticsorg/lean-agentic  
**GitHub Stars:** 63  
**npm Downloads (last month):** 702  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/lean-agentic

## Description
High-performance WebAssembly theorem prover with dependent types, hash-consing (150x faster), Ed25519 proof signatures, MCP support for Claude Code, AgentDB vector search, episodic memory, and ReasoningBank learning. Formal verification with cryptographic

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "lean-agentic": {
    "command": "npx",
    "args": ["-y","lean-agentic"]
  }
}
```

## Documentation

## 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.

_Full upstream README: https://allmcps.com/mcp/lean-agentic/readme_

