Skip to main content
Glama

QNX Host MCP

An embedded developer asking an AI assistant for QNX code needs to know whether it compiles for QNX and runs on a QNX target. This server returns the compiler result and the compiled artifact's SHA-256. When the operator enables execution, it also returns the guest program's exit status and console output from QEMU.

MCP server over stdio for inspecting a configured QNX compiler and compiling workspace C sources with fixed arguments. Operations return an ID for status polling and cancellation.

Real compilation and execution of the unchanged artifact inside QNX 8.0.0 x86_64 in QEMU 8.2.2 were completed on the project host. Guest execution evidence records the expected message and exit status 0.

A second example, native QNX message passing, uses ChannelCreate, ConnectAttach, MsgSend, MsgReceive and MsgReply between two threads. It was compiled through MCP with node scripts/compile-example.mjs examples/msgpass src/msgpass.c and run on QNX 8.0 in QEMU with the expected output and exit status 0 (evidence).

A third example, a QNX resource manager, registers /dev/automata-echo with resmgr_attach and a custom io_read handler, and the same process reads it back through open and read. It was compiled through MCP with node scripts/compile-example.mjs examples/resmgr src/resmgr.c and run on QNX 8.0 in QEMU with the expected output and exit status 0 (evidence).

A fourth example, native QNX pulses and timers, arms a CLOCK_MONOTONIC timer whose event is a pulse (SIGEV_PULSE_INIT) on the process's own channel and receives five pulses with MsgReceivePulse. It was compiled through MCP with node scripts/compile-example.mjs examples/pulses src/pulses.c and run on QNX 8.0 in QEMU with the expected output and exit status 0 (evidence).

A fifth example, native QNX registered events, shows the "reply now, notify later" pattern: a client registers a pulse event with MsgRegisterEvent, the server replies at once, checks it with MsgVerifyEvent and later delivers it with MsgDeliverEvent. It was compiled through MCP with node scripts/compile-example.mjs examples/events src/events.c and run on QNX 8.0 in QEMU with the expected output and exit status 0 (evidence).

A sixth example, native QNX message priority inheritance, shows that a server thread receiving a message runs at the priority of the sending client, and that a channel created with _NTO_CHF_FIXED_PRIORITY keeps the server at its own priority. It was compiled through MCP with node scripts/compile-example.mjs examples/prioinherit src/prioinherit.c and run on QNX 8.0 in QEMU with the expected output and exit status 0 (evidence).

A seventh example, a client in another process that finds the server by name, registers a server with name_attach and has a forked child open it with name_open and exchange three messages; the server checks that each request comes from another process. It was compiled through MCP with node scripts/compile-example.mjs examples/nameservice src/nameservice.c and run on QNX 8.0 in QEMU with the expected output and exit status 0 (evidence).

How it differs

Other public QNX MCP servers connect to a target that is already running: over SSH to deploy and run a binary, over qconn for introspection and debugging, or over SSH/SFTP for read-only diagnostics. QNX Host MCP needs no login or network access to the guest. It compiles with the configured QNX SDK through fixed MCP tools and, when the operator enables qnx_run_artifact (disabled by default), builds a private image for each run, boots it in QEMU without networking and returns the captured console output and the guest program's exit status. QNX's own tools (Momentics IDE, the QNX Toolkit for VS Code and qcc) remain the place for interactive development and debugging.

Related MCP server: Delphi Compiler MCP Server

Start here

QNX Host MCP is a stdio MCP server for inspecting a configured QNX compiler and compiling workspace C sources with fixed arguments, and, when the operator enables it, running a compiled artifact in QEMU with no network adapter.

Resource

What it shows

Evidence

Demo video

An AI client compiles and runs QNX programs through MCP with qnx_run_artifact, plus all seven examples checked with tutorial/check-run.sh (2:11)

Run output · Verification log

Compile and run through MCP

qnx_compile_c, then qnx_run_artifact: an AI client compiles a C file and runs it in QEMU with no network adapter (node scripts/run-example.mjs examples/hello src/hello.c)

Run output

Tutorial: Part 1

Compile a QNX C program, build an image and run it in QEMU

Verification log

Tutorial: Part 2

Native synchronous message passing

Verification log

Tutorial: Part 3

A resource manager accessed with ordinary file operations

