MCP server bridging AI agents with the Isabelle proof assistant via its LSP/PIDE interface
Project description
Isabelle-MCP
MCP server that lets AI agents (Claude Code, Codex, …) drive the Isabelle theorem prover through its LSP/PIDE commands — fully autonomously, with no human in the loop.
Purpose
This MCP server exists so that Claude / Codex can issue Isabelle LSP commands
without any human mediation. The entire Isabelle process is encapsulated
behind the MCP tools — it exposes no UI to the user. The agent works by
editing .thy/.ML files on disk and calling the tools to evaluate them and
query proof states; nobody watches or steers the prover interactively.
This server is not designed for human–AI collaboration (there is no jEdit/VSCode front-end in the picture). It implements a single AI ↔ Isabelle, no-human-in-the-loop model.
⚠️ One agent per server instance. This server holds a single Isabelle session with global mutable state — one set of open documents, one caret/perspective, and one evaluation in flight at a time. It is single-threaded and not concurrency-safe: pointing multiple agents at one instance, or interleaving concurrent requests, corrupts the evaluation/caret/ document state with catastrophic, hard-to-debug results. The server runs over stdio, so each agent already gets its own dedicated server process (and its own
isabelle mcp_server) — just don't share one or drive it concurrently.
[!IMPORTANT] No Isabelle patch is needed. Earlier versions required one: the server drove the stock
isabelle vscode_server, which lacks the PIDE requests it needs, so the distribution had to be patched. It no longer does. Isabelle-MCP now ships its own Isabelle Scala component —isabelle mcp_server— and registers it with your Isabelle the first time you launch a session. Nothing is compiled on your machine (the component carries a prebuilt jar and declaresno_build = true), sosite-packagesmay even be read-only, and no session heap is invalidated.Requirements: Isabelle2025-2, with
isabelleonPATH(or pinned withisabelle-mcp install --isabelle-bin /path/to/Isabelle/bin/isabelle). Isabelle2024 is no longer supported — see thelast-isabelle2024-supporttag.To undo the registration:
isabelle-mcp uninstall. If you remove the package without it, Isabelle will print### Missing Isabelle component: …on every command until you runisabelle components -x <the path it names>— harmless, but noisy.
Quick Start
pip install isabelle-mcp # or: uv tool install isabelle-mcp
# register into Claude Code / Codex (auto-detects whichever is installed):
isabelle-mcp install
For Claude Desktop, register manually instead
(~/.config/claude/claude_desktop_config.json):
{
"mcpServers": {
"isabelle": {
"command": "isabelle-mcp"
}
}
}
Tools
| Tool | Description |
|---|---|
isabelle_launch |
Start (or restart) the prover with the session/logic that fits the work (bare Main is only a minimal fallback); call this first |
isabelle_terminate |
Terminate the running prover (the MCP server stays up; you can relaunch) |
isabelle_evaluate_to |
Evaluate the theory up to a line; returns a per-file snapshot of errors / warnings / running command lines |
isabelle_evaluation_status |
Poll progress of a running evaluation (same snapshot) |
isabelle_cancel_evaluation |
Cancel a running evaluation |
isabelle_hover |
Type info and documentation at position |
isabelle_definition |
Jump to symbol definition |
isabelle_local_occurrences |
In-file occurrences (definition + uses) of a local entity |
isabelle_goal |
Proof goals — omit after_text for before/after diff |
isabelle_find_theorems |
Search the theorem database in the context at a position (Isabelle's find_theorems): by name, pattern, intro/elim/dest, solves, simp |
isabelle_command_output |
Prover output messages |
isabelle_session_info |
Current session info |
All positions are 1-indexed. File paths must be absolute.
PIDE tools (goal, command_output) are best-effort wrappers around async PIDE notifications and may time out.
Development
pip install -e ".[dev]" # editable install from a checkout
pytest # unit tests
pytest -m integration # requires running Isabelle
python -m mypy src/ # type checking
Architecture
server.py FastMCP entry point — tool registration, lifespan
lsp_client.py JSON-RPC 2.0 client for isabelle mcp_server
tools/ Tool implementations (one file per tool)
utils/ Position conversion, URI handling, HTML parsing
models.py Pydantic output models
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file isabelle_mcp-0.3.1.tar.gz.
File metadata
- Download URL: isabelle_mcp-0.3.1.tar.gz
- Upload date:
- Size: 617.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15e337dcabf3425ed66a2752b9403cddff5f4b27ad0d76b7ec3999381e14d12e
|
|
| MD5 |
4b11bbc94515abc17705c25fbcaf1556
|
|
| BLAKE2b-256 |
ec526b32afffcb675374a0b2a695c803af9ef0e556a9aa66762158b209837d70
|
Provenance
The following attestation bundles were made for isabelle_mcp-0.3.1.tar.gz:
Publisher:
ci.yml on xqyww123/Isabelle-MCP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
isabelle_mcp-0.3.1.tar.gz -
Subject digest:
15e337dcabf3425ed66a2752b9403cddff5f4b27ad0d76b7ec3999381e14d12e - Sigstore transparency entry: 2216601657
- Sigstore integration time:
-
Permalink:
xqyww123/Isabelle-MCP@0b4d7dd25203cc56f189ff7f5d6d5b1ab768e559 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/xqyww123
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@0b4d7dd25203cc56f189ff7f5d6d5b1ab768e559 -
Trigger Event:
push
-
Statement type:
File details
Details for the file isabelle_mcp-0.3.1-py3-none-any.whl.
File metadata
- Download URL: isabelle_mcp-0.3.1-py3-none-any.whl
- Upload date:
- Size: 592.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd3ea409237545b8951a0d822fc9d46ec0212ef013a1f2721d9492f8e17e72b6
|
|
| MD5 |
9e7058363b1329de95ce8c116e1a8d96
|
|
| BLAKE2b-256 |
047ae188ea7985d0915ea1bebfae42166162b49f3103f7d082d4db9bee1c0d19
|
Provenance
The following attestation bundles were made for isabelle_mcp-0.3.1-py3-none-any.whl:
Publisher:
ci.yml on xqyww123/Isabelle-MCP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
isabelle_mcp-0.3.1-py3-none-any.whl -
Subject digest:
bd3ea409237545b8951a0d822fc9d46ec0212ef013a1f2721d9492f8e17e72b6 - Sigstore transparency entry: 2216601687
- Sigstore integration time:
-
Permalink:
xqyww123/Isabelle-MCP@0b4d7dd25203cc56f189ff7f5d6d5b1ab768e559 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/xqyww123
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@0b4d7dd25203cc56f189ff7f5d6d5b1ab768e559 -
Trigger Event:
push
-
Statement type: