explaingit

cpntodd/hoi4-mcp

Analysis updated 2026-05-18

2PythonAudience · vibe coderComplexity · 3/5LicenseSetup · moderate

TLDR

An MCP server that gives AI coding assistants deterministic tools and a learning memory for modding the game Hearts of Iron IV.

Mindmap

mindmap
  root((HOI4-MCP))
    What it does
      Gives AI modding tools
      Deterministic game data
      Prevents hallucinated IDs
    Tech stack
      Python
      SQLite
      MCP server
    Use cases
      Search mod files fast
      Validate script syntax
      Parse error logs
    Learning system
      Records mistakes as rules
      Loads rules each session
      Shares rules via git
    Audience
      HOI4 modders
      AI assistant users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Let an AI assistant look up a mod's full file structure in one call instead of searching dozens of files.

USE CASE 2

Validate Clausewitz script syntax and catch bracket mistakes before launching the game.

USE CASE 3

Check whether an ID for a focus or event already exists to avoid silent overwrites.

USE CASE 4

Save corrections as permanent rules so the AI stops repeating the same modding mistakes.

What is it built with?

PythonSQLiteMCP

How does it compare?

cpntodd/hoi4-mcp0-bingwu-0/live-interpreter010zx00x1/faresnipe
Stars222
LanguagePythonPythonPython
Setup difficultymoderatemoderateeasy
Complexity3/52/52/5
Audiencevibe codergeneralgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires Python 3.10+ and building a local vanilla game database before first use.

You can use, modify, and share this freely, but any modified or shared version must also be released as open source under the same license.

In plain English

HOI4-MCP is a tool that helps an AI coding assistant become better at modding the video game Hearts of Iron IV. If you have ever tried to get an AI to help you write a game mod, you know the problem: the AI ends up guessing at IDs, miscounting brackets in the game's script files, and making the same mistakes over and over because it has no memory between sessions. This project tries to fix that. It works as an MCP server, which is a small program that gives an AI assistant extra tools it can call instead of just reading and writing text blindly. With this server running, the AI can look up an entire mod's structure in one call, search across mod files for text, check whether an ID is already in use before creating a new one, and validate the game's script syntax before you even launch it. It can also read the game's error log and sort the problems into categories so fixing them is faster. The standout feature is a learning system. When the AI makes a mistake and gets corrected, that correction can be saved as a permanent rule. The next time a session starts, those rules are loaded automatically, so the same error should not happen again. Rules can also be exported and shared with a modding team through git, so a whole group benefits from lessons one person already learned. Under the hood it includes a parser for the game's Clausewitz script format, a small database of vanilla game data such as focuses and events, and offline reference material from the Paradox wiki. It is written in Python, needs version 3.10 or newer, and the project reports 101 passing tests. It works on Linux, macOS, and Windows. This is a niche tool built specifically for people who mod Hearts of Iron IV using AI coding assistants like Claude, Cursor, or similar tools. It is not meant for general software development. The project is licensed under GPL-3.0, so any modified or shared versions must also stay open source under the same license. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Use the HOI4-MCP server to show me the full index of my mod so I can see what already exists.
Prompt 2
Validate the syntax of my focus tree file before I launch Hearts of Iron IV.
Prompt 3
Look up the vanilla event ID for GER_drives_to_the_west so I don't create a conflicting one.
Prompt 4
Read my latest error.log and tell me what categories of mistakes are showing up.
Prompt 5
Record this correction as a learned rule so future sessions don't repeat it.

Frequently asked questions

What is hoi4-mcp?

An MCP server that gives AI coding assistants deterministic tools and a learning memory for modding the game Hearts of Iron IV.

What language is hoi4-mcp written in?

Mainly Python. The stack also includes Python, SQLite, MCP.

What license does hoi4-mcp use?

You can use, modify, and share this freely, but any modified or shared version must also be released as open source under the same license.

How hard is hoi4-mcp to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is hoi4-mcp for?

Mainly vibe coder.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.