cities2-mcp 0.1.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cities2_mcp-0.1.5/.gitignore +21 -0
- cities2_mcp-0.1.5/INSTALL.md +424 -0
- cities2_mcp-0.1.5/LICENSE +21 -0
- cities2_mcp-0.1.5/PKG-INFO +247 -0
- cities2_mcp-0.1.5/README.md +220 -0
- cities2_mcp-0.1.5/SECURITY.md +91 -0
- cities2_mcp-0.1.5/THIRD_PARTY_NOTICES.md +28 -0
- cities2_mcp-0.1.5/cities2_mcp/__init__.py +14 -0
- cities2_mcp-0.1.5/cities2_mcp/build_runner.py +345 -0
- cities2_mcp-0.1.5/cities2_mcp/data/ATTRIBUTION.md +43 -0
- cities2_mcp-0.1.5/cities2_mcp/data/LICENSE +25 -0
- cities2_mcp-0.1.5/cities2_mcp/data/index/chunks.jsonl +1095 -0
- cities2_mcp-0.1.5/cities2_mcp/data/index/pages.jsonl +126 -0
- cities2_mcp-0.1.5/cities2_mcp/data/manifest.json +14 -0
- cities2_mcp-0.1.5/cities2_mcp/diagnostics.py +275 -0
- cities2_mcp-0.1.5/cities2_mcp/game_encyclopedia.py +606 -0
- cities2_mcp-0.1.5/cities2_mcp/mcp_server.py +1005 -0
- cities2_mcp-0.1.5/cities2_mcp/project_analyzer.py +403 -0
- cities2_mcp-0.1.5/cities2_mcp/project_scaffold.py +410 -0
- cities2_mcp-0.1.5/cities2_mcp/retrieval/__init__.py +33 -0
- cities2_mcp-0.1.5/cities2_mcp/retrieval/mcp_server.py +967 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-csharp/.gitignore +4 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-csharp/CHANGELOG.md +4 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-csharp/LocaleEN.cs +29 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-csharp/Mod.cs +32 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-csharp/Properties/PublishConfiguration.xml +6 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-csharp/README.md +15 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-csharp/Setting.cs +29 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-csharp/__PROJECT_SLUG__.csproj +65 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-hybrid/.gitignore +6 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-hybrid/CHANGELOG.md +4 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-hybrid/LocaleEN.cs +29 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-hybrid/Mod.cs +32 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-hybrid/Properties/PublishConfiguration.xml +6 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-hybrid/README.md +13 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-hybrid/Setting.cs +29 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-hybrid/__PROJECT_SLUG__.csproj +46 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-hybrid/ui/package.json +13 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-hybrid/ui/src/index.tsx +5 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-hybrid/ui/src/styles.css +3 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-hybrid/ui/tsconfig.json +10 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-ui/.gitignore +2 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-ui/CHANGELOG.md +4 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-ui/README.md +12 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-ui/package.json +13 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-ui/src/index.tsx +5 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-ui/src/styles.css +3 -0
- cities2_mcp-0.1.5/cities2_mcp/templates/cities2-ui/tsconfig.json +10 -0
- cities2_mcp-0.1.5/mcp.config.example.json +15 -0
- cities2_mcp-0.1.5/pyproject.toml +82 -0
- cities2_mcp-0.1.5/scripts/mcp_launch_wrapper.sh +19 -0
- cities2_mcp-0.1.5/scripts/workbench_cli.py +193 -0
- cities2_mcp-0.1.5/server/mcp_server.py +17 -0
- cities2_mcp-0.1.5/server.json +44 -0
- cities2_mcp-0.1.5/skills/cities2-game-updates/SKILL.md +87 -0
- cities2_mcp-0.1.5/skills/cities2-game-updates/agents/openai.yaml +10 -0
- cities2_mcp-0.1.5/skills/cities2-knowledge/SKILL.md +69 -0
- cities2_mcp-0.1.5/skills/cities2-knowledge/agents/openai.yaml +10 -0
- cities2_mcp-0.1.5/skills/cities2-modding/SKILL.md +61 -0
- cities2_mcp-0.1.5/skills/cities2-modding/agents/openai.yaml +10 -0
- cities2_mcp-0.1.5/start_mcp.bat +2 -0
- cities2_mcp-0.1.5/tests/__init__.py +1 -0
- cities2_mcp-0.1.5/tests/smoke_mcp.py +211 -0
- cities2_mcp-0.1.5/tests/test_analyzer.py +127 -0
- cities2_mcp-0.1.5/tests/test_corpus_source_links.py +140 -0
- cities2_mcp-0.1.5/tests/test_diagnostics.py +57 -0
- cities2_mcp-0.1.5/tests/test_extension.py +30 -0
- cities2_mcp-0.1.5/tests/test_game_encyclopedia.py +400 -0
- cities2_mcp-0.1.5/tests/test_mcp_docs_guardrail.py +125 -0
- cities2_mcp-0.1.5/tests/test_mcp_game_encyclopedia.py +342 -0
- cities2_mcp-0.1.5/tests/test_packaging.py +121 -0
- cities2_mcp-0.1.5/tests/test_portability.py +360 -0
- cities2_mcp-0.1.5/tests/test_public_corpus_link_hygiene.py +99 -0
- cities2_mcp-0.1.5/tests/test_scaffold.py +136 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
tmp-smoke-ws/
|
|
2
|
+
packages/
|
|
3
|
+
.worktrees/
|
|
4
|
+
__pycache__/
|
|
5
|
+
.pytest_cache/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
.venv/
|
|
8
|
+
.venv-skill/
|
|
9
|
+
venv/
|
|
10
|
+
env/
|
|
11
|
+
node_modules/
|
|
12
|
+
.codex/
|
|
13
|
+
docs/
|
|
14
|
+
mcp.config.json
|
|
15
|
+
|
|
16
|
+
# Local game Encyclopedia cache/previews; generated from a user's installed game files.
|
|
17
|
+
game-encyclopedia-cache/
|
|
18
|
+
data-game-encyclopedia/
|
|
19
|
+
Locale.cok
|
|
20
|
+
*.cok
|
|
21
|
+
*.Locale.cok
|
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
# Installing the Cities2-MCP Server
|
|
2
|
+
|
|
3
|
+
This guide is written for AI coding agents. If a user asks you to install this MCP server, follow these steps in order.
|
|
4
|
+
|
|
5
|
+
## Preferred packaged install
|
|
6
|
+
|
|
7
|
+
For normal users, install through the published Python package with `uvx`:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"mcpServers": {
|
|
12
|
+
"cities2-mcp": {
|
|
13
|
+
"command": "uvx",
|
|
14
|
+
"args": [
|
|
15
|
+
"cities2-mcp",
|
|
16
|
+
"--workspace",
|
|
17
|
+
"<TRUSTED_MOD_PROJECT_OR_PARENT_FOLDER>"
|
|
18
|
+
],
|
|
19
|
+
"env": {
|
|
20
|
+
"CITIES2_MODS_DIR": "<CITIES2_MODS_DIR>"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The packaged server includes the bundled wiki corpus, so `--data-dir` is not
|
|
28
|
+
needed. Omit `--workspace` only for wiki and local Encyclopedia search; add one
|
|
29
|
+
or more `--workspace` entries when the user wants workflow tools to write,
|
|
30
|
+
analyze, build, or package local mod projects.
|
|
31
|
+
|
|
32
|
+
Use the source checkout instructions below when developing this repository or
|
|
33
|
+
when a user explicitly wants to run from a local clone.
|
|
34
|
+
|
|
35
|
+
## 1. Prerequisites
|
|
36
|
+
|
|
37
|
+
Before configuring any client, verify these prerequisites:
|
|
38
|
+
|
|
39
|
+
### Search tooling
|
|
40
|
+
|
|
41
|
+
`rg`/ripgrep is optional. If it is not installed, not on `PATH`, or fails to run
|
|
42
|
+
with an error such as Windows `Access is denied`, do not block the install.
|
|
43
|
+
Use a platform fallback instead:
|
|
44
|
+
|
|
45
|
+
- **Windows PowerShell file list:** `Get-ChildItem -Recurse -File`
|
|
46
|
+
- **Windows PowerShell text search:** `Get-ChildItem -Recurse -File | Select-String -Pattern "term"`
|
|
47
|
+
- **Windows CMD text search:** `findstr /S /N /I "term" *`
|
|
48
|
+
- **macOS / Linux text search:** `grep -RIn --exclude-dir=.git "term" .`
|
|
49
|
+
|
|
50
|
+
### Python 3
|
|
51
|
+
|
|
52
|
+
Find the **full absolute path** to the Python interpreter. Run one of these commands depending on platform:
|
|
53
|
+
|
|
54
|
+
- **Windows:** `py -3 -c "import sys; print(sys.executable)"`
|
|
55
|
+
- **macOS / Linux:** `python3 -c "import sys; print(sys.executable)"`
|
|
56
|
+
|
|
57
|
+
Store the output as `PYTHON_PATH`. Example: `C:\Users\You\AppData\Local\Programs\Python\Python311\python.exe`
|
|
58
|
+
|
|
59
|
+
**Important:** Do NOT use `py`, `py.exe`, `python3`, or `python` as the command value in any config. MCP clients spawn processes directly and may not resolve PATH entries, shell aliases, or the Windows `py` launcher. Always use the full absolute path.
|
|
60
|
+
|
|
61
|
+
### Optional: mod build and package workflows
|
|
62
|
+
|
|
63
|
+
The base MCP server, wiki search tools, and project scaffolding tools do not require the .NET runtime checks below. They only need Python and the local corpus.
|
|
64
|
+
|
|
65
|
+
If the user wants the MCP tools to build, post-process, or package Cities: Skylines II mods, also verify the CS2 mod build prerequisites:
|
|
66
|
+
|
|
67
|
+
1. The Cities: Skylines II modding toolchain is installed from inside the game.
|
|
68
|
+
2. `dotnet` is available on `PATH`.
|
|
69
|
+
3. `dotnet --list-runtimes` includes `Microsoft.NETCore.App 6.`.
|
|
70
|
+
|
|
71
|
+
The CS2 toolchain's `ModPostProcessor` and `ModPublisher` target `Microsoft.NETCore.App` version `6.0.0`. A newer runtime such as .NET 8 does not necessarily satisfy this requirement. If `Microsoft.NETCore.App 6.` is missing and the user asked for mod build/package readiness, install the Microsoft .NET 6 runtime for the current platform or tell the user exactly what is missing and that wiki/search-only MCP use is still available.
|
|
72
|
+
|
|
73
|
+
## 2. Resolve local values
|
|
74
|
+
|
|
75
|
+
You need four required values. There is also one optional game-directory override for non-standard installs. Determine them now before writing any config.
|
|
76
|
+
|
|
77
|
+
| Value | How to resolve |
|
|
78
|
+
|---|---|
|
|
79
|
+
| `PYTHON_PATH` | The full absolute path from step 1. |
|
|
80
|
+
| `REPO_ROOT` | The absolute path to this repository's root directory (the directory containing this `INSTALL.md` file). |
|
|
81
|
+
| `CITIES2_MODS_DIR` | **Windows:** Expand `%LOCALAPPDATA%Low\Colossal Order\Cities Skylines II\Mods` (typically `C:\Users\<username>\AppData\LocalLow\Colossal Order\Cities Skylines II\Mods`). **macOS:** `~/Library/Application Support/Colossal Order/Cities Skylines II/Mods`. **Linux:** `~/.local/share/Colossal Order/Cities Skylines II/Mods`. |
|
|
82
|
+
| `CITIES2_GAME_DIR` | Optional. Usually auto-detected for Steam installs. Set this only when `source_status()` reports that the Game Encyclopedia was not found. Point it at the Cities: Skylines II install directory, not the `Cities2_Data` directory. |
|
|
83
|
+
| `WORKSPACE_ROOTS` | Trusted folders where MCP workflow tools may read/write/build projects. Always include `REPO_ROOT`. If the user wants to analyze, build, package, or edit existing mod repos, also include those repo paths or a trusted parent folder containing them, such as the user's mod-projects folder. |
|
|
84
|
+
|
|
85
|
+
Advanced: if `CITIES2_GAME_DIR` is not enough, set `CITIES2_LOCALE_COK` to the full path of the specific `Locale.cok` file.
|
|
86
|
+
|
|
87
|
+
`--workspace` is a safety allowlist for workflow tools that write, build, or package projects. Repeat it once for each entry in `WORKSPACE_ROOTS`. Absolute project paths outside the configured workspaces are rejected with `Path must stay inside configured workspaces`.
|
|
88
|
+
|
|
89
|
+
### Slash-command style prompts
|
|
90
|
+
|
|
91
|
+
Cities2-MCP exposes MCP prompts that compatible clients may show as slash commands, prompt templates, or command-palette entries:
|
|
92
|
+
|
|
93
|
+
- `/cities2` - answer using both the bundled wiki corpus and the local game Encyclopedia when available.
|
|
94
|
+
- `/cities2-wiki` - answer using only the bundled wiki corpus.
|
|
95
|
+
- `/cities2-encyclopedia` - answer using only the local in-game Encyclopedia.
|
|
96
|
+
- `/cities2-modding` - answer modding questions with docs and local project workflow tools.
|
|
97
|
+
|
|
98
|
+
Client support varies. If a client does not show MCP prompts as slash commands, the same workflows may still be available through that client's MCP prompt picker.
|
|
99
|
+
|
|
100
|
+
### Agent Skills
|
|
101
|
+
|
|
102
|
+
Cities2-MCP also ships Agent Skills in the `skills/` directory. These are recommended for clients that support skills because they teach the agent how to query the wiki and local Encyclopedia with keywords, fetch full source records, compare source authority, synthesize answers, and include compact source notes with Encyclopedia entry names and wiki links.
|
|
103
|
+
|
|
104
|
+
- `skills/cities2-knowledge` - gameplay and city-system questions using wiki plus local Encyclopedia.
|
|
105
|
+
- `skills/cities2-modding` - modding questions and local mod project workflows.
|
|
106
|
+
|
|
107
|
+
Install these skills into the client's supported skill directory if the client does not load project-level skills automatically. The skills depend on the `cities2-mcp` MCP server being configured first.
|
|
108
|
+
|
|
109
|
+
## 3. Detect installed clients
|
|
110
|
+
|
|
111
|
+
A client can be installed even if its config file does not exist yet — many clients only create config files on demand.
|
|
112
|
+
|
|
113
|
+
> **IMPORTANT — always include yourself.** If you are an AI agent running inside a client (Claude Code, Cursor, Codex, etc.), that client is installed by definition. Add it to the detected list regardless of whether its config file exists yet. Do not skip yourself.
|
|
114
|
+
|
|
115
|
+
Do not collapse Claude clients into one entry. Claude Desktop app MCP settings and Claude Code MCP settings are separate, even when Claude Code is used inside the Desktop app. An agent may not be able to tell which one the user means from context. If the user asks to install for "Claude" or "Claude Code" and both surfaces might matter, ask the user which Claude surface they want: Claude Desktop app MCP settings, Claude Code MCP settings, or both.
|
|
116
|
+
|
|
117
|
+
Use all of the following checks to build the full list of installed clients:
|
|
118
|
+
|
|
119
|
+
1. **You are a client.** Identify which client you are running in and include it unconditionally.
|
|
120
|
+
2. **Config file exists:** Check the standard paths below for each platform.
|
|
121
|
+
3. **Binary on PATH:** Also check if other client commands are available (e.g. `claude --version`, `cursor --version`, `codex --version`). Include any that respond.
|
|
122
|
+
|
|
123
|
+
For each detected config file, read it and check for existing Cities2-MCP entries:
|
|
124
|
+
|
|
125
|
+
1. **Current name:** `cities2-mcp` (in `mcpServers` for JSON clients, or `[mcp_servers.cities2-mcp]` for Codex TOML).
|
|
126
|
+
2. **Legacy names:** also check for `cities2-modding-workbench`, `cities2Workbench`, `cities2-workbench`, or any key containing `cities2` (case-insensitive). These are older versions of this server config.
|
|
127
|
+
|
|
128
|
+
Classify each detected client into one of three states:
|
|
129
|
+
|
|
130
|
+
| State | Meaning | Action in step 4 |
|
|
131
|
+
|---|---|---|
|
|
132
|
+
| **Up to date** | Has a `cities2-mcp` entry using packaged `uvx cities2-mcp`, or a source checkout entry with the current `--data-dir` flag | Exclude from the picker — already installed |
|
|
133
|
+
| **Outdated** | Has a legacy-named entry or uses old flags (`--chunks`, `--pages` instead of `--data-dir`) | Include in the picker — describe as "outdated entry will be replaced" |
|
|
134
|
+
| **Not installed** | No matching entry found | Include in the picker — describe as "entry needs to be added" (or "config file will be created" if the file doesn't exist yet) |
|
|
135
|
+
|
|
136
|
+
When writing the config in step 4, if replacing an outdated entry, remove the old entry entirely before adding the new one.
|
|
137
|
+
|
|
138
|
+
If *all* detected clients are already up to date, inform the user that it is already installed everywhere and skip to step 5 (Verify).
|
|
139
|
+
|
|
140
|
+
### Windows
|
|
141
|
+
|
|
142
|
+
| Client | Global config path |
|
|
143
|
+
|---|---|
|
|
144
|
+
| Claude Desktop | Agents can edit `claude_desktop_config.json` directly. Use `Settings > Developer > Edit Config` only to confirm the active file if needed. Default path: `%APPDATA%\Claude\claude_desktop_config.json`. |
|
|
145
|
+
| Claude Code | `%USERPROFILE%\.claude.json` |
|
|
146
|
+
| Codex | `%USERPROFILE%\.codex\config.toml` |
|
|
147
|
+
| Cursor | `%USERPROFILE%\.cursor\mcp.json` |
|
|
148
|
+
|
|
149
|
+
### macOS
|
|
150
|
+
|
|
151
|
+
| Client | Global config path |
|
|
152
|
+
|---|---|
|
|
153
|
+
| Claude Desktop | Agents can edit `claude_desktop_config.json` directly. Use `Settings > Developer > Edit Config` only to confirm the active file if needed. Default path: `~/Library/Application Support/Claude/claude_desktop_config.json`. |
|
|
154
|
+
| Claude Code | `~/.claude.json` |
|
|
155
|
+
| Codex | `~/.codex/config.toml` |
|
|
156
|
+
| Cursor | `~/.cursor/mcp.json` |
|
|
157
|
+
|
|
158
|
+
### Linux
|
|
159
|
+
|
|
160
|
+
| Client | Global config path |
|
|
161
|
+
|---|---|
|
|
162
|
+
| Claude Code | `~/.claude.json` |
|
|
163
|
+
| Codex | `~/.codex/config.toml` |
|
|
164
|
+
| Cursor | `~/.cursor/mcp.json` |
|
|
165
|
+
|
|
166
|
+
### Project-level alternatives
|
|
167
|
+
|
|
168
|
+
Global config is the tested install path for this guide. If the user explicitly requests project-level install, first check that the target client supports project-level MCP configuration and use that client's documented project config path. Claude Code's shared project-level MCP config is `.mcp.json` at the project root. If you cannot verify project-level support for the requested client, install globally and tell the user why.
|
|
169
|
+
|
|
170
|
+
### Ask the user
|
|
171
|
+
|
|
172
|
+
Ask the user which detected clients to install into. If your runtime has an interactive question tool, use it with an "All detected (Recommended)" option plus one option per detected client. If no such tool is available, ask in plain text.
|
|
173
|
+
|
|
174
|
+
Install globally by default. Only use project-level config if the user explicitly requests it.
|
|
175
|
+
|
|
176
|
+
## 4. Write the config
|
|
177
|
+
|
|
178
|
+
### JSON clients (Claude Desktop, Cursor)
|
|
179
|
+
|
|
180
|
+
These clients all use a `mcpServers` key in their JSON config. Add the following entry inside the existing `mcpServers` object. If `mcpServers` does not exist, create it.
|
|
181
|
+
|
|
182
|
+
**If the config file already exists**, read it, add the entry, and write it back — do not overwrite unrelated settings. **If the config file does not exist**, create it with just the `mcpServers` key containing the entry below.
|
|
183
|
+
|
|
184
|
+
Replace `PYTHON_PATH`, `REPO_ROOT`, `CITIES2_MODS_DIR`, and any additional
|
|
185
|
+
workspace paths with the values resolved in step 2. On Windows, use
|
|
186
|
+
double-backslash escaping in JSON strings (e.g., `C:\\Users\\You\\...`). On
|
|
187
|
+
macOS and Linux, use forward slashes.
|
|
188
|
+
|
|
189
|
+
In the examples below, the first `--workspace` entry is `REPO_ROOT`. Add more
|
|
190
|
+
`"--workspace", "<TRUSTED_MOD_PROJECT_OR_PARENT_FOLDER>"` pairs for any existing
|
|
191
|
+
mod repos the user wants the MCP workflow tools to operate on.
|
|
192
|
+
|
|
193
|
+
```json
|
|
194
|
+
{
|
|
195
|
+
"cities2-mcp": {
|
|
196
|
+
"command": "<PYTHON_PATH>",
|
|
197
|
+
"args": [
|
|
198
|
+
"<REPO_ROOT>/server/mcp_server.py",
|
|
199
|
+
"--data-dir",
|
|
200
|
+
"<REPO_ROOT>/data",
|
|
201
|
+
"--workspace",
|
|
202
|
+
"<REPO_ROOT>"
|
|
203
|
+
],
|
|
204
|
+
"env": {
|
|
205
|
+
"CITIES2_MODS_DIR": "<CITIES2_MODS_DIR>"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Do not add `CITIES2_GAME_DIR` unless automatic discovery fails or the user has a non-standard install location. If needed, add it to the MCP server environment with the game install directory as its value.
|
|
212
|
+
|
|
213
|
+
This block goes **inside** the `mcpServers` key, not at the top level. For example, if the file already has:
|
|
214
|
+
|
|
215
|
+
```json
|
|
216
|
+
{
|
|
217
|
+
"mcpServers": {
|
|
218
|
+
"some-other-server": { ... }
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
It should become:
|
|
224
|
+
|
|
225
|
+
```json
|
|
226
|
+
{
|
|
227
|
+
"mcpServers": {
|
|
228
|
+
"some-other-server": { ... },
|
|
229
|
+
"cities2-mcp": {
|
|
230
|
+
"command": "<PYTHON_PATH>",
|
|
231
|
+
"args": [
|
|
232
|
+
"<REPO_ROOT>/server/mcp_server.py",
|
|
233
|
+
"--data-dir",
|
|
234
|
+
"<REPO_ROOT>/data",
|
|
235
|
+
"--workspace",
|
|
236
|
+
"<REPO_ROOT>"
|
|
237
|
+
],
|
|
238
|
+
"env": {
|
|
239
|
+
"CITIES2_MODS_DIR": "<CITIES2_MODS_DIR>"
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Do not add `CITIES2_GAME_DIR` unless automatic discovery fails or the user has a non-standard install location. If needed, add it to the MCP server environment with the game install directory as its value.
|
|
247
|
+
|
|
248
|
+
### Claude Code
|
|
249
|
+
|
|
250
|
+
Prefer the Claude Code MCP command instead of hand-editing `~/.claude.json`:
|
|
251
|
+
|
|
252
|
+
```sh
|
|
253
|
+
claude mcp add-json cities2-mcp '{"type":"stdio","command":"<PYTHON_PATH>","args":["<REPO_ROOT>/server/mcp_server.py","--data-dir","<REPO_ROOT>/data","--workspace","<REPO_ROOT>"],"env":{"CITIES2_MODS_DIR":"<CITIES2_MODS_DIR>"}}' --scope user
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
On Windows PowerShell, avoid complex command-line escaping by using a here-string:
|
|
257
|
+
|
|
258
|
+
```powershell
|
|
259
|
+
$json = @'
|
|
260
|
+
{"type":"stdio","command":"<PYTHON_PATH>","args":["<REPO_ROOT>/server/mcp_server.py","--data-dir","<REPO_ROOT>/data","--workspace","<REPO_ROOT>"],"env":{"CITIES2_MODS_DIR":"<CITIES2_MODS_DIR>"}}
|
|
261
|
+
'@
|
|
262
|
+
claude mcp add-json cities2-mcp $json --scope user
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Do not add `CITIES2_GAME_DIR` unless automatic discovery fails or the user has a non-standard install location. If needed, add it to the MCP server environment with the game install directory as its value.
|
|
266
|
+
|
|
267
|
+
Use `--scope project` only if the user explicitly wants a shared project-level `.mcp.json` file.
|
|
268
|
+
If the user wants workflow tools to operate on existing mod repos, add more
|
|
269
|
+
`"--workspace","<TRUSTED_MOD_PROJECT_OR_PARENT_FOLDER>"` pairs to the JSON before
|
|
270
|
+
running the command. If the Claude Code command fails because of shell quoting,
|
|
271
|
+
edit `~/.claude.json` directly using the JSON client shape above, preserving all
|
|
272
|
+
unrelated settings.
|
|
273
|
+
|
|
274
|
+
### Codex (TOML)
|
|
275
|
+
|
|
276
|
+
Add this block to the Codex config file. If the file does not exist, create it.
|
|
277
|
+
|
|
278
|
+
```toml
|
|
279
|
+
[mcp_servers.cities2-mcp]
|
|
280
|
+
command = "<PYTHON_PATH>"
|
|
281
|
+
args = [
|
|
282
|
+
"<REPO_ROOT>/server/mcp_server.py",
|
|
283
|
+
"--data-dir",
|
|
284
|
+
"<REPO_ROOT>/data",
|
|
285
|
+
"--workspace",
|
|
286
|
+
"<REPO_ROOT>"
|
|
287
|
+
]
|
|
288
|
+
|
|
289
|
+
[mcp_servers.cities2-mcp.env]
|
|
290
|
+
CITIES2_MODS_DIR = "<CITIES2_MODS_DIR>"
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
Do not add `CITIES2_GAME_DIR` unless automatic discovery fails or the user has a non-standard install location. If needed, add it to the MCP server environment with the game install directory as its value.
|
|
294
|
+
|
|
295
|
+
### Other / generic MCP client
|
|
296
|
+
|
|
297
|
+
For any MCP client not listed above, use the JSON shape from the "JSON clients" section. Consult that client's documentation for where to place MCP server configuration.
|
|
298
|
+
|
|
299
|
+
## 5. Install Agent Skills
|
|
300
|
+
|
|
301
|
+
If the selected client supports Agent Skills, install the bundled Cities2-MCP skills after configuring the MCP server. These skills teach the agent how to query and interpret the wiki corpus plus local Game Encyclopedia, then cite the specific source pages or entries used.
|
|
302
|
+
|
|
303
|
+
Install the user-facing skill folders:
|
|
304
|
+
|
|
305
|
+
- `<REPO_ROOT>/skills/cities2-knowledge`
|
|
306
|
+
- `<REPO_ROOT>/skills/cities2-modding`
|
|
307
|
+
- `<REPO_ROOT>/skills/cities2-game-updates`
|
|
308
|
+
|
|
309
|
+
### Codex skills
|
|
310
|
+
|
|
311
|
+
For Codex, copy the skill directories into the user's Codex skills folder:
|
|
312
|
+
|
|
313
|
+
| Platform | Codex skills folder |
|
|
314
|
+
|---|---|
|
|
315
|
+
| Windows | `%USERPROFILE%\.codex\skills` |
|
|
316
|
+
| macOS / Linux | `~/.codex/skills` |
|
|
317
|
+
|
|
318
|
+
On Windows PowerShell:
|
|
319
|
+
|
|
320
|
+
```powershell
|
|
321
|
+
$src = "<REPO_ROOT>/skills"
|
|
322
|
+
$dst = "$env:USERPROFILE/.codex/skills"
|
|
323
|
+
New-Item -ItemType Directory -Force -Path $dst | Out-Null
|
|
324
|
+
Copy-Item -Recurse -Force "$src/cities2-knowledge" "$dst/cities2-knowledge"
|
|
325
|
+
Copy-Item -Recurse -Force "$src/cities2-modding" "$dst/cities2-modding"
|
|
326
|
+
Copy-Item -Recurse -Force "$src/cities2-game-updates" "$dst/cities2-game-updates"
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
On macOS or Linux:
|
|
330
|
+
|
|
331
|
+
```sh
|
|
332
|
+
mkdir -p ~/.codex/skills
|
|
333
|
+
cp -R "<REPO_ROOT>/skills/cities2-knowledge" ~/.codex/skills/
|
|
334
|
+
cp -R "<REPO_ROOT>/skills/cities2-modding" ~/.codex/skills/
|
|
335
|
+
cp -R "<REPO_ROOT>/skills/cities2-game-updates" ~/.codex/skills/
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### Other clients
|
|
339
|
+
|
|
340
|
+
For Claude, Cursor, or other clients that support skills, use that client's documented skill-install location or project-level skill mechanism. If the client does not support Agent Skills, skip this step; the MCP server tools still work, and compatible clients may still expose the MCP prompts from `prompts/list`.
|
|
341
|
+
|
|
342
|
+
Do not copy skills into a client's directory if that client does not support skills.
|
|
343
|
+
|
|
344
|
+
## 6. Verify
|
|
345
|
+
|
|
346
|
+
After writing the config, test that the server starts and responds. Run this from
|
|
347
|
+
`REPO_ROOT` with the same Python interpreter used in the MCP config:
|
|
348
|
+
|
|
349
|
+
```
|
|
350
|
+
<PYTHON_PATH> tests/smoke_mcp.py
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
The smoke test validates MCP initialize/list, wiki retrieval tools, resource
|
|
354
|
+
listing, and mod workflow tools using a temporary workspace. It does not require
|
|
355
|
+
the optional CS2/.NET build prerequisites.
|
|
356
|
+
|
|
357
|
+
`source_status()` may report that the Game Encyclopedia is unavailable on machines without Cities: Skylines II installed. That is a warning, not an install failure.
|
|
358
|
+
|
|
359
|
+
You can also do a quick local tool-list check:
|
|
360
|
+
|
|
361
|
+
```sh
|
|
362
|
+
<PYTHON_PATH> scripts/workbench_cli.py list-tools
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
The expected Cities2-MCP tool names are:
|
|
366
|
+
|
|
367
|
+
- `search`
|
|
368
|
+
- `get_page`
|
|
369
|
+
- `query_reference`
|
|
370
|
+
- `get_snippets`
|
|
371
|
+
- `scaffold_project`
|
|
372
|
+
- `write_project_file`
|
|
373
|
+
- `list_project_tree`
|
|
374
|
+
- `build_project`
|
|
375
|
+
- `analyze_project`
|
|
376
|
+
- `package_project`
|
|
377
|
+
- `launch_cities2`
|
|
378
|
+
|
|
379
|
+
If either command fails, check that Python 3 is working and that the repository
|
|
380
|
+
contains `cities2_mcp/retrieval/mcp_server.py`.
|
|
381
|
+
|
|
382
|
+
If skills were installed, verify that the copied folders contain `SKILL.md`:
|
|
383
|
+
|
|
384
|
+
- `cities2-knowledge/SKILL.md`
|
|
385
|
+
- `cities2-modding/SKILL.md`
|
|
386
|
+
|
|
387
|
+
New Codex sessions should list `cities2-knowledge` and `cities2-modding` in the available skills. A plain gameplay question such as "How do I grow office demand in Cities: Skylines II?" should cause the agent to use the Cities2 knowledge skill, retrieve both wiki and Encyclopedia sources when available, and include a short source note naming the Encyclopedia entries and linked wiki pages used.
|
|
388
|
+
|
|
389
|
+
## 7. Post-install
|
|
390
|
+
|
|
391
|
+
Tell the user to restart **only the clients you installed into**. Use the platform-appropriate instructions:
|
|
392
|
+
|
|
393
|
+
| Client | Windows | macOS | Linux |
|
|
394
|
+
|---|---|---|---|
|
|
395
|
+
| Claude Desktop | Right-click the Claude icon in the **system tray** and choose **Quit** (not just close the window), then reopen. | **Quit** from the menu bar or Dock (Cmd+Q), then reopen. | Fully quit and reopen. |
|
|
396
|
+
| Claude Code | Start a new session. | Start a new session. | Start a new session. |
|
|
397
|
+
| Codex | Start a new session. | Start a new session. | Start a new session. |
|
|
398
|
+
| Cursor | `Ctrl+Shift+P` > "Reload Window" or restart. | `Cmd+Shift+P` > "Reload Window" or restart. | `Ctrl+Shift+P` > "Reload Window" or restart. |
|
|
399
|
+
|
|
400
|
+
## Publishing
|
|
401
|
+
|
|
402
|
+
Package and MCP Registry releases are tag driven. Before pushing the first
|
|
403
|
+
release tag, configure a PyPI trusted publisher for:
|
|
404
|
+
|
|
405
|
+
- PyPI project: `cities2-mcp`
|
|
406
|
+
- GitHub owner/repository: `mayor-modder` / `Cities2-MCP`
|
|
407
|
+
- Workflow file: `.github/workflows/release.yml`
|
|
408
|
+
- Environment: `pypi`
|
|
409
|
+
|
|
410
|
+
Then create and push a tag such as `v0.1.5`. The release workflow runs tests,
|
|
411
|
+
builds the wheel and source distribution, publishes to PyPI, authenticates to
|
|
412
|
+
the MCP Registry with GitHub OIDC, and publishes `server.json` for
|
|
413
|
+
`io.github.mayor-modder/cities2-mcp`.
|
|
414
|
+
|
|
415
|
+
## Troubleshooting
|
|
416
|
+
|
|
417
|
+
| Symptom | Cause | Fix |
|
|
418
|
+
|---|---|---|
|
|
419
|
+
| "Server disconnected" immediately after startup | `command` is an alias (`py`, `python3`) that the MCP client cannot resolve | Use the full absolute path from `sys.executable` (step 1) |
|
|
420
|
+
| Server connects then disconnects during `tools/list` or `resources/list` | stdout encoding error on Windows (`cp1252` cannot encode Unicode) | Update to the latest version of this repo (the ndjson output path writes via `sys.stdout.buffer` with explicit UTF-8) |
|
|
421
|
+
| Server does not appear after config change | Client was still running in the background | Fully quit and restart (see step 6) |
|
|
422
|
+
| `ModuleNotFoundError` on startup | Missing files, wrong `REPO_ROOT`, or unavailable package command | For packaged installs, verify `uvx cities2-mcp --version`. For source installs, confirm `REPO_ROOT` points to this repository and that `cities2_mcp/retrieval/mcp_server.py` exists |
|
|
423
|
+
| `Path must stay inside configured workspaces` when using project tools | The target mod repo is outside every configured `--workspace` allowlist entry | Add that mod repo, or a trusted parent folder containing it, as another `--workspace` entry and restart the client |
|
|
424
|
+
| Claude reports InfoLoom, save analysis, live city data, or city recovery tools as part of Cities2-MCP | Claude is also loading an older or separate Cities2-related MCP server, often from a previous local tools repo | Inspect every configured MCP server whose key, command, args, or path contains `cities2`, `skylines`, `infoloom`, `dataexport`, `saveinvestigator`, or `city_recovery`. Remove stale entries from the client config, keep only the current `cities2-mcp` entry for this repo, then fully restart the client. |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Cities2-MCP contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|