mcp-formal
Summary: An MCP server that checks SystemVerilog assertions with SymbiYosys formal verification (bounded BMC or inductive proof) and lints embedded SVA — giving explicit verdicts instead of silent simulation passes.
Prove assertions (
formal_prove): prove or refute RTL-embedded SystemVerilog assertions using SBYsmtbmc+z3, bounded (bmc) or inductive (prove), returning PROVEN, FAILED (with counterexample assertion name, location, step), UNKNOWN, ERROR, or TIMEOUT.Control the proof: set
top_module,verilog_sources,depth(1–100, default 10),timeout_ms(default 300000),cwd, andkeep_workdirto retain the SBY work directory for trace inspection.Handle solver-only constructs: pass
defines(e.g.["FORMAL"]) to enable`ifdef FORMAL-guarded SVA blocks that plain simulators/lint can't parse.Lint SVA early (
formal_lint_sva): elaborate RTL with embedded assertions in Yosys to catch syntax/elaboration errors as file:line diagnostics before spending solver time — it proves nothing.Probe the environment (
formal_toolchain_info): report the active runtime and versions of SymbiYosys, SMT solvers, and available proof engines.Run consistently anywhere: executes inside the rootless Podman image
ghcr.io/zesun33/asicby default, or host binaries viaMCP_FORMAL_RUNTIME=host.Plug into any agent/IDE over stdio MCP (Cursor, Windsurf, GitHub Copilot/Codex, Claude Code, Google Antigravity, OpenCode, Cline), e.g.
npx -y @zesun33/mcp-formal.Know the limits: only the
smtbmc z3engine ships (ABC/PDR excluded); sequential/multi-clock properties may return UNKNOWN or exhaust depth — unknown/timeout is not a pass.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-formal prove the assertions in counter.sv with top module counter using BMC depth 20"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@zesun33/mcp-formal
Purpose and first steps
Check assertions and run bounded or inductive RTL proofs through an MCP server.
Who it is for: Hardware engineers using an MCP-capable client or coding agent.
First task: Configure the server in your MCP client, then call formal_toolchain_info before running a design.
What to expect: Engine availability, then explicit proof, counterexample, unknown, error, or timeout results.
Current scope: Published MCP server with explicit proof outcomes. A proof applies to the supplied properties, assumptions, engine, and bounds; unknown or timeout is not success. The npx command waits for an MCP client.
Start here: Runtime requirements and configuration.
Related projects: mcp-rtl-review, mcp-verilog.
Model Context Protocol (MCP) server for SymbiYosys formal verification (BMC/prove) and SVA linting.
mcp-formal lets AI coding agents and IDEs (Cursor, Windsurf, GitHub Copilot / OpenAI Codex, Claude Code, Google Antigravity, OpenCode, Cline) prove SystemVerilog assertions with SymbiYosys (smtbmc+z3) instead of only simulating them. Author properties first with rtl_generate_assertion (mcp-rtl-review), then prove them here: verdicts are PROVEN, FAILED (with counterexample asserts), UNKNOWN, ERROR, or TIMEOUT — never a silent pass.
Engine reality (verified live): the image ships SBY with the
smtbmc z3engine (z3 5.1.0). The ABC/PDR engine is excluded: it crashes parsing witness output against this Yosys build. Sequential/multi-clock properties may report UNKNOWN or exhaust depth instead of proving; treat those as work for deeper bounds or induction, not as passes.
Related MCP server: mcp-cocotb
Install and run
Run this MCP server directly from npm:
npx -y @zesun33/mcp-formalFor the complete hardware-agent setup, use npx -y @zesun33/create-hw-agent my-asic.
⚡ Quick Tour: See It in Action
The examples below illustrate tool requests and result fields. Timings, counts, and scores depend on the input and runtime; they are not guaranteed outcomes or fresh verification results.
Example tool requests and results
1. Probing the Toolchain (Zero-Config Verification)
// Tool Call: formal_toolchain_info
{
"runtime": "podman",
"image": "ghcr.io/zesun33/asic",
"solvers": ["z3 (Z3 version 5.1.0 - 64 bit)"],
"engines": ["smtbmc_z3"]
}2. Proving a Holding Assertion (Bounded)
// Tool Call: formal_prove {"verilog_sources": ["counter_assert_ok.sv"], "top_module": "cnt_ok", "mode": "bmc", "depth": 6}
{
"success": true,
"verdict": "PROVEN",
"mode": "bmc",
"depth": 6,
"failedAssertions": []
}3. Refuting a False Assertion (Counterexample Triage)
// Tool Call: formal_prove {"verilog_sources": ["counter_assert_bad.sv"], "top_module": "cnt_bad", "mode": "bmc", "depth": 6}
{
"success": true,
"verdict": "FAILED",
"failedAssertions": [
{ "name": "cnt_bad.$assert$counter_assert_bad.sv:14$1", "location": "counter_assert_bad.sv:14", "step": 1 }
]
}4. Catching Syntax Errors Before Solver Time
// Tool Call: formal_lint_sva {"verilog_sources": ["sva_syntax_bad.sv"], "top_module": "sva_broken"}
{
"success": false,
"errors": ["sva_syntax_bad.sv:14: syntax error ..."]
}Tools Exposed
Tool | Parameters | Engine | Description |
|
| SBY | Proves embedded assertions; honest 5-state verdict with counterexample locations. Pass |
|
| Yosys elaboration | Catches SVA syntax/elaboration errors with file:line diagnostics. Proves nothing. |
| none | Probe | SBY version, SMT solvers, and proof engines. |
Execution Runtime
mcp-formal runs inside the zesun33/asic rootless Podman image so tools are identical on any Linux host.
Public install (recommended — anyone can pull):
podman pull ghcr.io/zesun33/asic:latest
export MCP_FORMAL_IMAGE=ghcr.io/zesun33/asicghcr.io/zesun33/asic is the default (anyone can pull). Local builds still work as localhost/zesun33/asic via MCP_FORMAL_IMAGE.
Container mount:
-v <workspace>:/workspace:Z -w /workspacePodman storage option:
--storage-opt overlay.ignore_chown_errors=true
To force host binaries instead of container execution:
export MCP_FORMAL_RUNTIME=hostRequires SymbiYosys + z3 in the image (shipped in zesun33/asic).
Universal Client & AI IDE Setup
Because mcp-formal implements the standard Model Context Protocol (MCP), it connects seamlessly to any MCP-compliant AI IDE or agent interface:
{
"mcpServers": {
"formal": {
"command": "node",
"args": ["/path/to/mcp-formal/dist/index.js"]
}
}
}Cursor: Configure in
.cursor/mcp.json.Windsurf: Configure in
~/.codeium/windsurf/mcp_config.json.GitHub Copilot / OpenAI Codex: Configure via Copilot MCP settings or Codex tool proxy.
Claude Code: Configure via
claude mcp add formal node /path/to/dist/index.js.Google Antigravity: Load as workspace MCP server in
antigravity.json.OpenCode & Cline: Direct stdio JSON-RPC connection.
Verification & Testing
Run the full 6-gate verification suite:
# Full verification (with Podman SBY runs)
./scripts/verify.sh
# Fast / CI verification (headless environments)
./scripts/verify.sh --quickLicense
Apache-2.0 © 2026 Md Zesun Ahmed Mia
npm releases
See RELEASING.md for GitHub Actions dry runs and trusted publishing.
Available Tools
3 toolsformal_lint_svaA
Elaborates RTL with embedded SVA in Yosys to catch syntax and elaboration errors before solver time. Reports file:line diagnostics. Does not prove anything; use formal_prove for verdicts.
Inputs: top_module (required), verilog_sources (required), cwd.
formal_proveA
Proves SystemVerilog assertions embedded in RTL with SymbiYosys (smtbmc+z3), bounded (bmc) or inductive (prove). Returns PROVEN, FAILED with counterexample asserts, UNKNOWN, ERROR, or TIMEOUT. Author properties first with rtl_generate_assertion (mcp-rtl-review); a passing lint does not mean properties hold.
Inputs: top_module (required), verilog_sources (required), cwd, mode, +4 more.
formal_toolchain_infoA
Returns active container/host runtime and versions of SymbiYosys, SMT solvers, and proof engines.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: formal_prove runs proofs, formal_lint_sva checks syntax/elaboration, and formal_toolchain_info reports environment details. No overlap or ambiguity exists even without reading full descriptions.
All tools share the formal_ prefix and use snake_case, but formal_prove and formal_lint_sva are verb-oriented while formal_toolchain_info is noun-oriented. This is a minor inconsistency rather than a serious naming problem.
Three tools is a compact, focused set that covers the core formal-verification workflow without redundancy or unnecessary bloat.
The set covers proving, linting/elaboration, and toolchain introspection, which forms a solid lifecycle. A tool for explicitly listing or managing assertions could be missing, but the current coverage is sufficient for typical formal verification tasks.
Maintenance
Related MCP Connectors
A public board where AI agents design pieces of an open AI inference accelerator on sky130. Submit Verilog and it is linted, synthesised, simulated against hidden vectors, mapped to real standard cells for area, timed for critical path and power, and proven equivalent to a reference. No key, no account, one call. The best verified design gets fabricated.
Jailbreak-proof AI guardrails. Automated Reasoning SMT solver, not an LLM. ZK proofs included.
Formally-verified injection/exfiltration detector for AI agents (MCP-02).
Pre-execution governance for AI agents. Deterministic PASS/FAIL/REVIEW verdicts, replayable proof.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI coding agents and IDEs to lint, compile, syntax-check, and simulate Verilog/SystemVerilog designs through structured, token-efficient MCP tools with isolated containerized toolchains.417 npmApache 2.0
- AlicenseAqualityCmaintenanceEnables AI coding agents to discover, generate, and run Cocotb co-simulation testbenches against Verilog/SystemVerilog designs, returning structured pass/fail results and tracebacks without manual simulator or Makefile setup.49 npm1Apache 2.0
- AlicenseAqualityBmaintenanceEnables AI coding agents and IDEs to synthesize Verilog/SystemVerilog designs with Yosys, inspect cell hierarchies and gate counts, and detect synthesis hazards like inferred latches and combinational loops before physical design flows.410 npmApache 2.0
- AlicenseAqualityBmaintenanceEnables AI coding agents and IDEs to perform AST-backed semantic Verilog/SystemVerilog code reviews, catching race conditions, reset polarity mismatches, and bitwidth truncations while computing a 0–100 RTL quality score.410 npm1Apache 2.0