mcp-retroarch
Provides tools for interacting with RetroArch's Network Control Interface, enabling memory read/write, save/load states, screenshots, pause/frame advance, reset, and on-screen messages for emulated games.
mcp-retroarch
An MCP server that bridges Claude (and any other MCP client) to RetroArch via its built-in Network Control Interface (UDP, port 55355).
Works against any libretro core (NES, SNES, Genesis, GB/GBC/GBA, PSX, N64, etc.) — give the model memory r/w, save-state automation, screenshot, pause / frame-advance / reset, and on-screen messages.
What it can do
Capability | Available? | Notes |
Memory read / write | ✅ | Two paths: |
Save / load state | ✅ | Current slot or explicit slot for load; save is current-slot-only (NCI limitation) |
Screenshot | ✅ | Saved to RetroArch's configured screenshot directory |
Pause / frame advance | ✅ |
|
Reset | ✅ | Hard-reset the running game |
On-screen message | ✅ | Useful for "look here" cues during scripted runs |
Game info | ✅ | Title, system, CRC32 |
Game-pad input | ❌ | NCI doesn't expose this. RetroArch has a separate "Remote RetroPad" core on UDP port 55400 that does, but it requires loading that specific core (you can't drive an existing emulation core through it). Not in scope for v0.1.0. |
If you need game-pad input on Game Boy Advance specifically, see mcp-mgba. For PCSX2 (memory + savestate only, no input/screenshot), see mcp-pine.
How it works
+----------------+ stdio +-----------------+ UDP :55355 +-----------------+
| MCP client | JSON-RPC | mcp-retroarch | text proto | RetroArch |
| (Claude etc) | -----------> | (Node.js) | ------------> | (NCI enabled) |
+----------------+ +-----------------+ +-----------------+Requirements
RetroArch (any recent version) with Network Commands enabled
Node.js 18+
Install
Option A — install from npm (recommended)
npm install -g mcp-retroarchOption B — npx (no install)
npx -y mcp-retroarchOption C — clone and develop
git clone https://github.com/dmang-dev/mcp-retroarch
cd mcp-retroarch
npm installEnable RetroArch's Network Control Interface
Either:
GUI: Settings → Network → Network Commands → ON, then confirm
Network Cmd Portis55355(the default)Or via
retroarch.cfg:network_cmd_enable = "true" network_cmd_port = "55355"
Then launch any libretro core + game. The NCI is always-on once enabled — no script to load.
Register with your MCP client
Claude Code
claude mcp add retroarch --scope user mcp-retroarchVerify:
claude mcp list
# retroarch: mcp-retroarch - ✓ ConnectedClaude Desktop
Edit claude_desktop_config.json:
Platform | Path |
macOS |
|
Windows |
|
Linux |
|
{
"mcpServers": {
"retroarch": {
"command": "mcp-retroarch"
}
}
}Restart Claude Desktop after editing.
Configuration
Env var | Default | Purpose |
|
| UDP destination host |
|
| UDP port (must match |
Tools
Tool | Description |
| Verify reachability — returns RetroArch version |
| State (playing/paused), system, game, CRC32 |
| Read named RetroArch config values (e.g. |
| Memory r/w via system memory map |
| Memory r/w via CHEEVOS address space (fallback when no memory map) |
| Toggle pause state |
| Step one frame (only effective while paused) |
| Hardware-reset the running game |
| Save a screenshot to RetroArch's screenshot directory |
| Display a notification on the RetroArch window |
| Save to currently-selected slot |
| Load from currently-selected slot |
| Load from explicit slot number |
| Change current slot pointer (NCI has no "set slot to N") |
See docs/RECIPES.md for end-to-end examples.
Tested cores
Verified end-to-end against mcp-retroarch:
System | Core |
|
| Notes |
Game Boy Advance |
| ✅ | ✅ | GBA interrupt vector table visible at |
NES |
| ✅ (only NES core tested that does) | ✅ | Full 16-bit NES address space exposed. WRAM at |
NES |
| ❌ no memory map | ✅ | CHEEVOS only. 64 KB bound. For NES + memory map, prefer Mesen. |
SNES |
| ❌ no memory map | ✅ | CHEEVOS bounded to ~128 KB (matches SNES WRAM size). 65C816 RTS opcodes ( |
Sega Mega Drive / Genesis |
| ❌ no memory map | ⚠️ sparse | CHEEVOS exposes some 68K WRAM addresses but fails at others ("no error message"). Usable if you know specific addresses; blanket sweep doesn't work. |
Nintendo 64 |
| ✅ | ✅ | Full N64 RAM exposed. KSEG0 mirror is faithful — |
PlayStation 1 |
| ❌ no memory map | ✅ | CHEEVOS only. PSX main RAM begins around CHEEVOS offset |
Patterns observed
Most libretro cores don't advertise a system memory map to NCI — they implement only the CHEEVOS read API. Of those tested, only Mesen (NES) and Mupen64Plus-Next (N64) expose a system memory map. Both also expose CHEEVOS, so they're strictly better.
System memory maps are faithful to real hardware — Mupen64Plus-Next preserves the N64's KSEG0 mirror (
0x80000000reads as0x0); Mesen preserves the NES's WRAM mirroring (0x1000reads as0x0). This is great for anyone using the bridge alongside disassembly.CHEEVOS bounds match the system's main RAM size — NES exposes 64 KB, SNES 128 KB, etc. Reads past the bound fail with "no error message".
When choosing a core for memory work, prefer the one with a system memory map if available.
If you've tested another core, please open a PR adding it to this table.
Troubleshooting
Symptom | Cause / Fix |
| Network Commands aren't enabled in RetroArch, or the port doesn't match |
| The loaded libretro core doesn't advertise a system memory map. Try |
| The address isn't covered by the core's memory map. Either a different core would expose it, or the address you want is outside the system bus (e.g. video memory in some cores). |
Screenshots don't appear where I expect | RetroArch saves to its configured screenshot directory. The NCI doesn't expose |
Can't save to a specific state slot directly | NCI limitation, not a bug. The protocol only exposes "save to current slot" — you have to walk the slot pointer to your target with |
Development
npm install
npm run dev # tsc --watchSmoke test against a running RetroArch:
node .scratch/smoke.cjsLicense
Related
Maintenance
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dmang-dev/mcp-retroarch'
If you have feedback or need assistance with the MCP directory API, please join our Discord server