Factorio Game Master
Provides restricted Docker Engine API access for a single Factorio server container, enabling container inspection, log retrieval, and restart operations.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Factorio Game Master — an MCP server for your Factorio server
An MCP server that turns Claude or ChatGPT into the game master of a Factorio server: it relays chat, runs admin commands, applies kid-friendly presets and keeps the server healthy — from a chat window or by voice ("who's online?", "tell the kids dinner is ready", "give me 50 iron plates", "save and restart the server").
Built for a family LAN server where one player is on a Nintendo Switch, so it bakes in a few strong opinions (all removable, see Customizing):
Vanilla only — mods and Space Age are refused; the mod list is read-only.
Version pinned (2.0.77, matching the Switch); restarts never upgrade the image.
Achievements are protected — Lua permanently disables achievements on a map, so every Lua call is gated behind a spoken human confirmation.
Restarts are polite — refused while anyone is online; players get a warning in chat first.
Kid-friendly — the system prompt and guide steer the agent's chat to be warm and simple.
How it works
Clients connect over Streamable HTTP (/mcp, also served at /):
claude.ai / Claude app / ChatGPT
│ MCP over Streamable HTTPS (behind your auth, e.g. Cloudflare Access)
▼
factorio-mcp (FastMCP, stateless, JSON responses)
├── RCON ─────────► Factorio server container (game console)
└── Docker API ──► inspect / logs / restart, for that one container onlyThe server is stateless and JSON-only, so it works well with hosted clients (claude.ai custom connectors, the Claude app, ChatGPT connectors). Voice mode works because every tool returns short, speakable text.
Related MCP server: minecraft-rcon-mcp
Tools
Tool | What it does |
| Overview; a console command's usage; |
| Who is playing right now |
| Version, players, map age, container state, uptime, latest save, achievements state |
| Chat to everyone, shown as |
| Private message to one player |
| Joins, leaves, chat, saves, commands — filtered or raw |
| Any console command ( |
| Run |
| Ready-made Lua actions (always day, speed boost, give items, ...) |
| The presets and their parameters |
|
|
| Save files, newest first |
| server-settings, map-gen/map-settings, adminlist, mod-list (secrets masked) |
| JSON-merge-patch a config file, with a timestamped backup |
| Save, restart, wait for RCON; refuses while players are online |
Plus the game_guide resource and prompt (the agent's manual: players, house rules,
console commands, a Lua cookbook) and a GET /healthz endpoint for container healthchecks.
Safety rails
Achievements gate.
run_lua/run_presetrefuse until called withconfirm_disable_achievements=true. The confirmation is recorded per map seed (state/achievements-disabled.json), so a new map re-arms the gate. On first confirm it sends a no-op/scfirst to absorb Factorio's "repeat the command to proceed" warning, so the real code never runs twice.Refused commands.
run_commandblocks/c,/sc,/mc(userun_lua), plus/quit,/cheat,/editorand/toggle-heavy-mode.Vanilla pin.
update_configrefusesmod-list; the server never upgrades the image.Docker access is one-way.
app/docker_api.pyallows exactly three operations (inspect, logs, restart) on exactly one hard-coded container name. No list, start, stop, exec or pull — even if the agent asks.Restart gate. Refuses while players are online (warns them in chat first) unless
force=true; saves before restarting; waits for RCON to come back.Config hygiene. Every
update_configkeeps afile.bak-YYYYmmdd-HHMMSSbackup; secrets are masked inread_config; writes are atomic (tmp file + rename) and validated before touching the original.Transport hardening. Stateless JSON-over-HTTP with DNS-rebinding protection; only
PUBLIC_HOSTS, localhost, and the container hostname are accepted. The app has no auth of its own — put a tunnel or reverse proxy with real auth (e.g. Cloudflare Access) in front of it.Audit trail. Every tool call (time, tool, args, short result) is appended to
logs/tool-calls.log(rotated at 1 MB × 5).
Deploying
You need:
a Factorio server container (e.g.
factoriotools/factorio) with RCON enabled and itsconfig/rconpwfile;its Docker network name (default compose project
factorio→factorio_default);Docker with the compose plugin.
Steps:
Clone and edit
docker-compose.yml:PUBLIC_HOSTS: the public hostname clients will use (or leave empty for localhost-only);the two
/srv/factoriovolume paths → your Factorio server's data directory;the Docker socket path (rootless Docker:
/run/user/<uid>/docker.sock);the external network name.
Build and start:
docker compose up -d --buildCheck:
curl http://127.0.0.1:8102/healthz→okExpose it through a tunnel or reverse proxy with authentication (e.g. cloudflared + Cloudflare Access). Never publish it as-is.
Add it to your client as a custom connector at
https://<your-host>/mcpand just talk to it: "who's online?", "what can you do?", "make it always day".
Tested with Factorio 2.0.77 and mcp 1.30.0 (FastMCP; the 2.x line renamed it).
Configuration
All via environment variables (defaults work with the compose file):
Variable | Default | Meaning |
|
| Listen port inside the container |
| (empty) | Comma-separated public hostnames for rebinding protection + CORS |
|
| Where the game listens for RCON |
|
| File containing the RCON password |
|
| The server's data dir (saves, config, mods) |
|
| Docker socket for status/logs/restart |
|
| The achievements-gate marker lives here |
|
| The tool-call audit log lives here |
Customizing
app/game_guide.md— the guide the agent reads (help('guide'), thegame_guideresource and prompt). Describe your players and house rules here; shipped with example playersalexandsam.app/presets.py— the ready-made Lua actions forrun_preset; add entries to thePRESETSdict.app/server.py—INSTRUCTIONS(the agent's system prompt) andPINNED_IMAGE(change the version pin if you're not matching a Switch).
Layout
├── Dockerfile # python:3.13-slim; the app idles at ~45 MB RAM
├── docker-compose.yml # example deployment next to a factorio server
├── requirements.txt # mcp==1.30.0 (FastMCP)
└── app/
├── server.py # tools, gates, HTTP transport
├── rcon.py # async Source-RCON client, one persistent connection
├── docker_api.py # restricted Docker Engine API client (one container)
├── presets.py # named Lua snippets
└── game_guide.md # the game master guide (resource + prompt)License
The Unlicense — released into the public domain. Use it, fork it, sell it, no attribution required.
This server cannot be deployed
Maintenance
Related MCP Connectors
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Safe folder access for ChatGPT and Claude: read, write and search files, risky tools opt-in.
Give Claude only the Google Drive files you choose. Every action logged.
Termalin's hosted MCP server. Claude, ChatGPT or any MCP client runs commands, moves files over SFTP, queries databases and reads server metrics and monitoring alerts on your servers, keylessly through Termalin Connectors: no SSH key is handed over and no inbound port is opened. Per-host command policy and an audit log. Needs a termal.in Pro or Team account (new accounts start with a 14-day Pro trial).
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceBidirectional chat bridge between Factorio and Claude Code via MCP protocol, enabling players to send /companion commands and receive AI responses.14MIT
- AlicenseAqualityDmaintenanceExposes Minecraft server commands via RCON as a tool, and optionally powers an in-game AI chat listener that answers player questions using Claude.2MIT
- AlicenseAqualityDmaintenanceEnables control and inspection of a Factorio 2.0 server via RCON, with tools for administration, player management, game state queries, and Lua execution.19ISC
- AlicenseNot gradedqualityBmaintenanceEnables AI clients like Codex and Claude Code to manage Minecraft servers through the Exaroton API, including status, logs, crash diagnostics, player management, and guarded server actions with confirmation.MIT