mcp-pine
MCP server for PCSX2 and other emulators that speak the PINE protocol. Read and write 8/16/32/64-bit emulator memory and control save states for PlayStation-family emulation.
README
mcp-pine
An MCP server for emulators that speak PINE (Protocol for Instrumentation of Network Emulators) — exposes memory read/write and savestate control to MCP-compatible clients (Claude Desktop, Claude Code, etc.).
What you can do with it
- Read & write emulated memory — 8/16/32/64-bit, anywhere in the EE address space
- Trigger save / load state to numbered slots
- Query game metadata — title, serial, disc CRC, version
- Inspect emulator state — running / paused / shutdown
What you can't do (because PINE itself doesn't expose these):
- Send controller input
- Take screenshots
- Step / pause / reset the emulator
This makes mcp-pine well-suited for memory inspection, cheat / RAM hunting, savestate automation, and reverse engineering, but not for "play games via Claude." For input + screenshot capability on Game Boy Advance, see the sister project mcp-mgba.
How it works
+----------------+ stdio +----------------+ PINE socket +-----------------+
| MCP client | JSON-RPC | mcp-pine | (TCP or Unix) | Emulator |
| (Claude etc.) | -----------> | (Node.js) | ---------------> | (PINE server) |
+----------------+ +----------------+ +-----------------+
mcp-pine opens a loopback connection to the emulator's PINE server (TCP on Windows, Unix domain socket on Linux/macOS) and translates each MCP tool call into a binary PINE message.
Compatible emulators
| Emulator | Platform | PINE built in? | Default slot |
|---|---|---|---|
| PCSX2 ≥ 1.7 (setup) | PlayStation 2 | ✅ Yes (toggle in settings) | 28011 |
| RPCS3 (setup) | PlayStation 3 | ⚠️ Has IPC with PINE-compatible opcodes — verify before relying on it | varies |
| Duckstation | PlayStation 1 | ⚠️ PINE has been discussed in upstream issues; check current build | varies |
Other emulators implementing the PINE spec should work out of the box once you point mcp-pine at the right slot — open an issue if you've tested one and it works.
Requirements
- An emulator with PINE enabled (see setup below)
- Node.js 18+
Install
Option A — install from npm (recommended)
npm install -g mcp-pine
Verify with mcp-pine (it prints a startup line and waits for stdio — Ctrl+C to exit).
Option B — npx (no install)
npx -y mcp-pine
Option C — clone and develop
git clone https://github.com/dmang-dev/mcp-pine
cd mcp-pine
npm install # also runs the build via the `prepare` hook
Emulator setup
PCSX2
- Launch PCSX2 (1.7.x Qt or newer).
- Settings → Advanced → Enable PINE Server (the option may live under a different submenu in some builds — search the settings for "PINE").
- Default slot is 28011. If you change it, set
PINE_SLOTformcp-pine. - Load any game.
That's it — no scripts, no console commands. PINE is always-on once the toggle is set.
RPCS3
RPCS3 has its own IPC implementation that mirrors PINE's opcode set, but the wire-level compatibility hasn't been thoroughly tested with this client. To try it:
- Configuration → Advanced → Enable IPC server (or similar — check current RPCS3 docs).
- Note the configured port.
- Run with
PINE_TARGET=rpcs3 PINE_SLOT=<port> mcp-pine.
If something doesn't work, please file an issue with details.
Duckstation
Check whether your build of Duckstation includes a PINE server (this varies by version). If yes, set PINE_TARGET=duckstation PINE_SLOT=<port>.
Register with your MCP client
Claude Code (CLI)
claude mcp add pine --scope user mcp-pine
Verify:
claude mcp list
# pine: mcp-pine - ✓ Connected
Claude Desktop
Edit claude_desktop_config.json:
| Platform | Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
{
"mcpServers": {
"pine": {
"command": "mcp-pine"
}
}
}
Restart Claude Desktop after editing.
Other MCP clients
mcp-pine speaks standard MCP over stdio. Run it and connect any compatible client.
Configuration
| Env var | Default | Purpose |
|---|---|---|
PINE_TARGET |
pcsx2 |
Emulator name — used as the prefix in the Unix socket file path on Linux/macOS (<target>.sock.<slot>). Ignored on Windows (TCP only). |
PINE_SLOT |
28011 |
PINE slot — also the TCP port on Windows |
PINE_HOST |
127.0.0.1 |
Override the host (TCP only) |
PINE_SOCKET_PATH |
(auto) | Override the full Unix socket path on Linux/macOS, bypassing automatic resolution |
Tools
| Tool | Description |
|---|---|
pine_ping |
Verify the connection by querying the emulator version |
pine_get_info |
Title, serial (e.g. SLUS-21274), disc CRC, game version, status |
pine_get_status |
Just the running/paused/shutdown state |
pine_read8 / pine_read16 / pine_read32 / pine_read64 |
Read memory |
pine_read_range |
Bulk read up to 4096 bytes (client-side pipelined PINE calls) |
pine_write8 / pine_write16 / pine_write32 / pine_write64 |
Write memory (RAM only — ROM writes are silently dropped) |
pine_save_state |
Trigger save state to a numbered slot (0-255) |
pine_load_state |
Trigger load state from a numbered slot (0-255) |
See docs/RECIPES.md for end-to-end examples (RAM hunting, struct decoding, snapshot-experiment-restore).
PlayStation 2 address space (cheat sheet)
| Range | Region |
|---|---|
0x00000000 |
EE main RAM (32 MiB) — start here for game data |
0x10000000 |
Hardware registers (DMA, GIF, VIF) |
0x11000000 |
VU0 / VU1 memory |
0x12000000 |
GS privileged registers |
0x1C000000 |
IOP RAM (2 MiB) |
0x1F800000 |
IOP scratchpad |
0x70000000 |
EE scratchpad (16 KiB) |
Troubleshooting
| Symptom | Cause / Fix |
|---|---|
Cannot reach PINE server |
Emulator isn't running, PINE isn't enabled in its settings, or the slot/port doesn't match. Check PINE_SLOT. |
PINE FAIL response (0xFF) |
The emulator rejected the request — most often because no game is loaded, or the address is unmapped. |
| Reads return zeros | Address is in an unallocated region. Try 0x00100000 first (almost always inside loaded EE RAM). |
| Tool calls work but values look corrupted | Check endianness expectations — PINE returns little-endian; if you're interpreting strings, use read_range-style byte reads. |
PINE call timed out (10s) from pine_ping after some heavy use |
PCSX2's PINE server can wedge. Its request queue is fragile — if a third-party tool pipelines too aggressively (more than ~6 in-flight requests) it silently drops requests, and from then on every reply is mis-aligned with the wrong waiting client. Symptom: even a fresh pine_ping times out. Fix: fully restart PCSX2. Reconnecting alone won't help — the corruption is on the emulator side. |
pine_read_range slower than mGBA's read_range |
Expected. PINE has no native bulk read, so we issue calls serially (pipelining can wedge PCSX2 — see above). Loopback TCP is fast enough that this isn't usually a problem: measured ~52 ms for a full 4096-byte read on PCSX2 v2.6.3. For workloads that need lower latency and can tolerate occasional emulator restarts, set PINE_PIPELINE_BATCH=2. |
Development
npm install
npm run dev # tsc --watch
Quick smoke test against a running PCSX2:
node .scratch/smoke.cjs
License
Related
- mcp-mgba — sister MCP server for the mGBA Game Boy Advance emulator (also includes button input + screenshot, which PINE doesn't expose)
- PINE protocol spec — the underlying IPC standard
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。