Recorded run

Tutorial: Part 4

A periodic timer that delivers pulses to a channel

Recorded run

Tutorial: Part 5

A server that replies at once and notifies the client later with a registered event

Recorded run

Tutorial: Part 6

A server thread that runs at the priority of the client it is serving

Recorded run

Tutorial: Part 7

A client in another process that finds the server by name (name_attach, name_open)

Recorded run

Tutorial: Part 8

Compile and run a program through MCP with qnx_run_artifact

Run output

Hello example

QNX-target C compilation and guest execution

Recorded run

Message-passing example

ChannelCreate, ConnectAttach, MsgSend, MsgReceive, MsgReply

Recorded run

Resource-manager example

resmgr_attach, custom io_read, ordinary open and read

Recorded run

Pulses and timers example

SIGEV_PULSE_INIT, timer_create, timer_settime, MsgReceivePulse

Recorded run

Registered events example

MsgRegisterEvent, MsgVerifyEvent, MsgDeliverEvent, MsgUnregisterEvent

Recorded run

Priority inheritance example

SchedGet, sched_curpriority, _NTO_CHF_FIXED_PRIORITY, SCHED_RR threads

Recorded run

Name service example

name_attach, name_open, _IO_CONNECT, _PULSE_CODE_DISCONNECT, two processes

Recorded run

Try it

  1. Prepare Node.js 22 or later and the existing project dependencies; load the licensed QNX SDK environment for real compilation.

  2. Follow Configuration: set an absolute QNX_MCP_WORKSPACE containing src/hello.c, provide a trusted compiler PATH, and configure the stdio MCP client.

  3. From the repository root, run npm run smoke:fake for simulated validation or npm run smoke with the SDK environment loaded for real compilation and artifact verification.

  4. Follow Tutorial Part 1 for the separate SDK image and QEMU workflow, then continue with Parts 2 to 6 above.

The compilation smoke does not execute the artifact; MCP image lifecycle tools remain blocked with UNSAFE_CONFIGURATION.

Configuration

Requires Node.js 22 or later and the existing project dependencies. Configure an absolute QNX_MCP_WORKSPACE directory containing src/hello.c and a trusted PATH containing the QNX executables. The server resolves executables from absolute PATH entries and invokes them without a shell. It forwards selected host and QNX environment variables only.

Example Claude Code configuration:

{
  "mcpServers": {
    "qnx-host": {
      "command": "node",
      "args": ["/absolute/path/qnx-mcp/src/server.mjs"],
      "env": {
        "QNX_MCP_WORKSPACE": "/absolute/path/qnx-workspace",
        "PATH": "/absolute/path/to/qnx/compiler/bin:/usr/bin:/bin"
      }
    }
  }
}

The project environment uses QNX SDP 8.0 on Ubuntu 24.04 under WSL2. Compiler evidence identifies GCC 12.2.0 and the QNX x86_64 target. SDK installation and licensing were not audited by this documentation update.

Compilation smoke and evidence

Run from the repository root after loading the licensed SDK environment:

npm run smoke

For validation without the SDK:

npm run smoke:fake

The smoke uses the installed MCP Client and StdioClientTransport to launch src/server.mjs, list tools, inspect the compiler, compile examples/hello/src/hello.c and poll operation status with bounded waits. It writes report.json and report.md under evidence/-/. Use --evidence-root DIRECTORY to select another report destination.

Reports include compiler version and target output, operation exit codes, reconstructed compiler arguments, artifact size and SHA-256. Arguments come from the fixed executor contract, not a server-provided execution trace. The smoke independently verifies artifact size and hash. Fake mode additionally checks arguments recorded by the simulated compiler.

Fake reports identify simulated evidence and do not demonstrate QNX compatibility. Real mode uses the operator's PATH; inspect compiler output alongside environment details. The compilation smoke does not execute artifacts or call image tools.

Retained real compilation — 2026-11-03

Evidence: report.json, report.md and host-facts.txt. JSON and Markdown describe one run.

Field

Recorded value

Start

2026-11-03T20:25:05.120Z

Finish

2026-11-03T20:25:05.431Z

Result

mode=real; simulated=false; success=true

Compiler inspection

succeeded; exitCode=0

Compiler

GCC 12.2.0

Default target

12.2.0,gcc_ntox86_64

