AtpMcp

io.github.jcschuster由 GitHub 账号 jcschuster 发布v0.8.1更新于 Oct 29, 2026

Theorem provers for agents: SystemOnTPTP, StarExec, Isabelle and local ATPs, with SZS verdicts.

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

AI 生成的概览

把 SystemOnTPTP、StarExec、Isabelle 和本地证明器四个后端暴露为工具,让助手提交 TPTP 问题并读取 SZS 判定结果。

可以做什么
  • 列出并探测各后端,向任一后端提交 TPTP 问题并取得 SZS 判定
  • 列出 SystemOnTPTP 上的证明器,运行单个证明器,或在同一问题上并行比较多个
  • 把手写的 Isabelle/HOL 理论提交到已配置的 Isabelle 服务器
  • 对 TPTP 问题做语法与类型检查,可本地执行也可经 TPTP4X
  • 查询 SZS 本体词汇表,解释判定结果的含义
适用场景
适合需要机器验证推理的场景:证明或反驳 TPTP 问题、比较不同证明器、检查 Isabelle 理论,或用远程服务复核本地证明器的结果。
运行要求
以 stdio 在本地运行,且只支持 MCP 修订版 2026-07-28,需要 initialize 握手的旧客户端会被拒绝。最简便的方式是 Docker 镜像(内含 Erlang 与 E 证明器);也可安装 Elixir escript,需要 Elixir 1.20/OTP 29,并在 PATH 中提供 eprover 或 isabelle。可选配置文件 atp_mcp.exs;StarExec 需要 base_url、用户名和密码;Isabelle 需要数 GB 内存。
安装前请注意
StarExec 凭据(STAREXEC_USER、STAREXEC_PASS)和 Isabelle 密码来自配置或环境变量,README 建议把密钥放在环境变量而非配置文件里。问题文本会发送给第三方服务(tptp.org、你的 StarExec 实例、远程 Isabelle 服务器)。Isabelle 理论会被写入配置的共享目录。取消 SystemOnTPTP 调用不会停止远端证明器。

安装

在 SourceWeft 中

  1. 打开 控制台中的 AtpMcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

AtpMcp

[DOI]

[AtpMcp]

An MCP server that exposes AtpClient's four theorem-prover backends — SystemOnTPTP, StarExec, Isabelle, and LocalExec — as tools for Claude Code and other MCP hosts.

Speaks MCP revision 2026-07-28 over stdio (JSON-RPC 2.0), and only that revision: clients that need the initialize handshake (2025-11-25 and earlier) are rejected.

Quick start with Docker

The image bundles the server, Erlang, and the E prover, so the only prerequisite is Docker. Add the server to your project's .mcp.json:

json
{  "mcpServers": {    "atp": {      "command": "docker",      "args": ["run", "-i", "--rm", "ghcr.io/jcschuster/atp_mcp:latest"]    }  }}

That gives you SystemOnTPTP (every prover on tptp.org) and a local E (query_backend with backend: "local_exec") with no configuration.

For Isabelle as well, use the latest-isabelle tag (amd64, a few GB; the container needs a few GB of RAM for the HOL session). The server starts Isabelle itself on the first Isabelle call, which takes up to a minute; later calls in the same session reuse it.

To configure the server, mount your project at /work, where it looks for atp_mcp.exs, and forward the environment variables the file reads:

json
{  "mcpServers": {    "atp": {      "command": "docker",      "args": [        "run",        "-i",        "--rm",        "-v",        "${PWD}:/work:ro",        "-e",        "STAREXEC_USER",        "-e",        "STAREXEC_PASS",        "ghcr.io/jcschuster/atp_mcp:latest"      ],      "env": { "STAREXEC_USER": "me", "STAREXEC_PASS": "…" }    }  }}

For Claude Code, also approve the server in .claude/settings.json:

json
{  "enabledMcpjsonServers": ["atp"]}

To build the images yourself:

bash
docker build -t atp_mcp .                             # SystemOnTPTP + Edocker build -t atp_mcp:isabelle --target isabelle .  # + Isabelle/HOL

Installing the escript

Without Docker, install the escript (Elixir 1.20 / OTP 29):

bash
mix escript.install hex atp_mcpexport PATH="$HOME/.mix/escripts:$PATH"

and use "command": "atp_mcp" in .mcp.json. Local backends then use whatever is on your PATH: eprover for local_exec, isabelle for the Isabelle backend.

