Skip to content

Commit b9df676

Browse files
committed
MCP: Improve tools
1 parent 3a14342 commit b9df676

File tree

11 files changed

+870
-228
lines changed

11 files changed

+870
-228
lines changed

MCP_README.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This server provides comprehensive tools for game development, rom hacking, reve
2020

2121
## Available MCP Tools
2222

23-
The server exposes 50 tools organized in the following categories:
23+
The server exposes tools organized in the following categories:
2424

2525
### Execution Control
2626
- `debug_pause` - Pause emulation
@@ -29,6 +29,7 @@ The server exposes 50 tools organized in the following categories:
2929
- `debug_step_over` - Step over subroutine calls
3030
- `debug_step_out` - Step out of current subroutine
3131
- `debug_step_frame` - Step one frame
32+
- `debug_run_to_cursor` - Continue execution until reaching specified address
3233
- `debug_reset` - Reset emulation
3334
- `debug_get_status` - Get debug status (paused, at_breakpoint, pc address)
3435

@@ -53,8 +54,7 @@ The server exposes 50 tools organized in the following categories:
5354
- `memory_search` - Search memory with operators (<, >, ==, !=, <=, >=), compare types (previous, value, address), and data types (hex, signed, unsigned)
5455

5556
### Disassembly & Debugging
56-
- `debug_get_disassembly` - Get disassembly around PC or specified address
57-
- `debug_run_to_cursor` - Continue execution until reaching specified address
57+
- `get_disassembly` - Get disassembly around PC or specified address
5858
- `add_symbol` - Add symbol (label) at specified address
5959
- `remove_symbol` - Remove symbol
6060
- `list_symbols` - List all defined symbols
@@ -70,9 +70,9 @@ The server exposes 50 tools organized in the following categories:
7070
- `list_breakpoints` - List all breakpoints
7171

7272
### Hardware Status
73-
- `get_media_info` - Get loaded ROM/CD info
7473
- `get_huc6270_status` - Get VDC status (position, state, control, interrupts)
75-
- `get_huc6270_registers` - Get all 32 VDC registers
74+
- `get_huc6270_registers` - Get all 20 VDC registers (0x00-0x13), Address Register (AR), and Status Register (SR)
75+
- `write_huc6270_register` - Write to a VDC register (0-19) or Address Register (20=AR). Status Register is read-only. Use vdc parameter (1 or 2) for SuperGrafx
7676
- `get_huc6260_status` - Get VCE status (position, sync signals, control)
7777
- `get_huc6202_status` - Get VPC status (SuperGrafx only)
7878
- `get_psg_status` - Get PSG status for all 6 channels
@@ -88,6 +88,24 @@ The server exposes 50 tools organized in the following categories:
8888
### Screen Capture
8989
- `get_screenshot` - Capture current screen frame as base64 PNG
9090

91+
### Media & State Management
92+
- `get_media_info` - Get loaded ROM/CD info
93+
- `load_media` - Load ROM file or CD-ROM image (.pce, .sgx, .hes, .cue, .zip). Automatically loads .sym symbol file if present
94+
- `load_symbols` - Load debug symbols from file (.sym format with 'BANK:ADDRESS LABEL' entries)
95+
- `list_save_state_slots` - List all 5 save state slots with information (rom name, timestamp, validity)
96+
- `select_save_state_slot` - Select active save state slot (1-5) for save/load operations
97+
- `save_state` - Save emulator state to currently selected slot
98+
- `load_state` - Load emulator state from currently selected slot
99+
- `set_fast_forward_speed` - Set fast forward speed multiplier (0: 1.5x, 1: 2x, 2: 2.5x, 3: 3x, 4: Unlimited)
100+
- `toggle_fast_forward` - Toggle fast forward mode on/off
101+
102+
### Controller Input
103+
- `controller_press_button` - Press a button on a controller (player 1-5). Buttons: up, down, left, right, select, run, i, ii, iii, iv, v, vi
104+
- `controller_release_button` - Release a button on a controller (player 1-5)
105+
- `controller_set_type` - Set controller type for a player: standard (2 buttons), avenue_pad_3 (3 buttons), avenue_pad_6 (6 buttons)
106+
- `controller_get_type` - Get the current controller type for a player (returns: standard, avenue_pad_3, or avenue_pad_6)
107+
- `controller_set_turbo_tap` - Enable or disable Turbo Tap (multitap) for 5-player support
108+
91109
## Transport Modes
92110

