Logo de Cities Skylines 2 MCP

Cities Skylines 2 MCP

Comunidade
LancerComet

Cities Skylines 2 MCP

Publicado porLancerComet
Repositóriocities-skylines-2-mcp
IdiomaC#
Forks
14
Estrelas
43
Ferramentas disponíveis
0
Tipo de transportestdio
Categorias
LicençaApache-2.0
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    Cities Skylines 2 MCP disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • 0 ferramentas disponíveis

    Confira abaixo as ações que podem ser chamadas, incluindo nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    43 estrelas e 14 forks no repositório vinculado.

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

Instalação

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

Use o MCP de Cities Skylines 2 MCP com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar Cities Skylines 2 MCP, é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. Este MCP é executado localmente no seu dispositivo por meio do conector MCP do TypingMind.

Guia de configuração para usar o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, vá até Configurações, Configurações avançadas e depois Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Ajustes.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione Cities Skylines 2 MCP como servidor

Quando o status do conector for Pronto, clique em Editar e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar.
  3. Cole a configuração do servidor MCP de Cities Skylines 2 MCP.
  4. Salve a lista de servidores.
  5. Atualize para confirmar se o conector ainda está pronto para uso.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar
{
  "mcpServers": {
    "cities-skylines-2-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de Cities Skylines 2 MCP, selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de Cities Skylines 2 MCP.
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar Cities Skylines 2 MCP para me ajudar nesta tarefa?
Cities Skylines 2 MCP
Claro. Já li.
Veja o que encontrei usando Cities Skylines 2 MCP.

Perguntas frequentes

Para que serve o servidor MCP Cities Skylines 2 MCP?

Cities Skylines 2 MCP é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP Cities Skylines 2 MCP com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar Cities Skylines 2 MCP com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP Cities Skylines 2 MCP com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com Cities Skylines 2 MCP conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP Cities Skylines 2 MCP ao TypingMind?

Cities Skylines 2 MCP funciona por meio do conector MCP local do TypingMind. Essa é a melhor opção quando o servidor MCP precisa acessar arquivos locais, apps de desktop, ferramentas de linha de comando ou recursos privados no seu computador.

Quais ferramentas o MCP Cities Skylines 2 MCP oferece no TypingMind?

Cities Skylines 2 MCP disponibiliza recursos MCP que podem ser ativados na página Plugins do TypingMind e usados no chat ou atribuídos a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP Cities Skylines 2 MCP?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se Cities Skylines 2 MCP exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

Servidores MCP relacionados

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