Aristotle MCP Server
Click on "Install 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., "@Aristotle MCP ServerFill in the proof fortheorem mul_comm (a b : ℕ) : a * b = b * a := by"
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.
Aristotle MCP Server
Note: This project was 100% vibe-coded with Claude Code.
An MCP (Model Context Protocol) server that wraps Aristotle, Harmonic's automated theorem prover for Lean 4. This enables AI assistants to strategically invoke theorem proving during Lean development—filling in sorry statements, verifying lemmas, or formalizing natural language into Lean code.
What is Aristotle?
Aristotle is a cloud-based theorem proving service by Harmonic that can automatically fill in proofs in Lean 4. Given Lean code with sorry placeholders, Aristotle attempts to find valid proofs using advanced search techniques.
To use this MCP server, you'll need an API key from aristotle.harmonic.fun.
Related MCP server: math-logic-mcp
Tools Provided
Tool | Description |
| Fill in |
| Prove all sorries in a Lean file with automatic import resolution |
| Convert natural language math to Lean 4 code |
| Poll async proof jobs for completion |
| Poll async file proof jobs for completion |
| Poll async formalization jobs for completion |
Installation
Prerequisites
Install uv (the fast Python package manager):
# macOS
brew install uv
# Or via shell script (macOS/Linux)
curl -LsSf https://astral.sh/uv/install.sh | shGet Your API Key
Sign up at aristotle.harmonic.fun
Copy your API key
Add it to your shell configuration (
~/.zshrcor~/.bashrc):
export ARISTOTLE_API_KEY="your-api-key-here"Then restart your terminal or run source ~/.zshrc.
Adding to Claude Code
Option 1: Command Line (Recommended)
claude mcp add aristotle -e ARISTOTLE_API_KEY=$ARISTOTLE_API_KEY -- uvx --from git+https://github.com/septract/lean-aristotle-mcp aristotle-mcpThis registers the server with your API key from the environment. Use --scope user to make it available across all projects:
claude mcp add aristotle --scope user -e ARISTOTLE_API_KEY=$ARISTOTLE_API_KEY -- uvx --from git+https://github.com/septract/lean-aristotle-mcp aristotle-mcpOption 2: JSON Configuration
Add to your ~/.claude.json:
{
"mcpServers": {
"aristotle": {
"type": "stdio",
"command": "uvx",
"args": ["--from", "git+https://github.com/septract/lean-aristotle-mcp", "aristotle-mcp"],
"env": {
"ARISTOTLE_API_KEY": "${ARISTOTLE_API_KEY}"
}
}
}
}The ${ARISTOTLE_API_KEY} syntax expands to your shell environment variable.
Verify Installation
claude mcp list # Check server is registered
claude mcp get aristotle # Test the connectionOr inside Claude Code, run /mcp to see connection status.
Adding to Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"aristotle": {
"command": "uvx",
"args": ["--from", "git+https://github.com/septract/lean-aristotle-mcp", "aristotle-mcp"],
"env": {
"ARISTOTLE_API_KEY": "your-api-key-here"
}
}
}
}Note: Claude Desktop doesn't expand environment variables, so you must include your actual API key.
Mock Mode (Testing Without API Key)
To test the MCP server without making real API calls:
claude mcp add aristotle-mock -e ARISTOTLE_MOCK=true -- uvx --from git+https://github.com/septract/lean-aristotle-mcp aristotle-mcpOr set in your configuration:
{
"env": {
"ARISTOTLE_MOCK": "true"
}
}Usage Notes
Proofs take time: Aristotle proofs can take anywhere from a few minutes to several hours depending on complexity. Simple proofs may complete in 1-5 minutes, but complex proofs can take significantly longer. The tools support async mode (
wait=False) for non-blocking operation—this is strongly recommended for anything non-trivial.Lean 4 only: Aristotle works with Lean 4, not Lean 3 or earlier versions.
Mathlib support: File-based proving automatically resolves Lake dependencies including Mathlib.
Async Workflow
All proving tools support synchronous (wait=True, default) and asynchronous (wait=False) modes.
Synchronous Mode (Simple)
prove(code, wait=True) → Returns filled proof when complete
prove_file(file, wait=True) → Writes solution file when complete
formalize(desc, wait=True) → Returns Lean code when completeAsynchronous Mode (Non-blocking)
Use async mode for long-running proofs to avoid blocking:
1. Submit: prove_file(file, wait=False) → Returns project_id
2. Poll: check_prove_file(project_id) → Returns status (save=False by default)
3. Save: check_prove_file(project_id, output_path="out.lean", save=True)Key points:
check_prove_filedefaults tosave=False— it only checks status without writing filesTo save the result, call with
save=TrueIf
output_pathis omitted, uses the path from the originalprove_filecall (stored for 30 days)You can override
output_pathto save to a different locationcheck_proofandcheck_formalizereturn the code directly in the response (nosaveparameter needed)
Context Files
proveacceptscontext_files(a list) — multiple Lean files can provide importsformalizeacceptscontext_file(singular) — only one context file supported
This difference reflects the underlying aristotlelib API.
Local Development
Clone the repository and install in editable mode:
git clone https://github.com/septract/lean-aristotle-mcp.git
cd lean-aristotle-mcp
make venv
source .venv/bin/activate
make install-dev # Includes dev dependenciesRun the development server:
make run # Uses real API
make run-mock # Uses mock responsesThe project uses a Makefile for common tasks. Run make help for all options.
make check # Run lint + type-check
make test # Run mock tests (no API key needed)
make test-api # Run live API tests (requires ARISTOTLE_API_KEY)
make verify # Full verification suiteTroubleshooting
"spawn uvx ENOENT" error
This means uv isn't in Claude's PATH. On macOS, GUI applications don't always inherit your shell PATH. Solutions:
Restart Claude after installing uv
Use full path: Replace
uvxwith the full path (e.g.,/opt/homebrew/bin/uvx)Check installation: Run
which uvxin terminal to verify uv is installed
"ARISTOTLE_API_KEY not set" error
Make sure you've:
Added
export ARISTOTLE_API_KEY="..."to your shell configRestarted your terminal
Included
-e ARISTOTLE_API_KEY=$ARISTOTLE_API_KEYwhen adding the server
License
MIT - see LICENSE for details.
Links
Aristotle API - Get your API key
Harmonic - Company behind Aristotle
aristotlelib on PyPI - Python client library
Model Context Protocol - MCP specification
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/septract/lean-aristotle-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server