Cities Skylines 2 MCP logo

Cities Skylines 2 MCP

Community
LancerComet

Cities Skylines 2 MCP

PublisherLancerComet
Repositorycities-skylines-2-mcp
LanguageC#
Forks
14
Stars
43
Available tools
0
Transport typestdio
Categories
LicenseApache-2.0
Links
  • Connect tools to AI workflows

    Cities Skylines 2 MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    43 stars and 14 forks from the linked repository.

CS2MCP — An MCP Server for Cities: Skylines II

English | 简体中文

Give Claude (or any MCP client) full control over a running Cities: Skylines II game: read city data, drive the camera and take screenshots, build roads and buildings, paint zones, manage finances and policies, and control simulation time.

Architecture

Claude Code / Claude Desktop (any MCP client)
      │  MCP (stdio)
      ▼
cs2-mcp  (mcp-server/, Node.js process)
      │  HTTP, localhost-only 127.0.0.1:8642
      ▼
CS2MCP bridge mod  (CS2MCP.Bridge/, inside the game process)
      │  all ECS reads/writes run on the simulation main thread
      ▼
Cities: Skylines II
  • In-game mod (C#): runs a minimal HTTP server on a TcpListener bound to 127.0.0.1 inside the game process. Requests are queued by listener threads and executed on the simulation main thread by an ECS system registered at SystemUpdatePhase.UIUpdate (works while paused). Construction goes through a custom ToolBaseSystem using the game's native definition/validation/apply pipeline; demolition goes through the bulldozer pipeline — no entity mutations that bypass game validation.
  • MCP server (TypeScript): translates MCP tool calls into HTTP requests against the bridge mod, over stdio transport.

Requirements

  • Windows + Cities: Skylines II (Steam)
  • .NET SDK 8.0+ (to build the mod)
  • Node.js 18+ (to run the MCP server)

Build & Install

powershell
# 1. Build the in-game mod (auto-deploys to the game's local Mods folder)
dotnet build CS2MCP.Bridge\CS2MCP.Bridge.csproj

# 2. Build the MCP server
cd mcp-server
npm install
npm run build

The mod deploys to %USERPROFILE%\AppData\LocalLow\Colossal Order\Cities Skylines II\Mods\CS2MCP\ and loads automatically on game start — no Paradox Mods publishing required. To disable it temporarily, rename the folder to .CS2MCP.

Game path configuration

Building the mod references assemblies from the game folder. Resolution order (first match wins):

  1. Command line: dotnet build -p:GamePath="X:\...\Cities Skylines II"
  2. CS2_PATH environment variable
  3. CSII_INSTALLATIONPATH environment variable (set by the official modding toolchain)
  4. Auto-probing of common Steam library locations (C:\Program Files (x86)\Steam, Steam / SteamLibrary on common drive letters)

If the game cannot be found the build fails with a clear error. Example:

powershell
setx CS2_PATH "D:\Steam\steamapps\common\Cities Skylines II"

Runtime environment variables (.env supported)

The MCP server loads mcp-server/.env via dotenv (see .env.example):

VariableScopeDefaultDescription
CS2_BRIDGE_URLMCP serverhttp://127.0.0.1:8642Address of the bridge mod
CS2MCP_PORTgame process8642Bridge listen port (change both together)
CS2MCP_TOKENgame process and MCP server(unset)Optional shared secret sent as X-CS2MCP-Token; when set for the game, every route except /ping requires it. Independently, requests with an Origin header or a non-loopback Host are always rejected, and state-changing routes require POST
CS2_PATHbuild timeauto-probedGame install folder

Using with Claude

Claude Code: .mcp.json in the repository root registers the cs2 server — just open Claude Code in the project directory (it asks for trust on first use). To register from another directory:

powershell
claude mcp add cs2 -- node <repo-path>\mcp-server\dist\index.js

Claude Desktop (claude_desktop_config.json):

json
{
  "mcpServers": {
    "cs2": {
      "command": "node",
      "args": ["<repo-path>\\mcp-server\\dist\\index.js"]
    }
  }
}

Start the game, load a save, then ask Claude: "How are my city's finances?", "Zone a residential area by the river", "Build a road connecting the industrial area to the highway".

Tool Reference (62 tools)

State & view

ToolDescription
cs2_pingBridge liveness, mod version, game mode (responds even while loading)
cs2_game_stateMode, city name, pause/speed, in-game date & time
cs2_city_overviewPopulation, happiness, health, money, XP, date
cs2_screenshotCurrent view as PNG (end-of-frame capture, default 1280px wide)
cs2_get_camera / cs2_set_cameraCamera read/write (pivot/angles/zoom) — combined with screenshots, the AI's own eyes

City data

ToolDescription
cs2_demandRCI demand + demand factors (internal 0-255 scale; refreshes only while simulating)
cs2_budgetBudget breakdown: 14 income / 15 expense sources
cs2_city_servicesElectricity, water & sewage, garbage status
cs2_laborEmployment, unemployment, jobs by education level, age structure
cs2_statisticsTime series for 60+ statistics (32 samples per in-game day)
cs2_terrainWhole-map heightmap + water depth grid
cs2_gridmapNative cell-map layers: land value, ground/air/noise pollution, ground water
cs2_zoningZoning summary (occupied/empty per zone type)
cs2_notificationsAll in-world warning icons (no power/water, abandoned...) with target entities
cs2_trafficCity-wide traffic flow, worst roads (flow %, volume, four daily periods) and traffic bottlenecks, with the game's own numbers
cs2_vehiclesCensus of driving vehicles by type and destination, what stopped vehicles wait for, the queue heads holding traffic up and any gridlock loops
cs2_road_graphRoad segments of an area with their junctions, direction, flow and traffic lights (optionally every network, incl. station tracks)
cs2_inspectSingle-entity detail (residents/employees/status flags)

Construction

ToolDescription
cs2_find_prefabsSearch building/road/network/tree prefabs by name
cs2_place_buildingPlace buildings/trees (terrain-sampled height, rotation, native validation)
cs2_build_roadAny network segment: straight / curved via cx,cz / elevated via e1,e2 (bridges, ramps)
cs2_upgrade_roadRoad upgrades: grass/trees/wide sidewalk/sound barrier/parking/lighting/median
cs2_set_junction_controlSet a junction to traffic lights, no lights, an all-way stop or the game default (the intersection tools' node upgrades)
cs2_replace_roadChange the road type of existing segments in place (the road tool's Replace mode): widen a highway, make a street one-way
cs2_connect_roadBuild a road or track whose ends snap to existing junctions or split existing segments (like the road tool's snapping), optionally raised or lowered
cs2_prefab_infoFootprint, size, placement rules and cost of a building, or width and layers of a network
cs2_place_shorelinePlace a harbor, pump or other shoreline building on the water's edge, snapped like the game's placement tool
cs2_place_roadsidePlace a station, depot or service building flush against a road segment, facing it
cs2_buildings_nearBuildings around a point with kind, footprint and facing, to find free spots or what to clear
cs2_zone_area / cs2_list_zonesPaint zoning (None to clear) and list zone types
cs2_demolishDemolish buildings/segments/trees/districts (bulldozer pipeline)
cs2_list_buildings / cs2_list_roads / cs2_list_objectsEntity listings (ids, coordinates)

Finance & policy

ToolDescription
cs2_get_taxes / cs2_set_taxTax rates for the four zone classes (clamped to game limits)
cs2_policies / cs2_set_policyCity policies (with localized names)
cs2_service_budgets / cs2_set_service_budgetPer-service budget sliders 50-150%
cs2_get_fees / cs2_set_feeService fees (electricity/water/healthcare/education...)
cs2_get_loan / cs2_set_loanBorrow / repay loans
cs2_list_districts / cs2_create_districtList districts / draw a district polygon
cs2_district_policies / cs2_set_district_policyDistrict policies
cs2_tiles_infoOwned map tiles / upkeep info
cs2_list_map_tiles / cs2_buy_map_tilesList tiles (ownership, natural features, permits left) / buy tiles through the game's own purchase logic (price, permits and funds checked by the game)

Public transport

ToolDescription
cs2_list_transit_stopsStops with type, name, position, owning station, attached road and the lines serving them; airplane lists airport gates (passenger or cargo) and the map's air outside connections
cs2_place_transit_stopPlace a roadside bus/tram stop via the object tool pipeline (attached, snapped and validated by the game)
cs2_create_transit_lineLine through ordered stops (ids, station buildings or points snapped to stops) via the route tool pipeline; waits for the game's pathfinding and refuses unreachable segments
cs2_list_transit_linesLines with the transportation panel's numbers (stops, vehicles, passengers on board, usage, length, schedule) and optional per-stop waiting passengers
cs2_delete_transit_lineDelete a line exactly like the game's own delete button
cs2_line_policies / cs2_set_line_policyA line's policies (ticket price, vehicle count...) and setting them like the line panel does
cs2_line_vehicles / cs2_set_line_vehiclesVehicle models a line can use, with capacity, and choosing the model new vehicles use, like the line panel's vehicle selection

Time & meta

ToolDescription
cs2_set_simulationPause / set speed (0-8)
cs2_run_simulationTimed run: simulate N in-game hours, then auto-pause
cs2_save_gameTrigger a save (recommended before large AI operations)

Troubleshooting

  • cs2_ping unreachable: the mod is not loaded. Check %USERPROFILE%\AppData\LocalLow\Colossal Order\Cities Skylines II\Logs\CS2MCP.log (should contain bridge listening on ...); if the file is missing, check Player.log in the same folder.
  • 409 no city loaded: still in the main menu — load a save first.
  • Lock states look wrong: unpause briefly once after loading (lock-related endpoints return a stalenessWarning until the simulation has ticked).
  • Port conflict: set CS2MCP_PORT for the game process and update CS2_BRIDGE_URL in .env to match.

Known Limitations / Roadmap

  • Terraforming is not implemented yet
  • Transit: stops can be placed for bus/tram (roadside); train/metro stops are station buildings (place with cs2_place_building) that must be connected by tracks. Lines only get vehicles when a depot of the same type exists and the simulation runs
  • Ramps can only connect at segment endpoints (nodes); mid-segment smooth merges are not supported yet
  • Screenshots capture the game's current rendering: with a road-tool panel open the game renders roads in white outline mode

Disclaimer & Credits

  • This is an unofficial community mod, not affiliated with Colossal Order or Paradox Interactive.
  • CS2MCP.Bridge/CreateDefinitions.cs is ported from LineTool-CS2 (Apache-2.0, © algernon) and contains portions derived from decompiled game code, subject to the Paradox Interactive User Agreement.
  • Thanks to the CS2 modding community — the public code of LineTool, InfoLoom, Traffic, unity-mcp and others made this project possible.

License

Apache-2.0

Installation

TypingMind
{
  "mcpServers": {
    "cities-skylines-2-mcp": {
      "command": "node",
      "args": [
        "mcp-server/dist/index.js"
      ]
    }
  }
}

Use Cities Skylines 2 MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Cities Skylines 2 MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Cities Skylines 2 MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Cities Skylines 2 MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "cities-skylines-2-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Cities Skylines 2 MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Cities Skylines 2 MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Cities Skylines 2 MCP to help me with this task?
Cities Skylines 2 MCP
Sure. I read it.
Here is what I found using Cities Skylines 2 MCP.

Frequently asked questions

What is the Cities Skylines 2 MCP MCP server used for?

Cities Skylines 2 MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Cities Skylines 2 MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Cities Skylines 2 MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Cities Skylines 2 MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Cities Skylines 2 MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Cities Skylines 2 MCP MCP to TypingMind?

Cities Skylines 2 MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Cities Skylines 2 MCP MCP provide in TypingMind?

Cities Skylines 2 MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Cities Skylines 2 MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Cities Skylines 2 MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