Rhoiscribe

Created By
czxieddan8 hours ago
Local MCP server for Hearts of Iron IV modding agents
Overview
RHoiScribe

RHoiScribe

Local MCP server for Hearts of Iron IV modding agents

简体中文 | Русский | 日本語

GitHub Stars License Rust MCP

If RHoiScribe helps your modding workflow, starring the repository helps other HOI4 mod authors find it.

RHoiScribe gives Codex, Claude Code, and other MCP-compatible clients a local HOI4 modding reference layer plus tools for generating game-readable files.

The goal is simple: reduce wasted agent work caused by repeated web searches, stale assumptions, unsafe file paths, missing localisation encoding, and Paradox script that looks plausible but does not load in game.

Environment

AreaValue
Server transportMCP over stdio
ImplementationRust 2024
Build toolCargo
Primary clientsCodex, Claude Code, MCP-compatible clients
Runtime networkNot required for bundled prompts, resources, and tools
Modding targetHearts of Iron IV local mods

Who It Is For

  • Mod authors who want AI agents to generate HOI4 content with better local context.
  • Agent workflows that need prompts, resources, and tools available through one MCP server.
  • Offline or low-search development sessions where the agent should read bundled HOI4 guidance before writing files.
  • Teams that want generated content to follow predictable mod-root paths and reviewable output shapes.

What Agents Get

Prompts

Agents can use built-in prompts for:

  • mod feature planning
  • HOI4 script writing
  • localisation writing
  • GUI, GFX, and scripted GUI work
  • generated-content review

Prompt names currently include hoi4_mod_planner, hoi4_script_writer, hoi4_localisation_writer, hoi4_gui_assistant, and hoi4_review.

Resources

Agents can read local resources instead of starting from a blank prompt:

  • rhoiscribe://hoi4/latest-update
  • rhoiscribe://hoi4/knowledge/catalog
  • rhoiscribe://hoi4/knowledge/<topic_id>

The knowledge catalog is structured for agent use. Topics contain category, file types, tags, syntax examples, relationships to other HOI4 systems, validation guidance, and source references. Current coverage includes script basics, scopes, triggers, effects, modifiers, variables, MTTH variables, arrays, localisation, scripted localisation, scripted triggers/effects, GUI, scripted GUI, focuses, events, detailed on_action scope families, decisions, missions, ideas, characters, history, map files, technology, equipment, units, AI, diplomacy, game rules, defines, bookmarks, audio, and common loading errors.

Tools

Agents can call tools for repeatable generation and validation:

  • generate_localisation_batch
  • generate_focus_batch
  • generate_event_batch
  • generate_decision_batch
  • search_hoi4_knowledge
  • validate_hoi4_paths
  • format_paradox_script

Generation tools support dry-run previews. In write mode they require an output_root and write paths relative to the target mod root. Knowledge search returns matching topic IDs and MCP resource URIs for queries such as mtth variables, decision mission blocks, or on_actions FROM.FROM.

Quick Start

Build the server:

cargo build --release

Use the release binary in your MCP client:

<ABSOLUTE_PATH_TO_RHOISCRIBE>\target\release\rhoiscribe.exe

Linux and macOS clients should use:

<ABSOLUTE_PATH_TO_RHOISCRIBE>/target/release/rhoiscribe

Run it directly only when you want to start the stdio MCP server by hand:

.\target\release\rhoiscribe.exe

For Codex, Claude Code, and generic MCP configuration examples, see docs/client-setup.md.

MCP Surface

After the client starts RHoiScribe, the agent can use standard MCP methods:

  • prompts/list
  • prompts/get
  • resources/list
  • resources/read
  • tools/list
  • tools/call

Example resource read:

rhoiscribe://hoi4/knowledge/scripted_gui.dynamic_lists

Example tools/call arguments for a localisation dry run:

{
  "language": "l_simp_chinese",
  "file_stem": "common/autonomy/CHI",
  "key_prefix": "CHI",
  "entries": [
    {
      "id": "industrial_recovery",
      "title": "Industrial Recovery",
      "description": "Rebuild the industrial base."
    }
  ],
  "dry_run": true
}

Write mode adds a mod output root:

{
  "language": "l_simp_chinese",
  "file_stem": "common/autonomy/CHI",
  "entries": [
    {
      "id": "industrial_recovery",
      "title": "Industrial Recovery"
    }
  ],
  "dry_run": false,
  "output_root": "<MOD_OUTPUT_ROOT>"
}

The generated localisation file is written with UTF-8 BOM when write mode is enabled. Use file_stem values such as common/autonomy/CHI, or complete mod-relative paths such as localisation/simp_chinese/common/autonomy/CHI_l_simp_chinese.yml, when the user's mod already organizes localisation in nested folders.

Output Model

Generation tools return structured file plans:

