Qecguard
Qecguard
Qecguard lints and inspects Stim .dem v1.15 detector error models, synthesizes rotated-surface and repetition DEMs, samples deterministic syndromes, benchmarks Union-Find and MWPM-approx decoders, sweeps multi-distance threshold curves, and audits QPU calibration drift. Version 0.1.0; changes are listed in CHANGELOG.md.
Quick Start
Try Qecguard on Apify. Run the prefilled 2-detector Stim .dem v1.15 lint sample, then open the default dataset. The single row reports data.valid as true, data.stats.numDetectors as 2, data.stats.numObservables as 1, data.stats.numErrors as 3, and data.stats.errorCount as 0. This example uses zero paid Actor events.
Lint a 2-detector Stim .dem v1.15 model via the hosted Streamable HTTP MCP endpoint (2025-03-26). This free call needs only curl.
curl -sS https://qecguard-mcp.raymond-deoliveira.workers.dev/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"qec_lint_dem","arguments":{"dem":"error(0.01) D0\nerror(0.01) D0 D1\nerror(0.01) D1 L0\ndetector(0, 0, 0) D0\ndetector(1, 0, 0) D1\nlogical_observable L0\n"}}}'Under result.structuredContent, qec_lint_dem returns valid: true, stats.numDetectors: 2, stats.numObservables: 1, stats.numErrors: 3, and stats.errorCount: 0. Inspecting the same DEM with qec_inspect_dem returns graphlikeEdges: 3, hyperedges: 0, graphlikeFraction: 1, and dEffLowerBound: 3. To keep the example handy, star Qecguard on GitHub.
Synthesize and benchmark a Willow distance-3 surface code
Synthesize a 3-round rotated-surface DEM calibrated to willow-105 (17 physical qubits, 24 detectors, 76 error mechanisms) and decode 1,000 seeded shots (seed: 42) with both Union-Find and MWPM-approx (qec_decode_benchmark, $0.005/call via x402 v2 or Polar Pro key, or free locally via CLI/stdio MCP):
Metric | Value |
|
|
Union-Find |
|
MWPM-approx |
|
Decoder agreement ( |
|
Threshold sweep |
|
Related MCP server: @mhdd_24/ai-benchmark-mcp
What It Does / What It Does Not Do
Surface / Tool | Tier / Price | What It Does |
| Free ( | Stim |
| Free ( | Graph/hypergraph metrics: |
| Free ( | Deterministic rotated-surface ( |
| Free ( | Seeded Mulberry32 deterministic syndrome and observable-flip sampler ( |
| Metered ( | Deterministic Union-Find ( |
| Metered ( | Multi-distance and multi-noise-scale sweep ( |
| Metered ( | Baseline vs current calibration snapshot drift audit ( |
HTTP | MCP | Cloudflare Worker at |
Apify Actor & Standby MCP | PPE / Standby | Single ( |
What It Does Not Do:
No physical QPU hardware drivers, pulse-level execution, or paid IBM/Braket/Google cloud quantum credentials (
$0Day 1 stateless compute only).No remote
.demURL fetching (inline bounded payloads only;<= 262,144bytes per payload).No full arbitrary-hypergraph exponential solver:
qec_decode_benchmarksplits hyperedges cleanly onto graphlike edges (dEffLowerBoundinspects exact shortest graphlike logical cycles).
Install & Uninstall
Use the hosted endpoint with curl or any MCP client. The public GitHub repository contains documentation, skill metadata, and packaging manifests. The local CLI and tests require a source checkout.
The source checkout requires Node.js >= 22.18.0 for native TypeScript type stripping (0 runtime and 0 dev npm dependencies, 340,611 bytes / 332.6 KiB source across 44 TypeScript files and 8,089 lines in src/, 412 KB src/ on disk, 888 KB project total via du -sk):
node --test tests/*.test.ts
node --test e2e/*.test.tsMeasured runs on node v25.9.0 (macOS):
Unit & integration (
node --test tests/*.test.ts):80tests across20suites in12test files (80pass,0fail,0skipped).End-to-end (
node --test e2e/*.test.ts):147tests across14test files (147pass,0fail,0skipped).Total:
227tests (227pass,0fail).Representative CLI latency (median of
5runs after1warm-up onnode v25.9.0):156.2 ms(synth-dem --preset willow-105 --distance 3 --rounds 3 --seed 42 --json, range149.2–160.1 ms).
Install the agent skill reference from GitHub:
npx skills add raydeoliveira/qecguardConnect Claude Code to the hosted MCP endpoint (free tools work without credentials; pass -H "X-Polar-License-Key: ..." for metered tools):
claude mcp add --transport http qecguard https://qecguard-mcp.raymond-deoliveira.workers.dev/mcpFor clients using mcpServers JSON:
{
"mcpServers": {
"qecguard": {
"url": "https://qecguard-mcp.raymond-deoliveira.workers.dev/mcp"
}
}
}Hosted & discovery links:
Live Cloudflare Worker:
https://qecguard-mcp.raymond-deoliveira.workers.dev(MCP endpointPOST /mcp, healthGET/HEAD /health, agent summaryGET/HEAD /llms.txt, discovery cardGET/HEAD /.well-known/mcp/server-card.json; free tools run live with zero auth, and metered tools accept x402 v2 Base USDC via PayAI facilitator, Polar Pro license keys, or Bearer API keys, failing closed with HTTP402).Live Browser Demo: raymonddeoliveira.com/software#qecguard-example (interactive Qecguard demo against the deployed Worker).
Polar Pro License (
$29one-time, 3 activations): Buy Qecguard Pro.Apify Store: raydeoliveira/qecguard-mcp.
Live Official MCP Registry & Glama: io.github.raydeoliveira/qecguard (v0.1.0) · Glama Server · Glama Connector.
Apify Actor / Standby container:
FROM node:22-alpine(0npm install, non-rootUSER node, port4321).
To uninstall locally, remove the directory (rm -rf qecguard).
CLI and MCP Examples
1. Local CLI (source checkout)
Inspect capabilities and run DEM linting, synthesis, sampling, decoding, threshold sweeps, and calibration drift checks with --json output:
node src/adapters/cli.ts --describe --json
printf '%s\n' '{"dem":"error(0.01) D0\nerror(0.01) D0 D1\nerror(0.01) D1 L0\ndetector(0, 0, 0) D0\ndetector(1, 0, 0) D1\nlogical_observable L0\n"}' | node src/adapters/cli.ts lint-dem --json --input -
node src/adapters/cli.ts synth-dem --preset willow-105 --distance 3 --rounds 3 --seed 42 --json
node src/adapters/cli.ts threshold --code rotated-surface --preset willow-105 --distances 3,5,7 --noise-scales 0.5,1.0,2.0 --rounds 3 --shots-per-point 300 --seed 42 --json
printf '%s\n' '{"preset":"willow-105","baseline":{"error1Q":0.00035,"error2Q":0.0033,"readoutError":0.007,"cycleTimeUs":1.1},"current":{"error1Q":0.0007,"error2Q":0.014,"readoutError":0.02,"cycleTimeUs":1.1,"couplers":[{"edge":[0,1],"error2Q":0.018}]},"distance":5,"patchQubits":[0,1,2]}' | node src/adapters/cli.ts shield --input - --json2. HTTP 402 & stdio MCP Server
Dry-run or start the local HTTP 402 server or stdio MCP server:
node src/adapters/cli.ts serve-mcp --dry-run --json
API_KEYS_CSV="demo-key" node src/adapters/cli.ts serve-mcp --host 127.0.0.1 --port 0
node src/adapters/cli.ts serve-mcp --stdio3. Apify Actor & Standby MCP (source checkout)
Run offline Actor mode against APIFY_LOCAL_STORAGE_DIR (create INPUT.json first; without it the run exits 2 and writes ERR_INVALID_INPUT to OUTPUT.json):
mkdir -p storage/key_value_stores/default
printf '%s\n' '{"tool":"qec_lint_dem","arguments":{"dem":"error(0.01) D0\nerror(0.01) D0 D1\nerror(0.01) D1 L0\ndetector(0, 0, 0) D0\ndetector(1, 0, 0) D1\nlogical_observable L0\n"}}' > storage/key_value_stores/default/INPUT.json
APIFY_LOCAL_STORAGE_DIR=./storage node src/adapters/apify_main.ts
cat storage/key_value_stores/default/OUTPUT.jsonRun Standby MCP mode (PORT=0 for ephemeral bind):
APIFY_META_ORIGIN=STANDBY ACTOR_WEB_SERVER_PORT=0 node src/adapters/apify_main.tsSafety & Compute Bounds
Stateless
$0compute: Zero OS hardware mutation, zero physical QPU driver installation, and zero remote file fetching.Fail-closed R7 bounds: DEM payloads
<= 262,144bytes,<= 150,000tokens,<= 16repeat depth,<= 10,000repeat iterations,<= 100,000expanded errors,<= 65,536detectors,<= 256observables,<= 500,000expand steps,<= 100,000sample shots,<= 50,000decode shots,<= 36threshold sweep points, HTTP MCP body<= 262,144bytes, JSON-RPC batch1..64messages, and strict prototype-chain key rejection (__proto__,constructor,prototype).Fail-closed
402& deferred x402 settlement: Authorization runs before tool validation on metered calls; x402/settleexecutes only after the tool succeeds (QecValidationErrornever settles or charges).Apify Pay-Per-Event: Results are pushed to the Dataset before charging; on
APIFY_IS_AT_HOME=1,chargeEvents: falseis ignored and runs stop before exceedingACTOR_MAX_TOTAL_CHARGE_USD.
Exit Codes
Code | Meaning |
| Success (including |
| Runtime error or |
| CLI usage error or validation error ( |
| I/O error or missing/unreadable |
| Domain limit exceeded ( |
| Internal error (or Apify PPE charge rejection / spending limit reached before any call succeeded) |
|
|
License & Support
Proprietary commercial software. Copyright (c) 2026 Raymond de Oliveira. All rights reserved. See LICENSE and SECURITY.md.
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
20 engineering MCP tools: 3D STL/G-code, ELF/WASM, Verilog/VCD, systemd/seccomp, PDF repair.
12 read-only MCP tools for AI communication rules, instruction linting & 25-model benchmarks.
Free MCP tools: the only MCP linter, health checks, cost estimation, and trust evaluation.
Render, verify, describe, and safely edit Mermaid diagrams through MCP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceMCP server wrapping Google's Stim stabilizer circuit simulator. Wire it up to an LLM and you can build and sample circuits through conversation.-
- AlicenseCqualityCmaintenanceEnables running, listing, inspecting, and comparing standardized model benchmarks through MCP.47 npmISC
- AlicenseNot gradedqualityNot gradedmaintenanceEnables users to simulate multi-qubit quantum circuits through an MCP interface, including unitary gates, entanglement, Born-rule measurement sampling, fidelity/probability calculations, and Grover amplitude amplification. Integrates with Claude Desktop, Cursor, and Windsurf via JSON-RPC stdio.MIT
- AlicenseAqualityCmaintenanceEnables AI agents to discover accessible quantum instances and backends, simulate circuits locally, preview transpiled circuits, submit Sampler or Estimator jobs, and inspect or cancel runtime jobs via typed MCP tools.10MIT