qnx-doctor
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
QNX Doctor
A host-side doctor for QNX OS 8.0 code: migration linter, message-passing / interrupt-thread
checker, runtime triage for pidin / slog2info / qcc output, 8.0-correct project
generator, and an MCP server so Claude, Cursor or any AI coding agent can do all of that while
it writes QNX code.
Runs on Windows, macOS and Linux (Python 3.9+, no dependencies). Targets QNX SDP 8.0 (x86_64 QEMU and aarch64le boards).
Why
QNX 8.0 is free for non-commercial use, so a lot of code is about to move to it: QNX 7.x code from vehicles, robots and medical devices, plus new developers (and their AI assistants) who learned from 7.x-era examples. QNX 8.0 changed things that compile fine today but break at run time:
ISRs are gone.
InterruptAttach()was removed; drivers must use Interrupt Service Threads.Receive IDs are 64-bit.
int rcvid = MsgReceive(...)truncates the value, so replies go to the wrong client or fail.Events must be registered. A server's
MsgDeliverEvent()fails unless the client calledMsgRegisterEvent().Mutexes in shared memory are process-private by default. You now need
PTHREAD_PROCESS_SHARED.sleepon,
nap(),itoa(),/dev/mem,ClockPeriod()changes,libmq, 32-bit targets and C++11/14 were removed or changed.
QNX code also has its own failure modes that ordinary C linters don't know about. A server that
forgets to MsgReply() leaves clients REPLY-blocked for good. A pulse handled as a message
corrupts state. An IST that never unmasks its interrupt goes silent after the first interrupt.
Two servers that send to each other deadlock.
QNX Doctor encodes these rules, each linked to the official QNX 8.0 documentation, and checks them at four points: when the code is written (MCP/AI), when it is committed (CI/SARIF), when it is built (qcc log explainer), and when it runs (pidin/slog2 triage).
Related MCP server: mcu-debug-mcp
Features
Command | What it does |
| 48 QNX-specific rules for C/C++ and Makefiles/buildfiles: 28 for 7.x→8.0 migration plus message passing, ISTs/hardware, resource managers and RT scheduling. Output as text, JSON, SARIF (GitHub code scanning) or Markdown |
| Mechanical 8.0 migrations ( |
| Markdown migration report with a per-rule fix plan and effort estimate |
| Wait-for graph from |
|
|
| Explains |
| 8.0-correct skeletons: |
| API index: header, library, 8.0 status and replacement, official doc URL (with |
| All of the above as 12 MCP tools + 2 prompts ( |
Quick start
pip install -e . # or just: python -m qnx_doctor ...
qnx-doctor lint examples/legacy71
qnx-doctor fix examples/legacy71 # preview the automatic part
qnx-doctor report examples/legacy71 -o migration.md
qnx-doctor pidin tests/fixtures/pidin_deadlock.txt
qnx-doctor slog2 tests/fixtures/slog2_crash.txt
qnx-doctor new ipc sensor && cd sensor && make # needs QNX SDP 8.0 envExample (legacy QNX 7.1 UART driver):
examples/legacy71/irq_driver.c:36:10: error: [QD101 removed-isr-api] InterruptAttach() was removed in QNX OS 8.0: interrupt service routines (ISRs) are no longer supported.
| id = InterruptAttach(UART_IRQ, uart_isr, NULL, 0, _NTO_INTR_FLAGS_TRK_MSK);
= fix: Attach an Interrupt Service Thread instead: call InterruptAttachThread() ... Run `qnx-doctor new ist` for a template.
= docs: https://www.qnx.com/developers/docs/8.0/com.qnx.doc.qnxsdp.migration/topic/kernel.html
examples/legacy71/irq_driver.c:40:9: warning: [QD302 heavy-work-in-ist] printf() inside the interrupt-service loop ...examples/legacy71 is a small QNX 7.1-style code base (an IPC server and client, an ISR driver,
a resource manager and a Makefile) that produces 26 findings. examples/ported80 is the same code
after qnx-doctor fix plus the manual fixes from the report. It has 0 findings and builds with qcc.
Tutorial: Porting a QNX 7.1 message-passing server and ISR driver to QNX 8.0 walks through this port step by step.
Use it from Claude / Cursor (MCP)
claude mcp add qnx-doctor -- python -m qnx_doctor mcpCursor / Claude Desktop (mcpServers):
{ "qnx-doctor": { "command": "python", "args": ["-m", "qnx_doctor", "mcp"] } }Tools: qnx_lint_code, qnx_lint_path, qnx_fix_code, qnx_migration_report,
qnx_explain_rule, qnx_explain_build_log, qnx_analyze_pidin, qnx_analyze_slog2,
qnx_scaffold, qnx_api_lookup, qnx_toolchain_status, qnx_build.
The port-to-qnx8 prompt runs the agent through report → fix → re-lint → qcc build → explain
errors until the tree is clean. Target access over ssh is limited to a fixed list of read-only
commands (pidin, slog2info, ...).
CI
examples/github-code-scanning.yml uploads findings as SARIF, so they show up as GitHub code
scanning alerts on pull requests, each linking to the QNX 8.0 documentation.
Build and run instructions (QNX version, target, toolchain)
QNX version: QNX SDP 8.0 (QNX Everywhere, non-commercial licence).
Host: Windows / Linux / macOS, Python ≥ 3.9. The analyzer needs no SDP.
Toolchain for generated and ported code:
qcc -Vgcc_ntox86_64(GCC 12) or-Vgcc_ntoaarch64le. Sourceqnxsdp-env.sh/qnxsdp-env.batfirst.Target: QNX 8.0 x86_64 QEMU VM created with
mkqnximage --type=qemu --arch=x86_64 --run. A Raspberry Pi 4/5 also works withmake ARCH=aarch64le.
pip install -e ".[test]" && pytest -q # 102 tests, no QNX needed
source ~/qnx800/qnxsdp-env.sh
VM=root@<qemu-ip> ./scripts/qemu-smoke.sh # build + deploy + run + live triagescripts/qemu-smoke.sh builds all three skeletons and examples/ported80 with qcc, explains the
real qcc errors from examples/legacy71, deploys the binaries to the QEMU VM and runs them. It then
collects live pidin and slog2info analysis over ssh and writes everything to evidence/.
Rules
ID | Name | Severity | Category | Autofix |
QD101 |
| error | migration | |
QD102 |
| warning | migration | |
QD103 |
| error | migration | |
QD104 |
| error | migration | yes |
QD105 |
| error | migration | |
QD106 |
| error | migration | |
QD107 |
| warning | migration | |
QD108 |
| error | migration | |
QD109 |
| error | migration | |
QD110 |
| warning | migration | |
QD111 |
| error | migration | yes |
QD112 |
| warning | migration | yes |
QD113 |
| warning | migration | yes |
QD114 |
| error | migration | |
QD115 |
| error | migration | |
QD116 |
| warning | migration | |
QD117 |
| error | migration | |
QD118 |
| error | migration | yes |
QD119 |
| error | migration | |
QD120 |
| error | migration | |
QD121 |
| warning | migration | yes |
QD122 |
| warning | migration | |
QD123 |
| note | migration | |
QD124 |
| error | migration | yes |
QD125 |
| error | migration | yes |
QD126 |
| error | migration | |
QD127 |
| warning | migration | |
QD128 |
| error | migration | |
QD201 |
| error | ipc | |
QD202 |
| warning | ipc | |
QD203 |
| warning | ipc | |
QD204 |
| warning | ipc | |
QD205 |
| warning | ipc | |
QD206 |
| warning | ipc | |
QD207 |
| note | ipc | |
QD208 |
| error | ipc | |
QD209 |
| note | ipc | |
QD301 |
| error | interrupts | |
QD302 |
| warning | interrupts | |
QD303 |
| warning | interrupts | |
QD304 |
| warning | interrupts | |
QD305 |
| note | interrupts | |
QD401 |
| warning | resmgr | |
QD402 |
| warning | resmgr | |
QD403 |
| error | resmgr | |
QD404 |
| error | resmgr | |
QD501 |
| warning | realtime | |
QD502 |
| warning | realtime |
Suppress a finding with // qnx-doctor: ignore[QD204] on the same line or on the line above.
List the rules with qnx-doctor rules, or explain one with qnx-doctor rules QD118.
How it works
source.pymasks comments and string literals while keeping offsets, then finds function and loop bodies by brace matching. No libclang and no SDP are needed, and it works on partially-ported code that doesn't compile yet.rules.py: each rule is a small function with its message, fix, docs links and an optional regex autofix. Every rule has positive and negative tests.pidin.pybuilds a process-level wait-for graph from the SEND/REPLY Blocked column and a thread-level graph from MUTEX owners, then looks for cycles and stalls.slog2.pyparses everyslog2infocolumn layout (-t,-s,-S,-f) and matches failure signatures.mcp_server.pyis a dependency-free MCP stdio server (optionally via the officialmcpSDK with--sdk).
Limitations
The analysis is heuristic (pattern-based, per file). It can miss cross-file flows, and it reports "possible" issues as warnings. Rules point to the official docs, so treat them as review prompts. Not affiliated with or endorsed by BlackBerry/QNX. QNX is a trademark of BlackBerry Limited.
License
MIT
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
Lints + auto-fixes how AI coding agents discover any new product. 24 rules, 6 tools, score 0-100.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Run, build, and validate firmware on virtual hardware from your AI agent. Hardware knowledge corpus.
Read-only AI coding tools for change verification, release readiness, capacity, and guidance.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to automate CODESYS V3 PLC development, including project editing, builds, library and alarm management, online variable read/write/force operations, and CODESYS documentation search via MCP.4MIT
- AlicenseAqualityBmaintenanceEnables AI agents to directly inspect and debug embedded hardware: reading/writing serial ports and bus devices, auto-detecting baud rates, parsing Modbus/NMEA/custom binary frames, plus diagnosing failures through a 45-rule fault-pattern library, error-code tables, and compile/flash error translation. Also provides pin-conflict checking, register and Cortex-M fault decoding, pre-validated driver and component selection libraries, board knowledge, and guarded flashing with post-flash byte-level verification.59MIT
- AlicenseNot gradedqualityAmaintenanceEnables developers using agentic AI tools to scaffold applications and integration cards, retrieve API references and best-practice guidelines, inspect project metadata, validate manifests, and detect and fix framework-specific code issues.547 npmMIT
- AlicenseAqualityBmaintenanceEnables AI coding agents to build, flash, debug, and communicate with STM32 microcontrollers over ST-Link entirely within the conversation. Provides headless CubeIDE builds, OpenOCD flashing, hardware breakpoints, live SWD variable monitoring resolved by C symbol names, fault triage, and pooled serial VCP I/O with deterministic sequencing for hardware-in-the-loop tests.35MIT