Amiga DevBench — Architecture & Reference Guide
A cross-development environment for Commodore Amiga (68k) that connects a modern host machine to an emulated (or real) Amiga via serial, providing live debugging, memory inspection, variable editing, remote execution, and full MCP integration with Claude Code.

One-line install
Brew-style installer — fetches the source, installs the Python host server, pulls the m68k Docker cross-compiler, builds the bridge daemon + examples, and launches the web UI on http://localhost:3000. Re-running pulls the latest commit and rebuilds in place.
macOS / Linux:
shcurl -fsSL https://raw.githubusercontent.com/geekychris/amiga_mcp/main/scripts/install.sh | bash
Windows (PowerShell):
powershelliwr -useb https://raw.githubusercontent.com/geekychris/amiga_mcp/main/scripts/install.ps1 | iex
The installer requires git, python>=3.10, and Docker. On mac/Linux you can opt into auto-install of missing CLI tools with AMIGA_MCP_AUTO_INSTALL=1. Docker Desktop on macOS/Windows needs a GUI install regardless.
What it does NOT install: FS-UAE itself (you need a Kickstart ROM — see FS-UAE Emulator Setup). The optional patched fs-uae fork with the HTTP debugger is opt-in via AMIGA_MCP_BUILD_PATCHED=1 (Linux + macOS). DevBench works fine with stock fs-uae either way; the patched build unlocks the FS-UAE tab in the Web UI and the amiga_fsuae_* MCP tools.
Knobs (env vars before invoking):
| Variable | Default | Meaning |
|---|---|---|
AMIGA_MCP_SRC | $HOME/.amiga-devbench/src | Where to clone the repo |
AMIGA_MCP_REF | main | Git ref to check out |
AMIGA_MCP_REPO | https://github.com/geekychris/amiga_mcp.git | Remote |
AMIGA_MCP_BUILD | 1 | Build examples via Docker (0 to skip) |
AMIGA_MCP_START | 1 | Launch web UI in background (0 to install only) |
AMIGA_MCP_OPEN | 1 | Open browser when ready (0 to suppress) |
AMIGA_MCP_AUTO_INSTALL | 0 | (mac/Linux) 1 to brew/apt/dnf install missing deps |
AMIGA_MCP_BUILD_PATCHED | 0 | (mac/Linux) 1 to clone+build the patched fs-uae fork into ~/.amiga-devbench/fs-uae. Combine with AMIGA_MCP_AUTO_INSTALL=1 to also install the ~10 system libs it needs. Takes ~10 min. |
How devbench picks the fs-uae binary
[emulator] binary in devbench.toml accepts the literal "auto" (default). When auto, devbench searches in order:
$AMIGA_MCP_FSUAE_BINenv var~/.amiga-devbench/fs-uae(installed byAMIGA_MCP_BUILD_PATCHED=1)/tmp/fsuae-src/fs-uae(default output path of the patched fork'sbuild.sh)~/code/fsuae_remote_patch/fs-uae(common dev checkout)fs-uaeonPATH(stock build from Homebrew / apt / etc.)
It prefers the patched build when found (probed by scanning the binary for the fs-uae-rpc service string). Set binary to an explicit path to pin a specific build. Check /api/emulator/status (patched: true|false) or the devbench startup log to confirm which one was selected.
The web UI runs in the background under $HOME/.amiga-devbench/run/devbench.pid with logs in $HOME/.amiga-devbench/logs/. Stop with kill $(cat ~/.amiga-devbench/run/devbench.pid) (or Stop-Process on Windows).
Table of Contents
- Overview
- System Architecture
- Component Deep Dives
- Build Toolchain
- Deployment Topologies
- FS-UAE Emulator Setup
- Bridge Protocol
- Client Library API
- Programming Examples
- MCP Tools Reference
- Developing Amiga Software with Claude Code
- Web UI Reference
- Scripts & Utilities
- Future Improvements
Overview
Traditional Amiga development is painful: no source-level debugger on the target, no network stack on stock machines, and crashes take down the entire OS. This project solves that by bridging the gap between a modern development host and the Amiga over a serial link.
What it enables:
- Write C code on macOS, cross-compile via Docker, deploy to emulator in one command
- Live-inspect memory, registers, tasks, libraries, and volumes on the running Amiga
- Register variables in your Amiga app and read/write them from the host in real-time
- Define "hooks" — functions the host can call into your running app remotely
- Launch, stop, and break Amiga programs from the host
- Execute arbitrary AmigaDOS scripts on the Amiga from the host
- Read and write files on the Amiga filesystem
- Source-level debugger — set breakpoints, step into/over, inspect registers and call stack
- Monitor everything through a web dashboard or Claude Code MCP tools
- Manage files, assigns, processes, and protection bits without touching the Amiga
- Verify deployments with CRC32 checksums, tail log files in real-time
- Full process lifecycle: launch, track, signal, and stop async processes
Before we go any further. The purpose of this tool is to make the amazing amiga community productive with AI. Here are some screenshots of games I clobbered together in an afternoon. They are included as examples and as of publishing are terrible. Go ahead make them better:
Frank the frog

Invaded

Moon kindalookaround

PacBro


System Architecture
High-Level Data Flow
Component Layers
Amiga-Side IPC Architecture
The daemon owns the serial port exclusively. Client apps never touch serial —
they communicate via AmigaOS MsgPort IPC (FindPort("AMIGABRIDGE") + PutMsg/GetMsg).
Component Deep Dives
amiga-bridge (Amiga Daemon)
The heart of the Amiga side. A single process that:
- Opens serial.device with async I/O (SendIO/CheckIO) for non-blocking reads
- Creates MsgPort "AMIGABRIDGE" for client app registration
- Runs a Wait() loop on serial + IPC + window signals
- Routes messages between serial (host) and IPC (client apps)
- Provides system inspection without requiring a client app (task list, memory, etc.)
| Source File | Responsibility |
|---|---|
main.c | Event loop, status window, signal handling |
serial_io.c | serial.device open/close, async read/write |
ipc_manager.c | MsgPort creation, message routing |
client_registry.c | Track active clients by name/ID |
protocol_handler.c | Parse host commands, format responses (~1400 lines) |
system_inspector.c | Task/lib/device/volume listing, memory inspection |
fs_access.c | Directory listing, file read/write, rename, copy, protect, comment, checksum (CRC32), append |
process_launcher.c | Launch processes (async), path validation, CTRL-C, process tracking (up to 16), signal delivery |
Key design decisions:
- All large buffers are
staticto avoid 4KB default stack overflow - Uses
Forbid()/Permit()for task list iteration (minimal critical sections) - Volatile byte-by-byte reads for memory inspection (CopyMem returns zeros in FS-UAE for some regions)
- Process launcher validates path with
Lock()before launch, suppresses requesters withpr_WindowPtr = -1 - Custom chip registers ($DFF000) blocked from reads (byte access corrupts word-only registers)
amiga-devbench (Host Server)
A single Python application that combines:
UI
See Web UI Reference for detailed documentation with screenshots of all 8 tabs.
| Module | Purpose |
|---|---|
server.py | Starlette app, all HTTP/SSE endpoints, PID file singleton |
mcp_tools.py | 45+ MCP tool definitions using FastMCP |
protocol.py | parse_message() and format_command() — protocol codec |
serial_conn.py | SerialConnection class — PTY creation, TCP connect, auto-reconnect |
state.py | AmigaState (log buffer, var cache) + EventBus (async queue-based pub/sub) |
builder.py | Builder class — wraps docker run for cross-compilation |
deployer.py | Deployer class — copies binaries to AmiKit shared folder |
simulator.py | Fake Amiga that speaks the bridge protocol (for testing without emulator) |
__main__.py | CLI entry point with argparse |
Connection modes:
- PTY mode (default): Creates a pseudo-terminal at
/tmp/amiga-serial, FS-UAE opens it as its serial port - TCP mode (
--serial-host): Connects to FS-UAE's TCP serial port (e.g.,tcp://0.0.0.0:1234)
libbridge.a (Client Library)
Static library that Amiga apps link against. Provides a simple API for:
- Registering with the daemon
- Logging (printf-style, 4 severity levels)
- Registering variables for remote inspection/modification
- Registering hooks (functions the host can call)
- Registering memory regions (named areas the host can read)
- Polling for incoming commands
- Sending heartbeats
Resource limits per client: 32 variables, 16 hooks, 8 memory regions
Message pool: 4 pre-allocated BridgeMsg structures (no malloc per call)
Build Toolchain
Cross-Compilation via Docker
Docker image: amigadev/crosstools:m68k-amigaos
- Debian-based with
m68k-amigaos-gcccross-compiler - Includes AmigaOS headers and amiga.lib
- Mounted project root as
/work
Compiler flags:
| Flag | Purpose |
|---|---|
-noixemul | No Unix emulation — pure AmigaOS (mandatory) |
-m68020 | Target 68020 CPU (A1200 default) |
-O0 | No optimization (easier debugging) |
-Wall | All warnings |
-Iinclude | Bridge header path |
-lbridge | Link client library |
-lamiga | Link amiga.lib |
Build commands:
bashmake all # Build everything (lib + bridge + examples) make bridge # Build daemon + libbridge.a make examples # Build every project under examples/ (auto-discovered) # examples/ is a submodule — run # `git submodule update --init` first if empty make clean # Clean all artifacts
Deploy Path
Host path:
/Applications/AmiKit.app/Contents/SharedSupport/prefix/drive_c/AmiKit/Dropbox/Dev/
Amiga path:
DH2:Dev/
Binaries are copied to the host path and immediately visible on the Amiga via the FS-UAE shared folder mount.
Deployment Topologies
DevBench talks to the bridge over a byte stream. What sits at the other end of that stream is a deployment choice — three well-supported shapes:
| Profile | Transport | Bridge process runs in | Amiga TCP stack |
|---|---|---|---|
local-fsuae | PTY symlink | FS-UAE on this host | n/a (byte stream is the PTY) |
real-amiga | TCP on the LAN | A real Amiga (Amiberry / stock 68k iron) | RoadShow / AmiTCP (bsdsocket.library) |
pi-amikit | TCP on the LAN | AmiKit inside Amiberry on a Raspberry Pi | Amiberry's built-in bsdsocket_emu |
All three run the same amiga-bridge binary; the only difference is the
transport argument you give it and where the process lives.
Switching profiles
devbench.toml ships with all three predefined. Pick one:
bash# via config file active_profile = "pi-amikit" # via CLI (overrides active_profile in the config) python -m amiga_devbench --profile local-fsuae python -m amiga_devbench --profile real-amiga python -m amiga_devbench --profile pi-amikit # ad-hoc override without a profile python -m amiga_devbench --mode tcp --serial-host 192.168.1.50 --serial-port 2345 # list what's defined python -m amiga_devbench --list-profiles
Profile fields overlay on top of the flat [serial] / [emulator] sections
in devbench.toml, so shared defaults (server_port, deploy_dir, FS-UAE RPC
settings) stay in one place and each profile only sets what it needs to change.
1. local-fsuae — FS-UAE on this host, PTY transport
toml[profiles.local-fsuae] mode = "pty" pty_path = "/tmp/amiga-serial" auto_start_emulator = true
FS-UAE side (.fs-uae config):
iniserial_port = /tmp/amiga-serial
Amiga side (Startup-Sequence or User-Startup):
Run >NIL: DH2:Dev/amiga-bridge ; no args = serial mode
Ordering matters: devbench must start before FS-UAE (it creates the
symlink). This is the mode [emulator] auto_start = true handles.
2. real-amiga — real Amiga on the LAN, TCP transport
toml[profiles.real-amiga] mode = "tcp" host = "192.168.1.50" # your Amiga's LAN IP port = 2345 auto_start_emulator = false
Amiga side (needs a working TCP/IP stack — RoadShow, AmiTCP, Miami …):
Run >NIL: DH0:AmigaBridge/amiga-bridge TCP 2345
Confirm the stack is up with ShowNetStatus before starting the bridge.
On this topology the Amiga listens and devbench dials in.
3. pi-amikit — AmiKit inside Amiberry on a Raspberry Pi
toml[profiles.pi-amikit] mode = "tcp" host = "amiga.local" port = 2345 # Optional: SSH-driven remote emulator control. When set, devbench uses # RemoteEmulatorController — amiga_emulator_{status,start,stop,restart} # MCP tools drive Amiberry over SSH. start escalates to `sudo reboot` # if the ready probe never answers. auto_start_emulator = true emulator_ssh = "chris@amiga.local" emulator_start_cmd = "sudo -u amikit env DISPLAY=:0 XAUTHORITY=/home/amikit/.Xauthority /home/amikit/Amiberry/amiberry -s use_gui no </dev/null >/dev/null 2>&1 & disown" emulator_stop_cmd = "sudo pkill -f amiberry" emulator_status_cmd = "pgrep -f amiberry >/dev/null" emulator_ready_probe = "amiga.local:2345" emulator_reboot_cmd = "sudo reboot"
Amiberry provides bsdsocket_emu = true in its .uae config — no RoadShow
install needed on the AmiKit side. The bridge runs on port 2345 just like the
real-Amiga case; devbench doesn't care which is on the other end.
Deploy over the wire. With this profile there is no shared folder between
the Mac and the Pi's AmigaOS, so amiga_deploy and amiga_build_deploy_run
automatically fall through to file_transfer.push_file (bridge WRITEFILE +
APPEND chunks, CRC32-verified). No config knob needed — the Deployer notices
emulator_ssh is set and forces the bridge path. The old
amiga_serial_deploy tool still works if you want to be explicit.
Amiga side (in AmiKit's S:User-Startup):
Run >NIL: SYS:AmigaBridge/amiga-bridge TCP 2345
Bring-up shortcut for this profile:
bash# 1. Push the current bridge binary + install script to the Pi scp amiga-deploy/amiga-bridge chris@amiga.local:/tmp/ ssh chris@amiga.local 'sudo mv /tmp/amiga-bridge \ /home/amikit/AmiKit/AmigaBridge/amiga-bridge && \ sudo chown amikit:amikit /home/amikit/AmiKit/AmigaBridge/amiga-bridge' # 2. Reboot — Amiberry auto-starts, AmigaOS boots, User-Startup runs the bridge ssh chris@amiga.local 'sudo reboot' # 3. Point devbench at it python -m amiga_devbench --profile pi-amikit # 4. Smoke-test the wire ./scripts/smoke-bridge.sh
Verifying the connection
./scripts/smoke-bridge.sh polls /api/status until connected=true and a
heartbeat has been observed. Works for all three modes since it only cares
that the wire is talking. PORT and TIMEOUT env vars tune it.
FS-UAE Emulator Setup
Configuration File
Location: ~/Documents/FS-UAE/Configurations/AmiKit-Debug.fs-uae
ini[fs-uae] # Kickstart ROM kickstart_file = ~/Documents/FS-UAE/Kickstarts/kick.rom # Hardware: A1200 with 68020+FPU, 2MB chip, 8MB fast amiga_model = A1200 cpu = 68020 fpu = 68882 chip_memory = 2048 fast_memory = 8192 # Hard drives hard_drive_0 = ~/Documents/FS-UAE/Hard Drives/System # DH0: (boot) hard_drive_1 = .../AmiKit/RabbitHole/InstalledOS # DH1: (OS extras) hard_drive_2 = .../AmiKit/Dropbox # DH2: (Dev binaries) # Serial: TCP mode (devbench connects as client) serial_port = tcp://0.0.0.0:1234 serial_on_demand = false # Mouse: don't capture mouse_integration = 1 automatic_input_grab = 0 initial_input_grab = 0 cursor_integration = 1 # Networking bsdsocket_library = 1
Startup Sequence
Location: ~/Documents/FS-UAE/Hard Drives/System/S/Startup-Sequence
Key additions for the development environment:
; Suppress "Please insert Work" requester Assign >NIL: Work: RAM: ; Auto-start bridge daemon If EXISTS DH2:Dev/amiga-bridge Run >NIL: DH2:Dev/amiga-bridge EndIf
Connection Modes
PTY mode: devbench must start before FS-UAE (creates the PTY file) TCP mode: FS-UAE must start before devbench (listens on port)
Bridge Protocol
Line-based text protocol over serial. Each message is \n-terminated,
fields are pipe-delimited (|), maximum 1024 characters per line.
Amiga → Host Messages
Logging & Status
| Message | Format | Description |
|---|---|---|
| LOG | LOG|level|tick|message | App log (level: D/I/W/E) |
| CLOG | CLOG|client|level|tick|message | Client-attributed log |
| HB | HB|tick|freeChip|freeFast | Heartbeat |
| PONG | PONG|clientCount|freeChip|freeFast | Ping response |
| READY | READY|version | Daemon startup |
Variables
| Message | Format | Description |
|---|---|---|
| VAR | VAR|name|type|value | Variable value (type: i32/u32/str/f32/ptr) |
| CVAR | CVAR|client|name|type|value | Client-attributed variable |
Memory
| Message | Format | Description |
|---|---|---|
| MEM | MEM|addr_hex|size|hex_data | Memory dump response |
System Info
| Message | Format | Description |
|---|---|---|
| CLIENTS | CLIENTS|count|name1,name2,... | Connected clients |
| TASKS | TASKS|count|name(pri,state,type),... | Task list |
| LIBS | LIBS|count|name(v.r),... | Library list |
| DEVICES | DEVICES|count|name(v.r),... | Device list |
| VOLUMES | VOLUMES|count|name1,name2,... | Volume list |
Files
| Message | Format | Description |
|---|---|---|
| DIR | DIR|path|count|name(size,type),... | Directory listing |
| FILE | FILE|path|size|offset|hex_data | File content |
| FILEINFO | FILEINFO|path|size|date|protbits | File metadata |
Process & Commands
| Message | Format | Description |
|---|---|---|
| PROC | PROC|id|status|output | Process completion |
| CMD | CMD|id|status|response | Command response |
Client Introspection
| Message | Format | Description |
|---|---|---|
| HOOKS | HOOKS|client|count|name:desc,... | Hook list |
| MEMREGS | MEMREGS|client|count|name:addr:size:desc,... | Memory regions |
| CINFO | CINFO|name|id|msgs|vars:...|hooks:...|memregs:... | Full client info |
Hardware & Inspection
| Message | Format | Description |
|---|---|---|
| MEMMAP | MEMMAP|count|name:attr:lower:upper:free:largest,... | Memory region map |
| STACKINFO | STACKINFO|task|spLower|spUpper|spReg|size|used|free | Task stack info |
| CHIPREGS | CHIPREGS|count|name:addr:value|... | Custom chip register values |
| REGS | REGS|D0=val|D1=val|...|SP=val|SR=val | CPU register snapshot |
| SEARCH | SEARCH|count|addr1,addr2,... | Memory search results |
Acknowledgements
| Message | Format | Description |
|---|---|---|
| OK | OK|context|detail | Success |
| ERR | ERR|context|detail | Error |
Host → Amiga Commands
Connection
| Command | Format | Description |
|---|---|---|
| PING | PING | Request status |
| SHUTDOWN | SHUTDOWN | Terminate daemon |
Variables
| Command | Format | Description |
|---|---|---|
| GETVAR | GETVAR|name | Get variable value |
| SETVAR | SETVAR|name|value | Set variable value |
Memory
| Command | Format | Description |
|---|---|---|
| INSPECT | INSPECT|addr_hex|size | Request memory dump |
| WRITEMEM | WRITEMEM|addr_hex|hex_data | Write to memory |
System Queries
| Command | Format | Description |
|---|---|---|
| LISTCLIENTS | LISTCLIENTS | List clients |
| LISTTASKS | LISTTASKS | List tasks |
| LISTLIBS | LISTLIBS | List libraries |
| LISTDEVS | LISTDEVS | List devices |
| LISTVOLUMES | LISTVOLUMES | List volumes |
Filesystem
| Command | Format | Description |
|---|---|---|
| LISTDIR | LISTDIR|path | List directory |
| READFILE | READFILE|path|offset|size | Read file |
| WRITEFILE | WRITEFILE|path|offset|hex_data | Write file |
| FILEINFO | FILEINFO|path | Get file info |
| DELETEFILE | DELETEFILE|path | Delete file |
| MAKEDIR | MAKEDIR|path | Create directory |
Process Control
| Command | Format | Description |
|---|---|---|
| LAUNCH | LAUNCH|id|command | Run and wait |
| RUN | RUN|id|command | Run async |
| DOSCOMMAND | DOSCOMMAND|id|command | Run AmigaDOS command |
| BREAK | BREAK|task_name | Send CTRL-C |
| SCRIPT | SCRIPT|id|script_text | Execute script (newlines → ;) |
| STOP | STOP|client_name | Stop client (CTRL-C + IPC shutdown) |
Hardware & Inspection
| Command | Format | Description |
|---|---|---|
| MEMMAP | MEMMAP | Request memory region map |
| STACKINFO | STACKINFO|taskname | Request stack info for a task |
| CHIPREGS | CHIPREGS | Read safe custom chip registers |
| READREGS | READREGS | Capture CPU registers |
| SEARCH | SEARCH|addr_hex|size|pattern_hex | Search memory for byte pattern |
Hooks & Memory Regions
| Command | Format | Description |
|---|---|---|
| LISTHOOKS | LISTHOOKS|client | List hooks |
| CALLHOOK | CALLHOOK|id|client|hook|args | Call hook |
| LISTMEMREGS | LISTMEMREGS|client | List memory regions |
| READMEMREG | READMEMREG|client|region | Read region |
| CLIENTINFO | CLIENTINFO|client | Get client details |
Capabilities & Process Management
| Command | Format | Description |
|---|---|---|
| CAPABILITIES | CAPABILITIES | Query daemon version, protocol level, supported commands |
| PROCLIST | PROCLIST | List tracked async processes |
| PROCSTAT | PROCSTAT|id | Get status of a tracked process |
| SIGNAL | SIGNAL|id|sigType | Send signal to tracked process (0=CTRL-C, 1=CTRL-D, 2=CTRL-E, 3=CTRL-F) |
Extended Filesystem Operations
| Command | Format | Description |
|---|---|---|
| RENAME | RENAME|oldPath|newPath | Rename or move a file |
| COPY | COPY|src|dst | Copy a file server-side (no host round-trip) |
| APPEND | APPEND|path|hexData | Append hex-encoded data to a file |
| CHECKSUM | CHECKSUM|path | Compute CRC32 checksum and file size |
| PROTECT | PROTECT|path | Get protection bits |
| PROTECT | PROTECT|path|bits | Set protection bits (hex) |
| SETCOMMENT | SETCOMMENT|path|comment | Set file comment (filenote) |
Assign Management
| Command | Format | Description |
|---|---|---|
| ASSIGNS | ASSIGNS | List all DOS assigns |
| ASSIGN | ASSIGN|name|path | Create/replace an assign |
| ASSIGN | ASSIGN|name|path|ADD | Add path to multi-assign |
| ASSIGN | ASSIGN|name||REMOVE | Remove an assign |
File Tail (Live Streaming)
| Command | Format | Description |
|---|---|---|
| TAIL | TAIL|path | Start tailing a file for new data |
| STOPTAIL | STOPTAIL | Stop tailing |
Amiga → Host (New Messages)
| Message | Format | Description |
|---|---|---|
| CAPABILITIES | CAPABILITIES|version|protocolLevel|maxLine|cmd1,cmd2,... | Daemon capabilities |
| PROCLIST | PROCLIST|count|id:cmd:status,... | Tracked process list |
| PROCSTAT | PROCSTAT|id|command|status | Single process status |
| TAILDATA | TAILDATA|path|hexData | New data appended to tailed file |
| CHECKSUM | CHECKSUM|path|crc32|size | File CRC32 and size |
| ASSIGNS | ASSIGNS|count|name:path:type,... | Assign list (type: A=assign, L=late, N=nonbinding) |
| PROTECT | PROTECT|path|bits | File protection bits (hex) |
Client Library API
Header: bridge_client.h
c#include "bridge_client.h"
Variable Types
c#define AB_TYPE_I32 0 /* signed 32-bit integer */ #define AB_TYPE_U32 1 /* unsigned 32-bit integer */ #define AB_TYPE_STR 2 /* null-terminated string */ #define AB_TYPE_F32 3 /* 32-bit float */ #define AB_TYPE_PTR 4 /* pointer (displayed as hex) */
Functions
Initialization
cint ab_init(const char *appName); /* Returns 0 on success, -1 on failure */ void ab_cleanup(void); /* Unregister from daemon */ BOOL ab_is_connected(void); /* Check daemon connection */
Logging
cvoid ab_log(int level, const char *fmt, ...); /* Printf-style */ /* Convenience macros */ AB_D(fmt, ...) /* DEBUG */ AB_I(fmt, ...) /* INFO */ AB_W(fmt, ...) /* WARN */ AB_E(fmt, ...) /* ERROR */
Variables
cvoid ab_register_var(const char *name, int type, void *ptr); void ab_unregister_var(const char *name); void ab_push_var(const char *name); /* Send current value to host */
Heartbeat & Memory
cvoid ab_heartbeat(void); /* Send status pulse */ void ab_send_mem(APTR addr, ULONG size); /* Dump memory to host */
Command Handling
ctypedef void (*ab_cmd_handler_t)(ULONG id, const char *data); void ab_set_cmd_handler(ab_cmd_handler_t handler); void ab_poll(void); /* Check for commands (non-blocking) */ void ab_cmd_respond(ULONG id, const char *status, const char *data);
Hooks (Host-Callable Functions)
ctypedef int (*ab_hook_fn_t)(const char *args, char *resultBuf, int bufSize); void ab_register_hook(const char *name, const char *description, ab_hook_fn_t fn); void ab_unregister_hook(const char *name);
Memory Regions
cvoid ab_register_memregion(const char *name, APTR addr, ULONG size, const char *description); void ab_unregister_memregion(const char *name);
Programming Examples
Minimal App — Hello World
c#include <proto/exec.h> #include <proto/dos.h> #include "bridge_client.h" int main(void) { if (ab_init("hello") != 0) { printf("Bridge not running\n"); return 1; } AB_I("Hello from Amiga!"); Delay(50); ab_cleanup(); return 0; }
Build: Link with -lbridge -lamiga
Variables — Remote Monitoring
c#include <proto/exec.h> #include <proto/dos.h> #include "bridge_client.h" static LONG score = 0; static LONG lives = 3; static char player_name[32] = "Player1"; int main(void) { ab_init("game"); /* Register variables — host can read and write these */ ab_register_var("score", AB_TYPE_I32, &score); ab_register_var("lives", AB_TYPE_I32, &lives); ab_register_var("player_name", AB_TYPE_STR, player_name); while (lives > 0) { score += 10; /* Push updated values to host every 50 frames */ if (score % 500 == 0) { ab_push_var("score"); ab_push_var("lives"); ab_heartbeat(); } /* Check for host commands (GETVAR, SETVAR, etc.) */ ab_poll(); Delay(1); } AB_I("Game over! Score: %ld", (long)score); ab_cleanup(); return 0; }
The host can now:
- Read
scorewithGETVAR|score - Set
liveswithSETVAR|lives|99 - See values in the web dashboard or via MCP tools
Hooks — Remote Function Calls
c#include <proto/exec.h> #include <proto/dos.h> #include "bridge_client.h" static LONG difficulty = 1; /* Hook: called by the host, runs on the Amiga */ static int hook_set_difficulty(const char *args, char *result, int bufSize) { if (args && args[0]) { difficulty = strtol(args, NULL, 10); sprintf(result, "Difficulty set to %ld", (long)difficulty); } else { sprintf(result, "Current difficulty: %ld", (long)difficulty); } return 0; /* 0 = success */ } static int hook_reset(const char *args, char *result, int bufSize) { difficulty = 1; strncpy(result, "Reset complete", bufSize - 1); return 0; } int main(void) { BOOL running = TRUE; ab_init("game"); ab_register_var("difficulty", AB_TYPE_I32, &difficulty); /* Register hooks — host can call these by name */ ab_register_hook("set_difficulty", "Set game difficulty (1-10)", hook_set_difficulty); ab_register_hook("reset", "Reset all settings", hook_reset); while (running) { /* IMPORTANT: Do NOT call ab_log inside hooks! * The daemon is waiting for the hook reply. */ ab_poll(); if (SetSignal(0L, SIGBREAKF_CTRL_C) & SIGBREAKF_CTRL_C) running = FALSE; Delay(5); } ab_cleanup(); return 0; }
From Claude Code: amiga_call_hook("game", "set_difficulty", "5")
From Web UI: Hooks panel → Call
Memory Regions — Named Memory Areas
c#include <proto/exec.h> #include "bridge_client.h" struct GameState { LONG x, y; LONG vx, vy; LONG score; LONG level; }; static struct GameState state = {100, 50, 2, 1, 0, 1}; int main(void) { ab_init("game"); /* Register a named memory region the host can inspect */ ab_register_memregion("gamestate", &state, sizeof(state), "Player position, velocity, score, level"); /* ... game loop ... */ ab_cleanup(); return 0; }
The host can read the raw bytes of gamestate at any time for low-level inspection.
Full Example — Bouncing Ball (excerpts)
c/* Register settable variables */ static LONG ball_speed = 1; static LONG ball_color = 3; ab_register_var("ball_speed", AB_TYPE_I32, &ball_speed); ab_register_var("ball_color", AB_TYPE_I32, &ball_color); /* Main loop uses the variables */ while (running) { draw_ball(rp, ball_x, ball_y, (UBYTE)ball_color); ball_x += dx; ball_y += dy; /* Push updates periodically */ if (frame_count % 60 == 0) { ab_push_var("ball_speed"); ab_push_var("ball_color"); ab_heartbeat(); } ab_poll(); /* Always poll! */ Delay(ball_speed < 1 ? 1 : ball_speed); }
Change the ball color from the web UI by editing ball_color, or from
Claude Code with amiga_set_var("ball_color", "1").
AmigaOS C Gotchas
| Gotcha | Fix |
|---|---|
sprintf returns char*, not int | Use strlen() after if you need length |
%d reads 16-bit WORD | Always use %ld with (long) cast |
%x reads 16-bit WORD | Always use %lx with (unsigned long) cast |
%c misaligns stack | Use %s with a 2-char string buffer |
| Default stack is 4KB | Make large buffers static |
| No memory protection | Buffer overflow crashes the entire OS |
Forbid()/Permit() imbalance | Freezes system permanently |
WaitPort() blocks forever | Use polling with timeout instead |
Two debuggers: when to use which
DevBench exposes two independent debuggers, each with its own UI tab, MCP tool family, and HTTP API. They're complementary — pick the one that matches what you're trying to inspect.
Bridge debugger — "what is my app doing?"
UI tab: Debugger MCP prefix: amiga_debugger_* API prefix: /api/debugger/*
Talks to the amiga-bridge daemon running in Amiga RAM, over the serial link (TCP or PTY). Source-level: knows about your symbols, lines, locals, call stack. Drives one of your processes via Launch & Attach.
Best for:
- Stepping through your own C functions line by line
- Reading local variables and walking the call stack of your task
- Breaking at function names or source lines
- Watching variables you registered with
ab_register_var()
Limitations:
- Requires the bridge daemon to be running and your app to be attached
- Bridge dies if the OS hangs / crashes / hasn't booted yet
- Can't see inside Kickstart ROM or other tasks
- No hardware-level watchpoints (limited to bridge-instrumented stops)
FS-UAE native debugger — "what is the emulator doing?"
UI tab: FS-UAE MCP prefix: amiga_fsuae_* API prefix: /api/fsuae/*
Talks to the patched fs-uae build over HTTP. Emulator-level: pauses the 68k CPU itself, sees every memory access, every cycle. No bridge daemon needed.
Best for:
- "Who keeps clobbering
$DFF180?" — hardware-style watchpoints with R/W/I and mustchange - Inspecting Kickstart ROM, exception vectors, CIA registers
- Pre-boot debugging (set BP at reset vector, single-step from instruction zero)
- Debugging when the OS has hung — bridge is dead but fs-uae is fine
- Decoding chipset state (DMACON / INTENA / BPLCONx / copper pointers / beam pos)
Limitations:
- Requires the patched fs-uae build (Linux + macOS only; Windows compiles to a no-op stub)
- No source-line mapping — addresses only
- Stock fs-uae from Homebrew/apt doesn't expose this API; the tab stays hidden
Side-by-side
| Capability | Bridge | FS-UAE |
|---|---|---|
| Pause / step / continue | ✓ | ✓ |
| Source-level (file:line, locals, backtrace) | ✓ | — |
| Function-name breakpoints (via symbol load) | ✓ | by address only |
| Hardware-style watchpoints (R/W/I, mustchange) | — | ✓ |
| Read Kickstart ROM | — | ✓ |
| Read/write 68k regs (D0-D7, A0-A7, PC, SR, USP, ISP) | partial (task ctx) | ✓ (live CPU) |
| Memory map (chip/fast/ROM/IO/unmapped) | — | ✓ |
| Chipset register snapshot | partial (inspector) | ✓ |
| State snapshot save/load (.uss) | — | ✓ |
| Works when OS has crashed | — | ✓ |
| Works without bridge running | — | ✓ |
| Works on Windows | ✓ | — (patched build is mac/linux only) |
You can mix them: set a hardware watchpoint with the FS-UAE debugger to find where something happens, then attach the bridge debugger to step through the surrounding source. The two run side-by-side without interfering.
MCP Tools Reference
All tools are available through Claude Code when connected to the MCP server.
Build & Deployment
| Tool | Parameters | Description |
|---|---|---|
amiga_build | project? | Cross-compile via Docker. Omit project for all. |
amiga_clean | project? | Clean build artifacts |
amiga_deploy | project? | Copy binaries to AmiKit shared folder |
amiga_build_deploy_run | project, command? | Build → deploy → launch in one step |
Connection & Status
| Tool | Parameters | Description |
|---|---|---|
amiga_connect | mode?, host?, port?, pty_path? | Connect to Amiga (TCP or PTY) |
amiga_disconnect | — | Close serial connection |
amiga_ping | — | Check if Amiga is alive, get client count and memory |
Logging
| Tool | Parameters | Description |
|---|---|---|
amiga_log | count?, level? | Get recent log messages |
amiga_watch_logs | duration_ms?, level? | Stream logs in real-time |
amiga_watch_status | duration_ms? | Stream heartbeats and variable updates |
Memory
| Tool | Parameters | Description |
|---|---|---|
amiga_inspect_memory | address, size | Hex dump at address (blocks custom chip regs) |
amiga_write_memory | address, hex_data | Write hex bytes to RAM address |
Variables
| Tool | Parameters | Description |
|---|---|---|
amiga_get_var | name | Read a registered variable |
amiga_set_var | name, value | Write a registered variable |
Process Control
| Tool | Parameters | Description |
|---|---|---|
amiga_launch | command | Launch a program on the Amiga |
amiga_dos_command | command | Run an AmigaDOS command |
amiga_run_script | script | Execute multi-line AmigaDOS script |
amiga_break | name | Send CTRL-C break to a task |
amiga_stop_client | name | Gracefully stop a bridge client |
amiga_proc_list | — | List tracked async processes with IDs and status |
amiga_proc_stat | proc_id | Get status of a specific tracked process |
amiga_signal | proc_id, signal? | Send signal to tracked process (CTRL_C/D/E/F) |
System Information
| Tool | Parameters | Description |
|---|---|---|
amiga_capabilities | — | Query daemon version, protocol level, and supported commands |
amiga_list_clients | — | List connected bridge clients |
amiga_list_tasks | — | List all running tasks/processes |
amiga_list_libs | — | List loaded libraries with versions |
amiga_lib_info | name | Detailed library info: version, revision, openCnt, flags, negSize, posSize, base address, ID string |
amiga_dev_info | name | Detailed device info: same fields as lib_info but for devices |
amiga_client_info | client | Detailed info: vars, hooks, memregs |
amiga_list_assigns | — | List all DOS assigns (logical device assignments) |
amiga_assign | name, path, mode? | Create, replace, add to, or remove a DOS assign |
Filesystem
| Tool | Parameters | Description |
|---|---|---|
amiga_list_dir | path? | List directory contents |
amiga_read_file | path, offset?, size? | Read file content (hex) |
amiga_write_file | path, offset, hex_data | Write hex data to file |
amiga_rename | old_path, new_path | Rename or move a file |
amiga_copy | src, dst | Copy a file server-side (no host round-trip) |
amiga_append_file | path, hex_data | Append hex-encoded data to a file |
amiga_checksum | path | Compute CRC32 checksum and file size |
amiga_protect | path, bits? | Get or set AmigaOS protection bits |
amiga_set_comment | path, comment | Set file comment (filenote) |
amiga_tail | path, duration_ms? | Stream live file appends (log monitoring) |
Hooks & Memory Regions
| Tool | Parameters | Description |
|---|---|---|
amiga_list_hooks | client? | List registered hooks |
amiga_call_hook | client, hook, args? | Call a hook function remotely |
amiga_list_memregions | client? | List registered memory regions |
amiga_read_memregion | client, region | Read a named memory region |
Execution
| Tool | Parameters | Description |
|---|---|---|
amiga_exec | command | Send expression to client's command handler |
Graphics & Hardware Inspection
| Tool | Parameters | Description |
|---|---|---|
amiga_screenshot | window? | Capture screen or window as PNG (planar→chunky conversion) |
amiga_get_palette | screen? | Read OCS/ECS 12-bit color palette via GetRGB4() |
amiga_set_palette | index, r, g, b | Set a palette color (4-bit per channel) |
amiga_copper_list | — | Read and decode copper list (MOVE/WAIT/SKIP instructions) |
amiga_sprites | — | Read 8 hardware sprite channels (copper + SimpleSprites) |
amiga_disassemble | address, count? | Disassemble 68k code with LVO annotation |
amiga_last_crash | — | Read last crash report (registers, stack, alert code) |
Client Profiling
| Tool | Parameters | Description |
|---|---|---|
amiga_list_resources | client | Query client resource tracking (alloc/free, open/close) |
amiga_perf_report | client | Query client performance data (frame timing, sections) |
Debug & Symbols
| Tool | Parameters | Description |
|---|---|---|
amiga_load_symbols | project | Load STABS debug symbols from a cross-compiled binary (requires -g flag) |
amiga_lookup_symbol | address, project? | Look up function name + source file:line for a code address |
amiga_list_functions | project | List all function symbols with source file:line mappings |
amiga_run_tests | project, command? | Build, deploy, run a test suite and collect pass/fail results |
Once symbols are loaded, the disassembler annotates function entry points and source line changes, and crash reports include symbolic register annotations and stack traces.
Audio
| Tool | Parameters | Description |
|---|---|---|
amiga_audio_channels | — | Read all 4 Paula audio channel registers (period, volume, length, pointer) |
amiga_audio_sample | address, size? | Read audio sample data from chip RAM, returns hex + waveform |
Intuition Inspection
| Tool | Parameters | Description |
|---|---|---|
amiga_list_screens | — | List all Intuition screens with dimensions, depth, title, flags |
amiga_list_screen_windows | screen? | List all windows on a screen with positions, sizes, flags |
amiga_list_gadgets | window | List gadgets attached to a window (type, position, size, flags) |
Input Injection
| Tool | Parameters | Description |
|---|---|---|
amiga_input_key | rawkey, direction? | Inject a keyboard event via input.device (raw key code) |
amiga_input_mouse_move | dx, dy | Inject a relative mouse move event |
amiga_input_click | button?, direction? | Inject a mouse button press/release |
ARexx
| Tool | Parameters | Description |
|---|---|---|
amiga_arexx_ports | — | List all ARexx message ports (running ARexx-aware apps) |
amiga_arexx_send | port, command | Send an ARexx command to a named port and get the result |
Font Browser
Available via the web UI (Tools > Inspect > Font Browser). Enumerates installed Amiga
fonts via diskfont.library AvailFonts(), grouped by family with available sizes.
Click a font to view metrics: baseline, x/y size, style flags, font type.
Protocol commands: LISTFONTS → FONTS|count|name:sizes|..., FONTINFO|name|size → FONTINFO|name|size|ysize|xsize|style|flags|baseline.
Locale/Catalog Inspector
Available via the web UI (Tools > Inspect > Locale/Catalog Inspector). Browses
installed locale catalogs under LOCALE:Catalogs/ using the SCRIPT command to run
AmigaDOS list commands. Click a catalog directory to see its contents.
Assign Manager
Available via the web UI (Tools > System > Assign Manager). Lists, creates, modifies,
and removes AmigaOS logical assigns (SYS:, LIBS:, FONTS:, etc.). Supports the ADD
flag for multi-directory assigns. Uses the SCRIPT command to run assign on the Amiga.
Startup-Sequence Editor
Available via the web UI (Tools > System > Startup-Sequence Editor). Remotely edit
S:Startup-Sequence, S:User-Startup, or S:Shell-Startup. Uses READFILE/WRITEFILE
protocol commands. Changes take effect on next boot.
Preferences Editor
Available via the web UI (Tools > System > Preferences Editor). Lists available
Workbench preferences files from ENV:sys/ and reads their contents. Prefs files
are IFF binary format.
Custom Chip Register Logger
Available via the web UI (Tools > Debug > Custom Chip Logger). Monitors 13 readable custom chip registers at $DFF000 for changes: DMACONR, VPOSR, VHPOSR, JOY0DAT, JOY1DAT, POT0DAT, POT1DAT, POTGOR, INTENAR, INTREQR, DSKBYTR, DENISEID, ADKCONR.
- Start — takes initial snapshot and begins polling from the bridge main loop (200ms interval)
- Stop — stops monitoring
- Snapshot — one-shot read of all registers
Register changes are reported in real-time via CHIPLOGCHANGE|tick|reg:old:new|... events.
Protocol commands: CHIPLOGSTART, CHIPLOGSTOP, CHIPLOGSNAPSHOT → CHIPLOG|reg:val|....
Memory Pool Tracker
Available via the web UI (Tools > Debug > Memory Pool Tracker). Tracks pool-based
memory allocation by patching exec.library pool functions via SetFunction():
CreatePool, DeletePool, AllocPooled, FreePooled.
- Start — installs patches, begins tracking (up to 32 pools)
- Stop — restores original function vectors
- Refresh — lists active pools with allocation counts and total sizes
Uses Forbid()/Permit() to protect tracking data and Disable()/Enable() around
SetFunction() calls.
Protocol commands: POOLSTART, POOLSTOP, POOLS → POOLS|count|addr:puddle:thresh:allocs:total|....
Visual Diff for Screenshots
Available via the web UI (Tools > Graphics > Visual Diff). Pixel-level comparison of two Amiga screenshots for visual regression testing.
- Capture A — take baseline screenshot
- Make changes on the Amiga
- Capture B — take comparison screenshot
- Compare — generates diff image with configurable threshold (0-255)
Produces a diff image (dimmed background + magenta changed pixels + yellow bounding boxes).
Reports change percentage, pixel counts, and detected change regions using 16x16 block
grid with flood-fill connected component analysis. Requires Pillow (pip install Pillow).
Clipboard Bridge
Available via