Configuration

The escript does not read your project's config/*.exs. It reads one config file at startup, the first of:

  1. atp_mcp --config PATH;
  2. the ATP_MCP_CONFIG environment variable;
  3. atp_mcp.exs in the working directory — for an MCP host, the project root (/work in the container).

The file is ordinary Elixir Config, evaluated at startup, so read secrets from the environment rather than writing them into it:

elixir
# atp_mcp.exsimport Config
config :atp_client, :sotptp,  default_system: "Vampire",       # a bare name runs the latest version  default_time_limit_sec: 30
config :atp_client, :local_exec,  binary: "vampire",  args: ["--mode", "casc", "-t", "30"],  cpu_timeout_s: 30
config :atp_client, :starexec,  base_url: "https://starexec.example.org/starexec",  username: System.get_env("STAREXEC_USER"),  password: System.get_env("STAREXEC_PASS")

Without any configuration:

  • SystemOnTPTP uses tptp.org and the latest E.

  • LocalExec runs eprover --auto --tstp-format --cpu-limit=30 if eprover is on PATH.

  • Isabelle starts a resident server named atp_mcp on a free port if isabelle is on PATH, or reuses one that is already running. Outside a container that server outlives the MCP process, so later sessions skip the startup cost. Stop it with isabelle server -n atp_mcp -x. To use a server you run yourself, configure it instead:

    elixir
    config :atp_client, :isabelle,  host: "isabelle.example.org",  port: 9999,  password: System.get_env("ISABELLE_PASSWORD")

    and set config :atp_mcp, isabelle_autostart: false to rule out a local one.

  • StarExec has no defaults; it needs base_url, username, and password.

See the AtpClient docs for every setting.

Checking the setup

atp_mcp doctor prints, for each backend, the settings it resolved to and whether it is reachable. Run it the way your MCP host runs the server:

console
$ docker run --rm -v "$PWD:/work:ro" ghcr.io/jcschuster/atp_mcp doctoratp_mcp 0.8.0config file: /work/atp_mcp.exs
sotptp - SystemOnTPTP  url: "https://tptp.org/cgi-bin/SystemOnTPTPFormReply"  default_system: "Vampire"  default_time_limit_sec: 30  check: OK…

Name backends to check only those (atp_mcp doctor sotptp local_exec). It exits with status 1 if any check fails, and passwords are shown only as set or unset.

Tools

Cross-backend (unified AtpClient.Backend)

list_backends

Lists every backend the server exposes (sotptp, isabelle, local_exec, starexec) with its human-readable label.

describe_szs

Returns a text reference for the SZS Ontology — the vocabulary every prover verdict is reported in. Lists every Success status (Theorem, Unsatisfiable, Satisfiable, CounterSatisfiable, ContradictoryAxioms, …) and NoSuccess status (GaveUp, Timeout, ResourceOut, MemoryOut, Forced, InputError, …) with its mnemonic and definition, so an agent can decide what a verdict means without leaving the MCP session. Generated from Tptp.Szs.Ontology, the table verdicts are read against. Takes no arguments.

verify_backend

Probes a backend's configuration and reachability. Returns OK or a descriptive error.

ArgumentTypeRequiredDescription
backendstringyessotptp | isabelle | local_exec | starexec

Backend-specific override keys (base_url, password, binary, …) are forwarded through to the backend's verify/1.

query_backend

Submits a TPTP-format problem to any backend through the unified c:AtpClient.Backend.query/2 entry point and returns an SZS Ontology verdict (Theorem, Unsatisfiable, Satisfiable, CounterSatisfiable, GaveUp, Timeout, ResourceOut, …). Call describe_szs for the full vocabulary.

ArgumentTypeRequiredDescription
backendstringyessotptp | isabelle | local_exec | starexec
problemstringyesTPTP problem text
time_limit_secintegernoApplied by backends that honour it (sotptp)
rawbooleannoReturn the system's verbatim output instead of the SZS verdict

Per-backend overrides are passed through (e.g. binary for local_exec, timeout_ms for isabelle, base_url for starexec, and system — the SystemOnTPTP name of the prover behind a local_exec binary or a starexec solver, for reading its output).

SystemOnTPTP

list_provers

Lists every theorem prover system available on SystemOnTPTP.

run_prover

Submits a TPTP problem to a specific prover and returns its SZS status.

