Warhammer Oracle

Warhammer 40K rules, unit stats, and game flow. An MCP server.

npm version npm downloads MIT Licence Node.js 18+ MCP Compatible warhammer-oracle MCP server

--- Ask your AI assistant about datasheets, stratagems, detachments, enhancements, keywords, phase sequences, wound math, and more. Covers Warhammer 40,000, Combat Patrol, and Kill Team. [![warhammer-oracle MCP server](https://glama.ai/mcp/servers/gregario/warhammer-oracle/badges/card.svg)](https://glama.ai/mcp/servers/gregario/warhammer-oracle) ## Installation ```bash npx warhammer-oracle ``` Or install globally: ```bash npm install -g warhammer-oracle ``` ## Configuration ### Claude Desktop Add to your `claude_desktop_config.json`: ```json { "mcpServers": { "warhammer-oracle": { "command": "npx", "args": ["-y", "warhammer-oracle"] } } } ``` ### Claude Code ```bash claude mcp add warhammer-oracle -- npx -y warhammer-oracle ``` ## Tools ### `lookup_unit` Look up a unit datasheet by name. Returns stat profiles, ranged and melee weapons, abilities, and keywords. ``` "Look up the Intercessor Squad datasheet" "What are the stats for a Leman Russ Battle Tank?" ``` **Parameters:** `unit_name` (required), `faction` (optional), `game_mode` (optional: `40k`, `combat_patrol`, `kill_team`) ### `lookup_keyword` Look up a keyword or rule. Returns the official definition, a plain English explanation, examples, and which game modes it applies to. ``` "What does Devastating Wounds do?" "Explain the Feel No Pain keyword" ``` **Parameters:** `keyword` (required), `game_mode` (optional) ### `lookup_phase` Look up a game phase by name. Returns step-by-step instructions and tips. ``` "Walk me through the Shooting phase" "How does the Firefight phase work in Kill Team?" ``` **Parameters:** `phase_name` (required), `game_mode` (optional, default: `40k`) ### `search_units` Search units by name, faction, or keywords. Returns a compact list (max 10 results) with faction, points, and keywords. ``` "Find all Necron units under 100 points" "Search for units with the Fly keyword" ``` **Parameters:** `query` (required), `faction` (optional), `max_points` (optional), `game_mode` (optional) ### `compare_units` Compare 2-4 units side by side. Shows full datasheets for each unit in a single response. ``` "Compare Intercessors vs Tactical Marines" "Compare the Leman Russ, Predator, and Hammerhead side by side" ``` **Parameters:** `units` (required, array of 2-4 unit names) ### `game_flow` Show the full turn sequence for a game mode, or highlight where you are in the turn and what comes next. ``` "Show me the 40K turn sequence" "I'm in the Shooting phase — what's next?" "Show the Kill Team turn sequence" ``` **Parameters:** `current_phase` (optional), `game_mode` (optional, default: `40k`) ### `lookup_stratagem` Look up a Warhammer 40,000 stratagem by name. Returns CP cost, phase timing, target, and effect. ``` "What does Fire Overwatch do?" "Show me the Command Re-roll stratagem" ``` **Parameters:** `name` (required), `faction` (optional), `phase` (optional), `detachment` (optional) ### `search_stratagems` Search stratagems by name, faction, phase, or detachment. Returns a compact list (max 10). ``` "What stratagems can I use in the Fight phase?" "Show me Gladius Task Force stratagems" ``` **Parameters:** `query` (required), `faction` (optional), `phase` (optional), `detachment` (optional) ### `lookup_detachment` Look up a detachment by name. Returns the detachment ability, available enhancements, and associated stratagems. ``` "Show me the Gladius Task Force detachment" "What does the Warhost detachment do for Aeldari?" ``` **Parameters:** `name` (required), `faction` (optional) ### `lookup_enhancement` Look up a character enhancement by name. Returns points cost, detachment, and effect. ``` "What does Adept of the Codex do?" "Show me Aeldari enhancements" ``` **Parameters:** `name` (required), `faction` (optional), `detachment` (optional) ### `lookup_ploy` Look up a Kill Team ploy by name. Returns type (strategic/tactical), CP cost, timing, and effect. ``` "What does the Bolster ploy do in Kill Team?" "Show me Legionaries ploys" ``` **Parameters:** `name` (required), `faction` (optional), `type` (optional: `strategic`, `tactical`) ### `wound_calculator` Calculate expected damage output for an attack profile against a target. Handles re-rolls, weapon keywords (Lethal Hits, Devastating Wounds, Sustained Hits, Torrent), invulnerable saves, and Feel No Pain. ``` "Calculate damage: 10 attacks, BS3+, S5 AP-1 D2 vs T4 Sv3+" "How much damage does a lascannon do to a Leman Russ?" ``` **Parameters:** `attacks`, `hit_skill`, `strength`, `toughness`, `armour_save`, `damage` (all required); `armour_penetration`, `invulnerable_save`, `feel_no_pain`, `reroll_hits`, `reroll_wounds`, `weapon_keywords`, `wounds_per_model`, `game_mode` (all optional) ## Data All data is embedded at build time — no network calls at runtime. | Category | Count | Source | |---|---|---| | 40K unit datasheets | 2,642 | [BSData/wh40k-10e](https://github.com/BSData/wh40k-10e) | | Kill Team operatives | 506 | [BSData/wh40k-killteam](https://github.com/BSData/wh40k-killteam) | | Detachments | 991 | BSData (auto-extracted) | | Enhancements | 3,908 | BSData (auto-extracted) | | Stratagems | 17 | Hand-curated (core + examples) | | Kill Team ploys | 14 | Hand-curated (universal + popular factions) | | Shared rules | 33 (40K) + 22 (KT) | BSData | | Curated keywords | 25 | Hand-written, plain English | | Game mode sequences | 3 | Hand-curated (40K, Combat Patrol, Kill Team) | ### Game modes - **Warhammer 40,000** (40k) — full-scale battles - **Combat Patrol** (combat_patrol) — smaller, starter-friendly format - **Kill Team** (kill_team) — squad-level skirmish game ## Development ```bash npm install npm run build npm test ``` To refresh unit data from BSData: ```bash npm run fetch-data npm run build ``` ## License MIT (for the MCP server code). Unit data sourced from the [BSData](https://github.com/BSData/wh40k-10e) community project. Game rules and army rules are the intellectual property of Games Workshop. This tool provides reference data for personal use during gameplay.