zandronum-mcp

v0.6.0
zandronum-mcp Checked 1 day ago Published 3 months ago

MCP server for driving and introspecting a local Zandronum dev build.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

run_command Run console command

Send a raw console command to a running, bridge-patched Zandronum instance and return its captured output.

ParameterTypeDescription
text *string
instanceinteger

list_actor_classes List actor classes

Run `dumpactors` and return the registered DECORATE/actor classes as structured data.

ParameterTypeDescription
instanceinteger

summon Summon actor

Spawn an actor of the given class at the player's position.

ParameterTypeDescription
className *string
instanceinteger
kindstring

give Give item

Give an inventory item to the player.

ParameterTypeDescription
item *string
amountinteger
instanceinteger

take Take item

Remove an inventory item from the player.

ParameterTypeDescription
item *string
amountinteger
instanceinteger

load_map Load map

Load a map by its lump name (e.g. MAP01, E1M1).

ParameterTypeDescription
mapName *string
instanceinteger

list_running_scripts List running ACS scripts

Run `scriptstat` and return the currently running ACS scripts and their states.

ParameterTypeDescription
instanceinteger

run_script Run ACS script

Run (puke) an ACS script by number or name, with optional integer arguments.

ParameterTypeDescription
script *
alwaysboolean
argsarray
instanceinteger

screenshot Screenshot

Take a screenshot of the game and return it as an image so it can be viewed.

ParameterTypeDescription
instanceinteger

menu_key Press a menu key

Send a single menu navigation key (GUI key event) to the active menu.

ParameterTypeDescription
key *string
instanceinteger

menu_nav Navigate a menu

Send a sequence of menu keys (e.g. ["down","down","enter"]) with a small delay between each.

ParameterTypeDescription
steps *array
instanceinteger

menu_text Type into a menu text field

Type a string into the active menu text-entry field (e.g. the player name box after pressing enter on it), one character at a time.

ParameterTypeDescription
text *string
instanceinteger

mouse_move Move the mouse pointer

Move the pointer to a screen position, in pixels from the top-left of the game window. Drives hover-only UI -- tooltips, hot states -- which nothing else here can reach.

ParameterTypeDescription
x *integer
y *integer
instanceinteger

mouse_click Click or drag the mouse

Press and release the left button at a position. Give toX/toY to DRAG: press at the first point, move through it, release at the second. `double` sends a double-click.

ParameterTypeDescription
x *integer
y *integer
doubleboolean
instanceinteger
toXinteger
toYinteger

mouse_wheel Scroll the mouse wheel

Wheel notches at the current pointer position. Positive scrolls up, negative down.

ParameterTypeDescription
notches *integer
instanceinteger

verify_menu Open, navigate, and screenshot a menu

Open a menu (via a console command like `menu_options`), apply navigation steps, then return a screenshot to verify it.

ParameterTypeDescription
instanceinteger
openstring
stepsarray

set_pause Pause or resume the game

Set the engine's master pause flag directly. Use this to resume a backgrounded instance that auto-paused on focus loss, so the simulation keeps advancing while the MCP drives it.

ParameterTypeDescription
paused *boolean
instanceinteger

step Advance the game by N tics

Resume the game, let it run for the given number of tics (35 tics = 1 second), then pause again. Lets you advance the simulation a deterministic-ish amount to observe time-based effects (charging, projectiles, animations) without keeping the window focused.

ParameterTypeDescription
instanceinteger
ticsinteger

get_acs_var Get ACS variable

Read an ACS world or global variable by index.

ParameterTypeDescription
index *integer
scope *string
instanceinteger

set_acs_var Set ACS variable

Write an ACS world or global variable by index.

ParameterTypeDescription
index *integer
scope *string
value *integer
instanceinteger

list_acs_vars List non-zero ACS variables

Run `dumpacsvars` and return all non-zero ACS world/global variables, optionally filtered by scope.

ParameterTypeDescription
instanceinteger
scopestring

acs_index Index ACS source

Parse a directory of .acs source files and return symbol counts (scripts, functions, numeric defines). Reads files directly; no game needed.

ParameterTypeDescription
dirstring

find_acs_symbol Find ACS symbol

Resolve a script number or a script/function name to its symbol(s) — name, number, file:line. Turns a profiler 'script 1017' into a source location.

ParameterTypeDescription
ref *string
dirstring

behavior_names Read ACS names from compiled bytecode

Read function and named-script names from a mod's compiled ACS (BEHAVIOR/library lumps) in a WAD or PK3 — for source-less mods. Numbered scripts have no names in bytecode (use find_acs_symbol with source for those).

ParameterTypeDescription
file *string

list_saves List savegames

List .zds savegames in the save directory with metadata (title, map, engine, game wad, creation time) read from each save's PNG text chunks. No running game needed.

ParameterTypeDescription
dirstring

save_game Save the game

Run `save` to write a savegame (single-player / cooperative only). NOTE: saving heavily-scripted mods can crash the engine — All-out-War crashes on save; vanilla and simple maps save fine.

ParameterTypeDescription
name *string
descriptionstring
instanceinteger

load_game Load a savegame

Run `load` to restore a savegame by name.

ParameterTypeDescription
name *string
instanceinteger

play_demo Play a demo

Run `playdemo` to play back a recorded .lmp demo. (Recording is via the -record launch arg, not a console command.)

ParameterTypeDescription
name *string
instanceinteger

player_state Player state

Run `currentpos` and return the player's position, angle, floor height, sector, and light level.

ParameterTypeDescription
instanceinteger

actor_state Actor state (DECORATE)