ArgumentTypeRequiredDescription
problemstringyesTPTP problem text
system_idstringyesProver ID from list_provers, or a bare name (Vampire) for the latest version
time_limit_secintegernoTime limit in seconds
rawbooleannoReturn the prover's verbatim output instead of the SZS verdict
compare_provers

Runs the same problem against multiple provers simultaneously and returns all results side by side, one row per requested system in the order given. A bare name shows the version it ran:

Vampire (Vampire---5.0.1): CounterSatisfiableE---3.5.1: CounterSatisfiableNope: not a system on SystemOnTPTP (see list_provers)
ArgumentTypeRequiredDescription
problemstringyesTPTP problem text
system_idsstring[]yesProver IDs or bare names to compare
time_limit_secintegernoTime limit per prover in seconds

Isabelle

prove_isabelle

Submits a hand-written Isabelle/HOL theory to a configured Isabelle server. The theory text is written into the configured shared directory and processed via use_theories. For TPTP/THF problems, use query_backend with backend: "isabelle" instead — that routes through prove_tptp. Session, host, port, and password come from configuration only.

ArgumentTypeRequiredDescription
theorystringyesIsabelle theory text (full or body only)
theory_namestringyesTheory name (also used as the .thy filename)
timeout_msintegernoOverall use_theories timeout in milliseconds
rawbooleannoReturn Isabelle's message text instead of the verdict

Diagnostics

lint_problem

Runs syntax and type diagnostics on a TPTP problem. By default combines the in-process tptp linter (Tptp.analyze/2) with TPTP4X on SystemOnTPTP; pass backends: ["local"] for the cheap pass only. TPTP4X is skipped when the local pass already found an error. Each finding is reported as line:column [severity] (source) message [code], with the linter's hint where it gives one, followed by the declared symbols and their types:

2:8 [warning] (tptp) "axim" is not a TPTP formula role [TPTP0401]    hint: expected one of axiom, hypothesis, definition, …2:12 [error] (tptp4x) Invalid role, exiting [TPTP4X]
Symbols:  plus : $i > $i (declared at 1:14)
ArgumentTypeRequiredDescription
problemstringyesTPTP problem text
backendsstring[]noSubset of ["local", "tptp4x"]; default runs both

Example

Once the MCP server is active, you can ask Claude Code things like:

"Which provers on SystemOnTPTP can prove this TPTP problem? Compare Vampire, E, and Satallax."

Claude will call compare_provers directly and report the SZS results.

"Run this problem against my local E build, then sanity-check it on SystemOnTPTP."

Claude will call query_backend twice — once with backend: "local_exec", once with backend: "sotptp" — and compare the verdicts.

Agent skill

skills/atp-mcp/SKILL.md is an Agent Skill that teaches an agent to use these tools: the TPTP dialects and which provers accept them, a lint-then-prove workflow, and what each SZS verdict lets it conclude. It also lists tasks where a prover helps, such as autoformalisation, checking proofs, and finding counterexamples, so agents reach for the tools unprompted. To use it with Claude Code, copy the directory into .claude/skills/ in your project or ~/.claude/skills/.

Cancellation and progress

Long-running tool calls run inside their own Task. The MCP host can:

  • Send notifications/cancelled with the in-flight request id to abort a call. Each AtpClient backend tears down its upstream work on caller death:

    • LocalExec SIGKILLs the prover binary via Port closure.
    • StarExec issues DELETE against the remote job.
    • Isabelle drops the session, which aborts the in-flight use_theories task on the server.
    • SystemOnTPTP closes the local connection, but the remote prover runs to its :time_limit_sec — SOTPTP has no remote-cancel endpoint.
  • Set _meta.progressToken on tools/call to receive periodic notifications/progress frames while the call is in flight. The heartbeat fires every five seconds by default; override via:

    elixir
    config :atp_mcp, heartbeat_ms: 10_000

Forward note: MCP Tasks extension

MCP Tasks (call now, fetch later through a task handle) fit ATP workflows almost exactly. Revision 2026-07-28 moved them out of the core protocol into the official extension io.modelcontextprotocol/tasks. Once MCP hosts support the extension, the long-running tools here should return tasks, which would also make a StarExec-style submit_job / await_job pair natural.

License

MIT.

来源:README.md,提交 11f2c34

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.8.1最新Oct 29, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分