Logo di Cities Skylines 2 MCP

Cities Skylines 2 MCP

Community
LancerComet

Cities Skylines 2 MCP

AutoreLancerComet
Repositorycities-skylines-2-mcp
LinguaC#
Fork
14
Stelle
43
Strumenti disponibili
0
Tipo di trasportostdio
Categorie
LicenzaApache-2.0
Link
  • Collega gli strumenti ai flussi di lavoro IA

    Cities Skylines 2 MCP mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • 0 strumenti disponibili

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni quando forniti dal server.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse open source

    43 stelle e 14 fork nel repository collegato.

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

Installazione

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

Usa MCP Cities Skylines 2 MCP con più modelli IA

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso Cities Skylines 2 MCP, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura MCP.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura MCP e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con Questo dispositivo selezionato
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi Cities Skylines 2 MCP come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di Cities Skylines 2 MCP.
  4. Salva l'elenco dei server.
  5. Aggiorna per verificare che il connettore sia ancora pronto.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "cities-skylines-2-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di Cities Skylines 2 MCP, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di Cities Skylines 2 MCP.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare Cities Skylines 2 MCP per aiutarmi con questa attività?
Cities Skylines 2 MCP
Certo. Ho letto.
Ecco cosa ho trovato con Cities Skylines 2 MCP.

Domande frequenti

A cosa serve il server MCP Cities Skylines 2 MCP?

Cities Skylines 2 MCP è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare Cities Skylines 2 MCP MCP con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare Cities Skylines 2 MCP con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP Cities Skylines 2 MCP con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando Cities Skylines 2 MCP, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego Cities Skylines 2 MCP MCP a TypingMind?

Cities Skylines 2 MCP funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre Cities Skylines 2 MCP MCP in TypingMind?

Cities Skylines 2 MCP mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare Cities Skylines 2 MCP MCP?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se Cities Skylines 2 MCP richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