axle-mcp

axle-mcp

Integrates the AXLE (Axiom Lean Engine) CLI with AI assistants to provide comprehensive tools for Lean 4 proof engineering. It enables users to validate, repair, and transform Lean theorems through a remote API without requiring a local Lean installation.

Category
Visit Server

README

axle-mcp

An MCP server that exposes the AXLE (Axiom Lean Engine) CLI as tools for AI assistants like Claude.

AXLE is a remote API for Lean 4 proof engineering — it can check, repair, simplify, extract, and transform Lean theorems without requiring a local Lean installation.

Tools

Tool Description
axle_environments List available Lean environments (versions + Mathlib)
axle_check Validate Lean code and report errors/warnings/info
axle_verify_proof Check that a candidate proof matches a formal statement
axle_extract_theorems Split a file into one-theorem-per-unit with rich metadata
axle_repair_proofs Auto-repair broken proofs (replaces sorry with working tactics)
axle_simplify_theorems Remove redundant tactics and clean up proof steps
axle_disprove Find counterexamples to false theorems via property-based testing
axle_theorem2sorry Replace proof bodies with sorry (create problem templates)
axle_have2sorry Replace have proofs with sorry (targeted exercises)
axle_sorry2lemma Lift sorry placeholders into standalone top-level lemmas
axle_have2lemma Lift have statements into standalone top-level lemmas
axle_theorem2lemma Convert between theorem and lemma keywords
axle_rename Rename declarations and update all references
axle_merge Combine multiple Lean snippets into one file
axle_normalize Standardize Lean file formatting

Requirements

  • Python 3.11+
  • mcp Python package (pip install mcp)
  • The axle CLI installed and accessible

Installation

1. Install dependencies

pip install mcp

2. Clone this repo

git clone https://github.com/Vilin97/axle-mcp
cd axle-mcp

3. Register with Claude Code

claude mcp add axle -s user \
  -e AXLE_BIN=/path/to/axle \
  -e AXLE_DEFAULT_ENVIRONMENT=lean-4.28.0 \
  -- python /path/to/axle-mcp/server.py

4. Register with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "axle": {
      "command": "python",
      "args": ["/path/to/axle-mcp/server.py"],
      "env": {
        "AXLE_BIN": "/path/to/axle",
        "AXLE_DEFAULT_ENVIRONMENT": "lean-4.28.0"
      }
    }
  }
}

Configuration

Environment variable Default Description
AXLE_BIN axle Path to the axle binary
AXLE_DEFAULT_ENVIRONMENT lean-4.28.0 Default Lean environment for all tools

Usage examples

Once registered, Claude can use these tools directly. Some examples of what you can ask:

  • "Check if this Lean theorem compiles"axle_check
  • "Repair the sorry'd proofs in this file"axle_repair_proofs
  • "Turn this proof into a problem set by replacing proofs with sorry"axle_theorem2sorry
  • "Does this theorem have a counterexample?"axle_disprove
  • "Extract each theorem into its own self-contained snippet"axle_extract_theorems
  • "Merge these two Lean files into one"axle_merge

Common parameters

Most tools accept these optional parameters:

  • environment — Lean environment to use (run axle_environments to list available ones)
  • names — comma-separated declaration names to process (default: all)
  • indices — comma-separated 0-based indices to process
  • timeout — max execution time in seconds (default: 120)
  • ignore_imports — ignore import mismatches between the code and the environment

How it works

Each MCP tool wraps the corresponding axle CLI command, passing Lean source code via stdin and returning the structured JSON response from the AXLE API. Tools that require multiple file arguments (verify-proof, merge) write temporary files automatically and clean them up after the call.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured