Inspiration
AI coding agents like Claude Code and Cursor excel at reading C/C++ code, yet connecting them to a real-time QNX Neutrino SDP 8.0 target introduces two deal-breaking risks:
- Unbounded shell risk: Giving an LLM raw SSH access to a safety-critical RTOS invites destructive commands (
slay,shutdown, shell injection). - Hallucinated root-cause analysis: Dumping raw
slog2infoandpidinlogs into an LLM misses subtle priority inversions, blocked real-time threads, and watchdog timeouts.
What it does
qnx-mcp-workbench is a zero-dependency Rust host tool, MCP server (2024-11-05 & 2025-03-26), and live browser telemetry dashboard built specifically for QNX SDP 8.0 targets (QEMU or Raspberry Pi 5):
- Fail-Closed Action Gateway (
src/gateway.rs): Allowlists safe read-only QNX commands (pidin,slog2info,hogs,uname) and staged benchmarks while deterministically blocking destructive commands (slay,rm,shutdown) and shell chaining (; && || | $(), recording every attempt to a tamper-evident JSONL audit log. - Deterministic QNX 8.0 Triage Engine (
src/diagnostics.rs): Parsesslog2infoandpidin threadsbefore the LLM sees them — computing a 0–100 health score, flagging blocked real-time threads (>=20r/20fstuck inMUTEX/SEM/DEAD), and evaluating microsecond scheduling jitter (P50/P95/P99/Maxvs SLA). - Live Zero-Dep Telemetry Dashboard (
src/dashboard.rs): Runcargo run -- serve --port 8088to inspect real-time triage, toggle before/afterPTHREAD_PRIO_INHERITjitter charts, and interactively test Action Gateway blocks. - Real QNX 8.0 C Sample Workload (
examples/qnx-rt-demo/) & 15-Minute Codelab (CODELAB.md): Compilable QNX Neutrino 8.0 C demo (motor_ctrl.cusing<sys/slog2.h>,SCHED_FIFOprio 25,PTHREAD_PRIO_INHERIT;latency_bench.cusingclock_nanosleep) withqcc -Vgcc_ntox86_64Makefile.
Evidence of QNX 8.0 Use & Build/Run Instructions
- Target & Toolchain: QNX SDP 8.0 (x86_64 QEMU Quick Start Image or Raspberry Pi 5),
qcc -Vgcc_ntox86_64forexamples/qnx-rt-demo/, Rust 1.80+ (stdonly, zero external crates) for host workbench. - Key QNX Files:
examples/qnx-rt-demo/motor_ctrl.c,examples/qnx-rt-demo/latency_bench.c,examples/qnx-rt-demo/Makefile,src/diagnostics.rs(slog2info&pidin threadsanalyzers),src/gateway.rs(QNX command allowlist), andCODELAB.md. - Quick Verification (5 seconds, no VM needed):
bash cargo test # 7/7 conformance tests pass cargo run -- doctor # Reproduces priority-inversion incident (33/100 CRITICAL, P99=142.8us) cargo run -- doctor --fixed # Verifies PTHREAD_PRIO_INHERIT fix (100/100 HEALTHY, P99=24.6us, -82.8%) cargo run -- serve --port 8088 # Live telemetry & Action Gateway dashboard # Against live QNX 8.0 QEMU target: cargo run -- mcp --ssh --host 127.0.0.1 --port 2222 --user qnxuser
How we built it
Written in 100% pure Rust standard library (std, zero external crates) for instant < 2s cross-platform builds and minimal attack surface, paired with authentic QNX Neutrino 8.0 C APIs and MCP JSON-RPC 2.0 over stdio.
Challenges & Accomplishments
- Designing a zero-dependency HTTP telemetry server, JSON-RPC 2.0 MCP router, and fail-closed command parser cleanly in pure Rust
std. - Delivering both a runnable Track 4 host tool and a complete 15-minute hands-on Best Codelab (
CODELAB.md) that lets any developer reproduce and fix a QNX 8.0 priority inversion using QEMU + Claude Code.
What's next for qnx-mcp-workbench
Adding QConn protocol transport alongside SSH, live tracelogger .kev kernel event parsing, and automated CI regression gates for QNX 8.0 firmware builds.