qnx-mcp
qnx-mcp lets an MCP coding agent manage QNX targets, build/deploy/run programs, inspect crashes and system state, and transfer files without a target shell.
Discover, create, boot, stop, destroy, and inspect QEMU QNX 8.0 targets, subject to allowlists and pinned host keys.
Build QNX executables with the SDP via qcc, make, or cmake and return diagnostics, artifacts, build IDs, and debug info.
Deploy and run host-built binaries or existing target programs with timeouts, capped output, process-group cleanup, and structured outcomes.
Start, poll, and stop long-running background runs with output cursors.
Analyze crash cores with gdb: faulting frames, source lines, locals, all thread stacks, signals, and verified build/path/pid provenance.
Upload, download, and list target files with size/SHA-256 checks and path/symlink safety rules.
List processes and thread states, stop approved non-system processes, and read/filter slog2 logs.
Run host environment checks for SDP, QEMU/KVM, SSH, allowlist, workspace, and related prerequisites.
Provides tools to create, boot, start, and stop QNX QEMU targets, manage QEMU-backed target lifecycle, and deploy/run programs on the QNX OS running inside QEMU.
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., "@qnx-mcp boot target tb, deploy and run crash_demo, then get its backtrace"
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.
qnx-mcp
Build, run and debug on QNX 8.0 through 21 typed tools. The coding agent gets no target shell tool. On managed QEMU guests, programs still run as root by default. Set QNX_MCP_RUN_AS for non-root program runs. This is not a sandbox.
In 50 timed-out runs of a hanging program, plain SSH left 50 processes and qnx-mcp left none. In 40 stale-core cases, gdb warned each time, then printed 30 unreadable stacks and 10 with the wrong function names. qnx-mcp refused all 40. Both arms of the agent study fixed 80 of 80 seeded bugs. The no-shell arm needed more turns (What the study shows).
Quickstart | Run the proof tests | Security model
qnx-mcp is a Model Context Protocol (MCP) server for QNX developers who want a coding agent to build, run and debug programs on a QNX OS 8.0 target. It gives the agent 21 typed tools in place of a raw SSH shell. Every run has a deadline and capped output. A crash comes back as a source-level backtrace, and a verified backtrace requires a matching build ID, executable path and pid. It works with Claude Code and Codex.
The reported live runs used QNX 8.0 x86_64 in QEMU, as root and with non-root program execution. Existing SSH targets can be registered. Registration has offline tests. No live AMI or board result is claimed here.

