
HOI4 Agent Tools
io.github.klimPaskovPublished by GitHub account klimPaskovv4.11.0Updated Nov 7, 2026
Build HOI4 mods: focus trees, events, decisions, worlds, GUI previews, docs and AI balance.
Overview
An MCP server that lets a coding agent build and edit Hearts of Iron IV mods: focus trees, events, decisions, maps, previews and script fixes.
- What you can do
- Create and edit focus trees, events, decisions and technology folders in mod source
- Generate a new world map from a reference image, with provinces, states, terrain, cities, countries and supply
- Preview focus trees, windows, maps and technology folders before writing
- Look up rules in the game's documentation and analyze or repair broken script
- Tune AI weights and choices
- When to use it
- Useful when you are modding Hearts of Iron IV and want an agent to scaffold or repair mod files, generate a map, or check script against the game's documentation. Best suited to working inside a single mod folder opened as the agent's workspace.
- Requirements
- Local process installed from npm; Node.js 22.19 or later, or 24. Hearts of Iron IV must be installed for vanilla files, artwork and fonts. No configuration file is needed when started inside a mod folder; a setup command can write one for multiple mods or explicit game paths.
Installation
In SourceWeft
- Open HOI4 Agent Tools in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
HOI4 Agent Tools
An MCP server that helps coding agents build and edit Hearts of Iron IV mods.
[npm] [Node.js] [License] [Release] [Discord] [YouTube] [Ko-fi] [Issues]
Quick start · npm · Changelog · Contributing · Security
[Watch the HOI4 Agent Tools demo]
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.
What it does
Your agent can build and edit focus trees, events, decisions and maps, and generate a new world.
For a new map, give it a cleaned local reference image and preview the interpreted geography before writing. The map workflow creates provinces, states, terrain, cities, countries, supply and a provisional starting scenario. Reviewed names and masks refine ambiguous artwork; offline validation is separate from native campaign acceptance. 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.
Quick start
-
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:
-
Print the client configuration:
Paste the
globalInstallblock into a JSON client such as Claude Code, Claude Desktop or Cursor, or thecodexTomlGlobalblock into Codex'sconfig.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).
Examples
[A large focus tree rendered from mod source]
Each pair shows a capture from the game next to the server's preview of the same source.
See more in the examples gallery.
Tools
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.
FAQ
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.
Configuration
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.
Documentation
- Setup and configuration
- Examples and tool reference
- Guides: local references, focus trees, scripted GUIs, maps, events, technology, AI weights and timing, decisions and impact, mechanic and package tests
- Background jobs and HTTP
- Development, changelog and security policy
- Documentation index
Development
See the contributing guide and the development guide.
License
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: README.md at commit 3f035b2
Tools
0Version history
27- v4.11.0LatestNov 7, 2026
- v4.8.0Nov 6, 2026
- v4.7.0Nov 3, 2026
- v4.6.4Nov 1, 2026
- v4.6.2Oct 31, 2026
- v4.6.1Oct 26, 2026
- v4.5.0Oct 25, 2026
- v4.4.0Oct 25, 2026
- v4.3.0Oct 19, 2026
- v4.2.0Oct 19, 2026
- v4.1.0Oct 15, 2026
- v4.0.5Oct 15, 2026
- v4.0.4Oct 14, 2026
- v4.0.3Oct 13, 2026
- v4.0.1Oct 12, 2026
- v4.0.0Oct 11, 2026
- v3.9.0Oct 6, 2026
- v3.8.1Oct 5, 2026
- v3.8.0Oct 4, 2026
- v3.7.0Oct 4, 2026
- v3.6.0Sep 27, 2026
- v3.5.1Sep 27, 2026
- v3.4.1Sep 25, 2026
- v3.4.0Sep 25, 2026
- v3.3.0Sep 20, 2026
- v3.2.0Sep 20, 2026
- v3.0.9Sep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts