Skip to main content
Glama

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

服务器运行于 Windowsnode.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 folder

install: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"

运行

  1. 启动 OpenRCT2 并加载一个场景。确认插件已加载——游戏内控制台会显示 [rct2-agent] listening on 127.0.0.1:7860

  2. 在此目录启动 Claude Code。MCP 服务器会在第一次调用工具时连接。

  3. 让 agent 管理乐园。核心循环是 测量 → 操作 → 等待 → 测量:读取基线数据、做出变更、advance_days(7)、并重新测量。

工具

读取(眼睛)get_park_summaryget_finance_reportlist_ridesget_ridelist_shopsget_guest_overviewsample_guest_thoughtslist_staffget_scenario

操作(双手)set_ride_priceset_shop_priceset_park_entry_feeopen_rideclose_rideset_inspection_intervalstart_marketing_campaignset_research_fundinghire_stafffire_staffset_staff_patrolset_loan

查看(视觉)capture_viewcapture_ridefind_location

时间get_clockset_game_speedpauseresumeadvance_days

保存snapshotlist_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 tests
F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

View all related MCP servers

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.

View all MCP Connectors

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/caseyjohnsonwv/rct2-agent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server