hw-verify-mcp
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., "@hw-verify-mcp Is my 8-bit tag comparator constant-time?"
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.
hw-verify-mcp
Ask Claude "is this Verilog constant-time?" and get a formal answer with the leaking signals named — not a guess.
▶ Try it in your browser — paste Verilog, get a formal constant-time verdict with the leaking signals named. No install, nothing uploaded.
Why this exists
An LLM asked to write constant-time RTL will produce something plausible. Plausible is exactly the failure mode: early-exit comparisons and data-dependent loop bounds look fine. The model has no way to check, and neither does the person reading the diff.
This server gives the agent a checker it cannot argue with. The loop is:
the agent writes RTL;
the server refuses it and names the secrets that reach the completion signal;
the agent applies the suggested repair;
the server confirms — or refuses again.
The agent cannot declare success. Every refusal carries a next_step telling it what
to change, and every tool description says a self-asserted verdict does not count. That
constraint is the product: it makes the checker's refusal semantics the grammar the agent
learns to think in.
Related MCP server: cg-agent-kit
Install
Not yet on PyPI. Install from a checkout:
git clone https://github.com/nickharris808/hw-verify-mcp.git && cd hw-verify-mcp
pip install .This pulls in ctbench, ct-mask, and patchproof, which do the actual analysis.
30-second quickstart
Add to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"hw-verify": {
"command": "hw-verify-mcp"
}
}
}Then ask: "Write me a constant-time 8-bit tag comparator, and check it with hw-verify."
Verify the server is wired up before you trust the agent's answers:
$ hw-verify-mcp --version 2>/dev/null; python -c "
from hwverify.server import TOOLS
from hwverify.tools import AVAILABILITY
print(len(TOOLS), 'tools'); print(AVAILABILITY)"
12 tools
{'ctbench': True, 'ct-mask': True, 'patchproof': True}If any backend reports False, the tools that need it return a clear error rather than a
wrong answer.
Worked example — the loop, verbatim
The agent writes the obvious early-exit comparator and calls check_constant_time:
{
"verdict": "LEAKY",
"observation": "done",
"reaching_secrets": ["x", "y"],
"cone_size": 9,
"model": "Syntactic fan-in cone of the observation signal, including every enclosing if/case guard. Over-approximate within the supported subset, so CONSTANT_TIME is conservative there; anything outside the subset returns UNKNOWN rather than a verdict.",
"next_step": "The completion signal depends on x, y. Make the completion condition a function of a data-oblivious counter rather than of operand values: run the loop a fixed number of cycles and drop any early-exit branch. Then call this tool again — a verdict you assert yourself does not count."
}The agent replaces the early exit with a fixed counter and re-submits:
{
"verdict": "CONSTANT_TIME",
"reaching_secrets": [],
"next_step": "No secret reaches the completion signal. Note this covers completion timing only, not power, EM, or cache channels."
}That exact sequence is a test (test_agent_loop_refuse_fix_confirm), so the loop is
verified rather than illustrated.
The tools
Tool | What it does |
| CONSTANT_TIME or LEAKY for a Verilog module, with the reaching secrets named |
| just the localisation: which secrets reach the completion signal, and the cone size |
| the ctbench matched-pair corpus, with expected verdicts |
| the Verilog source of one fixture, so the agent can reason about it |
| grade a set of verdicts; unsound is reported separately from imprecise |
| run the bundled baseline over the whole corpus |
| first-order masking verification of a gadget, by name or as a JSON netlist |
| the masking corpus, and the netlist format for your own |
| does a bounds-check repair eliminate every violating input? |
| the modelled defect classes, and what a COMPLETE verdict excludes |
| re-check an elimination certificate using integer arithmetic, no solver |
| not available — see below |
Secrets are never inferred
check_constant_time refuses to guess which inputs are sensitive:
{ "error": "no secrets declared. Secrets are a specification choice and are never inferred: pass the input names that carry sensitive values." }Guessing here would be worse than useless — it would produce confident verdicts about the wrong property.
Errors are data, not faults
A refusal is a normal outcome. Unknown tools, bad arguments, and malformed netlists all
come back as {"error": ...} rather than as transport failures, because an agent recovers
from a JSON error and cannot recover from a broken connection.
Honest scope
Everything the server inherits from its three backends, it also inherits the limits of:
Constant-time verdicts cover completion timing against declared secrets — not power, EM, cache, or microarchitectural channels. The checker is a syntactic over-approximation within the supported subset, so
CONSTANT_TIMEis conservative there andLEAKYmay be pessimistic. A design outside the subset (submodule instantiation,for,generate,function, macro) returnsUNKNOWNwith anext_steptelling the agent it has not been shown constant-time;find_leakreturnsleaks: nullrather thanfalse, so an agent cannot read it as clean.Masking is glitch-free, first-order (
d=1), 2-share probing. The report separates mean-invariance from whole-distribution invariance and says which was established.Patch completeness is reachability in modelled bit semantics — not an RCE claim — and
list_defect_classesreturns the shapes deliberately outside the model.
prove_confidential
The tool is in the list, and calling it tells you why:
Every tool in this server analyses a design you supply in full. Proving a property to a third party who never receives the design is a different problem: it needs the result bound to a commitment of a design that stays hidden. That capability is commercial and is not part of this package.
It is listed rather than omitted deliberately. An agent that discovers the boundary is more useful than one that silently never learns it exists.
Development
pip install -e . && pytest tests -q && ruff check .24 tests: the tool functions directly, one real MCP session over the in-memory transport,
and one that drives the installed hw-verify-mcp binary over stdio JSON-RPC (skipped
if the package is not on PATH). A further test asserts mcp-manifest.json lists exactly
the tools the server exposes, so the manifest cannot drift.
Note for anyone writing their own client: keep stdin open. Closing it immediately after writing makes the server shut down before later replies are flushed — that is correct stdio behaviour, and it will look like a hang or a dropped response if you batch-write.
Documentation
SCOPE.md — what the three checkers prove, and why
UNKNOWNreaches the agent asleaks: nullrather thanfalse.
Part of the hw-verify toolkit
Open tools for proving security properties of hardware and bounds checks. They share one boundary: everything open analyses a design you disclose in full.
Project | What it does |
Constant-time checker in your browser — the real analyzer via Pyodide | |
What the toolkit proves, and what it refuses to answer | |
One install, one command, all three checkers | |
Matched-pair constant-time RTL benchmark + leaderboard | |
Prove a bounds-check fix eliminates every violating input | |
Re-check its certificates in Rust, with no shared code | |
First-order masking verification by two certificates | |
| MCP server — the checkers, callable by AI agents |
GitHub Action — fail a PR on a leaky completion signal | |
Two datasets: what each design is, and why |
The commercial boundary. Proving a property to a third party who never receives the design — a verdict bound to a commitment of a design that stays hidden — is a different problem and a commercial one. It is not in any of these packages.
Citation
If you use this in academic work, please cite it — CITATION.cff has the metadata, and GitHub renders a "Cite this repository" button from it.
Contributing
A tool an agent misuses, or a refusal whose next_step did not help, is the most
valuable report. See CONTRIBUTING.md.
License
Apache-2.0. See LICENSE. Contributing: CONTRIBUTING.md.
Available Tools
12 toolscheck_constant_timeA
Decide whether a Verilog module's completion signal is independent of declared secret inputs. Returns CONSTANT_TIME or LEAKY, and on LEAKY names the secrets that reach the completion signal. You cannot declare a design constant-time yourself: re-run this tool after any fix.
Inputs: secrets (required), verilog (required), module, observation.
check_maskingA
Certify a masked gadget first-order secure under glitch-free probing, or name the probe wire that recombines a secret. Accepts a bundled gadget name or a JSON netlist. Two certificates are tried: dependence (touches at most one share) and uniformity (a fresh mask always flips the wire).
Inputs: gadget (required).
check_patch_completeA
Decide whether a modelled bounds-check repair eliminates EVERY violating input, not just a known one. Returns COMPLETE, INCOMPLETE (with a surviving violating input), or VACUOUS (the guard rejects everything).
Inputs: defect_class (required).
find_leakB
Localise a timing leak: name the secret inputs that reach the completion signal, and how large its fan-in cone is.
Inputs: secrets (required), verilog (required), module, observation.
get_benchmark_fixtureA
Fetch the Verilog source of one bundled benchmark fixture.
Inputs: name (required).
list_benchmark_fixturesA
List the ctbench matched-pair corpus: constant-time designs each paired with a deliberately leaky twin of identical interface, plus an out-of-remit control.
Inputs: no named parameters.
list_defect_classesA
List the modelled bounds-check defect classes, and what a COMPLETE verdict explicitly does not cover.
Inputs: no named parameters.
list_masking_gadgetsB
List the bundled masking gadgets and the JSON netlist format for your own.
Inputs: no named parameters.
prove_confidentialB
Prove a property to a third party WITHOUT disclosing the design. Not available in the open-source distribution; call it to see what is.
Inputs: no named parameters.
replay_certificateA
Re-check an elimination certificate using integer arithmetic only. No solver is used, so this verifies someone else's claim without trusting them or an SMT solver.
Inputs: certificate (required).
run_reference_checkerB
Run the bundled cone-of-influence baseline over the whole benchmark corpus.
Inputs: no named parameters.
score_benchmark_submissionA
Grade a set of verdicts against the benchmark. Reports unsound verdicts (said safe, is leaky) separately from imprecise ones, because only the first kind ships a vulnerability.
Inputs: verdicts (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools have clearly distinct purposes (e.g., list vs. get, check vs. replay), but check_constant_time and find_leak both analyze timing leaks, with check_constant_time already naming leaking secrets, making their boundaries slightly blurred. Descriptions mitigate confusion, but the overlap is present.
All 12 tools follow a consistent verb_noun pattern with underscores (check_*, list_*, get_*, score_*, run_*, replay_*, prove_*). No mixed conventions or camelCase appear, making the naming highly predictable.
With 12 tools spanning constant-time verification, benchmark handling, masking certification, and patch completeness, the count is well within the ideal 3-15 range. Each tool serves a distinct function, and none feel redundant or excessive.
The tool set covers the main workflows: checking constant-time, localizing leaks, running benchmarks, scoring submissions, certifying masking, and validating patches. A notable gap is prove_confidential, which is explicitly unavailable in open-source, leaving that functionality as a placeholder rather than a usable tool. Aside from this, the surface is comprehensive for the stated purpose.
Maintenance
Related MCP Connectors
Formally-verified injection/exfiltration detector for AI agents (MCP-02).
Design circuits, simulate and verify embedded firmware, and lay out PCBs with AI agents.
MERCATOR Verify: evidence-backed verification and decision support for autonomous agents.
Machine-verifiable authorization checks for autonomous AI agents.
Related MCP Servers
- AlicenseCqualityFmaintenanceEnables RTL simulation and hardware verification with Verilator through automatic testbench generation, natural language queries about simulations, waveform analysis, and protocol-aware testing for Verilog/SystemVerilog designs.44MIT
- AlicenseAqualityBmaintenanceEnables AI agents to design hardware by writing C-like HDL and compiling it to Verilog, with real toolchain verification including synthesis checks.1021 PyPI1MIT
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to interact with hardware designs (Verilog/SystemVerilog), formal verification tools, waveform logs, protocol specifications, and bug databases through 34 structured tools.-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to load, inspect, test, and repair machine-checked cryptographic proof files by wrapping EasyCrypt's batch CLI in six tools that report open goals and diagnostics. Agents can try tactic snippets on temporary copies, then commit only the steps that check, while the file itself holds all proof state.MIT