Alive2

io.github.phongndo由 GitHub 账号 phongndo 发布v0.1.2更新于 Nov 3, 2026

Prove or refute LLVM IR transformations with Alive2, and read or create alive2.llvm.org links

已验证STDIO仅桌面

概览

Alive2 的本地 MCP 服务;无需登录;STDIO。

暂无 AI 概览:以下信息来自注册中心条目和服务本身。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

alive2-mcp

An MCP server and CLI for checking LLVM IR transformations with Alive2. It lets an agent prove or refute that an optimization is correct, check a patched opt against trunk, and read or create the alive2.llvm.org/ce/z/... links used in LLVM issues and PRs.

It talks to the public instance at alive2.llvm.org by default, and to a local alive-tv when you have one. It's a single static Go binary with no runtime dependencies.

Tools

ToolDoesAnnotations
verifyChecks that tgt refines src, per function. tgt is given directly, or produced from passes by your opt or by trunk LLVM (opt: "upstream"). Returns each verdict and, when not correct, Alive2's counterexample.read-only
create_linkPublishes the check as a short link, then reads it back to confirm it holds the submitted IR.additive, idempotent
get_linkReads a short link back into IR and options, and optionally re-runs it.read-only

Verdicts are correct, incorrect, unknown (timeout or approximation) and error. Inputs take IR as text (src, tgt) or as paths (src_file, tgt_file), so agents don't have to paste large modules. Results are returned as structured content.

Install

WithRun
Homebrew (macOS, Linux)brew install phongndo/tap/alive2-mcp
misemise use -g github:phongndo/alive2-mcp
Gogo install github.com/phongndo/alive2-mcp@latest
Nixnix profile add github:phongndo/alive2-mcp
Dockerdocker pull ghcr.io/phongndo/alive2-mcp
Downloadarchives for Linux, macOS and Windows on the releases page

It's also listed in the MCP Registry as io.github.phongndo/alive2-mcp. Release archives carry build provenance; verify one with gh attestation verify <archive> --repo phongndo/alive2-mcp.

Use

Claude Code

sh
claude mcp add alive2 -- alive2-mcp -opt /path/to/build/bin/opt

or in a project's .mcp.json:

json
{  "mcpServers": {    "alive2": { "command": "alive2-mcp", "args": ["-opt", "build/bin/opt"] }  }}

Codex

sh
codex mcp add alive2 -- alive2-mcp -opt /path/to/build/bin/opt

Without installing

The image runs the server over stdio. It can't see your files or your opt, so pass IR as text and use opt: "upstream":

json
{  "mcpServers": {    "alive2": { "command": "docker", "args": ["run", "-i", "--rm", "ghcr.io/phongndo/alive2-mcp"] }  }}

Flags

FlagEnvMeaning
-opt PATHALIVE2_MCP_OPTDefault opt for turning passes into tgt, typically your patched build. Without it, passes run upstream.
-alive-tv PATHALIVE2_MCP_ALIVE_TVLocal alive-tv; checks then run locally, with no network.
-web URLALIVE2_MCP_WEBAlive2 Compiler Explorer instance (default https://alive2.llvm.org/ce).
-http ADDRServe stateless streamable HTTP instead of stdio.

CLI

The same binary works from a shell. Exit status is 0 for correct, 1 for anything else and 2 for errors, so it fits scripts and git bisect run.

sh
alive2-mcp -opt build/bin/opt verify -passes gvn repro.ll   # your patchalive2-mcp verify -opt upstream -passes gvn repro.ll        # trunk LLVMalive2-mcp verify before.ll after.ll                        # two files, matched by namealive2-mcp get-link -verify https://alive2.llvm.org/ce/z/_kCuTValive2-mcp link -function f before.ll after.ll              # publishes

How it works

The Alive2 website is a Compiler Explorer instance running alive-tv as a compiler, so this uses Compiler Explorer's API: /api/compiler/alive/compile, /shortener and /api/shortlinkinfo/<id>.

The website only compares functions named @src and @tgt. For two modules, each function they share is merged into one module, renamed, and checked concurrently. The target's attribute groups and metadata are renumbered so they can't collide with the source's. A local alive-tv gets both files and pairs functions itself.

Dropped connections, DNS timeouts and gateway errors are retried twice with a short backoff. Other HTTP errors are reported at once.

Limits

Alive2 is bounded and intraprocedural. Loops are unrolled a few times and calls to other functions are opaque, so correct is strong evidence rather than a proof. Anything sent to the website is sent to a public server, and create_link stores it permanently.

Development

sh
nix develop          # Go, gopls, golangci-lint, nixfmtgo test -race ./...  # unit tests against a fake Alive2 servernix flake check      # build, tests, golangci-lint, formatting

CI runs nix flake check on Linux (x86-64 and ARM) and macOS. A weekly job checks the live alive2.llvm.org API, since a change there is what would break this tool.

To release, set VERSION and push a matching vX.Y.Z tag on main. The Release workflow builds the archives and images with GoReleaser, attests them, publishes the release with its Homebrew formula (which phongndo/homebrew-tap picks up), and lists the version in the MCP Registry. CI runs the same build as a dry run on every push.

License

MIT; see LICENSE.

来源:README.md,提交 dc118ef

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:该软件包类型无法在沙箱中运行。

版本历史

2
  1. v0.1.2最新Nov 3, 2026
  2. v0.1.0Nov 3, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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