by lmwilki
An MCP server that lets LLM agents play Civilization VI.
# Add to your Claude Code skills
git clone https://github.com/lmwilki/civ6-mcpLast scanned: 7/1/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-07-01T08:13:33.102Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}civ6-mcp is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by lmwilki. An MCP server that lets LLM agents play Civilization VI. It has 105 GitHub stars.
Yes. civ6-mcp passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/lmwilki/civ6-mcp" and add it to your Claude Code skills directory (see the Installation section above).
civ6-mcp is primarily written in Python. It is open-source under lmwilki on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh civ6-mcp against similar tools.
No comments yet. Be the first to share your thoughts!
An MCP server that lets LLM agents play full games of Civilization VI.
Connect any MCP-compatible client — Claude Code, Codex, Gemini CLI, or your own — to a running Civ 6 game. The agent reads game state, moves units, manages cities, conducts diplomacy, and ends turns, all through the game's own rule-enforcing APIs. No cheats, no vision model required.
76 tools covering the full gameplay loop:
Every turn, end_turn takes before/after snapshots and reports what happened: units damaged, cities grew, production completed, threats spotted near your cities.
Enable the FireTuner debug interface and configure recommended settings:
| Setting | Value | Why |
|---|---|---|
| Tuner | Enabled | Required — opens the TCP debug port the MCP server connects to. Disables achievements. |
| Auto End Turn | Disabled | The agent controls when turns end. Auto-end interferes with the blocker resolution flow. |
| Windowed mode | Recommended | Lets you watch the game while the agent plays. Required for OCR-based save loading. |
Windows: All three settings are available in the in-game Options menu. The Tuner setting appears as "Tuner (disables achievements)" under gameplay options.
macOS: The Tuner setting is not exposed in the menu. Edit AppOptions.txt directly and set EnableTuner 1:
~/Library/Application Support/Sid Meier's Civilization VI/Firaxis Games/Sid Meier's Civilization VI/AppOptions.txt
Linux: Same as macOS — edit AppOptions.txt directly and set EnableTuner 1:
~/.local/share/aspyr-media/Sid Meier's Civilization VI/AppOptions.txt
Install the Civ 6 SDK — the tuner server is part of the SDK, not the base game:
Important notes:
FireTuner.exe (the SDK's GUI tool) before running civ6-mcp — the game only allows one tuner connection at a timeCiv6 process launched via Steam Linux Runtime (scout-on-soldier).Restart Civ 6. The game will listen on TCP port 4318 for connections.
git clone https://github.com/lmwilki/civ6-mcp.git
cd civ6-mcp
uv sync
For GUI automation features (screenshot, OCR-based menu navigation):
# macOS
uv pip install 'civ6-mcp[launcher-macos]'
# Windows (uses built-in Windows OCR — no external binaries needed)
uv pip install 'civ6-mcp[launcher-windows]'
# Linux (Ubuntu/Debian)
sudo apt install xdotool tesseract-ocr
uv pip install 'civ6-mcp[launcher-linux]'
With Civ 6 running and a game loaded:
uv run python scripts/test_connection.py
You should see a successful handshake and a list of Lua states (GameCore_Tuner, InGame, etc.).
The server runs over stdio. Point your client at it:
The repo includes .mcp.json — detected automatically:
cd civ6-mcp
claude
Add to your config file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json{
"mcpServers": {
"civ6": {
"command": "uv",
"args": ["run", "--directory", "/path/to/civ6-mcp", "civ-mcp"]
}
}
}
Add to .codex/config.toml in the project root:
[mcp_servers.civ6]
command = "uv"
args = ["run", "--directory", "/path/to/civ6-mcp", "civ-mcp"]
Add to .gemini/settings.json in the project root:
{
"mcpServers": {
"civ6": {
"command": "uv",
"args": ["run", "--directory", "/path/to/civ6-mcp", "civ-mcp"]
}
}
}
The server speaks stdio JSON-RPC:
uv run civ-mcp
Load a game in Civ 6, connect your client, and try:
Play my Civ 6 game. Start by getting an overview, then check units and
cities, and play through the turn.
The agent will orient with get_game_overview, scan the map for threats, move units, set production and research, handle diplomacy, and end the turn.
Civilization VI is a compelling environment for evaluating LLM strategic reasoning. Games run 300+ turns with compounding decisions, incomplete information, and multiple competing objectives — a significant step up from single-turn or short-horizon tasks.
The MCP interface provides a clean abstraction: the model receives narrated game state as text and responds with tool calls. All game rules are enforced by the engine. A companion web app lets you replay sessions turn by turn.
Claude / Any MCP Client
| stdio (JSON-RPC)
v
MCP Server (Python) <- 70+ tools
|
| Generates Lua code at runtime
| TCP :4318
v
Civilization VI <- Game is the TCP server
The server maintains a persistent TCP connection to Civ 6 via the FireTuner debug protocol. It generates Lua code, executes it inside the game's two Lua VMs (GameCore for reading state, InGame for issuing commands), parses the output, and returns narrated text to the LLM.
The repo includes an AGENTS.md playbook (symlinked as CLAUDE.md for Claude Code) with detailed instructions for agents: turn loop, combat, diplomacy, common pitfalls. See the devlog for the full development story, including reverse-engineering the FireTuner protocol and the many API quirks discovered along the way.
MIT