Build HOI4 mods: focus trees, events, decisions, worlds, GUI previews, docs and AI balance.
An MCP server that helps coding agents build and edit Hearts of Iron IV mods. Make focus trees, events and decisions. Edit maps and generate a new world. Preview windows, trees and maps, find the right rule in the docs, fix broken script and balance AI choices.
Your agent can build and edit focus trees, events, decisions and maps, and generate a new world. It previews focus trees, technology folders, windows and maps, finds the right rule in the game's documentation, fixes broken script and tunes AI choices. You describe what you want; the agent picks the right tools.
Install Node.js 22 (22.19 or later) or 24, and keep Hearts of Iron IV installed for vanilla files, artwork and fonts.
Install the server:
npm install --global hoi4-agent-tools
Print the client configuration:
hoi4-agent-tools-setup --print-client-config
Paste the globalInstall block into a JSON client such as Claude Code, Claude Desktop or Cursor, or the codexTomlGlobal block into Codex's config.toml.
Open your mod folder as the agent's workspace and tell it what you want to build or fix.
The setup guide covers several mods, explicit game paths, local wiki snapshots and troubleshooting with --discover and --diagnose.
Watch the Agent Tools demo or use HOI4 Mod Setup to install and connect the server for your mod. Part of the HOI4 modding toolkit with Agentic HOI4 Modding (skills and instructions for your agent) and HOI4 Live Tools (testing in the running game).
Each pair shows a capture from the game next to the server's preview of the same source.
| In game | Server preview |
|---|---|
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
See more in the examples gallery.
The server gives your agent previews, documentation, script analysis and editing tools. The agent combines them with its file editor to build events and decisions, repair scripts and adjust AI weights. The tool reference lists exact names, arguments and results for integrations.
Where do edits go? Changes are written to your mod folder; use Git to review or undo them.
Does it run the game? No. Previews come from mod source; test gameplay in HOI4 to see live clicks, AI choices and timing.
Started inside a mod folder, the server needs no configuration file.
hoi4-agent-tools-setup --init writes one when you work on several mods or the game is not found automatically.
For remote or shared use, hoi4-agent-tools-http serves the same tools over HTTP with tokens or OAuth.
See the configuration reference and the HTTP guide.
npm ci
npm run check
See the contributing guide and the development guide.
Apache-2.0; see LICENSE and the third-party notices. Hearts of Iron IV artwork belongs to Paradox Interactive; this project is unaffiliated with Paradox Interactive. The in-game captures were supplied for these comparisons.
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y hoi4-agent-toolsMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-klimpaskov-hoi4-agent-tools": {
"command": "npx",
"args": [
"-y",
"hoi4-agent-tools"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referencehoi4-agent-toolsnpmHOI4 Agent Tools works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.