
lancercomet/cities-skylines-2-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
都市 スカイライン 2 MCP
概要
走行中のCities上でClaude(または任意のMCPクライアント)を与える:Skylines IIゲーム:街のデータを読み込み、カメラを駆動し、スクリーンショットを撮る、道路や建物をビルドし、ペイントゾーン、財務と政策を管理し、シミュレーション時間を制御する。 - (C#):ゲームプロセス内の127.0.0.1にバインドされたTcpListenerで最小限のHTTPサーバーを実行します。 リクエストはリスナースレッドでキューイングされ、システムアップデートフェーズで登録されたECSシステムでシミュレーションメインスレッドで実行されます。 UIUpdate(未使用時) 構造は、ゲームのネイティブ定義/検証/適用パイプラインを使用して、カスタムツールベースシステムを介して行きます。 解体は、ブルドーザーパイプラインを介して行きます。 ゲーム検証を迂回するエンティティティティティティティのミューテーションはありません。 - (TypeScript): MCP ツールは、STdio トランスポート上のブリッジ mod に対して HTTP リクエストに呼び出します。 - Windows + Cities: Skyline II (Steam) - .NET SDK 8.0 + (mod をビルドする) - Node.
概要(AI 翻訳)
日本語 English
Claude(または任意のMCPクライアント)フルコントロールを実行しているCities上:Skylines IIゲーム:都市データを読み込み、カメラを駆動し、スクリーンショットを撮る、道路や建物をビルドし、ペイントゾーンを管理し、財務と政策を管理し、シミュレーション時間を制御する。
アーキテクチャ
-In-game mod (C#): [TcpListener]の最小限のHTTPサーバーを実行します。 リクエストはリスナースレッドでキューイングされ、シミュレーションメインスレッドで[SystemUpdatePhase.UIUpdateで登録されたECSシステムで実行されます。 構造は、ゲームのネイティブ定義/検証/アプリケーションパイプラインを使用して、カスタム[[ToolBaseSystemを通過します。 解体は、ブルドーザーパイプラインを通過します。 ゲーム検証を迂回するエンティティティティティティティの変異はありません。
-MCP サーバー (TypeScript): MCP ツールは、stdio トランスポート上のブリッジ mod に対して HTTP リクエストに呼び出します。
要件
・Windows+CITY:スカイラインII(Steam)
- .NET SDK 8.0+ (mod をビルドする)
- Node.js 18+(MCPサーバを実行する)
##ビルド&インストール
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
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
TcpListenerbound 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 atSystemUpdatePhase.UIUpdate(works while paused). Construction goes through a customToolBaseSystemusing 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
# 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):
- Command line:
dotnet build -p:GamePath="X:\...\Cities Skylines II" CS2_PATHenvironment variableCSII_INSTALLATIONPATHenvironment variable (set by the official modding toolchain)- Auto-probing of common Steam library locations (
C:\Program Files (x86)\Steam,Steam/SteamLibraryon common drive letters)
If the game cannot be found the build fails with a clear error. Example:
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):
| Variable | Scope | Default | Description |
|---|---|---|---|
CS2_BRIDGE_URL |
MCP server | http://127.0.0.1:8642 |
Address of the bridge mod |
CS2MCP_PORT |
game process | 8642 |
Bridge listen port (change both together) |
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →設定
{
"mcpServers": {
"cs2": {
"command": "node",
"args": ["<repo-path>\\mcp-server\\dist\\index.js"]
}
}
}