Cities Skylines 2 MCPのロゴ

Cities Skylines 2 MCP

コミュニティ
LancerComet

Cities Skylines 2 MCP

公開者LancerComet
リポジトリcities-skylines-2-mcp
言語C#
フォーク
14
スター
43
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスApache-2.0
リンク
  • ツールをAIワークフローに接続

    Cities Skylines 2 MCPは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには43件のスターと14件のフォークがあります。

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

インストール

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

Cities Skylines 2 MCPのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Cities Skylines 2 MCPに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Cities Skylines 2 MCPをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Cities Skylines 2 MCPのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "cities-skylines-2-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてCities Skylines 2 MCPのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Cities Skylines 2 MCPのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Cities Skylines 2 MCPを使ってこのタスクを手伝ってもらえますか?
Cities Skylines 2 MCP
はい、読みました。
Cities Skylines 2 MCPで調べた結果をお伝えします。

よくある質問

Cities Skylines 2 MCP MCPサーバーは何に使いますか?

Cities Skylines 2 MCPは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでCities Skylines 2 MCP MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでCities Skylines 2 MCPを利用できます。

TypingMindでCities Skylines 2 MCP MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Cities Skylines 2 MCPを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Cities Skylines 2 MCP MCPをTypingMindに接続するにはどうすればよいですか?

Cities Skylines 2 MCPはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでCities Skylines 2 MCP MCPのどのようなツールを利用できますか?

Cities Skylines 2 MCPはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Cities Skylines 2 MCP MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Cities Skylines 2 MCPで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