93111
The Geargrafx MCP server supports two transport modes:
@@ -241,6 +259,7 @@ The HTTP transport mode runs the emulator with an embedded web server on `localh
241259
Once configured, you can ask your AI assistant:
242260

243261
- "What game is currently loaded?"
262+
- "Load the ROM at /path/to/game.pce"
244263
- "Is the emulator running or paused?"
245264
- "Show me the current CPU registers"
246265
- "What's the value of PC?"
@@ -253,6 +272,17 @@ Once configured, you can ask your AI assistant:
253272
- "Step through the next 5 instructions"
254273
- "Show me the VDC registers"
255274
- "Capture a screenshot of the current frame"
275+
- "Save the current state to slot 3"
276+
- "List all save state slots"
277+
- "Load the state from slot 1"
278+
- "Enable fast forward at 2x speed"
279+
- "Load symbols from /path/to/game.sym"
280+
- "Press the up button on player 1 controller"
281+
- "Release the run button on player 2"
282+
- "Set player 1 controller to avenue pad 6 type"
283+
- "Enable turbo tap for 5 players"
284+
- "Press buttons i and ii on player 1 simultaneously"
285+
- "What controller type is player 2 using?"
256286

257287
## Available Resources
258288

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Don't hesitate to report bugs or ask for new features by [opening an issue](http
8989
- Supported platforms (standalone): Windows, Linux, BSD and macOS.
9090
- Supported platforms (libretro): Windows, Linux, macOS, Raspberry Pi, Android, iOS, tvOS, PlayStation Vita, PlayStation 3, Nintendo 3DS, Nintendo GameCube, Nintendo Wii, Nintendo WiiU, Nintendo Switch, Emscripten, Classic Mini systems (NES, SNES, C64, ...), OpenDingux, RetroFW and QNX.
9191
- Full debugger with just-in-time disassembler, CPU breakpoints, memory access breakpoints, code navigation (goto address, JP JR and JSR double clicking), debug symbols, automatic labels, memory editor, PSG inspector and video viewer including registers, tiles, sprites, backgrounds, CD-ROM sub-systems and both VDCs in SuperGrafx mode.
92-
- MCP server for AI-assisted debugging with GitHub Copilot, Claude Desktop, ChatGPT ..., exposing 50 tools for execution control, memory inspection, hardware status, and more.
92+
- MCP server for AI-assisted debugging with GitHub Copilot, Claude Desktop, ChatGPT ..., exposing tools for execution control, memory inspection, hardware status, and more.
9393
- Windows and Linux *Portable Mode*.
9494
- ROM loading from the command line by adding the ROM path as an argument.
9595
- ROM loading using drag & drop.
@@ -128,7 +128,7 @@ Options:
128128

129129
### MCP Server
130130

131-
Geargrafx includes a [Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP) server that enables AI-assisted debugging through AI agents like GitHub Copilot, Claude Desktop, ChatGPT... The server provides 50 tools for execution control, memory inspection, breakpoints, disassembly, hardware status, sprite viewing, and more.
131+
Geargrafx includes a [Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP) server that enables AI-assisted debugging through AI agents like GitHub Copilot, Claude Desktop, ChatGPT... The server provides tools for execution control, memory inspection, breakpoints, disassembly, hardware status, sprite viewing, and more.
132132

133133
For complete setup instructions and tool documentation, see [MCP_README.md](MCP_README.md).
134134

platforms/shared/desktop/emu.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,11 @@ void emu_set_pad_type(GG_Controllers controller, GG_Controller_Type type)
494494
geargrafx->GetInput()->SetControllerType(controller, type);
495495
}
496496

497+
GG_Controller_Type emu_get_pad_type(GG_Controllers controller)
498+
{
499+
return geargrafx->GetInput()->GetControllerType(controller);
500+
}
501+
497502
void emu_set_avenue_pad_3_button(GG_Controllers controller, GG_Keys button)
498503
{
499504
geargrafx->GetInput()->SetAvenuePad3Button(controller, button);

platforms/shared/desktop/emu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ EXTERN void emu_set_backup_ram(bool enabled);
110110
EXTERN void emu_set_turbo_tap(bool enabled);
111111
EXTERN void emu_set_mb128_mode(GG_MB128_Mode mode);
112112
EXTERN void emu_set_pad_type(GG_Controllers controller, GG_Controller_Type type);
113+
EXTERN GG_Controller_Type emu_get_pad_type(GG_Controllers controller);
113114
EXTERN void emu_set_avenue_pad_3_button(GG_Controllers controller, GG_Keys button);
114115
EXTERN void emu_set_turbo(GG_Controllers controller, GG_Keys button, bool enabled);
115116
EXTERN void emu_set_turbo_speed(GG_Controllers controller, GG_Keys button, u8 speed);

0 commit comments

Comments
 (0)