openrct2-mcp
Model Context Protocol (MCP) server for OpenRCT2. Build roller coasters, manage theme parks and play RollerCoaster Tycoon 2 using AI agents.
OpenRCT2 MCP
Build rides and paths, manage park operations, and inspect guests, staff, finances, research and terrain in OpenRCT2 through an MCP client. The in-game bridge uses normal game actions and returns observed state. The caller decides what to build or change.

Works with Claude Code, Codex, pi, opencode and other stdio MCP clients. Live-verified with OpenRCT2 0.5.7 / scripting API 124 / plugin 0.19.0.
Quickstart with an agent
Give your coding agent this prompt from a workspace where it can clone the repo:
Clone https://github.com/milanboers/openrct2-mcp and read its README.
Install the MCP server in this workspace, and install the matching OpenRCT2 plugin.
Use a separate OpenRCT2 user-data folder so my usual saves, settings, and plugins
stay untouched.
Once installed, use the same workspace for the second prompt:
Launch OpenRCT2 in a visible window using a user-data folder that contains the
openrct2-mcp plugin. Load a fresh scenario with no fixed deadline, such as
Six Flags Great Adventure if installed.
Play through the scenario using the OpenRCT2 MCP tools.
Use the fastest normal game speed when waiting.
Stop when the game reports a win or you hit a blocker.
For a shorter demo, launch the bundled sandbox instead and use the coaster prompt.
How it works
- In-game plugin (
openrct2-mcp.js) runs inside OpenRCT2, accepts local TCP requests and performs construction and park-management actions. - MCP server (Python) forwards tool calls to the plugin and returns game state, bounded observations and images.
- AI client chooses construction and park-management actions, inspects results and decides what to change next. The server does not plan layouts or park strategy.
Setup
Requires OpenRCT2, uv and an MCP-capable client.
1. Install the plugin and sandbox
Copy openrct2-mcp.js into your OpenRCT2 user directory's plugin/ folder:
| OS | OpenRCT2 user directory |
|---|---|
| macOS | ~/Library/Application Support/OpenRCT2/ |
| Windows | Documents/OpenRCT2/ |
| Linux | ~/.config/OpenRCT2/ |
| Linux (Flatpak) | ~/.var/app/io.openrct2.OpenRCT2/config/OpenRCT2/ |
Or use the installer:
uv run python scripts/install_plugin.py --user-dir "/path/to/OpenRCT2"
Add --overwrite to replace an existing copy. If OpenRCT2 is running, save your work and restart it to load the new plugin.
For the coaster demo, copy scenarios/sandbox.park into the user directory’s scenario/ folder. Load the sandbox in OpenRCT2 and unpause.
2. Install the server
From this checkout:
uv sync --locked
3. Connect your AI client
Use a dedicated workspace so the game tools stay separate from your coding projects.
Claude Code: create .mcp.json in that workspace:
{
"mcpServers": {
"openrct2-mcp": {
"command": "uv",
"args": ["--directory", "/path/to/openrct2-mcp", "run", "openrct2-mcp"],
"type": "stdio"
}
}
}
Codex: create .codex/config.toml in the workspace:
[mcp_servers.openrct2-mcp]
command = "uv"
args = ["--directory", "/path/to/openrct2-mcp", "run", "openrct2-mcp"]
pi: configure it locally from the workspace:
pi mcp add --local openrct2 -- uv --directory /path/to/openrct2-mcp run openrct2-mcp
OpenCode V2: create opencode.json in the workspace:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"openrct2-mcp": {
"type": "local",
"command": ["uv", "--directory", "/path/to/openrct2-mcp", "run", "openrct2-mcp"]
}
}
}
}
Start OpenCode from that workspace. For V1, use the V1 configuration example.
Other stdio clients: configure the client to run uv --directory /path/to/openrct2-mcp run openrct2-mcp.
Use it
Play a full scenario
Use the playthrough prompt in the quickstart to launch a fresh scenario and play through MCP until the game reports a win or the agent hits a blocker.
Build a coaster
Load the bundled sandbox, then ask the agent:
Read
skills/build-coaster/SKILL.mdin the OpenRCT2 MCP checkout. Use the MCP tools to build a wooden roller coaster, complete the circuit, add station buildings, and test it. Check the ratings and train movement before calling it done.
No skill install is needed for this prompt. For automatic discovery, copy the skill to .agents/skills/build-coaster/SKILL.md in your workspace for Codex, pi, or OpenCode. For Claude Code, use .claude/skills/build-coaster/SKILL.md.
Verify the connection
Ask the agent to call get_plugin_info in the session that will play. If the call fails, see session readiness.
Safety and limits
- The plugin listens on 127.0.0.1:8080 without authentication. Callers can demolish rides. Do not expose or forward the port.
- Use matching versions of the plugin and server. The plugin requires scripting API 124 or newer.
- Try it in a test park before giving an agent access to a save you care about. See the reference for tool limits.
Tools
buy_land_rights— Buy rights offered for sale; does not grant arbitrary ownership.check_track_candidates— Query independent track alternatives without building.check_track_segment— Query one track piece without building.clear_scenery— Clear selected items: small scenery=1,large=2,paths=4,walls=8,path additions=16.close_park— Close the park to new arrivals; this does not evacuate existing guests.close_ride— Close a ride before editing track or vehicles.create_ride— Create a coaster and its first station piece.create_unbuilt_ride— Create only a native ride record, without track, station, name, buildings or paths.delete_all_rides— Demolish all rides.delete_ride— Permanently demolish one ride by ID, including its track and vehicles.edit_maze_cell— Build or fill a caller-chosen maze half-cell using the normal editor action.fire_staff— Permanently fire one staff member.get_balloon_details— Read a balloon entity and its native position in game coordinates.get_calendar— Read calendar/ticks; month 0=March, year starts at 1, month progress is 0-65535.get_coaster_state— Inspect layout, history, endpoint, candidates and track occupancy.get_coaster_view— View the endpoint surroundings or elevation profile.get_entity_details— Read entity identity/type and position.get_game_state— Read game mode, pause state and native speed.get_guest_details— Read native guest state (0-255 needs except energy/intensity/tolerance as specified by the SDK), cash in tenths GBP and favourite ride.get_guest_flags— Read all named peep flags exposed by the SDK.get_guest_items— Read guest possessions; voucher/photo-only attributes are null on other item types.get_guest_thoughts— Read native guest thoughts and freshness counters (not inferred intent).get_installed_objects— Read paged installed-object metadata without loading/unloading anything.get_litter_details— Read a litter entity and its native position in game coordinates.get_loaded_music_objects— List loaded music objects with park-local indices, identifiers and localized names.get_loaded_object_details— Read one loaded park-local object, common identity and applicable ride/scenery metadata.get_loaded_objects— List loaded object indices, identifiers and localized names for a selected object category.get_loaded_ride_objects— Discover loaded ride and vehicle objects.get_map_area— Inspect nearby terrain and objects.get_map_tile— Read one tile and up to 256 type-gated native element records, with elements_total.get_monthly_expenditure— Read up to 16 native monthly expenditure entries (index 0=current month).get_park_awards— Read actual park awards; does not grant awards or certify eligibility.get_park_flags— Read named park flags without changing scenario rules or money/research state.get_park_guest_generation— Read guest-generation settings/counters, not a guarantee of arrivals.get_park_messages— Read current/archived park news, native dates and subjects; does not post/delete messages.get_park_status— Read finances, guests, research and scenario status.get_path_area— Inspect path edges, heights and queue assignments.get_path_objects— Discover loaded path surfaces and railings.get_plugin_info— Diagnose connection and plugin/protocol compatibility.get_research_items— Read invented and uninvented research queues.get_research_status— Read research funding, progress and expected completion date.get_ride_build_options— Discover normal-play starting pieces, enabled track groups, loaded objects and research.get_ride_finances— Inspect prices, charging rules, upkeep and financial estimates/counters.get_ride_guest_report— Observe customer-counter progress.get_ride_layout— Inspect physical track elements and exact selections across connected/disconnected layouts, footprints and mazes.get_ride_maintenance_status— Read inspection interval (engine enum 0-6), reliability/downtime percentages, age in game months and due-inspection/broken-down/crashed flags.get_ride_operating_settings— Read current operating settings without changing the ride.get_ride_station_access— Inspect station buildings and nearby paths.get_ride_stats— Read ride status, ratings and train telemetry.get_ride_test_report— Inspect test readiness and optionally observe train movement.get_ride_track_colours— Read one track colour scheme (0-3).get_ride_vehicle_colours— Read one vehicle colour slot.get_scenario_details— Read scenario identity, description, status, objective type and completion metadata without changing success, objectives or time.get_staff_details— Read staff type, orders and basic peep state.get_staff_flags— Read all named peep flags exposed by the SDK.get_staff_patrol_tiles— Read a bounded page of staff patrol tiles as tile indices (not game coordinates), plus total count.get_track_catalog— List track descriptors, optionally only the server's supported subset.get_vehicle_details— Read a vehicle/car snapshot in raw game/API units.get_weather— Read current/future weather and temperature (native Celsius), not a forecast time guarantee.hire_staff— Hire staff.list_all_rides— List existing rides.list_entities— Page through native entities; IDs can disappear/recycle between calls.lower_land— Apply native land editing to a selected range; engine checks local authority, ownership, clearance and supports.lower_water— Change native water height across a range.open_park— Open the park to guests.open_ride— Open a ride through the game's normal status action.place_banner— Place banner.place_entrance_exit— Automatically place missing station entrance/exit buildings.place_large_scenery— Place large scenery.place_path_addition— Place/replace or remove a path addition (bin, bench, lamp, etc.).place_path_sequence— Build a caller-chosen flat/elevated/sloped path sequence, stopping on failure.place_path_tile— Build one flat, elevated or sloped modern path without replacement or local scenery clearing.place_ride_footprint— Build the normal footprint of an existing empty flat ride, shop or facility.place_small_scenery— Place small scenery.place_station_building— Place an entrance or exit at a chosen position, with a guard for relocation.place_track_segment— Place one track piece.place_track_sequence— Place a batch of track pieces, stopping at the first failure.place_wall— Place wall.press_balloon— Press/pop a balloon entity using the game action; entity must be a balloon.preview_track_removal— Identify the terminal piece before removal.raise_land— Apply native land editing to a selected range; engine checks local authority, ownership, clearance and supports.raise_water— Change native water height across a range.remove_banner— Remove the currently selected banner.remove_large_scenery— Remove the currently selected large scenery.remove_path_addition— Place/replace or remove a path addition (bin, bench, lamp, etc.).remove_path_tile— Remove a flat, elevated or sloped path using its exact current observation.remove_small_scenery— Remove the currently selected small scenery.remove_station_building— Remove the selected station entrance/exit through the native action.remove_terminal_piece— Remove the terminal piece with an optional stale-state guard.remove_track_piece— Remove a chosen whole track piece with a guarded live element selection.remove_wall— Remove the currently selected wall.renew_ride— Refurbish/renew an existing ride, not demolish it.reset_ride— Explicitly clear vehicles on a closed, guest-free ride.save_park— Request a fresh checkpoint, with disk persistence still to be verified.set_banner_colour— Recolour the currently selected banner.set_game_speed— Set normal player game speed (1=normal, 2-4=fast).set_guest_name— Rename one guest by entity ID.set_land_height— Set one land tile base height in units of 8 game coordinates and native corner-slope bits (0-31).set_large_scenery_colour— Recolour the currently selected large scenery.set_park_entrance_fee— Set entrance fee in tenths GBP (10 raw = GBP 1).set_park_loan— Set outstanding loan in tenths GBP.set_park_name— Rename the park (not its scenario).set_research_funding— Set research category bitmask (transport=1,gentle=2,coaster=4,thrill=8,water=16,shop=32,scenery=64) and spending.set_ride_circuit_count— Set the number of circuits through the normal game action (1-20, the normal engine range).set_ride_departure_flags— Replace the entire departure-settings byte.set_ride_inspection_interval— Set the mechanic inspection interval through the game's normal action.set_ride_lift_hill_speed— Set chain-lift speed in mph through the normal game action and read it back.set_ride_maximum_waiting_time— Set the maximum dispatch waiting time (0-250 seconds) and read back both bounds.set_ride_minimum_waiting_time— Set the minimum dispatch waiting time (0-250 seconds) and read back both bounds.set_ride_music_enabled— Enable or disable ride music through the normal game action and read back its flag.set_ride_music_style— Select a loaded music object through the normal game action and read back its index.set_ride_name— Rename an existing ride through the normal game action and read it back.set_ride_operating_mode— Change operating mode through the normal game action.set_ride_operation_option— Set the ride-specific operation option.set_ride_price— Set a guarded price through the game, with explicit consent for potentially shared prices.set_ride_random_shop_colours— Toggle random shop-item colours through the appearance action; applicability depends on the ride/shop.set_ride_station_style— Set a loaded station/entrance style object.set_ride_track_colour— Set one track colour channel in one of the four colour schemes.set_ride_trains_reversed— Set reversed trains through the vehicle action.set_ride_vehicle_colour— Set a vehicle colour slot/channel.set_ride_vehicle_colour_scheme— Set vehicle colour grouping.set_ride_vehicle_object— Select a compatible loaded ride vehicle object/preset.set_ride_vehicles— Set the proposed train count or cars per train using OpenRCT2's ride action.set_sign_name— Rename a scrolling sign or banner using the type-safe sign action.set_sign_style— Set scrolling wall/large-scenery sign colours, not standalone path-banner styles.set_small_scenery_colour— Recolour the currently selected small scenery.set_staff_colour— Change the uniform colour for all staff of a type and its future hires, not one individual.set_staff_costume— Select a loaded peep-animation costume.set_staff_name— Rename one staff by entity ID.set_staff_orders— Replace handyman/mechanic orders.set_staff_patrol_area— Edit a rectangular staff patrol area; clear_all clears the entire patrol.set_surface_style— Set loaded terrain surface/edge styles and colours.set_track_brake_speed— Set a selected brake/booster speed using the native encoded value 0-30 (two-unit storage resolution, odd values round down).set_track_piece_colour_scheme— Assign an existing track piece to a colour scheme.set_wall_colour— Recolour the currently selected wall.set_water_height— Set water height 2-254 in units of 8 game coordinates.simulate_ride— Request simulation status (not guest operation); ride-specific engine restrictions apply.smooth_land— Apply native land editing to a selected range; engine checks local authority, ownership, clearance and supports.start_food_marketing_campaign— Start a paid food or drink voucher campaign for 2-12 weeks.start_marketing_campaign— Start a park-wide paid campaign for 2-12 weeks.start_ride_marketing_campaign— Start a paid campaign for an open attraction for 2-12 weeks.start_ride_test— Start the ride in test mode to calculate ratings.toggle_game_pause— Toggle pause once.undo_last_piece— Alias for terminal-piece removal, not chronological undo.
Further reading
- Reference: detailed setup, tool behavior, and troubleshooting.
- Contributing: where to make changes, how to regenerate bindings, and how to run tests against the game.
Attribution
The plugin is based on the OpenRCT2 Ride Creation API.