Target configuration directory

/root/qnx800/host/linux/x86_64/etc/qcc

Compilation

succeeded; exitCode=0

Compile operation

0279c855d511a150ba531331739c259b

Workspace-relative artifact

build/0279c855d511a150ba531331739c259b/program

Size

9208 bytes

SHA-256

e5596d9e949d480cf1c129c6dbcd98adec84661edad263e40af204991dc6e798

ELF identification

x86-64; interpreter /usr/lib/ldqnx-64.so.2

Execution by compilation smoke

Not performed; subsequent guest execution is recorded separately below

The report represents the source as /path/to/qnx-mcp/examples/hello/src/hello.c and output as /path/to/qnx-mcp/examples/hello/build/0279c855d511a150ba531331739c259b/program. These are recorded project-host paths. The fixed target argument is -Vgcc_ntox86_64.

The report records independentlyVerified: true and retained: true. This documentation update inspected records without rehashing binaries or checking current retention. The output does not identify an additional SDK patch version. Exact compiled source-commit provenance remains unestablished. See REAL-QNX.md for compiler reproduction guidance.

For the separate SDK image and QEMU reproduction procedure, see Real QNX compilation and guest execution. Retained evidence files preserve original host paths; adapt working copies for a new run.

Successful QNX guest execution — 2026-11-03

Evidence: execution README, serial console and hash records. The separate SDK/QEMU workflow ran on the project host: Ubuntu 24.04 on WSL2, kernel 6.6.87.2-microsoft-standard-WSL2, QEMU 8.2.2 from the Ubuntu archive. It used TCG with -cpu max; no KVM device was available.

QNX_MCP_RUN_BEGIN
QNX noname 8.0.0 2026/06/05-16:26:03EDT x86pc x86_64
Hello from QNX MCP smoke.
QNX_MCP_RUN_EXIT=0

The unchanged 9208-byte program has the same SHA-256 recorded by the compiler smoke. sha256.txt matches the original program and automata-hello; the recorded output/ifs.bin SHA-256 is e606657ba117cbdb05ddea7385e92f5493e0b7712c82ce368fa15285be72f8fe. The execution README reports three independent compilations with the same program hash; additional compilation reports were not inspected here.

The SDK's mkqnximage --type=qemu --arch=x86_64 --graphics=no, using /root/qnx800/target/qnx, built the image. As described in the evidence README, ifs_files.custom places the unchanged artifact at /proc/boot/automata-hello; post_start.custom runs it during startup and prints its exit status. No login was performed. The retained run-qemu.sh is described as waiting for the marker and stopping QEMU with SIGTERM. This update did not run these files.

The guest had no network interface. Its unedited console reports no valid interfaces found and an sshd startup failure, Memory fault (core dumped), before the successful program output. Networking and SSH operation were not validated. The SDK image tools placed the artifact; the MCP server did not transfer it. All four MCP image lifecycle tools remain blocked with UNSAFE_CONFIGURATION.

MCP tools

  • qnx_toolchain_info: fixed qcc --version and qcc -V commands; 30-second deadline.

  • qnx_compile_c: accepts src/name.c, compiles for QNX x86_64 and checks build//program; 120-second deadline. Returns artifact path, size and SHA-256.

  • qnx_operation_status and qnx_operation_cancel: supervise operation IDs created by this executor. Cancellation acceptance precedes confirmed termination.

  • qnx_image_build, qnx_image_start, qnx_image_ip and qnx_image_stop: remain blocked with UNSAFE_CONFIGURATION.

Output is capped at 32 KiB per stream. Excess output is drained and reported as OUTPUT_LIMIT. Process cancellation targets the operation's Linux process group and escalates after the configured grace period. Native Windows process execution remains disabled.

qnx_run_artifact (disabled by default)

Accepts only { "compileOperationId": "<successful compilation operation ID>" } from this server. Poll qnx_operation_status for completion or request cancellation with qnx_operation_cancel.

To enable it, the operator supplies an absolute QNX_MCP_RUN_CONFIG path to a JSON file containing exactly:

{ "version": 1, "enabled": true, "templateDir": "/absolute/path/to/prepared-template" }

