factorio-mcp

module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2026 License: MIT

README

factorio-mcp

CI codecov Quality Gate Status Go 1.26 MIT License

A Claude Code plugin that lets Claude play Factorio 2.0 (base game, no Space Age) and work toward launching a rocket. Claude perceives live game state over RCON, reasons about it, and acts — under the real game economy, so placing a building consumes a crafted item and crafting and research take real time and ingredients.

Factorio can't run in CI, so setup is a manual path on your own machine.

1. Install the companion mod

Copy or symlink mod/factorio_mcp into your Factorio mods folder:

OS Mods folder
Windows %APPDATA%\Factorio\mods
macOS ~/Library/Application Support/factorio/mods
Linux ~/.factorio/mods
ln -s "$(pwd)/mod/factorio_mcp" "<MODS_DIR>/factorio_mcp"
# or package a zip: just mod-zip

Start Factorio, open Mods, enable Factorio MCP Bridge, restart if asked.

2. Enable RCON

Add to config.ini in Factorio's config/ folder:

[other]
local-rcon-socket=127.0.0.1:27015
local-rcon-password=changeme

3. Host a game

Multiplayer → Host new game: freeplay, peaceful / no enemies, Space Age off. Hosting is what opens the RCON socket — single-player does not.

4. Run

brew install danielriddell21/tap/factorio-mcp

export FACTORIO_RCON_PASSWORD=changeme
factorio-mcp

Or from a clone: just build && ./bin/factorio-mcp. With the plugin installed, .mcp.json launches the binary automatically as long as FACTORIO_RCON_PASSWORD is set.

Env var Default Meaning
FACTORIO_RCON_HOST 127.0.0.1 RCON host
FACTORIO_RCON_PORT 27015 RCON port
FACTORIO_RCON_PASSWORD (required) RCON password
FACTORIO_MCP_ALLOW_EVAL (unset) Set to enable the eval cheat tool

Ask Claude for factorio_get_player_state — if it returns your position, the Claude → MCP → RCON → mod chain is live.

Troubleshooting

  • mod_not_loaded — the mod isn't enabled in the active save.
  • Connection errors — RCON off, wrong port/password, or the game isn't hosted.
  • missing item to place — legit economy: craft or obtain the item first.

Requires Go 1.26+.

Directories

Path Synopsis
cmd
factorio-mcp command
Command factorio-mcp is an MCP server that lets Claude play Factorio by reading game state and issuing high-level actions over RCON, routed through the factorio_mcp companion mod.
Command factorio-mcp is an MCP server that lets Claude play Factorio by reading game state and issuing high-level actions over RCON, routed through the factorio_mcp companion mod.
internal
config
Package config resolves runtime configuration for the Factorio MCP server from environment variables, with optional flag overrides handled by callers.
Package config resolves runtime configuration for the Factorio MCP server from environment variables, with optional flag overrides handled by callers.
factorio
Package factorio turns typed calls into one-line RCON commands routed through the factorio_mcp companion mod, and decodes the mod's JSON envelope back into Go values.
Package factorio turns typed calls into one-line RCON commands routed through the factorio_mcp companion mod, and decodes the mod's JSON envelope back into Go values.
rcon
Package rcon provides a Factorio-aware wrapper around a Source RCON connection.
Package rcon provides a Factorio-aware wrapper around a Source RCON connection.
tools
Package tools registers the MCP tool surface that Claude uses to perceive and act on a running Factorio game.
Package tools registers the MCP tool surface that Claude uses to perceive and act on a running Factorio game.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL