Skip to main content
Glama
README.md
# QNX Agent Bridge

An MCP (Model Context Protocol) server that lets AI agents query and
control a live **QNX 8.0** system — in plain language.

> A factory robot running QNX starts overheating. Normally only a QNX
> expert with special tools can see inside it. With this bridge, an
> operator just asks an AI agent *"how is the robot doing?"* and the
> agent asks QNX through the bridge and answers in plain language.

Built for the **QNX Global Hackathon** (https://qnx.devpost.com/),
category **Developer Tooling & Host Tools**. Deadline: **16 Dec 2026
02:00 Bangkok**. Judging: 15–29 Jan 2027.

## What it does

| MCP tool | What the agent learns |
| --- | --- |
| `qnx_list_processes` | Processes on the QNX target (pid, name, state, priority, memory) |
| `qnx_system_resources` | RAM total/free/used, RAM used %, CPU count, uptime |
| `qnx_system_info` | Hostname, OS name/version, architecture |

Phase 2 adds control: `qnx_service_control` (start/stop services) and a
live QEMU target demo on video.

## Architecture

```
AI agent  ── MCP (stdio) ──▶  qnx-agent-bridge (this repo)
                                   │
                      ┌────────────┴────────────┐
                      ▼                         ▼
               MockQNXTarget            SSHQNXTarget
            (dev / tests, no         (real QNX 8.0 over SSH:
             QNX install needed)     pidin / pidin info / showmem)
```

The bridge talks to the target through a small `QNXTarget` interface,
so the MCP layer is identical whether the target is the mock or a real
QNX 8.0 QEMU guest.

## QNX version & target

- **QNX:** SDP 8.0 / QNX 8.0.0 (QNX Everywhere, free non-commercial licence)
- **Target:** QEMU x86_64 guest (no hardware needed)
- **Host:** Ubuntu 24.04, QEMU 8.2.2 with KVM
- **Bridge language:** Python 3.10+ (MCP Python SDK v2, MCPServer)

## Status — Phase 1 (5 Dec 2026)

- [x] QEMU 8.2.2 installed on the build box (KVM available)
- [x] MCP server skeleton: 3 tools, working against `MockQNXTarget`
- [x] `pidin` / `pidin info` / `showmem` parsers unit-tested against
      sample text in the documented QNX formats
- [x] `SSHQNXTarget` implemented (SSH + parsers) — **not yet verified
      against a live target**
- [ ] **BLOCKED: QNX SDP 8.0 download needs a myQNX account.**
      Creating the account is the user's job (see below). Until then,
      no real QNX toolchain, no QEMU boot image, no verified Hello World.

### The blocker — what the user needs to do

1. Go to https://www.qnx.com/getqnx and create / sign in to a **myQNX
   account**.
2. Accept the QNX Everywhere licence and **deploy** it to the account
   (accepting alone is not enough — deploy it).
3. Download the **QNX Software Center** installer for Linux Hosts
   (~104 MB) from the myQNX account.
4. Tell the agent the account is ready — the agent will then install
   QNX SDP 8.0 on the build box (`~/qnx800`, ~6.4 GB) and verify
   Hello World on QNX in QEMU.

Without a deployed licence, the Software Center install fails — there
is no public direct download of SDP 8.0.

## Run the bridge (mock target — works now)

```sh
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python -m qnx_agent_bridge        # MCP server on stdio
```

Test it (no QNX install needed):

```sh
python tests/test_tools.py        # parser + tool tests, mock target
```

## Run against a real QNX target (once SDP + QEMU are up)

```sh
QNX_TARGET=ssh QNX_SSH_HOST=127.0.0.1 QNX_SSH_PORT=2222 \
  python -m qnx_agent_bridge
```

The QEMU guest must run `sshd` (see `qnx/README.md` for the image plan).

## Build Hello World for QNX (once SDP 8.0 is installed)

```sh
source ~/qnx800/qnxsdp-env.sh
cd qnx && ./build.sh
```

See `qnx/README.md`.

## Roadmap

- **Phase 1 (5 Dec):** setup + skeleton — this repo.
- **Phase 2 (6–8 Dec):** SDP install, QEMU boot image, Hello World
  verified on QNX, `SSHQNXTarget` verified live.
- **Phase 3 (9–12 Dec):** control tools (start/stop services), health
  checks, demo script.
- **Phase 4 (13–14 Dec):** end-to-end test + demo video (≤3 min).
- **Phase 5 (15 Dec):** submit to Devpost before 16 Dec 02:00 Bangkok.

## License

MIT — see `LICENSE`.

TDQS

A3.6/5.0

Scored across 3 tools

Disambiguation4/5

Each tool targets a distinct aspect: process listing, resource metrics (RAM/CPU), and system identification. The two 'system_' tools could be momentarily confused, but their descriptions clearly separate metrics from identity metadata.

Naming Consistency4/5

All names are snake_case with a consistent qnx_ prefix, which is predictable. However, only one follows a verb_noun pattern while the other two are noun phrases, a minor deviation.

Tool Count4/5

Three tools is slightly thin but reasonable for a focused target-inspection bridge. Each tool covers a clear, non-redundant facet of the target.

Completeness2/5

The surface is read-only inspection: no process control (start/kill), file access, or command execution despite being an 'Agent Bridge'. These are significant gaps for the implied domain of interacting with a QNX target.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues