cea
Uses git bisect run on a compiler checkout to bisect compiler history against a reduced testcase.
Integrates with GCC from the GNU Compiler Collection for compiling with exact flags, collecting diagnostics and optimization remarks, running sanitizer checks, differential execution, and compiler-history bisection.
Provides compiler-engineering workflows backed by LLVM tools: emitting LLVM IR, inspecting pass timelines with opt, reducing testcases with llvm-reduce, analyzing throughput with llvm-mca, and validating transforms with Alive2.
Integrates with rustc to emit Rust MIR and LLVM IR, compile Rust code with exact flags, run sanitizers/Miri, and include Rust in differential and triage workflows.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
cea: Compiler Engineering Agent
Give your coding agent a compiler engineer's toolbox — and make it prove every claim.
cea is an MCP server, a CLI and an agent skill. It wraps the compiler tools you already have (clang, opt, llvm-reduce, llvm-mca, GCC, rustc, Alive2, cvise, Csmith), stores every result as a citable Evidence record, and teaches the agent a workflow in which "compiler bug", "this pass is correct" and "this is faster" are things you say only with proof.
Three rules run through all of it:
Semantics before speed. A faster program with a different answer is a bug.
Evidence before claims. Every conclusion cites evidence IDs and separates observed, inferred and unknown.
Small before large. Reduce the test case, then reason about it.
One wrong compiler rewrite breaks everyone's programs. One wrong "it's a compiler bug" wastes a maintainer's day. Agents are fluent at both. cea makes them slow down in the right places.
30-second quickstart
Requires Node 20 or newer, and whichever compilers you want to use. cea never installs or downloads a compiler.
npm install -g cea-agents # the `cea` command
cea doctor # what was found, what is missing, how to fix it
cea triage examples/01-ub-not-a-compiler-bug/overflow.cGive it to your agent (Claude Code shown; any MCP client with stdio works):
claude mcp add cea -- cea mcp # the MCP server
cea install-skill # the skill, into ~/.claude/skills/compiler-engineeringThe npm package is cea-agents; without a global install, npx -y cea-agents <command> works too. Setup for other clients, environment variables and troubleshooting: connection and recovery.
Related MCP server: io.github.morluto/flameox
What it looks like
A program prints 0 at -O0 and 1 at -O2. The agent's first instinct is "miscompile". The demo above is that case, recorded from a real run (cast):
$ cea triage examples/01-ub-not-a-compiler-bug/overflow.c
[1] environment ok 9/19 providers available; compilers: clang (x86_64-w64-windows-gnu), ...
evidence ev_environment_report_84b6d483
[2] check_ub ok UB found: signed integer overflow: 2147483647 + 1 cannot be represented
in type 'int' at overflow.c:3
evidence ev_check_ub_6a29004c
verdict: undefined_behavior
UB found at overflow.c:3:36 (signed integer overflow ...), not a compiler bug
compiler bug? noSeven steps were available; it stopped after two, because the question was answered.
Tools
Every tool is an MCP tool and a CLI command: cea <tool> --json '<input>' or cea <tool> --input file.json. Each call returns one Evidence record.
Tool | What it does | Docs |
| Detected compilers, versions, targets, providers, and why any are unavailable | |
| Compile with exact flags; asm, IR, object or executable, diagnostics, timing | |
| Frontend-only IR, before any pass ran (clang, rustc MIR and LLVM IR, GCC GIMPLE) | |
| What each pass did to one function, as paged diffs, no-op passes skipped | |
| Optimisation remarks and missed-optimisation reasons, grouped by function and loop | |
| UBSan, ASan, MSan or Miri at -O0 and -O1; findings with source locations | |
| Same program across compilers and optimisation levels; compares output and exit codes | |
| Binary search over | |
| Strict interestingness test plus cvise, creduce, llvm-reduce or a built-in reducer | |
| Alive2 on before/after IR; pass or fail with the counterexample | |
| Time-boxed Csmith or YARPGen differential campaign; every divergence saved with its seed | |
|
| |
| llvm-mca on a loop or function for a named CPU, with its limits stated | |
| Warm-up, repeated runs, median and spread, machine info, output-correctness check | |
| The whole chain in one call, with early stops and a draft bug report | |
| Read a record, or page through its raw output without flooding the context | |
| Evidence IDs in the session | |
| Track open questions with supporting and contradicting evidence IDs | |
| The whole session as one portable file, for a bug report |
Command-line reference: docs/cli.md.
The Evidence record
{
"evidence_id": "ev_check_ub_6a29004c", // cite this
"operation": "check_ub",
"status": "ok", // ok | inconclusive | unavailable | error
"summary": "UB found: signed integer overflow ... at input.c:3",
"input_files": [{ "path": "...", "sha256": "...", "bytes": 164 }],
"tools": [{ "name": "clang", "path": "...", "version": "clang version 23.1.5 ..." }],
"commands": [{ "argv": ["clang", "-O0", "-g", "-fsanitize=undefined,address", "..."], "exit_code": 0, "duration_ms": 212 }],
"target_triple": "x86_64-w64-windows-gnu",
"result": { "clean": false, "findings": [{ "sanitizer": "ubsan", "line": 3, "column": 36, "message": "..." }] },
"observed": ["ubsan: signed integer overflow ... at input.c:3:36 (-O0)"],
"inferred": ["The program executes undefined behaviour, so differing output ... is not evidence of a compiler bug."],
"unknowns": [],
"limitations": ["Sanitizers only see undefined behaviour on the paths this input executed ..."],
"coverage": { "opt_levels": ["O0", "O1"], "sanitizers_run": ["undefined", "address"] },
"views": [{ "name": "04-run_O0-undefined_address.stderr.txt", "lines": 2, "sha256": "..." }]
}Records live in a local session directory (JSONL plus raw output files). Later calls refer to earlier ones by ID. Large outputs stay on disk and are paged with inspect_evidence_view. Failures are records too: "alive-tv is not installed" is a fact the agent has to report, not work around.
Example prompts
With the server connected and the skill installed:
"This prints 0 at -O0 and 1 at -O2. Is it a compiler bug?
examples/01-ub-not-a-compiler-bug/overflow.c""Why isn't the loop in
scale()vectorised, and is fixing it actually faster? Show the spread.""I want to add a peephole that turns
(x + 1) > xintotrue. Check it with Alive2 before I write the code.""clang crashes on
crash.c. Reduce it and tell me the crash signature.""Sanitizers are clean but -O2 still gives a different answer. Go through the whole triage and tell me what is observed, inferred and unknown."
"Fuzz clang against gcc for two minutes and save anything that diverges."
Examples
Five small cases with the real output of a recorded run, each reproducible with one command:
Case | Outcome | |
"Compiler bug" that is signed-overflow UB | cea stops at step 2: UB at | |
Missed vectorisation caused by aliasing | remark: "uncountable loop"; with | |
A wrong InstCombine-style rewrite | Alive2 counterexample at | |
A clang crash in an 88-line file | reduced to 2 lines under a crash-signature test | |
UB that sanitizers cannot see (strict aliasing) | full chain runs; verdict "suspected undetected UB", compiler bug "unlikely" |
The numbers come from one machine and one compiler version, stated in each example. Yours will differ.
Architecture
flowchart LR
A[Agent] -- MCP stdio --> S[server.ts]
H[Human] -- "cea tool --json" --> C[cli.ts]
S --> R[registry.ts<br/>20 tools, zod schemas]
C --> R
R --> I[invoke<br/>validate, run, persist]
I --> T[Toolbox<br/>find providers, versions]
I --> L[(Evidence ledger<br/>JSONL + views)]
I --> X[exec<br/>argv arrays, timeout, output cap]
X --> P[clang, opt, llvm-reduce, llvm-mca,<br/>gcc, rustc, alive-tv, cvise, csmith, git]
I -. opt-in only .-> N[Alive2 online instance]One tool definition serves both the MCP server and the CLI.
Providers are thin adapters. They are found on
PATH, inCEA_TOOLCHAIN_DIRS, or throughCEA_TOOL_<NAME>; nothing is bundled or installed.Every process is started with an argument array and no shell, with a timeout and an output cap.
No network by default. The single remote feature sends the IR being checked to the Alive2 project's online instance, and only if
CEA_REMOTE_PROVIDERS=compiler-exploreris set.
Design notes: docs/design.md.
Limitations
Read these before trusting a result.
Running a test program executes its code. Test programs get a scrubbed environment, a timeout and an output cap, in a per-call work directory. That limits accidents. It is not a sandbox. See SECURITY.md.
Sanitizers are not proof. A clean
check_ubmeans no finding on the paths that ran. Strict-aliasing violations, unsequenced modifications and most uninitialised reads are invisible to it. Example 5 exists to make this concrete.Alive2 is bounded (loop unrolling, one function at a time, approximated memory and calls) and does not model type-based aliasing.
validate_transformis unavailable withoutalive-tvunless you opt into the remote provider.Pass bisection names where behaviour flips, not where the fault is.
llvm-mca is a static model: no caches, no branch misprediction, no frontend effects.
benchmarkmeasures wall-clock time of whole processes on one machine with one input. It is not pinned to a core and does not read hardware counters; perf is detected but not used yet.The built-in reducer removes whole lines only. Install cvise for real reductions.
Coverage of this release. Developed and run on Windows 11 with clang 23.1.5 (llvm-mingw) and GCC 16.2; CI runs unit tests on Linux, macOS and Windows and integration tests on Ubuntu. Csmith fuzzing was run for real with Csmith 2.3.0. The Rust paths (rustc
emit_ir, Miri incheck_ub), YARPGen, MSan and a localalive-tvbinary are implemented from the tools' documentation and unit-tested with fakes, but have not been run against the real tools. PROGRESS.md lists exactly what was verified and how.GCC support is narrower than LLVM support: no IR validation, tree dumps only in
pass_timeline, and a flag scan in place of pass bisection.
Development
npm install
npm run build
npm run typecheck && npm run lint
npm run test:unit # providers mocked; runs anywhere
npm run test:integration # real compilers; a test whose provider is missing is skipped and reportedSee CONTRIBUTING.md. Changes: CHANGELOG.md.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
38 MCP tools: Rust computation, Discovery, composition, counterexample scans and signed checks.
Multiple MCP tools, persistent graph memory, token-saving data pointers, and more.
Deterministic memory & code intelligence MCP for 15 IDEs (100% LongMemEval in 12.9ms, 0 LLM tokens).
141Goal and task planning MCP for Codex and AI agents, with evidence-backed completion.
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables coding assistants to gather bounded source evidence, prepare typed judgments, and verify claims through MCP tools while leaving editing and execution to the host.13MIT
- FlicenseNot gradedqualityAmaintenanceEnables coding agents to coordinate local profilers, benchmark tools, trace processors, and explicit targets into bounded runtime evidence, including observed inputs, execution provenance, typed findings, coverage, and limitations. It supports analysis and capture through named MCP tools without workspace setup or project configuration.-
- FlicenseNot gradedqualityAmaintenanceEnables agents to gather bounded, reproducible runtime evidence by coordinating local profilers, benchmark tools, and trace processors against explicit artifacts or captured commands. It exposes typed analysis and capture operations over MCP that return provenance-tracked results inline, with optional durable preservation and replay of prior evidence.-
- FlicenseNot gradedqualityAmaintenanceEnables coding agents to coordinate local profilers, benchmark tools, trace processors, and direct targets, turning explicit artifacts or commands into bounded runtime evidence with provenance, coverage, and limitations. Exposes named analysis and capture tools through MCP without workspace setup, with optional durable preservation.-