Run `dumpactor` and return an actor's live state: class, health, position, current DECORATE state (sprite/frame/tics, e.g. TNT1 A 0), inventory, and (for players) ready weapon + morph status. Defaults to the player; pass a TID for any actor.

ParameterTypeDescription
instanceinteger
tidinteger

read_hud Read on-screen HUD

Run `dumphud` and return everything the engine painted last frame: HUD text strings (with screen x/y), images (by texture name + position), and active ACS HUD messages (full composed text, layer, position, remaining tics). Captures menus too.

ParameterTypeDescription
instanceinteger

actors_near Actors near the player

Run `actorsnear` and return actors within a radius (map units, default 512) of the player: class, health, position, and current sprite.

ParameterTypeDescription
instanceinteger
radiusinteger

inspect_target Inspect aimed target

Run `linetarget` and return the actor the player is aiming at (class, health, spawn health).

ParameterTypeDescription
instanceinteger

list_scripts List ACS scripts

Run `dumpscripts` and return every script across loaded modules (module, number, name, type, arg count).

ParameterTypeDescription
instanceinteger

list_functions List ACS functions

Run `dumpfunctions` and return named ACS functions across loaded modules.

ParameterTypeDescription
instanceinteger

profile_scripts Profile ACS scripts

Run `acsprofile` and return per-script/function execution stats (total instructions, runs, avg/min/max).

ParameterTypeDescription
instanceinteger
limitinteger
sortstring

profile_window Profile a time window

Clear ACS profiling, wait N seconds, then return what ran during that window — `what's hot right now` rather than cumulative since map start.

ParameterTypeDescription
instanceinteger
limitinteger
secondsinteger
sortstring

list_modules List loaded ACS modules

Run `dumpmodules` and return the loaded ACS modules (id + name). Map vars live only while a map is loaded.

ParameterTypeDescription
instanceinteger

get_map_var Get map variable

Read a map-scope ACS variable by name (searched across loaded modules).

ParameterTypeDescription
name *string
instanceinteger

set_map_var Set map variable

Write a map-scope ACS variable by name.

ParameterTypeDescription
name *string
value *integer
instanceinteger

get_map_array Get map array element

Read one element of a map-scope ACS array by name and index.

ParameterTypeDescription
index *integer
name *string
instanceinteger

set_map_array Set map array element

Write one element of a map-scope ACS array by name and index.

ParameterTypeDescription
index *integer
name *string
value *integer
instanceinteger

renderer_info Renderer info

Active backend (software/opengl), GL vendor/shader model, resolution, fullscreen/vsync.

ParameterTypeDescription
instanceinteger

viewport_info Viewport info

The 3D view window rect (x/y/width/height) and screenblocks size.

ParameterTypeDescription
instanceinteger

hud_info HUD info

Status bar Y position, status bar / HUD scale, alt HUD, crosshair.

ParameterTypeDescription
instanceinteger

map_info Map info

Read a map from a WAD and return its format (doom/hexen/udmf) and entity counts. Reads the file directly — the game need not be running.

ParameterTypeDescription
map *string
filestring

get_sector Get sector

Return one sector's properties by index (all fields, format-native keys).

ParameterTypeDescription
index *integer
map *string
filestring

get_linedef Get linedef

Return one linedef by index, with its referenced sidedefs (textures + offsets) resolved.

ParameterTypeDescription
index *integer
map *string
filestring

find_sectors_by_tag Find sectors by tag

Return all sectors whose tag/id matches (binary `tag` or UDMF `id`).

ParameterTypeDescription
map *string
tag *integer
filestring

launch_instance Launch a Zandronum instance

Spawn a bridge-enabled Zandronum process with the given options and attach to it. Requires ZANDRONUM_EXE to be set.

ParameterTypeDescription
extraArgsarray
filesarray
fullscreenboolean
heightinteger
instanceinteger
iwadstring
mapstring
skillinteger
widthinteger

attach_instance Attach to an engine you started yourself

Connect to a bridge-patched Zandronum that is ALREADY running — one you launched by hand, or from a terminal — and bind it to an instance number for the other tools. Only needed for engines this session didn't launch: launch_instance binds automatically. Defaults to this instance's conventional port.

ParameterTypeDescription
instanceinteger
portinteger

kill_instance Kill a Zandronum instance

Stop a launched instance and detach from it. Asks the engine to quit itself first (a hard kill mid-render can wedge macOS GPU teardown and leave an unkillable process), then force-kills if it doesn't exit.

ParameterTypeDescription
instanceinteger

reset Reset — reap this session's engine instances

Kill every instance this session launched, and reap engines ORPHANED by earlier sessions (whose launcher is gone) that could otherwise squat bridge ports. Engines belonging to another running editor window are left alone. Pass all:true to also kill those — only do that if you know no other session is using this engine build.

ParameterTypeDescription
allbooleanAlso kill engines owned by other live MCP sessions using this same build.

get_startup_errors Get engine startup errors

Read the engine's captured console log for an instance and surface DECORATE/ACS compile errors and fatal startup errors. Works even when the bridge never came up (e.g. the engine aborted on a bad script) — exactly when the other tools can't connect.

ParameterTypeDescription
instanceinteger

get_crash Get the last engine crash backtrace

Return the signal, faulting address, and symbolized backtrace the bridge's crash handler captured the last time the engine crashed (segfault/abort/bus error/etc.). Use this when an instance dies unexpectedly — e.g. run_command reports the bridge closed. Empty if the instance has not crashed.

ParameterTypeDescription
instanceinteger