CivMCP
CivMCP is an MCP server that lets an AI read and coach a Civilization VI game, combining rules, live FireTuner state, and archived logs.
Inspect game state: Check where CivMCP looks for game data (
civ_status) and whether the FireTuner socket is reachable with the current turn (civ_tuner_status).Query rules: Look up techs, civics, units, districts, policies, and more (
rules_lookup); get adjacency bonuses (rules_adjacency); compare two entries (rules_compare); list prerequisite paths (rules_path_to); explore DB schema (rules_schema); run read-only SQL (rules_query).Get live game data (when Tuner is enabled): overview, cities, units, diplomacy, threats, city-states, tech/civic/build options, combat previews, governors, trade routes, map tiles, and a full turn snapshot (
game_*tools, e.g.game_overview,game_cities,game_units,game_diplomacy,game_threats,game_turn).Play the game: Move units, set production/research/civics/policies, appoint governors, end turn, and perform unit actions via
play_*tools.Analyze history: Retrieve per-turn yields and scores (
game_history), recent events like combats/eurekas (game_recent_events), and list saves (saves_list).Get coaching: Record snapshots and receive pace-adjusted advice (
coach_snapshot,coach_findings), with built-in prompts for turn reviews, diagnoses, and explanations.Use as a teaching tool: The server cites actual game data and scales pace by speed/difficulty (e.g. Marathon), helping the AI explain “why” rather than just autopilot.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CivMCP Check if my game is connected and what turn is it?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CivMCP
MCP server that lets an AI read your Civilization VI game and coach you. See PLAN.md for the architecture and phase history.
Description
CivMCP is an MCP server for Sid Meier's Civilization VI (Aspyr Mac 1.4.6). It feeds an AI client — Claude Code, Grok, or any other MCP host — three kinds of truth about the game:
Rules from the cached gameplay database (
DebugGameplay.sqlite): techs, civics, units, districts, adjacency, eurekas.History from engine CSVs (
Player_Stats, combat, diplomacy, boosts), archived so they survive the game wipingLogs/on launch.Live state over the FireTuner socket (
127.0.0.1:4318): cities, units, diplomacy, threats, tiles around a city.
A coaching layer on top of that records per-turn snapshots, compares you to speed- and difficulty-scaled pace targets, and turns the gap into advice.
You play by default. The model explains, prioritizes, and points at mistakes. If you ask it to take control, play_* tools can move units, set production/research/civics/policies, found cities, and end the turn — still through the game's own APIs, not cheats. Read Lua is adapted from civ6-mcp (MIT); writes use the same operation types.
Related MCP server: civ6-mcp
Goals
Teach, don't autopilot. After a session you should know why a Campus wants mountains, why a second city is late, or why 4 science/turn has been flat — not just which button to press.
Cite the real game. Advice must come from this save's yields, queues, and logs, not from the model's memory of Civ VI.
Stay honest about pace. Marathon turn 30 is not standard turn 30. Benchmarks scale by game speed and difficulty so the coach does not invent a crisis.
Work on this Mac. Aspyr Apple Silicon has no
Lua.logand noioin the sandbox. Live data goes through FireTuner; history goes through archived CSVs.Coach first, control on request. Do not autopilot a turn unless asked.
game_luastill rejects mutations unlessmutate=True; useplay_*for normal actions.Get better from real games. Keep findings that changed a decision; drop the rest. Snapshot history exists so later advice can say “science unchanged for 15 turns.”
Success looks like: you ask “what should I build in my capital and why?” and the answer names the actual queue, yields, and available districts; or “how has my science compared to the AI?” and you get a table from the logs.
Start the server
You need uv (Python 3.12 is installed per-project) and a Civ VI install that has been launched at least once so Logs/ and Cache/ exist.
cd ~/Projects/CivMCP
uv syncOne-shot checks (no MCP client)
uv run civmcp-smoke # FireTuner: needs Civ VI running, a game loaded, EnableTuner 1
uv run python -m unittest discover -s tests -v
uv run mcp dev src/civmcp/__init__.py # MCP inspector UIuv run civmcp is the stdio MCP server. Do not run it by hand in a normal terminal and type at it — an MCP client must spawn it.
Register with Claude Code (this machine)
Already done once as:
claude mcp add civmcp -- uv run --directory ~/Projects/CivMCP civmcpAfter you pull new tools/prompts, restart the MCP server (quit/reload Claude Code, or /mcp) so the client picks up the new list.
Other MCP clients
Point the client at stdio:
{
"mcpServers": {
"civmcp": {
"command": "uv",
"args": ["run", "--directory", "/Users/jonesdevlin/Projects/CivMCP", "civmcp"]
}
}
}Live reads (optional but needed for “what should I build?”)
Quit Civ VI.
In
~/Library/Application Support/Sid Meier's Civilization VI/Firaxis Games/Sid Meier's Civilization VI/AppOptions.txt, under[Debug], setEnableTuner 1.Launch the game, load a save. The Tuner listens on
127.0.0.1:4318(achievements are disabled while this is on).Confirm:
uv run civmcp-smoke.
Rules, logs, saves, and log-based coaching work without the Tuner. Live city/unit/map tools do not.
Usage
Typical loop:
Play a few turns (or load a save).
In the MCP client, ask in plain English (examples below). The model should call
coach_snapshot/coach_review_turnor thegame_*tools — you do not invoke Lua yourself.Take the advice in-game, or say “take control” / “do it” and the model will call
play_*. Repeat next turn.
Pace is scaled by game speed: Marathon turn N ≈ standard N/3. A one-city Marathon T28 game is still the ancient settler phase.
Example commands (what to type to the AI)
Coaching:
Review my turn. What should I do next?
Diagnose my science.
Diagnose expansion.
Explain Campus adjacency.
Explain why a Monument is the first building.
How does a science victory work from here?
What mistakes did I already make?
State (Tuner + loaded game):
What should I build in my capital and why?
What techs can I research right now?
List city-states and my envoys.
Preview combat: warrior at (x,y) vs the spear on the camp.
List my units and who is idle.
Any barbarians or camps near my cities?
What are the tiles around Constantinople? Where should I settle?
Who have I met and are we at war?
History / logs (game does not need to be open):
How has my science compared to the AI over the last 30 turns?
Show recent combats and eurekas.
List my saves.
Rules (always available after one Civ VI launch):
What does a Campus get from mountains and geothermal fissures?
Compare Swordsman and Man-At-Arms.
What techs do I need for Crossbowmen?
Look up Dromon.
If the model has MCP prompts available, these map directly:
You say | Prompt / tool |
“Review my turn” |
|
“Diagnose my economy / science / military / expansion” | prompt |
“Explain X” | prompt |
Tools
Tool | Source | What |
| filesystem | Where CivMCP looks for game data and what it finds. Archives engine CSVs on each call. |
| Tuner socket | Is the game reachable; current turn if a game is loaded. |
| rules DB | Tech / civic / unit / building / district / improvement / policy / government: cost, prereqs, yields, unlocks, eureka, adjacency, description. |
| rules DB | Full adjacency bonus table for a district. |
| rules DB | Side-by-side stats. |
| rules DB | Transitive tech/civic prerequisites with costs. |
| rules DB | Tables / columns. |
| rules DB | Read-only SELECT; localization attached as |
| engine CSVs | Per-turn science/culture/gold/faith/cities/score/… for you vs other majors. Survives launch truncation via |
| engine CSVs | Combat, meetings, envoys, eurekas, disasters, production-queue changes. |
|
| Turn, leader, civ, difficulty, speed, map size, timestamp. |
| Tuner Lua | Live turn, era, yields, government, policies, research/civic + turns left, era score. |
| Tuner Lua | Cities: pop, yields, housing, amenities, queue, districts, buildings, loyalty. |
| Tuner Lua | Units: type, position, HP, moves, charges, promotions, idle. |
| Tuner Lua | Relationship, war, grievances, alliances, agendas. |
| Tuner Lua | Visible enemy/barbarian units and barb camps (occupant if any). |
| Tuner Lua | One connection: overview, cities, units, alerts, camps, CS, tech/civic options, governors, trades, map. Prefer this for reviews. |
| Tuner Lua | Met CS: type, envoys, war, suzerain, tokens to send. |
| Tuner Lua | Legal next nodes with cost, turns, eureka/inspiration already popped. |
| Tuner Lua | What the city can produce, turns, gold buy cost. |
| Tuner Lua | Approximate melee % damage; warns if a CS is on a camp. |
| Tuner Lua | Appointed governors and leftover titles. |
| Tuner Lua | Outgoing routes vs capacity. |
| Tuner Lua | Tiles, unimproved resources, district hints, ASCII hex, settle scores. |
| Tuner Lua | Escape hatch; mutations rejected unless |
| Tuner Lua | One tile: terrain, resource, improvement, units. |
| Tuner write | Move, fortify, heal, skip, explore, found city, build improvement. |
| Tuner write | Replace a city's queue (Builder, Settler, Monument, …). |
| Tuner write | Set the current tech or civic. |
| Tuner write | Swap military/economic/diplomatic/wildcard cards. |
| Tuner write | Appoint and assign Liang / Pingala / … |
| Tuner write | Request end of turn. |
| logs + Tuner + sqlite | Record this turn; return pace targets, trends, findings. |
| same | Findings only ( |
Prompts
Prompt | What |
| Snapshot + history → at most 5 actions for this turn. |
| Economy / science / military / expansion (or all). |
| How a tech/unit/district works, tied to the current game. |
Resources
URI | What |
| Pace table (standard-speed turns) + speed/difficulty multipliers. |
| Common-mistakes checklist. |
| Science / culture / domination / religion / diplomacy checklist. |
| Stored per-turn snapshots ( |
Live Tuner tools need Civ VI running with a game loaded and EnableTuner 1. Engine logs, saves, and coaching-from-logs work without the game open. Marathon turn N is treated as ≈ standard N/3 so the coach does not demand four cities at turn 30.
Tests
uv run python -m unittest discover -s tests -vCiv VI on this Mac (Aspyr build 1.4.6)
Root: ~/Library/Application Support/Sid Meier's Civilization VI/
Path (under root) | What |
| Engine options. |
| Engine logs. ~40 per-turn CSVs ( |
| Full gameplay rules DB (318 tables). Rebuilt on launch. |
| Base-game text only ( |
| Manual saves; autosaves in |
| User mods folder (where the snapshot mod goes). |
Game install (read-only reference for Lua API examples):
~/Library/Application Support/Steam/steamapps/common/Sid Meier's Civilization VI/Civ6.app/Contents/Assets/Base/Assets/UI/
Available Tools
8 toolsciv_statusA
Report where CivMCP is looking for Civilization VI data and what it can see.
Inputs: no named parameters.
civ_tuner_statusB
Check whether the FireTuner socket is reachable and, if a game is loaded, read the current turn.
Inputs: no named parameters.
rules_adjacencyC
Adjacency bonus table for a district (e.g. "Campus", "Harbor", "DISTRICT_THEATER"): every rule with yield, tiles required, and the tech/civic that enables or obsoletes it.
Inputs: district (required).
rules_compareA
Side-by-side stats for two entries of the same kind, e.g. compare("unit", "Swordsman", "Man-At-Arms").
Inputs: a (required), b (required), kind (required).
rules_lookupB
Look up a technology, civic, unit, building, district, improvement, policy or government by English name or type key (e.g. "Campus", "TECH_WRITING"). Returns cost, prerequisites, yields, what it unlocks, eureka/inspiration trigger, adjacency rules, and the in-game description. kind narrows the search: technology, civic, unit, building, district, improvement, policy, government.
Inputs: name (required), kind.
rules_path_toB
Every technology or civic needed (transitively) to reach the target, with costs and eras.
Inputs: target (required).
rules_queryC
Run a read-only SELECT against the gameplay database. The localization DB is attached as loc:
JOIN loc.LocalizedText l ON l.Tag = t.Name AND l.Language = 'en_US' to get English names.
Inputs: sql (required), limit.
rules_schemaA
List the tables in the gameplay database, or the columns of one table.
Inputs: table.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a clear, distinct purpose: generic SQL query, game entity lookup, adjacency bonus rules, comparison, tech/civic path, schema introspection, and server status. No apparent overlap or ambiguity.
The majority use a consistent 'rules_' prefix, but two tools (civ_status, civ_tuner_status) deviate with a 'civ_' prefix. This is a minor inconsistency but still understandable.
With 8 tools, the set is well-scoped—neither too sparse nor overwhelming. Each serves a distinct function relevant to querying and exploring Civilization VI game data.
The tool set covers core CRUD-like operations (query, lookup, adjacency, compare, path) and system introspection (schema, status). It lacks obvious write/update operations, but given the read-only nature of the domain, it is reasonably complete.
Maintenance
Related MCP Connectors
Ask Claude, ChatGPT, or any MCP client about your game's players, retention, revenue, and win rates.
Make games with AI: one MCP server that connects your agent to Unity, Unreal and Godot editors.
Read-only MCP tools for AI agent discovery, structured resources, and NIULAI information.
Hosted MCP server for live public-data APIs and Skills for AI agents.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude to access real-time Civilization VI game data for strategic analysis, diplomatic intelligence, military assessments, and more via MCP.216MIT
- AlicenseAqualityDmaintenanceAn MCP server that lets LLM agents play full games of Civilization VI. It connects to a running game and provides tools for unit movement, city management, diplomacy, and more, all through the game's rule-enforcing APIs.76249MIT
- AlicenseNot gradedqualityBmaintenanceEnables any LLM to play Freeciv as a player through MCP tools and resources, with a graphical observer view.MIT
- AlicenseAqualityCmaintenanceEnables MCP-compatible AI agents to play full Civilization VI games by reading game state and issuing rule-enforced actions such as moving units, managing cities, conducting diplomacy, and ending turns.76MIT