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
访问服务器

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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选