rct2-agent
rct2-agent
一个 MCP 服务器 + OpenRCT2 插件,让 agent 在你游玩时从旁管理你的乐园:读取状态、处理经营事务(价格、员工、营销、贷款)、查看乐园(截图)并控制时间。仅限管理——agent 会微调经营,也可以推荐建造项目,但从不真正建造。
组件如何配合
Claude Code (WSL)
│ stdio (MCP)
▼
MCP server ── dist/server.mjs, run by Windows node.exe
│ TCP 127.0.0.1:7860 (newline-delimited JSON)
▼
Plugin (intransient) ── loaded inside OpenRCT2, LISTENS on the port
│
▼
OpenRCT2 game服务器运行于 Windows 版 node.exe(WSL 中没有 node),因此服务器与插件都处于同一个 Windows localhost 上——不涉及 WSL↔Windows 网络通信。插件保持监听(它是常驻的,因此加载不同乐园后仍存活);服务器按需接入并按需重连。
Related MCP server: Roblox Executor MCP
要求
OpenRCT2 0.5.4+(QuickJS 引擎——支持 Promises/ES2023 所需)。
Windows 版 Node.js(此处位置为
C:\Program Files\nodejs\node.exe)。
构建与安装
在 WSL 中,使用 Windows 工具链:
# helper wrappers (or just call node.exe / npm-cli.js directly)
NODE="/mnt/c/Program Files/nodejs/node.exe"
NPM=("$NODE" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js")
"${NPM[@]}" install
"${NPM[@]}" run build # builds dist/rct2-agent.plugin.js + dist/server.mjs
"${NPM[@]}" run install:plugin # copies the plugin into your OpenRCT2 plugin folderinstall:plugin 会复制到
C:\Users\casey\OneDrive\Documents\OpenRCT2\plugin\rct2-agent.plugin.js
(可通过 RCT2_PLUGIN_DIR 覆盖)。
配置 MCP 服务器
现成的项目配置位于 .mcp.json。在 Claude Code 中,从项目目录启动时会自动加载它(出现提示时批准即可),也可以显式添加:
claude mcp add rct2-agent --scope project \
-- "/mnt/c/Program Files/nodejs/node.exe" \
"C:\\Users\\casey\\OneDrive\\Desktop\\dead code projects\\rct2-agent\\dist\\server.mjs"运行
启动 OpenRCT2 并加载一个场景。确认插件已加载——游戏内控制台会显示
[rct2-agent] listening on 127.0.0.1:7860。在此目录启动 Claude Code。MCP 服务器会在第一次调用工具时连接。
让 agent 管理乐园。核心循环是 测量 → 操作 → 等待 → 测量:读取基线数据、做出变更、
advance_days(7)、并重新测量。
工具
读取(眼睛):get_park_summary、get_finance_report、list_rides、get_ride、list_shops、get_guest_overview、sample_guest_thoughts、list_staff、get_scenario
操作(双手):set_ride_price、set_shop_price、set_park_entry_fee、open_ride、close_ride、set_inspection_interval、start_marketing_campaign、set_research_funding、hire_staff、fire_staff、set_staff_patrol、set_loan
查看(视觉):capture_view、capture_ride、find_location
时间:get_clock、set_game_speed、pause、resume、advance_days
保存:snapshot、list_snapshots
行为说明
金额在工具边界使用普通美元整数;OpenRCT2 内部存储是基于十分之一,由
src/shared/protocol.ts中的MONEY_FACTOR转换。如果某个值看起来差了 10 倍,那就是唯一需要检查的地方。坐标 在
capture_view/set_staff_patrol/find_location中以 tile 为单位(内部转换为地图单位)。advance_days会取消暂停、以最大速度运行,并在到达目标日期时自动暂停——然后返回新的时钟。该操作会阻塞直到完成。快照保存到
save/agent/<play>/<label>.park。恢复需要在游戏中手动加载——插件 API 可以保存,但不能加载乐园。写入操作通过游戏动作进行,因此游戏自身的限制同样适用(例如 ride 价格上限)。被拒绝的操作会以工具错误的形式返回。
开发
npm run typecheck— 运行 tsc,不产生输出。node scripts/smoke.mjs— 将构建后的插件加载到 stubbed 游戏中,并通过真实 socket 执行处理器。node scripts/mcp-smoke.mjs— 启动构建后的 MCP 服务器,并用真实的 MCP JSON-RPC 与模拟插件进行交互。
目录结构
src/shared/protocol.ts wire protocol + money conversion + method names
src/plugin/main.ts the intransient in-game plugin (TCP listener + handlers)
src/server/rct-client.ts reconnecting TCP client to the plugin
src/server/index.ts MCP server: tool definitions -> plugin methods
esbuild.mjs builds both bundles
scripts/ install + smoke testsThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceBridges a running OpenRCT2 game to AI agents, enabling them to read park state, optimize parks, and build roller coasters.MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to interact with a running Roblox game client to execute Lua code, inspect scripts, spy on remotes, and more.143216MIT
- AlicenseAqualityBmaintenanceEnables AI agents to execute Lua code, inspect scripts, spy on remotes, and interact with a running Roblox game client through an MCP interface.8221431MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI clients to validate and run Minecraft commands, read chat and tellraw messages, control player movement and GUI, and capture screenshots from within the game, aiding datapack debugging.1MIT
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to control Unreal E…
Machine-readable utilities and datasets for AI agents.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/caseyjohnsonwv/rct2-agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server