Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
rootYesThe folder programs are run from and the target's host: files are served from.
targetYesA target's address, address[:port], or mock. It has no default: nothing is sent to a console that wasn't named.
journalNoThe journal's file: ~/.local/state/ps2mcp/journal.jsonl by default, none for none.~/.local/state/ps2mcp/journal.jsonl

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

ps2mcp gives you a PlayStation 2 (or an emulator of one, or a mock) to work with: its memory and hardware registers, programs run on it with their outcome returned, sequences of register accesses run back to back for measuring what the hardware does, its picture, a debugger for the programs it runs, and a controller whose buttons you press.

Call status first: it says what the target is and which abilities it has. Addresses and values may be given as numbers or as text such as "0x10003000". Programs and host: files are relative to the server's root folder. Every request that reaches the hardware is appended to a journal with the target's identity, so a finding can be traced to the console it came from.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
statusA

What the target is (a console, an emulator or the mock, with its identity), what it can do, and what the program on it is doing. Connects if the link is down. Call this first.

read_memoryA

Reads count values of width bytes (1, 2, 4, 8 or 16) starting at address, each with one access of exactly that width, in ascending order. This is the way to read a hardware register, where the width of the access matters. space is "ee" or "iop". For a block of plain memory use dump_memory.

write_memoryA

Writes values of width bytes (1, 2, 4, 8 or 16) starting at address, each with one access of exactly that width, in ascending order: the way to write a hardware register. space is "ee" or "iop".

dump_memoryA

Reads a block of plain memory as bytes. Returns a hex dump of up to 4096 bytes; with save_to, a file name under the server's root, any length is written there as raw bytes instead and only a summary is returned. Not for hardware registers: use read_memory.

measureA

Runs a sequence of steps on the target back to back, with no traffic to the host between them, and returns each step's result in order. Use it when the order and timing of register accesses matter, as when finding out what the hardware does.

Steps (addresses and values as numbers or "0x..." text; width 1, 2, 4, 8 or 16, default 4; any step that gives a result may carry a "label"): {"op": "read", "address": A, "width": W} the value read {"op": "write", "address": A, "width": W, "value": V} {"op": "delay", "cycles": N} waits at least N CPU cycles {"op": "time"} the CPU's cycle counter, 32 bits {"op": "wait", "address": A, "width": W, "mask": M, "value": V, "timeout": N} reads until (value read & M) == V; the cycles waited, or the sequence ends in TIMEOUT {"op": "repeat", "count": N, "steps": [...]} up to three deep {"op": "call", "address": A} calls code at A; what it returned

processor is "ee" or "iop": which runs the steps, and in whose address space. On the IOP widths go up to 4, and the clock that time, delay and a wait's timeout count in is a console's 36.864 MHz system clock, which is the IOP's own.

interrupts_off runs it with interrupts disabled. note says what the measurement is for, and is kept with it in the journal. If a step fails, the results up to it are still returned, with failed saying why.

runA

Runs a program under the server's root, served to the target as host:: an ELF on the EE, or, if its name ends in .irx, a module on the IOP. Waits up to timeout seconds for it to end, or returns as soon as it has printed the text until, if that's given.

Returns its state and everything it printed as output. For an ELF the state is "exited" with an exit_code, "crashed" with the exception (what, where and the registers), or "running" if it hasn't ended, in which case output and stop carry on from there. Not every target can tell that a program has ended: one that can't leaves it "running", and until is the way to know it's done. For a module the state is "loaded", with its number and what its start returned.

On a target with the debug capability an ELF can be held instead of lost. hold is "exception", for a program that's kept where it would have crashed, or "entry", for one kept at its first instruction too; any breakpoint set does the first by itself. The state is then "held", with held saying why and where, and the program waits, whole, for registers, read_memory, step and resume, or for stop to end it.

breakpointA

Sets a breakpoint at an instruction of the EE's program, or removes one. A program that reaches it is held there, before the instruction is done: run and resume return with the state "held". Breakpoints are kept from one run to the next, and can be set before the program is run or while it runs. Returns all that are set.

While a program is held its breakpoints are out of its memory, which reads as the program's own. One in a branch's delay slot is reported at the branch.

watchpointA

Sets the watch: the EE's program is held when it stores to an address (access "write"), loads from it ("read"), or either ("any"). run and resume then return with the state "held", and held says what was caught. It's for finding what touches a variable or a hardware register. There is one watch, kept until it's removed or set elsewhere; remove takes it away.

length is how many bytes from address are watched, a power of two, and the address is rounded down to a multiple of it. The program is held at the instruction that's about to make the access, with the access not yet made: a store's value is in the register it's stored from, and step does it.

With value only an access of that value is caught: the 32 bits stored or loaded, or those of them set in value_mask. A store of the value is held before it's made, as any store is. A load can only be known by what it loaded: the program is held a few instructions after it, with the load made.

On a console it catches the program's own accesses, in its threads: not the kernel's, not an interrupt handler's, and not the GS's display registers at 0x12000000 to 0x12000fff, whose writes display gives instead.

haltA

Holds the program that's running, wherever it is, as a breakpoint there would: the state is "held", and registers, step and resume follow. A console holds it at the next instruction one of its threads does. A program whose threads are all waiting (for a semaphore, the next frame) is still "running" when this returns, and is held when one next runs; one that's waiting for good is ended with stop.