The server requires the SDK environment to be loaded beforehand. Each run copies the template without output/, verifies the compiled artifact, builds a private image and launches QEMU with no emulated network adapter. Guest console retention is limited to 32 KiB. Preparation, build, guest execution and cleanup have deadlines of 30, 120, 60 and 30 seconds, respectively. The result separates guest, builder and QEMU exit codes.

Absent configuration or enabled: false returns UNSAFE_CONFIGURATION without creating an operation. Regression tests use synthetic executables. On 9 November 2026 the tool also ran with the real QNX SDP 8.0 SDK and QEMU: examples/hello and examples/nameservice each exited with status 0, leaving no QEMU process or run directory (evidence). To try it: node scripts/run-example.mjs examples/hello src/hello.c.

Image configuration

QNX_MCP_IMAGE_CONFIG optionally names an absolute operator-controlled JSON file containing exactly:

{
  "version": 1,
  "enabled": false
}

Absent configuration defaults to disabled. Invalid configuration prevents startup. enabled=true does not activate the MCP image tools. The separate SDK/QEMU execution evidence does not change this gate.

Internal image lifecycle

Executor.imageOperation(action, imageName) is an internal interface for direct tests; the MCP dispatcher does not invoke it. Actions are build, start, ip and stop. Names contain 1–32 lowercase ASCII letters, digits or hyphens. Image directories reside under workspace/images/.

Commands use fixed arguments: --type=qemu --arch=x86_64 followed by --build, --run, --getip or --stop. Deadlines are respectively 900, 60, 20 and 30 seconds. An internal image operation starts only when no operation is active. Images must have been built by the same executor before start; IP lookup and stop require a recorded instance.

Internal startup retains a persistent launcher, reads output/qemu.pid and checks captured Linux process identities and ancestry. Socket observation uses Linux procfs unless a test observer is injected. The unsafeListeningPorts function checks owned TCP listeners against exact 127.0.0.1 and ::1. This point-in-time observation does not establish network isolation or guest readiness.

Stop checks ownership before invoking the fixed --stop command. Cleanup observes removal of the captured target and launcher and may fall back to signalling the captured launcher group after identity checks. Unconfirmed cleanup returns CANCEL_FAILED. Controlled-process tests and the separate SDK/QEMU guest run do not establish the real mkqnximage ownership and stop behavior of this internal executor.

See Image notes, Launcher validation and Demo plan. All four MCP image tools remain blocked pending verified host controls.

Tests

npm test

Reported results on the project host comprise six consecutive complete WSL runs, each passing 60/60, and an integrated-project run passing 60/60. Their underlying suite logs were not inspected for this update. Separately, the isolated Linux candidate previously produced an observed result of 60 passed, zero failed, zero cancelled and zero skipped. With qnx_run_artifact and its three new test files, the suite passed 85/85 on Linux with Node 22 on 9 November 2026.

Regression tests use fake executables, controlled Linux processes and supplied socket tables. Guest execution is supported by the separate retained console evidence, rather than those regression tests. No tests were repeated for this documentation update.

The CI workflow runs on Ubuntu with Node 22 on every push. It runs npm test, the tutorial checker's self-test on synthetic logs (bash tutorial/test-check-run.sh, six cases) and the checker against the console retained from the 9 November 2026 boot (evidence/qemu-run-name-20261109/qemu-serial-console.txt, seven examples). That step re-reads stored evidence. A further step runs npm run smoke:fake with its report directory outside the repository: a real MCP client starts src/server.mjs over stdio, lists the nine tools, inspects the compiler and compiles examples/hello/src/hello.c through a FAKE compiler, and the resulting report is shown in the run summary, marked SIMULATED. CI has no QNX SDK and does not boot QNX: a green run shows the client-server conversation and the stored evidence, not a new QNX compilation or guest execution.

Scope and limitations

Real compilation and subsequent guest execution are supported by separate retained evidence. The compilation smoke does not run artifacts. The SDK/QEMU workflow records QNX 8.0.0 x86_64, expected program output and exit status 0. It does not establish networking, SSH, MCP image lifecycle operation or host isolation. The guest had no network interface and sshd startup failed with a memory fault. No login was performed.

Canonical path checks do not provide operating-system isolation. Persisted image configuration, actual stop scope, descendant ownership and live networking require verification before enabling MCP image execution. Use trusted source files and an operator-controlled workspace.

