Gardawg MCP
以離線優先的 Rust CLI 和 MCP 伺服器,提供確定性的 tree-sitter AST 防護機制、實體層 RF/序列鏈路預算(LoRa、BLE、Wi-Fi、LEO、UART),以及具種子的混沌代理冒煙測試。
文件
Gardawg 
Link-aware static analysis, physical-layer airtime budgets, and seeded chaos proxies in one offline-first binary.
Gardawg is an offline-first Rust CLI and MCP server by Oceans Niagara, LLC, built for embedded C/C++ and firmware teams. It enforces deterministic AST rules and quality gates on your code, checks payloads against real physical-layer limits (LoRa, BLE, Wi-Fi, LEO satellite, UART), and runs seeded chaos/impairment proxies, with zero LLM dependencies inside Gardawg and zero code leaving your machine. It also gives AI coding agents deterministic guardrails over MCP. AST rules cover C, C++, Rust, Python, TypeScript, and JavaScript. CI is free on public/open-source repositories; private CI uses an offline-verified Ed25519 license key.
- Website, WASM sandbox & licensing: https://oceans-niagara.github.io/gardawg/
- Interactive sandbox: https://oceans-niagara.github.io/gardawg/sandbox.html
What It Catches
GR000Syntax & stray fences: parse errors and stray Markdown code fences, even withouttsc/cargo/ruff.GR001Money floats:f32/f64on money and quantity identifiers.GR002Missing timeouts:fetch,axios,reqwest,requests,httpx,socket.socket(),HTTPServer, and Crecv/connectcalls without explicit timeouts.GR004-GR005Swallowed errors & stubs: emptycatch/except: pass, ignored C returns, non-atomic state writes,todo!(),NotImplementedError, and placeholder comments.GR006-GR007Security & panics: hardcoded secrets (sk_live_,AKIA,ghp_, private keys),eval/exec/shell=True/strcpy, and non-test Rust.unwrap().- Link budgets & AST rules:
budgetcomputes the Shannon ceiling, MTU fragmentation, airtime, and BER loss;--linkadds loop-send batching, framing, and timeout checks. - Chaos, verify & SARIF: seeded TCP/UDP/HTTP impairment proxies,
gardawg verify, and OASIS SARIF 2.1.0 output (--format sarif).
init detects your stack and generates gardawg.toml, AGENTS.md, .mcp.json, and opencode.json. Re-sync them after editing gardawg.toml with gardawg sync.
See It in CI
gardawg-zephyr-demo is a small public Zephyr-style C project with a missing socket timeout and a LoRa payload overflow. The free Gardawg binary passes on main and blocks PR #2, with no license needed on a public repo.
Install & Multi-Project Quickstart
Prebuilt binaries (no Rust required): download from GitHub Releases. The open binaries are free, including CI on public repositories. Commercial gardawg-pro-* binaries (private CI, desktop GUI) are on the same releases page.
| OS | Binary |
|---|---|
| Windows | gardawg-windows-x86_64.exe |
| macOS (Apple Silicon) | gardawg-macos-arm64 |
| macOS (Intel) | gardawg-macos-x86_64 |
| Linux (x86_64) | gardawg-linux-x86_64 |
Option 1: Global PATH Install (Recommended for Multiple Repos)
Run gardawg install (alias install-path) to copy the binary + adjacent gardawg.lic into %LOCALAPPDATA%\Programs\gardawg (Windows) or ~/.local/bin (macOS/Linux) and add it to your user PATH - or move gardawg.exe + gardawg.lic there manually:
# Windows (PowerShell)
.\gardawg-windows-x86_64.exe install
# In ANY repo root (new terminal):
gardawg init --link
gardawg check --format text
# macOS / Linux
chmod +x ./gardawg-macos-arm64
./gardawg-macos-arm64 install
gardawg init --link
init --link defaults to wifi-24g-congested (for general networked apps). Pass --link-profile ble-1m or --link-profile lora-sf12 for constrained RF/serial links, or edit [link] profile = "..." in gardawg.toml anytime.
Option 2: Point at Any Project Without Modifying PATH (-w)
.\gardawg-windows-x86_64.exe -w C:\path\to\project init --link
init automatically writes the binary's full path into .mcp.json and opencode.json, so MCP works from your AI tools even without gardawg on PATH.
Build from Source & Core Commands
cargo install --git https://github.com/Oceans-Niagara/gardawg
gardawg check --format sarif
gardawg budget --profile lora-sf12 --bytes 64 --hz 10
gardawg proxy --listen 127.0.0.1:9000 --target 127.0.0.1:9001 --profile ble-1m --seed 42
gardawg verify --profile wifi-24g-congested --udp --listen 127.0.0.1:9000 --upstream 127.0.0.1:9001 --cmd "python client.py"
gardawg mcp
Free vs Pro
| Free (Apache-2.0) | Pro / Team / Enterprise | |
|---|---|---|
Core CLI: check, budget, proxy, verify, fix, mcp, init, install | Yes | Yes |
| Built-in RF/serial profiles, standard SARIF | Yes | Yes |
| CI on public / open-source repos | Unlimited | Unlimited |
| CI on private repos | No | Team and Enterprise (Pro is local workstations only) |
Desktop GUI, resilience, sync --check, custom profiles.toml, [agents].custom_rules, --baseline, --profile-matrix, org-stamped SARIF | No | Yes, by tier (see Licensing below) |
Pro binaries are named gardawg-pro-* (headless) and gardawg-pro-gui-* (desktop dashboard) on the releases page. They are inert without a license: pass --license-key, set GARDAWG_LICENSE_KEY, or place gardawg.lic next to the binary. Keys are verified offline with Ed25519, so air-gapped CI works.
# Desktop GUI: standalone simulator, or live UDP impairment proxy with real-time plots
.\gardawg-pro-gui-windows-x86_64.exe
.\gardawg-pro-gui-windows-x86_64.exe gui --udp --listen 127.0.0.1:9000 --target 127.0.0.1:9001 --profile ble-1m
# Fault-injection suite (requires schemathesis on PATH, or [resilience] keploy_cmd)
gardawg resilience --openapi openapi.yaml
AI Agents (MCP) & Local Models
Gardawg itself is 100% offline - your host coding CLI (OpenCode, Claude Code, Cursor, Windsurf, etc.) chooses which LLM runs.
- Primary Workflow - Agentic MCP Guardrails (
AGENTS.md+.mcp.json/opencode.json):gardawg initwires Gardawg's stdio MCP server into your project and writes a 3-stepAGENTS.mdcontract (evaluate_payload->gardawg_check->verify_runtime). Pair it with OpenCode's built-in models or any tool-capable coding model so your agent checks link budgets before designing frames, fixes AST findings after every edit, and smoke-tests through the impairment proxy automatically. - 100% Local Ollama in
opencode.json:gardawg initincludes a commented Ollama"provider"template (http://127.0.0.1:11434/v1with"tool_call": true) inopencode.jsonso you can uncomment it with any tool-capableollama listtag. - Lightweight CLI Repair Helper (
gardawg fix): for localized single-file fixes (such as adding missingtimeout=arguments or moving hardcoded secrets toos.environ) using small local Ollama models (1.5B-3B) without full agentic overhead:
gardawg fix --model ollama/qwen2.5-coder:3b
gardawg fix --model ollama/qwen2.5-coder:1.5b --file src/client.py --dry-run
Tools
When run as an MCP server (gardawg mcp), Gardawg exposes the following four tools to AI coding agents:
list_link_profiles
List physical-layer RF/serial link profiles (lora-sf12, ble-1m, wifi-24g-congested, leo-sat, uart-9600, plus licensed custom profiles).
- Parameters: None
evaluate_payload
Step 1 (Budget first): Compute Shannon ceiling, protocol goodput, MTU fragmentation, safe byte limit, and BER loss before writing wire framing code.
profile(string, required): Physical link profile ID (e.g.,lora-sf12,ble-1m,wifi-24g-congested,leo-sat,uart-9600).payload_bytes(integer, required): Payload size in bytes (minimum1).hz(number, required): Transmit rate in Hz (minimum0.001).
check
Step 2 (Check every edit): Run unified single-pass AST + physical-layer link rules + external compiler/linter gate (alias: gardawg_check).
path(string, optional): Subpath or file to scan.profile(string, optional): RF/serial link profile ID (e.g.,lora-sf12).hz(number, optional, default10.0): Assumed transmit rate in Hz.ast_only(boolean, optional, defaultfalse): Run only AST rules without external compiler/linter gates.pedantic(boolean, optional, defaultfalse): Enable pedantic rule checks.
verify_runtime
Step 3 (Verify runtime): Run an automated black-box smoke test through the impairment/chaos proxy and return structured runtime diagnostics (alias: smoke_test).
command(string, required): Shell command to run (e.g.,"python app.py").profile(string, optional): Physical link profile ID (e.g.,lora-sf12,ble-1m).upstream(string, optional): Targethost:portto proxy to (e.g.,127.0.0.1:8080).probe_path(string, optional): HTTP path to probe through the chaos proxy (e.g.,/health).duration_secs(integer, optional, default4): Duration of the smoke test in seconds.udp(boolean, optional, defaultfalse): Use UDP proxy mode instead of TCP/HTTP.
See BENCHMARKS.md for latency measurements (45 ms median check) and a 46-run controlled agent evaluation (0/5 -> 5/5 bilateral CRC-16/CCITT-FALSE and binary framing on constrained UART/LoRa tasks).
Licensing & Commercial Editions
Gardawg is open-core. The core CLI and engine in this repository are licensed under Apache-2.0 and are free to use, including in CI on public/open-source repositories.
Commercial editions (Pro, Team, and Enterprise) unlock additional local and CI capabilities using offline Ed25519-signed license keys (LG1...) verified locally with zero network calls:
- Free (Apache-2.0): Core CLI, AST rules, quality gates, SARIF output, built-in link profiles, seeded proxy/chaos/verify,
gardawg fix --model ollama/<tag>, stdio MCP server, and browser sandbox. - Pro (Local Workstations): Adds
gardawg resilience, customprofiles.toml, local--baselineratchet, andgardawg-pro-guidesktop dashboard with CSV/JSON export (ci_allowed: false). - Team (Up to 6 Seats + CI): Adds CI/CD runner authorization (
ci_allowed: true),gardawg sync --checkconfig drift gate,[agents].custom_rulesenforcement, and offline 90-day contributor cap (<= 6non-bot committers viagit shortlog). - Enterprise (Unlimited Seats & CI): Adds unlimited developers & CI runners (
max_seats: null), multi-profile matrix sweeps (gardawg check --profile-matrix ble-1m,wifi-24g-congested,lora-sf12), and organization-stamped SARIF audit headers (Licensed to <Org> - Enterprise).
See oceansniagara.com/gardawg for current pricing and licensing details.
License Lookup Order (first match wins):
--license-key <key-or-path>GARDAWG_LICENSE_KEY(orLINKGUARD_LICENSE) environment variable./gardawg.lic(or./linkguard.lic) in the current working directory<exe_dir>/gardawg.lic(or<exe_dir>/linkguard.lic) next to thegardawgbinary (global fallback across all repos)%APPDATA%\gardawg\license.lic(Windows) or~/.config/gardawg/license.lic(macOS/Linux)
Verify anytime with gardawg license.
© 2026 Oceans Niagara, LLC • connect@oceansniagara.com
MCP Registry: mcp-name: io.github.Oceans-Niagara/gardawg