Demo video: qnx-mcp: a QNX 8.0 target for AI coding agents
Step-by-step codelab: Give your AI coding agent a QNX target
Design notes: docs/DESIGN.md. Test logs and target observations: docs/evidence.
Quickstart
You need an Ubuntu x86_64 build host with KVM and QEMU, and QNX SDP 8.0 (tested with the non-commercial licence). On macOS or Windows, run the agent there and qnx-mcp on such a host; see Agent on macOS or Windows. Details are under Requirements and tested versions.
git clone https://github.com/NikhilGogu/qnx-mcp.git && cd qnx-mcp
python3 -m venv ~/venv-qnx-mcp
~/venv-qnx-mcp/bin/pip install -e '.[test]'
claude mcp add -s project qnx -e QNX_MCP_ALLOW_TARGETS='dev*' -- ~/venv-qnx-mcp/bin/qnx-mcpThe package is installed from the clone; it is not on PyPI. Start claude and type a first prompt:
What qnx tools do you have? Run environment_check and tell me if anything needs fixing.The agent should list the 21 tools and report that every required check passes. Then ask it to create a target (the allowlist above accepts names that start with dev):
Create a QNX target named dev1 and show me its status.From there the agent can build, deploy, run, read crash backtraces, thread states and logs. Configure your agent covers Codex and running the server through ssh -T; the codelab walks through a crash and a deadlock.
Related MCP server: STM32 GDB MCP Server
What is new
Exact core path from dumper: a small helper on the target registers a pulse with dumper (
DCMD_DUMPER_NOTIFYEVENT) before the program starts. When the program dies from a signal dumper handles, the helper waits for the pulse that carries the pid and asksDCMD_DUMPER_GETPATHfor the core path. The agent never guesses a core file name.Core provenance check:
get_crashverifies the core's executable path, pid and GNU build ID against the binary that was deployed, and refuses a stale or mismatched core withcore_mismatch. Plain gdb only warns. See docs/PROOF_TESTS.md.Process-group cleanup: each run gets its own process group, which is killed when the program ends, so a hung program does not leave copies behind. A child that leaves its process group with
setsid()can survive;process_stopcan end it afterwards.
Why it matters for QNX
Crash evidence tied to one build:
get_crashmarks a backtrace verified only when the core's executable, its pid and its GNU build ID match the run that crashed. A rebuilt binary is refused withcore_mismatch, so a backtrace in a bug report names the exact build. That matters to a team that has to explain a field failure.Bounded runs: Each run has a wall-clock deadline, capped output and its own process group, which is killed when the program ends. A descendant that calls
setsid()leaves the group and keeps running;process_stopcan end it afterwards. If the client cancels the call, the program is killed on the target. The outcome is one ofexited,crashed,killed,timeout,stoppedorexec_failed.Next to QNX's own agent work: QNX publishes agent skills (qnx/qnx-agent-skills) with QNX facts and procedures, and a way to run Claude Code on a QNX system (qnx/claude-code-qnx). qnx-mcp is the tool layer from the build host: it builds, runs and analyses crashes on the target (DESIGN section 1).
Agent-driven test loops on QNX targets in CI: Targets are created and booted headless, the server speaks MCP over stdio, and results are structured JSON, so the loop of build, run, read the crash and fix can be scripted on a host that has KVM and the SDP, for example a self-hosted runner. The hosted CI of this repository runs only the offline tests, because the live-target tests need a QNX SDP.
Limits: managed targets are QEMU x86_64 images created by mkqnximage on a libvirt network. Real boards and aarch64 QEMU targets are not supported (aarch64 builds work). The full list is under Limitations.
For judges
Each row points at something you can open or run.
Criterion | Where to look |
Technical work | The target runner |
Design | Quickstart, the codelab, |
Potential impact | Agent test loops on QNX targets that a self-hosted CI runner can script (see below). QNX publishes its own agent skills (qnx/qnx-agent-skills); qnx-mcp is the tool layer next to them (DESIGN section 1) |
QNX-specific work | The dumper pulse and |
Honest limits |
Install
git clone https://github.com/NikhilGogu/qnx-mcp.git && cd qnx-mcp
python3 -m venv ~/venv-qnx-mcp
~/venv-qnx-mcp/bin/pip install -e '.[test]'
QNX_MCP_ALLOW_TARGETS='dev*' ~/venv-qnx-mcp/bin/qnx-mcp # MCP over stdio; normally your agent starts itThe target-side helper is compiled with the SDP's qcc on first use and uploaded to each target; nothing has to be installed on the target.
Configure the server
Configuration is by environment variable:
Variable | Default | Meaning |
| none (refuses every target) | Comma-separated globs of target names this server may touch, e.g. |
|
| One mkqnximage directory per target |
|
| Locks, pinned host keys, run records, binary snapshots, cores (mode 0700) |
| the directory the server was started in | Colon-separated host directories; every host path argument must resolve inside them (symlinks are resolved first). |
|
| The SDP environment script |
|
| Key installed into images by |
|
| Lease file used to find target addresses |
| not set |
|
| none (refuses every | Comma-separated globs of hosts that SSH-only targets may be registered for, e.g. |
|
| Colon-separated target directories below which |
| not set (programs run as the login user: root on QEMU targets) | Numeric |
Target creation and start take a while, so raise client tool timeouts where a client has them.
Configure your agent
Claude Code (tested, transcript in docs/evidence/claude-code-session.json):
claude mcp add -s project qnx -e QNX_MCP_ALLOW_TARGETS='dev*' -- ~/venv-qnx-mcp/bin/qnx-mcpWith the SDK and QEMU on a separate build box, run the server there through ssh (this is the configuration that was tested):
claude mcp add -s project qnx -- ssh -T buildbox env "QNX_MCP_ALLOW_TARGETS='dev*'" /home/me/venv-qnx-mcp/bin/qnx-mcpAgent on macOS or Windows. QEMU targets need KVM, so qnx-mcp, the QNX SDP and the targets stay on a Linux x86_64 host, and the agent on your laptop starts the server there through ssh -T, as above. Two things change:
Host paths in tool calls are paths on the Linux host. The agent has to read and edit the project there, for example through your editor's remote mode, or in a directory both machines mount.
The ssh session starts in your home directory on the Linux host, so set the workspace explicitly:
claude mcp add -s project qnx -- ssh -T buildbox env "QNX_MCP_ALLOW_TARGETS='dev*'" \
QNX_MCP_WORKSPACE=/home/me/project /home/me/venv-qnx-mcp/bin/qnx-mcpqnx-mcp --check on a machine without /dev/kvm says the same. This setup is untested from a Mac or a Windows machine.
Codex CLI (tested, transcript in docs/evidence/codex-session.json), in ~/.codex/config.toml:
[mcp_servers.qnx]
command = "ssh"
args = ["-T", "buildbox", "env", "QNX_MCP_ALLOW_TARGETS='dev*'", "/home/me/venv-qnx-mcp/bin/qnx-mcp"]
tool_timeout_sec = 600The test passed the same keys as -c mcp_servers.qnx.command=... overrides to codex exec.
Cursor (untested), .cursor/mcp.json:
{ "mcpServers": { "qnx": { "command": "/home/me/venv-qnx-mcp/bin/qnx-mcp", "env": { "QNX_MCP_ALLOW_TARGETS": "dev*" } } } }VS Code (untested), .vscode/mcp.json:
{ "servers": { "qnx": { "type": "stdio", "command": "/home/me/venv-qnx-mcp/bin/qnx-mcp", "env": { "QNX_MCP_ALLOW_TARGETS": "dev*" } } } }Status and background
Status: v0.3.0 is the last release; main is 0.4.0.dev0 (CHANGELOG.md). v0.2 added the tools an agent needs when it has no shell on the target (file_list, process_stop, and remote_binary for deploy_and_run and run_start), and v0.2.1 fixed the defects found in them; every defect found so far and its fix is in docs/DESIGN.md section 9. v0.3.0 fixes two gaps found in the study under "What the study shows" below: process_stop handles services started with a relative path, and remote_binary refuses shells and system programs. Test logs, target observations, tool versions and client session transcripts are in docs/evidence. Design notes and the security model in detail: docs/DESIGN.md.
Tutorial: the codelab Give your AI coding agent a QNX target (about 45 minutes; source in codelab/, dry runs in codelab/DRYRUN.md). The agent skill file is skills/qnx-mcp/SKILL.md.
What the tools do
qnx-mcp composes the commands, finds the cores, picks the matching gdb and sysroot and parses the output, on the target and on the host, and returns objects:
Crash notification from dumper
A small C helper on the target (qnx-mcp-run) registers a pulse with dumper (DCMD_DUMPER_NOTIFYEVENT) before the program starts. When the program dies from a signal that dumper handles, the helper waits for the pulse carrying that pid and asks DCMD_DUMPER_GETPATH for the exact core path, then moves the core into the run's own directory. In the example below, dumper's completion pulse was already waiting when the helper saw the program exit.
Verified crash provenance
Each run keeps a snapshot of the exact binary that was deployed. get_crash downloads the core with a size and SHA-256 check and refuses it (core_mismatch) unless the executable the core names is the run's content-addressed binary, the pid in the core is the run's pid, and the GNU build ID matches. The build ID of the executable that ran is read from the dumper's link map note in the core, which records it for every loaded object, so it does not depend on the binary passed in; when that note is missing, it is read from the executable's note in the core's memory. A rebuilt binary, another program and a modified snapshot are refused, and so is a binary without a build ID when the run or core is not a remote_binary run. For a remote_binary run with no build ID in the core, get_crash returns the backtrace marked verified: false (see "Programs already on the target"). A verified backtrace requires a matching build ID, executable path and pid (test_crash_slice, test_remote_binary_runs).
Bounded runs
Every run has a wall-clock deadline, capped output (truncation is reported), stdin on /dev/null, its own process group, and the whole group is killed when the program ends, so a forked child does not outlive the run. If the client cancels a call, the server kills its ssh and the helper notices the closed session and kills the program. Long-running programs get run_start, run_poll (output cursors) and run_stop.
Structured system state
processes returns every thread with its QNX state (RECEIVE, REPLY, SEND, MUTEX, NANOSLEEP, ...), priority, policy and what it is blocked on; get_crash returns every thread's stack and the id of the thread that faulted.
Example (abridged)
From the v0.1 test run (docs/evidence/test-run-v0.1.log), the crash demo in examples/crash_demo:
deploy_and_run(target="tb", binary=".../crash_demo")
{"run_id": "r-1680de50d5cd", "outcome": "crashed", "signal_name": "SIGSEGV", "stdout": "imu: average offset 6\n",
"dumper": "notified", "core_path": "/tmp/qnx-mcp/runs/r-1680de50d5cd/crash_demo.core",
"dumper_core_path": "/data/var/dumper/crash_demo.core", "remote_path": "/tmp/qnx-mcp/apps/9216f565e767f4b9/crash_demo",
"group_clean": true,
"next_step": "call get_crash with target='tb' and run_id='r-1680de50d5cd' for a source-level backtrace"}Target timings omitted. Run the example locally for full output.
get_crash(target="tb", run_id="r-1680de50d5cd")
{"summary": "SIGSEGV (SEGV_MAPERR (address not mapped)) at fault address 0x0 in read_calibration at .../examples/crash_demo/crash.c:21; stack: read_calibration() <- average_offset() <- main(). Fault address 0x0 means a NULL pointer dereference.",
"faulting_instruction": "=> 0x52c64838b1 <read_calibration+32>:\tmov (%rax),%eax",
"frames": [{"level": 0, "function": "read_calibration", "line": 21}, {"level": 1, "function": "average_offset", "line": 28}, {"level": 2, "function": "main", "line": 46}],
"locals_frame0": [{"name": "s", "type": "const struct sensor *", "value": "0x3c26d9aab8", "arg": true}, {"name": "index", "type": "int", "value": "0", "arg": true}],
"provenance": {"core_executable": "/tmp/qnx-mcp/apps/9216f565e767f4b9/crash_demo", "core_pid": 66793494, "core_build_id": "c65158d019120da0f95c3df1a466d88b", "build_id_match": true, "executable_match": true, "pid_match": true, "verified": true}}The same call with core_path and a rebuilt binary:
{"ok": false, "error": {"code": "core_mismatch", "message": "the core's executable has build ID c65158d019120da0f95c3df1a466d88b, the binary 0d42bd18fe0b4cb9ec2eeb2e1a83556c",
"hint": "Pass the exact unstripped binary that crashed (same build), or use the run_id of the run that crashed."}}Requirements and tested versions
Tested on (commands and output in docs/evidence/versions.txt):
Component | Version |
Build host | Ubuntu 22.04.5 LTS, x86_64, KVM, libvirt |
QNX SDP | 8.0 (gcc 12.2.0 targets, |
Targets | QNX OS 8.0.0 x86_64 QEMU images built by mkqnximage |
QEMU | 6.2.0 |
Python | 3.10.12, |
OpenSSH client | 8.9p1 |
Clients | Claude Code 2.1.312, Codex CLI 0.160.0 |
aarch64 builds work (build(arch="aarch64le") is tested). aarch64 QEMU targets are not supported, but an existing aarch64le QNX 8.0 machine reachable over SSH (for example QNX's QNX OS 8.0 AMI on AWS Graviton) can be registered with target_register; that path has offline tests only, and no live run against a real machine is claimed (see "SSH-only targets").
Tools
Every tool returns JSON as MCP structuredContent (and as text). Success has ok: true; failure sets isError and returns {ok: false, error: {code, message, hint, details}}. Each declared output schema is "success object or error object", so both conform.
Tool | What it does |
| SDP, qcc, mkqnximage, gdb, KVM, QEMU, ssh, key, lease file, allowlist and workspace checks, each with a fix |
| Allowed targets under the targets dir with kind ( |
| mkqnximage build and headless boot, waits for SSH; pins the image's host keys; failed creates are removed |
| Add or forget an existing QNX 8.0 machine that is reachable only over SSH (the QNX OS 8.0 AMI): host from the operator's |
| Boot without rebuild / stop QEMU only through a pidfd of the verified QEMU process. Refused for SSH-only targets ( |
| Stop and delete a managed target ( |
| Kind, state, IP, SSH probe, target clock, dumper arguments and core naming, host key policy. |
| qcc, make or cmake with the SDP, for |
| Snapshot, verified upload, one run with deadline and caps; outcome |
| Background runs with output cursors ( |
| Verified core, gdb/MI backtrace: faulting frame, first user frame, locals, source lines, every thread's stack. For a |
| One file each way, size and SHA-256 verified; no directory, symlink or symlinked-parent destinations; never replaces a file unless |
| One target directory, read-only: name, type, size, mode, mtime, symlink target (links are never followed); sorted by name, at most |
|
|
| Stop a process qnx-mcp did not start, only if its executable is below |
|
|
More outputs from the v0.1 test run (docs/evidence/test-run-v0.1.log):
target_status(name="tb")
{"name": "tb", "state": "running", "ip": "192.168.122.130", "uname": "QNX noname 8.0.0 2026/06/05-16:26:03EDT x86pc x86_64",
"dumper_running": true, "dumper_args": "dumper -U 30:30 -d /data/var/dumper -M 1000 -D cores", "core_naming": "fixed", "host_key_policy": "image"}build(path=".../bad.c") (excerpt)
{"ok": false, "error": {"code": "build_failed"}, "diagnostics": [
{"file": ".../bad.c", "line": 4, "column": 16, "severity": "error", "message": "'y' undeclared (first use in this function)", "source": "gcc-json"},
{"file": ".../bad.c", "line": 3, "column": 9, "severity": "warning", "message": "unused variable 'unused'", "option": "-Wunused-variable", "source": "gcc-json"}]}run_start of a program printing a line every 200 ms, then run_poll, processes while it runs, run_poll from the returned offset, run_stop:
{"run_id": "r-1780d01f863c", "state": "running", "pid": 69701655, "remote_path": "/tmp/qnx-mcp/apps/38649b3e134f0afd/ticker"}
{"state": "running", "stdout": "tick 0\ntick 1\ntick 2\ntick 3\ntick 4\ntick 5\n", "stdout_next": 42}
{"pid": 69701655, "name": "ticker", "threads": [{"tid": 1, "priority": 10, "policy": "RR", "state": "NANOSLEEP", "blocked_on": null}]}
{"state": "running", "stdout_offset": 42, "stdout_next": 86}
{"was_running": true, "acknowledged": true, "state": "finished", "outcome": "stopped"}get_crash of a program whose third thread dereferences NULL while the main thread waits in pthread_join and another thread waits on a mutex: faulting_thread_id is "3", faulting_frame.function is crasher, and threads[] lists all three stacks with faulting: true on thread 3.
file_get(target="tb", remote_path="/tmp/qnx-mcp-test/.../blob.bin.txt")
{"remote_path": "/tmp/qnx-mcp-test/157045-1793725678/blob.bin.txt", "local_path": "/home/ubuntu/.qnx-mcp/state/files/tb/69f50322b9a5/blob.bin.txt",
"size": 20, "sha256": "e4a985feba6c291b0de2319ce53b41e44d6a1413c535c586a649e896ac623743", "mode": "0600", "text": "hello from the host\n"}logs(target="tb", process="sshd", since_s=3600, limit=3) (one entry)
{"total_entries": 1082, "matched": 6, "returned": 3, "entries": [{"time_iso": "2026-11-03T17:08:02.594Z", "process": "sshd_session", "pid": 71675906,
"severity_name": "info", "message": "<38>Nov 03 17:08:02 sshd-session[71675906-1]: Connection closed by 192.168.122.1 port 49756 [preauth]"}]}Without a shell on the target (v0.2 and later)
With qnx-mcp and no shell on the target, an agent can list directories, restart a program installed on the target and stop a hung one. Outputs from docs/evidence/test-run.log (tests/test_shellfree_e2e.py), abridged:
file_list(target="tb", path="/tmp/qnx-mcp-test/l1059391") (alink and boot are symlinks the test made; file_list never follows links)
{"path": "/tmp/qnx-mcp-test/l1059391", "real_path": "/data/var/tmp/qnx-mcp-test/l1059391", "real_path_verified": true, "complete": true, "total_entries": 4, "returned": 4, "truncated": false, "entries": [
{"name": "a.txt", "type": "file", "size": 6, "mode": "0644", "mtime_iso": "2026-11-04T00:39:20Z"},
{"name": "alink", "type": "symlink", "size": 5, "link_target": "a.txt"},
{"name": "boot", "type": "symlink", "size": 10, "link_target": "/proc/boot"},
{"name": "sub", "type": "dir", "size": 4096, "mode": "0755"}]}With max_entries=2 the same call returns a.txt and alink with truncated: true and total_entries: 4.
deploy_and_run(target="tb", remote_binary="/tmp/qnx-mcp-test/r1059391/bin/echoargs", args=["a b", "$(id)"])
{"run_id": "r-a684f7a8aabe", "outcome": "exited", "exit_code": 7, "stdout": "[a b]\n[$(id)]\n", "remote_binary": true, "binary": null,
"remote_path": "/tmp/qnx-mcp-test/r1059391/bin/echoargs", "binary_sha256": "b610c3606440f8f7c80590e8f4520b11396456b2277706e6c2a27d2ea05ae7d9"}The crash demo installed on the target and run the same way crashes, and next_step says that get_crash needs binary=<host path of the unstripped build of ...>, because qnx-mcp holds no copy of a program it did not deploy. get_crash(target="tb", run_id="r-60b0e584e5c8", binary=".../crash_demo"):
{"summary": "SIGSEGV (SEGV_MAPERR (address not mapped)) at fault address 0x0 in read_calibration at .../examples/crash_demo/crash.c:21; stack: read_calibration() <- average_offset() <- main(). ...",
"provenance": {"source": "remote_run", "core_executable": "/tmp/qnx-mcp-test/r1059391/bin/crash_demo", "core_pid": 164540438, "pid_match": true, "executable_match": true,
"core_build_id": "c65158d019120da0f95c3df1a466d88b", "build_id_match": true, "evidence": "build ID, executable path and pid match", "verified": true}}A rebuilt binary is refused with core_mismatch (different build ID). The same program linked with --build-id=none gets a backtrace with "verified": false and "evidence": "pid and path match; build ID not available (the binary has none)".
process_stop(target="tb", pid=167637014) of a program that was started outside qnx-mcp:
{"pid": 167637014, "name": "hang", "ppid": 1, "start_ns": 1793752782325283512, "executable": "/tmp/qnx-mcp-test/p1059391/hang",
"real_path": "/data/var/tmp/qnx-mcp-test/p1059391/hang", "signal": "SIGTERM", "signal_sent": true, "sigkill_sent": false, "exited": true, "still_running": false}A program that ignores SIGTERM returns exited: false, still_running: true after grace_s=1, with a next_step; the same call with kill_after_grace=true returns sigkill_sent: true, exited: true. Refusals are process_not_allowed errors with a hint; the messages from the log:
pid 1: pid 1 is procnto, the QNX microkernel and process manager
./sleep started in /system/bin: its executable /system/bin/sleep is in /system, a system directory
slogger2: its executable /proc/boot/slogger2 is in /proc/boot, a system directory
/system/bin/sleep: its executable /system/bin/sleep is in /system, a system directory
a symlink in /tmp to /system/bin/sleep: it is in a system directory (/tmp/qnx-mcp-test/p1059391/sleeplink resolves to /system/bin/sleep)
the runner of a background run: it is qnx-mcp's own runner, which enforces the deadline of a run; use run_stop for runsServices started with a relative path, the way the evaluation's field services are (cd dir && ./prog &), are found through /proc/<pid>/exefile: for a program started as ./hang the result has "executable": "/data/var/tmp/qnx-mcp-test/p1059391/./hang", "real_path": "/data/var/tmp/qnx-mcp-test/p1059391/hang", "exited": true.
remote_binary refuses shells and system programs, also through a link (path_not_allowed): /proc/boot/ksh "is refused: it is a shell"; /system/bin/slay "is in /system, a system directory"; a link in /tmp to /proc/boot/ksh "is in a system directory (it resolves to /proc/boot/ksh)".
A program that execs /system/bin/sleep when it gets SIGTERM, stopped with grace_s=1, kill_after_grace=true, returns an error with details.signal_sent: true: "SIGTERM was sent to process 169095190 and it did not exit; SIGKILL was not sent because its start time differs (the pid was reused, or the program called exec)".
SSH-only targets (QNX OS 8.0 AMI)
A target does not have to be a QEMU image that qnx-mcp built. Any QNX 8.0 machine you can log in to over SSH works as a second kind of target, for example QNX's official QNX OS 8.0 AMI on an AWS Graviton instance (aarch64le, user qnxuser, several cores). target_list and target_status show kind: qemu or ssh.
Set up, once:
Start the machine with its own tooling (AWS console or CLI), with your public key authorised for
qnxuser.Add the machine to the server's environment:
QNX_MCP_SSH_HOSTS=<its address>, and a name thatQNX_MCP_ALLOW_TARGETSaccepts (for exampleami*). SetQNX_MCP_SSH_KEYto the private key (no%or$in the path).Get the machine's host key fingerprint from a source other than the machine's first answer, for example the instance's console output or
ssh-keygen -l -fon a copy of its host key. It looks likeSHA256:followed by 43 characters.Ask the agent to register it:
target_register(name="ami1", host="<address>", arch="aarch64le", user="qnxuser", host_key_fingerprint="SHA256:..."). The first connection pins the key it presents, and only if it hashes to the fingerprint; every later connection checks the pin strictly (StrictHostKeyChecking=yes). Without a fingerprint the registration is refused unless the operator setQNX_MCP_TRUST_FIRST_USE=1, which pins whatever key answers first.build(path=..., target="ami1")cross-compiles for the machine's architecture (qcc -Vgcc_ntoaarch64le), thendeploy_and_run,run_start/run_poll/run_stop,get_crash,file_put/file_get/file_list,processesandlogswork as on a QEMU target.target_unregisterremoves the registration, the pin and the run records on the host and does not touch the machine.
What differs from a QEMU target:
target_start,target_stopandtarget_destroyrefuse withtarget_kind_unsupportedand say what to do instead. qnx-mcp did not build the machine and cannot power it.The login user is not root.
QNX_MCP_RUN_AScannot be used there (every run is refused withconfig_errorwhile it is set),target_statusshowsprivileges.login_user, andprocess_stopcan stop only processes that user may signal.qnx-mcp puts the runner and the agent's programs under
/tmp/qnx-mcpon the machine and nothing else.dumpermust be running there and able to write the core of a program run by that user; if its core directory is on another filesystem than/tmp/qnx-mcp, the runner cannot move the core anddeploy_and_runreportscore_move_errorwithdumper_core_path.environment_checktreatskvm,qemu-system-x86_64,mkqnximageanddhcp_leasesas optional whenQNX_MCP_SSH_HOSTSis set and no QEMU target exists. It addsssh_hostsandtool:ssh-keygen. Building still needs the QNX SDP on the build host.
Status: the registration, host key, refusal and architecture logic is covered by tests/test_ssh_target.py with a fake ssh that follows OpenSSH's host-key rules. tests/test_ssh_target_e2e.py is the live suite for it. No live AMI result is claimed. Run it as described under Tests.
What the study shows
Agents fixed the same bugs with and without a shell on the target. In both arms every fix passed its oracle. The cost was more turns for the agent with qnx-mcp and no shell. The study did not measure what qnx-mcp adds beyond that: typed and bounded calls, crash evidence tied to one build, and no shell on the target. The study used qnx-mcp 0.2.1; 0.3.0 fixed the two gaps it found (listed below).
The evaluation in eval/ gave agents eight seeded QNX bugs whose fault needs evidence from the target (a buffer overflow, a deadlock across processes, a resource manager whose error shows in slog2, a stack overflow, a hang, a NULL dereference in a worker thread, a CMake cross-build, a file descriptor leak). The protocol is preregistered in eval/PROTOCOL.md; tasks, harness, summaries and every trial transcript are in eval/results/raw.tar.xz.
Arm A: QNX's agent skills and a root shell on the target over SSH.
Arm C: the same skills and qnx-mcp 0.2.1. The agent's ssh, scp and sftp were PATH wrappers that refused the target, and every transcript was reviewed. The agents ran as the same Unix user as the harness and kept a shell on the build host for their workspace.
5 trials per task, arm and model, with Claude Sonnet 5.5 and Haiku 5.5 in Claude Code 2.1.312: 160 trials, all scored (summary). An oracle with unseen inputs scored each fix, and a blind judge scored the stated root cause.
model | arm | oracle pass | root cause (blind judge) | median turns [range] | median cost USD [range] |
Sonnet 5.5 | A (root shell) | 40/40 | 39/40 | 10 [2-16] | 0.123 [0.087-0.194] |
Sonnet 5.5 | C (qnx-mcp, no shell) | 40/40 | 40/40 | 20 [13-43] | 0.198 [0.128-0.354] |
Haiku 5.5 | A (root shell) | 40/40 | 40/40 | 16 [10-44] | 0.019 [0.013-0.038] |
Haiku 5.5 | C (qnx-mcp, no shell) | 40/40 | 39/40 | 37 [20-64] | 0.028 [0.021-0.051] |
Arm C needed about twice the turns and cost 61 percent (Sonnet) and 47 percent (Haiku) more per trial at the median. Paired by task and repetition, C minus A was +10 turns and +0.067 USD for Sonnet, and +18 turns and +0.008 USD for Haiku. The study's agents cost 15.31 USD, and all of phase 3 (smoke test, pilot, study, blind judge) 17.98 USD, by Claude Code's list-price estimates. No arm C agent tried ssh, scp or sftp, and qnx-mcp's own 3643 ssh and scp calls reached only the trial targets.
Two gaps in qnx-mcp 0.2.1 showed up; 0.3.0 fixes both:
process_stoprefused services started with a relative path (23 of 80 arm C trials; the agents then checked their fix with their own copy of the service).remote_binarywould have started a shell or a system program as root (no agent did).
Limits:
Both arms passed the oracle in every trial; with 40 of 40, the 95 percent lower bound of each pass rate is 0.91.
One root-cause miss (Haiku, arm C, v2-02) is a judge parse failure: the judge returned no parsable verdict, and the trial counts as a miss.
The v2-04 oracle accepts a stack-size workaround: a Sonnet arm A agent enlarged the thread stack, the judge rated that as masking the unbounded recursion, and the oracle passed it.
The tasks are our own small programs on QEMU, with one client and two models.
Security model
The agent is treated as capable, fallible and possibly prompt-injected. The server enforces the limits, and the tool descriptions explain them. This table is the short version.
Risk | Covered? | How, or why not |
Agent arguments that run host commands (compiler, linker and make options) | Yes |
|
Agent host paths outside the project | Yes | Every host path must resolve inside the workspace, symlinks included |
Agent mistakes on the target: stopping a system process, starting a shell, writing into qnx-mcp's directory | Yes, for mistakes | Path rules in |
The agent's own program acting as root on the target | Only with | By default programs run as the login user, which is root on QEMU targets. With |
Build files in the workspace running host commands | No | make and cmake run the tree's own files with the server user's rights. Only build trees you trust |
The agent using the target's SSH key directly | No | qnx-mcp reads the key as the server user. An agent with a shell as that user can use it too. Run the agent as another user if this matters |
These rules guard the build host against what an agent passes in, and guard against mistakes. They are not a sandbox against a hostile agent.
Scope of the path rules (v0.2 and later)
The rules on process_stop, file_list and remote_binary guard against mistakes: an agent stopping a system process, starting qnx-mcp's own runner, or misreading where a directory is. They do not stop an agent that sets out to break them: deploy_and_run runs any program the agent builds, as root unless QNX_MCP_RUN_AS is set, and a root program can stop any process or change any file. Since v0.3.0 remote_binary refuses shells and system programs; a program the agent builds can still do what a shell does. The races that remain are listed under Limitations.
Targets
Names must match [a-z][a-z0-9_-]{0,31} and the allowlist; an unset or empty allowlist refuses everything. A target directory that is a symlink, or resolves outside the targets dir, is refused. target_destroy only deletes mkqnximage directories directly inside the targets dir.
SSH-only targets
target_register makes the server log in to a machine with the operator's key, so the operator decides which machines: QNX_MCP_SSH_HOSTS (unset refuses every registration). The host must be a DNS name or IP address; link-local, unspecified, multicast and reserved addresses (cloud metadata services) and names a resolver could read as a number are refused. Port, user and architecture are validated, the key path has no % or $, the registration file is a small regular file that is validated again on every read, and a directory that holds both a QEMU image and a registration is refused. Host-key checking is never turned off: the first key is pinned only if it matches the given fingerprint (or only with QNX_MCP_TRUST_FIRST_USE=1), later connections use StrictHostKeyChecking=yes, and a pin that goes missing is not replaced for a fingerprint target. The login is key-only with agent and X11 forwarding off. The VM lifecycle tools refuse. All argument bounds, allow-lists and the checks of /tmp/qnx-mcp apply as for QEMU targets. The server's key opens every machine the allowlist names, so list only machines you mean it to use. One address range is not refused by the host check: the IPv6 unique-local range (fc00::/7), where one cloud metadata service has its IPv6 address; the allowlist is what keeps the server away from it.
Target identity
mkqnximage generates the image's SSH host keys on the host (--sshd-pregen=yes, its default; target_create passes it explicitly). They are stored in local/misc_files/ of the target directory and copied to /data/var/ssh on the image's persistent data partition, so they survive reboots (tested: SSH with StrictHostKeyChecking=yes after stop and start). qnx-mcp pins them under HostKeyAlias=qnx-mcp-<name>; a VM that does not present the pinned key gets host_key_mismatch, whatever its address. A target without pre-generated keys is refused (host_key_missing) unless QNX_MCP_TRUST_FIRST_USE=1 is set, which pins whatever key answers first (weaker; not tested against a real image). Expired DHCP leases are ignored; mkqnximage --getip is the fallback.
No shell tool
Remote commands are fixed argument lists; agent arguments are quoted one by one. A test passes $(touch ...), ; touch ..., backticks, quotes, *, a newline and U+2028 and checks that the program receives them unchanged.
Build arguments are allow-listed
make and gcc have options that run a program or read a file of commands, so build checks every agent argument against a list of forms and refuses anything else with invalid_argument naming it, before any tool starts. qcc mode passes cflags and ldflags to qcc. cmake mode sets CMAKE_C_FLAGS and CMAKE_CXX_FLAGS from cflags and CMAKE_EXE_LINKER_FLAGS from ldflags on every configure, empty when they are omitted, so flags from an earlier call do not stay in the cache. make mode refuses both, because the server hands make no flags; pass CFLAGS=... or LDFLAGS=... in make_args. cflags and ldflags: -O*, -g*, -W* warnings, -D, -U, -l, -std=, -f* and -m* options, -pthread, -static, -shared, -pie, -MD/-MMD/-MP, -I, -L, -isystem and -iquote inside the workspace, -include with a file inside the workspace, -fdebug-prefix-map, -ffile-prefix-map and -fmacro-prefix-map with plain paths, .o and .so inputs that are ELF files and .a inputs that are ar archives, inside the workspace (qcc mode; ld would read any other file as a linker script), and -Wl, only with --build-id[=none|sha1|md5|uuid], --gc-sections, --as-needed, --no-as-needed, --no-undefined, --export-dynamic, -E, -O1, -z with relro, norelro, now, lazy, noexecstack or defs, or -Map=<workspace path>. -I, -L, -D, -U, -isystem, -iquote and -include may also come as two list elements (["-I", "include"]), and the second is checked as in the joined form. In qcc mode a -D value may be a double-quoted string without spaces or shell characters (-DVERSION="1.2"); make and cmake pass flags through a shell in their recipes, so there it is refused. Refused among others: -Wa,, -Wp,, -Xlinker, -wrapper, -specs=, -fplugin, -fdump, -fuse-ld, other -f options with a path, -B, -o, -include outside the workspace, -Wl,--wrap, -Wl,-rpath (ld also searches those directories on the build host), linker scripts, --sysroot and @file. make_args for make: target names, -j N, -k, -s, -B, -n, -w, CFLAGS, CXXFLAGS, CPPFLAGS, LDFLAGS and LDLIBS whose words are allowed flags, PREFIX and DESTDIR inside the workspace, and V, VERBOSE or DEBUG set to a small number or yes/no; so no -f, -C, --eval, SHELL=, CC= or CROSS_COMPILE=. For cmake: --target NAME, -j N, --parallel N, --config, --clean-first, -v. Apart from those quoted qcc -D strings, values never contain whitespace, $, quotes, backticks or ;. Sources may not start with - or @, and in qcc mode need a C, C++ or assembly extension (.c, .cc, .cpp, .cxx, .s, .S), since gcc hands any other file to the linker. Tests: test_build_rejects_unsafe_arguments (69 refused forms), test_build_rejects_unsafe_pairs_and_values (33 refused near-misses), test_build_passes_allowed_arguments and test_build_passes_separate_and_wider_forms; test_live_test_build_arguments_pass_the_allow_list checks every literal build call in the SDK and end-to-end tests against the list.
Validated paths
Remote paths must be normalised (no //, ., .. or trailing /) and use [A-Za-z0-9._+/-] only. file_put writes only below /tmp or /data and never into qnx-mcp's own directory, also not through an alias such as /data/var/tmp/qnx-mcp (the runner compares real paths); parents are opened one by one without following symlinks, directories and symlinks are refused as destinations, and installation is atomic. file_get stages the download in the server state and installs it through a descriptor of the destination directory without changing that directory, never replacing a file or following a symlink unless overwrite is set for a regular file. Every host path (build path, sources, output, -I/-L and the cmake build directory, deploy_and_run/run_start/get_crash binary, file_put and file_get local paths) and every source file read for backtraces (paths come from DWARF) must resolve, symlinks included, inside the workspace: QNX_MCP_WORKSPACE, or the directory the server was started in when it is not set. environment_check reports the effective workspace and fails if it fell back to /. Source context is only read from C/C++ source files.
Listing
file_list reads one directory anywhere on the target (as file_get reads any file) and never follows links inside it; the directory itself may be reached through a link. real_path is resolved separately and real_path_verified says whether it names the directory that was read (same device and inode, checked after reading). A failed readdir gives complete: false. Output is bounded (max_entries at most 1000, and the runner gives up after 30 s).
Programs already on the target
remote_binary must be a normalised absolute path to an executable regular file below /tmp or /data (QNX_MCP_REMOTE_BINARY_ROOTS), outside /proc/boot, /bin, /sbin, /usr, /system and /tmp/qnx-mcp, and not named like a shell (sh, ksh, bash, QNX's esh, fesh and uesh, toybox, busybox and others). The host checks the path as given; the runner on the target checks it again by real path, before and just before the program starts, so a link in /tmp to /proc/boot/ksh is refused (tested). A crash is tied to a host binary only by the GNU build ID in the core; without one, get_crash still returns the backtrace but with verified: false and evidence: "pid and path match; build ID not available".
Stopping processes
process_stop first reads the process's identity: its start time in nanoseconds from its /proc entry (DCMD_PROC_INFO, the creation token), its executable from /proc/<pid>/exefile (documented by QNX as the path of the executable used to run the process; for a relative start it is the start directory joined with the relative path, tested), and the path pidin shows, which must name the same file. The runner then opens /proc/<pid>/ctl, requires the same start time, reads the executable again, resolves it, and signals through that descriptor. The executable, in normal form, and its resolved path must both be below /tmp or /data and outside /proc/boot, /bin, /sbin, /usr, /system and qnx-mcp's runner directory; pid 1, procnto and critical processes are refused, and so are a symlink in /tmp to a system program and ./sleep started in /system/bin (tested). Right before each signal (SIGTERM, and SIGKILL after the grace period) the start time, the critical flag and the executable path are read again through the held descriptor and nothing is sent if they changed; on QNX 8.0 an exec gives the process a new start time (tested). A state that cannot be read is an error result that says which signal was sent, never exited.
Builds run code
build runs the project's own make or cmake files, which can execute anything on the build host. The allow-list covers only the arguments an agent passes, not the build files or sources in the tree. Only point it at trees you trust.
Bounded execution
Host commands run in their own process group with timeouts and capped output; cancelled calls kill their processes. Target programs have deadlines and output caps; cores are size-limited before download and after decompression.
Locking
Per-target flock: exclusive for lifecycle changes, shared for runs, probes and inspection, so processes works during a run and target_stop waits for runs in progress (both tested). Waiting fails with target_busy after 120 s.
Privileges
qnx-mcp logs in to mkqnximage targets as root. By default the agent's programs run as root too, so a program the agent builds can do anything root can. Set QNX_MCP_RUN_AS=uid:gid and the runner starts the program as that user. The runner itself stays root, because it talks to dumper, moves the core and reads /proc. In the child it sets the groups to the gid alone, then calls setgid and setuid. It then checks the real and effective ids and checks that setuid(0) fails. If any step fails, the program does not start: the run ends with exec_failed and exec_error says why. The run directory becomes mode 0711 with 0600 files, so the program cannot list or read the runner's files. It gets an empty work directory as its working directory. Files left in work are removed by a process running as that user, so root never follows a link the program planted. Run results carry run_as. environment_check and target_status report privileges: the login user, who the program runs as, and for each tool which identity it uses and what it needs on the target (src/qnx_mcp/abilities.py). qnx-mcp's directories on the target are owned by root and get the same modes whoever programs run as, so root and non-root runs can follow each other in any order. /tmp/qnx-mcp, apps, apps/<hash> and runs are 0711: the program can reach its own executable and its run's work directory but cannot list or create anything there. bin is 0700. dumper writes a core as the program's user; the runner makes it root's and 0600 where dumper wrote it, before it moves it into the run directory, and reports in core_exposed when the user could reach it before that (see Limitations).
Tested on a QNX 8.0 x86_64 QEMU target made by target_create, with QNX_MCP_RUN_AS=1000:1000 (tests/test_nonroot_e2e.py, examples/escape_probe/escape.c). The program ran with uid and gid 1000. These attempts failed with EPERM: signal procnto, signal the runner, open /proc/1/ctl for writing, setuid(0), ThreadCtl(_NTO_TCTL_IO), mmap_device_memory. These failed with EACCES: create a file in /system/bin and /etc, in its own run directory, in /tmp/qnx-mcp, runs, apps, bin and its own apps/<hash>; list /tmp/qnx-mcp, runs, apps and another run's directory; read another run's stdout; open its own run's core for reading or writing. A create in /proc/boot failed with ENOENT. A create in its own work directory worked. A program running as uid 1001 got EACCES for every read of a uid 1000 run: its directory, stdout, work, a file in work and its core. dumper wrote and reported cores for non-root programs (into /data/home/qnxuser/cores for uid 1000 and /tmp for uid 2000, both reported in core_exposed), get_crash matched them by build ID, path and pid, and process_stop ended a child that had left the run with setsid().
Data
Cores, logs, run records and binary snapshots stay in the state directory (mode 0700, files 0600) on the build host.
Tests
cd tests
python -m pytest -q -p no:asyncio test_units.py test_mcp_offline.py test_skill.py test_nonroot.py test_ssh_target.py # no QNX needed
python -m pytest -q -p no:asyncio test_build_sdk.py # needs the QNX SDP
QNX_MCP_ALLOW_TARGETS='tb,tb[0-9]*' QNX_MCP_E2E_TARGET=tb \
python -m pytest -q -s -p no:asyncio test_slice_e2e.py test_shellfree_e2e.py # needs a running target
QNX_MCP_ALLOW_TARGETS='tb,tb[0-9]*' QNX_MCP_E2E_TARGET=tb QNX_MCP_E2E_CREATE=tb2 \
python -m pytest -q -s -p no:asyncio test_lifecycle_e2e.py # builds, boots and destroys tb2
QNX_MCP_ALLOW_TARGETS='tb,tb[0-9]*' QNX_MCP_E2E_TARGET=tb QNX_MCP_E2E_RUN_AS=1000:1000 \
python -m pytest -q -s -p no:asyncio test_nonroot_e2e.py # non-root runs
QNX_MCP_ALLOW_TARGETS='ami*' QNX_MCP_E2E_SSH_HOST=<address> QNX_MCP_E2E_SSH_FINGERPRINT=SHA256:... QNX_MCP_SSH_KEY=~/.ssh/qnx-ami \
python -m pytest -q -s -p no:asyncio test_ssh_target_e2e.py # an SSH-only machine (QNX OS 8.0 AMI)On a Linux host with the SDP and a running target, scripts/live-tests.sh runs all of these in order and writes one log to a file named for the version in docs/evidence (its header lists the variables it needs). With QNX_MCP_RUN_AS=uid:gid set as well, every suite's server runs programs as that user. The script also takes an SSH-only machine: set QNX_MCP_E2E_SSH_HOST and QNX_MCP_E2E_SSH_FINGERPRINT (or QNX_MCP_TRUST_FIRST_USE=1) and it adds test_ssh_target_e2e.py; the QEMU suites then run only if their own variables are set, and QNX_MCP_RUN_AS must be unset. The QEMU end-to-end tests (test_slice_e2e.py, test_shellfree_e2e.py, test_lifecycle_e2e.py, test_nonroot_e2e.py) assume an x86_64 QEMU image and are not run against an SSH-only machine; test_ssh_target_e2e.py covers the same tools with the machine's own architecture.
Two more live tests set a plain baseline next to qnx-mcp and count the result on a target: leftover processes after timed-out runs, and what is printed when a core and a binary do not match. They skip without QNX_MCP_E2E_TARGET; see docs/PROOF_TESTS.md.
The last full live run (docs/evidence/test-run.log) used scripts/live-tests.sh on an Ubuntu 22.04 host with QNX SDP 8.0 against a QNX 8.0 x86_64 QEMU target, as root and with QNX_MCP_E2E_RUN_AS=1000:1000. Every test passed except test_cmake_project, which skips because cmake is not installed there. The end-to-end tests drive the server through an MCP ClientSession over stdio.
Limitations
Builds run trusted code:
buildruns the project's own make or cmake files with your user's rights on the build host; there is no sandbox. Only build trees you trust. Build arguments from the agent are allow-listed, but an agent that can write files in the workspace can write a build file that runs commands, or a source file that includes any host file the compiler can read and so shows it in diagnostics.Allow-list limits: Flags outside the list are refused even when harmless, for example
-Dvalues with spaces, quoted-Dvalues under make or cmake,-Wl,-rpath,-Wl,--wrap, linker scripts,-fprofile-use=pathand make variables such asCROSS_COMPILE=. Put such settings in the project's Makefile or CMakeLists.txt.Linker input checks: inputs, and the libraries that
-lfinds in workspace-Ldirectories, are checked whenbuildstarts, so a file can still change before the link. That needs write access to the workspace, which already allows a build file that runs commands.Root on the target: qnx-mcp logs in to QEMU targets as root (on an SSH-only target it logs in as that target's user, see "SSH-only targets"), and programs run as root unless
QNX_MCP_RUN_ASis set. All non-root runs share one uid, so one run's program can reach another run'sworkdirectory and processes (seen on the target). Use disposable development targets.Uploaded programs:
apps/<hash>/<name>is mode 0755 below 0711 directories, so any local user who knows the content hash can run or read an uploaded program. They cannot list the directories to find it.Core of a non-root run: the runner takes the core (root, 0600) where dumper wrote it and then moves it, so after that the program's user cannot open it (seen on the target). Before that, the user can reach it on images made by
target_create: dumper writes the core of a user with a home directory into that home'scoresdirectory, which the user owns (/data/home/qnxuser/coresfor uid 1000), and the core of a uid without a home into/tmp. A process of that user that is still running could change or replace the core in that window. The runner checks the directories on the core's path and reports this in the run'score_exposed;get_crashcopies it intoprovenance.core_exposedand its evidence. Only a core written to a directory the user cannot reach (dumper's own-ddirectory,/data/var/dumper, 0700) is free of it. If the runner cannot take the core, it leaves it where dumper wrote it and says why incore_move_error.Not verified: cmake builds (cmake is not installed on the test host), aarch64 targets (only aarch64 cross builds ran), images built with
--secpol, and real hardware.setsid escapes: A descendant that calls
setsid()leaves the program's process group and is not killed at the end of a run (process_stopmay end it afterwards, since its executable is below/tmp; tested with a non-root program's escaped child).Races that remain in the v0.2 tools (see the threat model under Security model):
process_stop: the process can still exec or change between the last check and a signal. The path rules judge the path the process was started with and what it resolves to now, so a symlink replaced after launch, or a hard link to a system program placed below/tmp, can mislead them. The creation token is taken byprocess_stopitself, so it does not cover the time since the agent's lastprocessescall. Children of the process are not signalled.remote_binary: the file can be replaced between the check and the start; the runner repeats only the path rules, so the SHA-256 in the run record describes the file at check time. Shells are recognised by name: a copy of a shell renamed and placed below/tmppasses.file_list: an entry's metadata and its link target are read one after the other and can describe different versions of it.Address: a stale lease is noticed only when ssh fails to connect, and the command is then retried once at a rediscovered address; images that share host keys (a copied target directory) cannot be told apart.
Unverified SDK libraries: Frames inside shared libraries are resolved against the SDK's copies on the build host and are not checked against the libraries on the image; a custom image with different builds can give wrong library frames (gdb's warnings are returned in
gdb_warnings).Source lines from the current files: Source lines in a backtrace are read from the files on the build host at the time of
get_crash; if you edited them after building, the lines shown are the edited ones.Lossy text decoding: Program output, logs and gdb text are decoded as UTF-8 with replacement characters; byte counts and output cursors are exact, but binary output is not reproduced exactly in text fields.
Unique core names: qnx-mcp moves each core into its run's directory right after dumper reports it. Images created by
target_create(without--secpol) also run dumper with sequential names (-n). On other images (core_naming: "fixed"), a second crash of a program with the same name in the moment between the dump and the move could overwrite the first core;get_crashthen reportscore_mismatch(pid check).Background runs are detached from the ssh session that started them but do not survive a target reboot (
run_pollthen reportslost; this path is not tested).Managed targets are QEMU x86_64 images created by mkqnximage on a libvirt network. An existing QNX 8.0 machine can be registered over SSH; that path has offline tests and no live AMI or board result. aarch64 QEMU targets and real boards are not supported. Host-side disk use is limited by record and size caps; there is no quota.
On the shared test box, 3 of 13 mkqnximage builds reported success but left no
output/disk-qemu, at times when other agents were running mkqnximage builds;target_createnow rebuilds once with--cleanin that case. The cause is not known.
Licence
Apache-2.0, see LICENSE. The QNX SDP is not part of this project and has its own licence.
Available Tools
19 toolsbuildBuild for QNXADestructive
Compile on the build host with the QNX SDP 8.0 toolchain. system=auto picks cmake (CMakeLists.txt), make (Makefile) or qcc (plain sources). make and cmake run the project's own build files, which can execute any command: only build trees you trust. qcc mode builds the given sources (default: every .c/.cpp in path) with -g -O0 -Wall unless cflags is set. Returns diagnostics[] with file, line, column, severity, message (gcc JSON diagnostics in qcc mode, parsed text for make/cmake), linker errors, and artifacts[] with path, arch, build_id and debug_info for deploy_and_run. ok=false with error.code build_failed when compilation fails.
Inputs: path (required), arch, cflags, output, +5 more. Returns: object
deploy_and_runDeploy and run on a QNX targetADestructive
Snapshot a host-built QNX executable, copy it to the target (content-addressed under /tmp/qnx-mcp/apps, SHA-256 verified on the target) and run it once via the qnx-mcp-run helper: own process group, stdin /dev/null, stdout and stderr captured separately (capped, truncation reported), wall-clock timeout; when the program ends the rest of its process group is killed too. Returns outcome (exited | crashed | killed | timeout | stopped | exec_failed), exit_code or signal_name, and for crashes the exact core_path obtained from dumper (DCMD_DUMPER_NOTIFYEVENT pulse, then DCMD_DUMPER_GETPATH), moved into the run's own directory. Checks the ELF arch and loader first. Arguments are an array, never interpreted by a shell. For long-running programs use run_start. To run a program that is already installed on the target, pass remote_binary (a target path) and no binary: an executable regular file below /tmp or /data (QNX_MCP_REMOTE_BINARY_ROOTS) and outside /tmp/qnx-mcp, never a shell or anything in /proc/boot, /bin, /sbin, /usr or /system (checked by real path on the target). get_crash then needs binary= to symbolise a crash.
Inputs: target (required), cwd, env, args, +5 more. Returns: object
environment_checkCheck the QNX host environmentARead-onlyIdempotent
Prerequisite checks with fixes: QNX SDP environment, qcc, mkqnximage, gdb, KVM access, QEMU, ssh/scp, SSH key, DHCP lease file, target allowlist, targets directory, workspace confinement. Run it first on a new machine.
Inputs: no named parameters. Returns: object
file_getCopy a file from a QNX targetA
Copy one regular file from the target to the build host, verifying size and SHA-256. Without local_path it lands in the server's state directory (path returned); with local_path it never follows or replaces a symlink and replaces a file only with overwrite=true. UTF-8 files up to 64 KiB are also returned inline as text.
Inputs: target (required), remote_path (required), max_mb, overwrite, +1 more. Returns: object
file_listList a directory on a QNX targetARead-onlyIdempotent
List one directory on the target, read-only: name, type (file, dir, symlink, char, block, fifo, socket, other), size, mode, mtime and, for symlinks, where they point (links are described, never followed; the directory itself may be reached through a link, real_path says where it is). Entries are sorted by name; at most max_entries are returned, total_entries counts all of them and truncated says whether some were left out. path must be absolute and normalised (no '.', '..', '//' or trailing '/'); '/' lists the root.
Inputs: path (required), target (required), max_entries. Returns: object
file_putCopy a file to a QNX targetADestructive
Copy one host file to the target (below /tmp or /data, never into qnx-mcp's own directory) through a temporary name, verify size, mode and SHA-256 on the target, then install it atomically. Destinations that are directories or symlinks, and parent directories that are symlinks, are refused. Never replaces an existing file unless overwrite=true.
Inputs: target (required), local_path (required), remote_path (required), mode, +2 more. Returns: object
get_crashAnalyse a QNX crashARead-onlyIdempotent
Fetch the core file of a crashed run (size and SHA-256 verified), check that it belongs to the exact binary that was deployed (GNU build ID or the content-addressed path in the core's notes; error core_mismatch otherwise), open it with the SDP's gdb in MI mode and return a structured backtrace: faulting_frame (where the signal happened) and user_frame (innermost frame in your sources), frames with function, file, line, address, library, locals and source lines, every thread's stack, signal, si_code, fault address (0x0 = NULL dereference), the faulting instruction and a one-line summary. Default: the newest crashed run on the target; or pass run_id, or core_path plus binary for any other core. For a run of a program that was already on the target (remote_binary), pass run_id plus binary, the host path of its unstripped build (accepted when its build ID matches the core's, or when it is the same file).
Inputs: target (required), binary, run_id, core_path, +3 more. Returns: object
logsRead slog2 logs on a QNX targetARead-onlyIdempotent
Read the system log (slog2info -f -s -t) and filter it: buffer (buffer or buffer-set name), process (name substring or pid), since_s (relative to the target clock), min_severity (keep this level and more severe), contains (substring). Returns the newest limit entries with timestamps, pid, thread, severity and message.
Inputs: target (required), limit, buffer, process, +3 more. Returns: object
processesList processes on a QNX targetARead-onlyIdempotent
Run pidin with fixed -F format strings and return processes as JSON: pid, ppid, uid, name, path, args, code/data size, thread count and thread states (READY, RECEIVE, REPLY, SEND, MUTEX, ...). include_threads adds per-thread priority, policy, state and what it is blocked on.
Inputs: target (required), pid, name, include_threads. Returns: object
process_stopStop a process on a QNX targetADestructiveIdempotent
Stop a process that qnx-mcp did not start (for runs use run_stop), for example a hung program or a service you want to restart. Allowed only when its executable lives below /tmp or /data, checked on the target at call time: the executable in /proc//exefile (which also covers services started with a relative path such as ./statusd) and the same path with symlinks resolved. The process is identified by pid and start time; the start time, critical flag and executable are checked again right before each signal, and nothing is sent if they changed. Never pid 1, procnto, a critical process, qnx-mcp's runner, or anything in /proc/boot, /bin, /sbin, /usr or /system; refusals are process_not_allowed errors that name the rule. Sends signal (default TERM), waits up to grace_s for the process to exit and, with kill_after_grace, then sends SIGKILL. The result says what was stopped and whether it exited.
Inputs: pid (required), target (required), signal, grace_s, +1 more. Returns: object
run_pollPoll a background runARead-onlyIdempotent
Read new output of a run_start run from byte offsets (pass back stdout_next and stderr_next) and its state: running, finished (with outcome and the final result) or lost (target rebooted). wait_s waits up to that long for new output or the end. Only runs started by this server are accessible.
Inputs: run_id (required), target (required), max_kb, wait_s, +2 more. Returns: object
run_startStart a long-running program on a QNX targetADestructive
Like deploy_and_run, but the program runs in the background (its own session on the target) so the call returns at once. Output goes to files on the target (capped per stream); read it with run_poll using offsets, end it with run_stop. timeout_s is a hard limit on its lifetime. processes and logs keep working while it runs. Crashes leave a core for get_crash(run_id). remote_binary (a target path, with no binary) starts a program that is installed on the target, for example to restart a service (same rules as deploy_and_run: below /tmp or /data, never a shell or a system program).
Inputs: target (required), cwd, env, args, +5 more. Returns: object
run_stopStop a background runADestructiveIdempotent
Stop a run_start run: the request goes through the run's control FIFO to the runner that owns it, which kills the program's process group and writes the final status. acknowledged=false means it did not finish within grace_s (its deadline still applies).
Inputs: run_id (required), target (required), grace_s. Returns: object
target_createCreate and boot a QNX targetA
Build a new QNX OS 8.0 QEMU image with mkqnximage in its own directory and boot it headless (KVM when available), then wait until root SSH works. Takes 20 s to 3 minutes. Fails with target_exists if the name is taken; a failed build or boot is cleaned up (QEMU stopped, directory removed, mkqnximage log kept). The SSH host keys mkqnximage generates are pinned. Extra mkqnximage options are restricted to: --aslr, --boot-size, --data-inodes, --data-size, --hostname, --perl, --python, --secpol, --secure-procfs, --sys-inodes, --sys-size, --time-servers, --tz, --valgrind (form --opt=value). The image runs dumper with sequential core names (unless --secpol is set), so crashing programs leave distinct core files.
Inputs: name (required), ram, arch, cpus, +2 more. Returns: object
target_destroyDestroy a QNX targetADestructiveIdempotent
Stop and permanently delete a target this server manages: its mkqnximage directory under the targets dir and its server state. Refuses names outside the allowlist, symlinks and anything that is not an mkqnximage directory directly inside the targets dir. confirm must repeat the target name.
Inputs: name (required), confirm (required). Returns: object
target_listList QNX targetsARead-onlyIdempotent
List the QEMU QNX targets this server may manage (directories under the targets dir that match the allowlist), with state running/stopped from the QEMU pid. Cheap, no SSH. Call first to discover target names.
Inputs: no named parameters. Returns: object
target_startStart a QNX targetAIdempotent
Boot an existing target (no rebuild) and wait until root SSH answers with the target's pinned host key. Idempotent: if it is already running it only waits for SSH.
Inputs: name (required), boot_timeout_s. Returns: object
target_statusQNX target statusARead-onlyIdempotent
State of one target: running/stopped/booting, IP, arch, RAM, CPUs, host key policy and, when running, an SSH probe with uname, the target clock, whether dumper is running and with which core naming. Use it before deploy_and_run and after target_down or ssh_failed errors.
Inputs: name (required). Returns: object
target_stopStop a QNX targetADestructiveIdempotent
Power off the target's QEMU (mkqnximage --stop, then SIGTERM/SIGKILL through a pidfd of the verified QEMU process). Waits for runs in progress (they hold a shared lock). Background runs are lost; files on the target disk persist.
Inputs: name (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 19 tools
The three 'stop' tools (target_stop, run_stop, process_stop) and the two run tools (deploy_and_run vs run_start) could easily blur, but each description explicitly draws the boundary and cross-references the correct alternative. deploy_and_run vs run_start, target_status vs target_list, and processes vs process_stop are all cleanly differentiated. Every tool targets a distinct resource+action.
The dominant convention is resource_action (target_*, run_*, file_*, process_stop, environment_check), applied consistently across 14 tools. A few outliers break pattern: get_crash reverses to verb_noun, and build/processes/logs are bare names. The deviations are still readable and unambiguous, so it's mostly consistent with minor exceptions.
19 tools is slightly above the ideal range, but the domain (target lifecycle, build, sync/async run, crash analysis, file transfer, process control, logs, environment) genuinely needs this breadth. Each tool has a clear, non-redundant role, so the count is justified rather than padded.
Coverage is strong: full target lifecycle (list/create/start/stop/destroy/status), build, deploy/run, async run control, crash post-mortem, bidirectional file transfer with listing, process inspection/stopping, logs, and environment checks. Minor gaps remain—no file delete or directory-create operation on the target, and no arbitrary exec/shell tool—which are either deliberate safety choices or small workaround-able omissions.
Maintenance
Related MCP Connectors
Secure Linux sandboxes for AI agents, as MCP tools.
AI-native programming language and toolchain for accountable, verifiable agent-driven development.
Run, build, and validate firmware on virtual hardware from your AI agent. Hardware knowledge corpus.
Run verified read-only code tools: quant diagnostics + agent-ops preflight, no source exposure.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI clients to perform sandboxed filesystem, directory, Ubuntu system, network, git, and code/text operations through 38 typed tools confined to a workspace. Ships with a browser-based web console that provides an interactive Linux terminal, a live tool playground, and real-time CPU, memory, and disk monitoring.383MIT
- AlicenseAqualityBmaintenanceEnables AI agents to debug STM32 firmware on real hardware by driving GDB with OpenOCD/ST-Link/J-Link to flash, set breakpoints, inspect memory, registers and RTOS state, triage HardFaults, and profile. Returns decoded, structured evidence and suggested next actions instead of raw GDB text, with composite tools that collapse multi-step debug loops into single calls.863MIT
- AlicenseAqualityCmaintenanceEnables AI coding agents to discover installed host compilers, execute builds in isolated child environments with timeout enforcement, and convert noisy ANSI-laden compiler logs from Python, Rust, C/C++, Node, and Go toolchains into clean structured JSON diagnostics. It also reports toolchain readiness so agents can avoid blind invocations of missing compilers.4MIT
- AlicenseBqualityBmaintenanceNido is a local QEMU VM manager. Install it on your computer from https://github.com/Josepavese/nido and run nido mcp via stdio, or use npx -y nido-mcp@latest mcp with QEMU installed locally. It manages VMs on that same computer; a server hosted by Glama cannot access your local VM inventory.62MIT