{
  "dry_run": true,
  "files": [
    {
      "path": "localisation/simp_chinese/common/autonomy/CHI_l_simp_chinese.yml",
      "encoding": "utf-8-bom",
      "summary": "HOI4 localisation file"
    }
  ],
  "messages": ["dry-run only; no files were written"]
}

Paths are mod-relative and can use nested HOI4-readable folders when they match the user's workspace. Unsafe paths, drive-prefixed paths, and traversal attempts are rejected before writing.

Server Config

{
  "mcpServers": {
    "rhoiscribe": {
      "command": "<ABSOLUTE_PATH_TO_RHOISCRIBE>\\target\\release\\rhoiscribe.exe",
      "args": []
    }
  }
}
Project Info
Created At
8 hours ago
Updated At
8 hours ago
Author Name
czxieddan
Star
-
Language
-
License
-
Category

Recommend Servers

View All
Thousand Api

2 hours ago
Hellogrowthcrm

18 hours ago
GovQL
@Alex Stout

# govql-mcp-server An MCP (Model Context Protocol) server for [GovQL](https://govql.us) — gives AI clients like Claude Desktop, Claude Code, and Cursor direct access to the US Congressional GraphQL API at [api.govql.us/graphql](https://api.govql.us/graphql) without bespoke HTTP wiring. For the design rationale (why FastMCP-Python, the passthrough+curated philosophy, roadmap through v0.4), see [design.md](https://github.com/govql/govql/blob/main/mcp-server/docs/design.md). ## What you can do with it Ask an agent questions like: - *"How did Vermont's two senators vote on the most recent nomination?"* - *"Which legislators in the 118th Congress switched parties during their service?"* - *"Compare Senator Sanders' voting record to Senator Murkowski's on cloture votes in the most recent Congress."* The agent picks the right tool, writes the GraphQL query against the live schema, and parses the response — no manual API wrangling. ## Install The server runs as a per-client subprocess over stdio. Pick your client: ### Claude Desktop Edit `claude_desktop_config.json` (Settings → Developer → Edit Config): ```json { "mcpServers": { "govql": { "command": "uvx", "args": ["govql-mcp-server"] } } } ``` Restart Claude Desktop. The `govql` tools appear in the tools panel. ### Claude Code Add to `.mcp.json` in your project (or `~/.mcp.json` for global): ```json { "mcpServers": { "govql": { "command": "uvx", "args": ["govql-mcp-server"] } } } ``` ### Cursor Settings → MCP → Add Server. Use the same `command` / `args` as above. ### Other clients Any MCP-compatible client that supports stdio servers will work. The command is `uvx govql-mcp-server` with no required arguments. ## Tools | Tool | Purpose | |---|---| | `execute_graphql` | Run any GraphQL query against the GovQL endpoint. Returns the result plus an `last_ingest` timestamp so the agent can reason about data freshness. | | `list_types` | Returns the names and kinds of every type in the GovQL schema. Optional `kind` filter (`"OBJECT"`, `"INPUT_OBJECT"`, `"ENUM"`, etc.) to narrow further. Start here when you don't know what's queryable. | | `describe_type` | Returns one type's full details — fields, arg signatures, input fields, enum values. Call after `list_types` to learn the shape of a specific type before writing a query. | ## Configuration All env vars are optional — the package is zero-config for end users. | Env var | Default | Purpose | |---|---|---| | `GOVQL_ENDPOINT` | `https://api.govql.us/graphql` | Endpoint to query. Override to point at a local dev stack. | | `GOVQL_TIMEOUT_MS` | `30000` | Per-request HTTP timeout. | | `LOG_LEVEL` | `INFO` | Logging level. Logs go to stderr only (stdout is reserved for the MCP transport). | ## Limits (enforced by the upstream API) - Max query depth: 10 - Max query complexity: ~10 billion points (`first: N` multiplies child cost by N — keep page sizes reasonable on deeply nested queries) - Rate limit: 100 requests / 60 s per source IP A depth or complexity violation surfaces as a GraphQL `errors` entry in the tool response so the agent can adjust and retry. ## Data freshness Every `execute_graphql` response includes a `last_ingest` ISO timestamp. Vote data refreshes hourly; legislator data refreshes daily. ## Status Version 0.1.0 ships three foundational tools: a GraphQL passthrough (`execute_graphql`) and two narrow schema-discovery tools (`list_types`, `describe_type`). Curated higher-level tools (`find_legislator`, `get_voting_record`, `compare_voters`, etc.) are planned for subsequent releases — see [design.md](https://github.com/govql/govql/blob/main/mcp-server/docs/design.md) for the roadmap. ## Links - [GovQL project site](https://govql.us) - [GraphQL API](https://api.govql.us/graphql) - [Source / issues](https://github.com/govql/govql)

a day ago