The retained evidence was produced from a working copy of this source before publication; the exact source revision it was compiled from is not recorded in the reports.

QNX Global Hackathon

This project is an entry for the QNX Global Hackathon, Developer Tooling and Host Tools category. The evidence is summarized in EVIDENCE.md and the demonstration plan is in DEMO.md. The simulated demonstration remains a labeled rehearsal.

Publication note: project and validation paths in this document use neutral placeholders. Consult the unchanged evidence files for original recorded paths.

Tutorial

Step by step, verified on 6 November 2026: Run a QNX 8.0 C program in QEMU from Windows (WSL2 and Ubuntu 24.04, qcc, a custom mkqnximage image and a captured serial console, without hardware or a guest login), Part 2: native QNX message passing, Part 3: a resource manager, Part 4: pulses and timers, Part 5: registered events, Part 6: message priority inheritance (verified on 8 November 2026), Part 7: a server found by name from another process and Part 8: compile and run through MCP (both verified on 9 November 2026) in the same image.

Available Tools

8 tools
qnx_compile_cA

Compile one workspace src/name.c file for QNX x86_64 with fixed compiler arguments. Never runs the resulting binary or accepts compiler flags. Deadline: 120 seconds.

Inputs: source (required).

qnx_image_buildA

Build a fixed QEMU x86_64 image only after host isolation and persisted image configuration have been verified. Otherwise returns UNSAFE_CONFIGURATION. Deadline: 900 seconds.

Inputs: no named parameters.

qnx_image_ipA

Read the address reported for an owned image using a fixed command. Requires verified image ownership and configuration; does not connect to the address. Deadline: 20 seconds.

Inputs: no named parameters.

qnx_image_startA

Start an owned image only after process ownership and loopback-only networking have been verified. Otherwise returns UNSAFE_CONFIGURATION. Launcher success does not establish guest readiness. Deadline: 60 seconds.

Inputs: no named parameters.

qnx_image_stopA

Stop only a verified server-owned instance. Returns UNSAFE_CONFIGURATION when ownership or command scope cannot be established. Deadline: 30 seconds.

Inputs: no named parameters.

qnx_operation_cancelA

Request cancellation of an operation created by this server. Acceptance does not confirm process termination; poll operation status for the final state.

Inputs: operationId (required).

qnx_operation_statusA

Read the bounded output and current state of an operation created by this server. Accepts an operation ID, never a PID or path.

Inputs: operationId (required).

qnx_toolchain_infoA

Read QNX compiler version and available targets using fixed commands. Does not install or activate the SDP. Deadline: 30 seconds.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool targets a distinct resource+action pair: toolchain inspection, single-file compilation, image build/start/stop/IP, and operation status/cancel. The only near-neighbors (start vs. status, stop vs. cancel) are explicitly separated in their descriptions, which clarify that launch success ≠ guest readiness and cancel acceptance ≠ termination.

    Naming Consistency4/5

    All names use a consistent snake_case qnx_ prefix and follow a predictable resource_action pattern (qnx_image_build, qnx_image_start, qnx_operation_status). The deviation is qnx_compile_c and qnx_toolchain_info, which don't fit the resource_action template cleanly (verb-first / noun_noun), though they remain readable and unambiguous.

    Tool Count5/5

    Eight tools is well-scoped for a narrow QNX host workflow, with no obvious redundancy. Each tool earns its place across the toolchain, compile, image lifecycle, and long-running operation phases.

    Completeness3/5

    The compile-and-run-image lifecycle is covered end to end, but there are notable gaps: no way to list or delete existing images, no mechanism to transfer the compiled binary into an image, and no access to guest console/logs after start. Agents can partially work around these via operation_status, but guest-level verification and cleanup are dead ends.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables AI coding agents to compile Delphi projects programmatically by parsing .dproj files, executing the Delphi compiler, and returning structured error results with multi-language support and automatic configuration generation from IDE build logs.
      4
      10
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to compile Delphi projects and single units directly through the Model Context Protocol. It features automatic compiler detection via the Windows registry and supports MSBuild with full build event integration.
      52 PyPI
      109
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI coding agents to test C++ code by running static analysis, sanitizers (ASan, TSan, LSan, UBSan), and performance profiling through eight MCP tools.
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables 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.
      4
      MIT