Repository navigation
Using MCP Clients
fai-mcp is an MCP server over stdio. It gives any MCP client the same 15 tools the in-game agent uses, so you can
plan and build from Claude Desktop, Cursor, Claude Code or another client. The client's own model does the thinking;
no API key is needed on the commander's side.
The game must be running with RCON and the mod enabled, as for the agent: see Command-Line Setup.
fai setup --write-mcp claude-desktop # or: --write-mcp cursorThis adds a server named factorio to the client's config file and keeps any servers already there:
| Client | Config file |
|---|---|
| Claude Desktop on Windows | %APPDATA%\Claude\claude_desktop_config.json |
| Claude Desktop on macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Claude Desktop on Linux | ~/.config/Claude/claude_desktop_config.json |
| Cursor | ~/.cursor/mcp.json |
Restart the client afterwards. Without --write-mcp, fai setup prints the same snippet and a ready-made
Claude Code command for you to copy.
Point a stdio MCP server at fai-mcp and tell it where the config is:
{
"mcpServers": {
"factorio": {
"command": "C:\\path\\to\\fai-mcp.exe",
"args": [],
"env": { "FAI_CONFIG": "C:\\path\\to\\server\\config.toml" }
}
}
}Instead of FAI_CONFIG you can pass the RCON settings directly, for example FAI_RCON_PASSWORD_FILE pointing at
server/rcon.pw, plus FAI_RCON_HOST and FAI_RCON_PORT for a remote server. See Configuration.
claude mcp add factorio --env FAI_CONFIG=/path/to/server/config.toml -- /path/to/fai-mcpAsk the client something like "Show me the factory dashboard" or "Plan 30/min red science near the starting area".
Good first tools are world_observe for a snapshot and calc_ratio for ratios, which do not build anything.
plan_factory can plan only or also build, and execute_plan runs plans step by step. Anything they build follows
the build mode and safety rules in Playing with the AI.
All tools and parameters: docs/TOOLS.md.
Repository · Releases · Issues · MIT licence · Factorio is a trademark of Wube Software Ltd. This project is not affiliated with Wube Software.
Getting started
Playing
Developing
中文