resumeA

Sends a held program on from where it is, and waits as run does: for it to end, to be held again, to print until, or for the timeout. Returns what run returns, with what the program printed since.

stepA

Steps a held program by count instructions, and says where that leaves it. A branch and the instruction in its delay slot are one step. A call is stepped into; a syscall is stepped over, and one that waits leaves the program "running" until it returns.

registersA

A held program's registers. group chooses which:

  • "general", the default: the 32 general ones, pc, hi and lo, and the exception's status, cause and bad_address. The general registers are given as their low 64 bits, or as all 128 with wide.

  • "fpu": f0 to f31, each as its bits and the single-precision number they are; the accumulator, acc; fcr31, the control and status register; and fcr0.

  • "cop0": the system control registers by name. status, cause, epc and badvaddr are the held program's; the rest are as they are now, count running on.

  • "other": hi1 and lo1, the halves of HI and LO the R5900 added, and sa, the shift amount.

  • "vu0": VU0's, which the EE has as its second coprocessor: vf0 to vf31, each as its four numbers x, y, z and w and as their bits, w's highest; vi0 to vi15; and its control registers. They're read as they are: changing, if VU0 is running a program of its own, which vpu_stat's lowest bit says.

set_registerA

Gives a register of a held program a value: a general register by its name (v0, a0, sp, ra...), pc, hi, lo or status; f0 to f31 or acc of the FPU, fcr31; hi1, lo1 or sa. Setting pc is how a program is sent on from somewhere else, past a break instruction of its own, say. A general register takes up to 128 bits; a negative value is sign-extended. An FPU register takes a number with a point in it, 1.5 or "1.5", as that number in single precision, and anything else as its bits. VU0's vf1 to vf31 take four numbers, x, y, z and w, as "1.0, 2.0, 3.0, 4.0", or 128 bits; vi1 to vi15 take 16 bits.

outputA

What the target has printed to its console since output or run last returned, and what the program is doing now.

stopB

Stops the program that's running, or held, and returns the target to idle.

resetA

Resets the target to the state it starts in, and connects to it again. Use it to recover a target that's stuck, or to start a measurement from a known state.

screenshotA

A picture from the target, as an image. With no arguments, what's being shown.

An emulator or the mock knows what that is. A console can't ask the GS (its display registers are write-only), so it watches what the program writes to them, and reads back the frame buffer they describe: see display. A program that has written none of them gets the 640 by 448 at the start of the GS's memory.

Any argument given makes it a rectangle of the GS's memory instead, the others taking these defaults: base 0, the buffer's address in the GS's units of 64 words (a frame buffer's FBP times 32, or a texture's TBP as it is); buffer_width 640, in pixels, a multiple of 64; format ct32, or ct24, ct16, ct16s, z32, z24, z16, z16s; x and y 0; width 640 and height 448. That's for textures, the buffer not being shown, the depth buffer. The most at once is 1.3 MB of pixels: 640 by 512 at ct32. All of the GS's memory is 1024 by 1024 at ct32 from base 0, in pieces.

The picture is of one moment, read with the console's interrupts off: a program drawing at that moment may show a frame half drawn.

controllerA

Presses buttons on a controller of the target's own making, a DualShock 2 in port 1 or 2, which the program finds there whatever is really plugged in. buttons are those held down, all the others up: select, start, up, right, down, left, triangle, circle, cross, square, l1, l2, l3, r1, r2, r3. The sticks are x and y from -1 to 1, right and down positive, and are centred if not given.

With seconds the buttons are held that long and then let go, the call returning after: a press. Without, they stay as set until the next call; an empty call lets everything go. A program usually wants a button down for a few frames to notice it: 0.1 is a press. unplug takes the controller out, and the port is as it really is again.

polls counts the times the port was asked what's pressed: one that isn't growing means no program is reading it. A console reaches a program that reads the controller through the IOP's sio2man, as the console's own padman and PS2SDK's do.

displayA

What a console's program has written to the GS's display registers, which can't be read from the GS itself: PMODE, SMODE2, DISPFB1 and 2, DISPLAY1 and 2, BGCOLOR and their neighbours, each as it was last written, with writes, how many there have been since the program started. DISPFB and DISPLAY are taken apart too, as circuits: where the frame buffer is and what of it is shown. Only writes since the program started are known; the kernel's own, made when it sets the video mode, are among them.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.9/5.0

Scored across 19 tools

Disambiguation4/5

Tools mostly target distinct operations, and descriptions explicitly separate easily confused pairs such as read_memory vs dump_memory and run vs resume. Minor overlap remains around execution control (halt/stop) and memory/register access, but boundaries are workable.

Naming Consistency4/5

All names are lower_snake_case with no casing or style collisions. The set mixes verb names (resume, step, read_memory) with resource nouns (registers, display, controller), so it is readable but not a strict verb_noun convention.

Tool Count4/5

Nineteen tools is somewhat heavy but justified for a full PS2 debug/emulation surface: execution control, memory, registers, break/watch, measurement, display, screenshot, and input are distinct responsibilities. It is above the typical 3-15 range but not bloated.

Completeness4/5

The surface covers the core lifecycle: status, run/resume/step/halt/stop/reset, breakpoints/watchpoints, register and memory access, screenshots, display state, and controller input. Minor gaps such as disassembly, memory search, or save-state management are workarounds rather than fatal omissions.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues