theEngine includes a zero-LLM-math Model Context Protocol (MCP) and OpenAPI 3.1.0 server (mcp-combat/) built on the exact same TypeScript rules core (shared/genesis-rules/) that powers Caudex Machina (/machina/). AI Game Masters, autonomous aiPC squad companions, IDE agents, and custom apps can execute canonical Caudex Regulum character creation, Character Life survival, 5-step hit-location combat, and High-DWarp astrogation without hallucinating dice math or table lookups.

Core Guarantees

  • Zero LLM Math + mathAudit: Every percentile target, table lookup, armor soak, and state transition runs in deterministic TypeScript and returns a structured mathAudit trace (rollsUsed, rollSource, tablesConsulted, modifiers, formulas, effectiveTarget).
  • Hybrid Tabletop Dice (manualRolls & rngSeed): Pass physical d100 rolls from your table via manualRolls: [35, 72], pass rngSeed: "session-42" for reproducible PRNG sequences, or omit both for live server rolls.
  • Dual-Mode State (Zero Auth Required or Live Firestore Sync): Run 100% locally/statelessly with JSON state pass-through or local disk persistence (CAUDEX_STATE_FILE) and zero Firebase credentials, or enable optional firestore_sync to mirror character, squad, and encounter updates live into /machina/.

Quickstart & Transports

Clone the monorepo from GitLab (theengine-public/interesting-octopus) and build the server once:

Build mcp-combat from source:
git clone https://gitlab.com/theengine-public/interesting-octopus.git
cd interesting-octopus/mcp-combat
npm install
npm run build

1. Local stdio Transport (Claude Desktop, Cursor, Antigravity)

Register the compiled stdio entrypoint in your MCP client configuration (see mcp-combat/mcp-config.json in the repository):

MCP client configuration (mcp_config.json / claude_desktop_config.json):
{
  "mcpServers": {
    "theEngine": {
      "command": "node",
      "args": ["/ABS/PATH/TO/interesting-octopus/mcp-combat/dist/stdio.js"]
    }
  }
}

2. Streamable HTTP & OpenAPI 3.1.0 Transport (Remote Agents & Actions)

Launch the HTTP service for remote agent runtimes, multi-agent aiPC orchestrators, or ChatGPT Custom Actions:

Start the Streamable HTTP & REST server (defaults to port 8787):
cd mcp-combat
PORT=8787 npm run start:http
  • POST /mcp (plus GET /mcp, DELETE /mcp) — MCP Streamable HTTP endpoint.
  • GET /openapi.json — Full OpenAPI 3.1.0 schema for importing into agent frameworks and Custom Actions.
  • POST /api/tools/:toolName — Direct JSON REST execution for any of the 23 tools (accepts optional Authorization: Bearer <firebase-id-token>).
  • GET /api/resources — JSON snapshot of all 12 canonical machina://* and genesis://* rule tables and catalogs.
  • GET /llms.txt & GET /health — Service discovery summary and session health check.

Connecting aiPC Companions to theEngine

External agents can pilot aiPC Squad Companions alongside human players in three steps:

  1. Generate or Load an aiPC Operative: Call chargen_create_character with controlMode: "aiPC", one of the five canonical Tactical Doctrines (balanced, medic_support, cautious_recon, vanguard, bodyguard), and an optional aiPersona directive—or register an existing sheet in a squad via squad_manage_state.
  2. Run Adventure & Survival Loops: Initialize a canonical or custom module with adventure_initialize_session, resolve environmental checks via character_life_* tools, and advance milestones with adventure_advance_milestone.
  3. Escalate & Sync Tactical Combat: Call adventure_escalate_to_combat (mode: "escalate") to launch a 5-step machina_* encounter, resolve turns deterministically from Step 1 Surprise through Step 5 Segment Trauma, and sync wounds, ammo, and Performance Points back to the squad via mode: "sync_outcome" (with optional firestore_sync for live browser visibility in /machina/combat and /machina/teams).

Deterministic Tool Inventory (23 Tools)

Character Generation & Star Travel (2 Tools)

  • chargen_create_character — Full Chapter 1 Steps 1–15 character creation (rolled or racial_average, Table #1.4 Appearance, CO-scaled Table #1.5 Damage Points, Encultured skills with Krane sex split, Table #1.8 I.G.A.L. courses, Xeno-Disciplines check, and aiPC doctrine).
  • flight_calculate_transit — 3D Euclidean star-system distance, DeltaRatio drive tuning, DWarp transit duration, G-dampener acceleration/deceleration, and Micro-Singularity Crunch Hazard alert (> 1.39e-8).

Character Life & Progression (6 Tools)

  • character_life_attribute_check — Single or opposed Attribute checks, Encumbrance Efficiency, Limb Ability Percentage (AP), and +1 ATTR Performance Point ticks.
  • character_life_skill_check — Procedures 1 (Simple), 2 (Table #2.1), and 3 (Xeno-Disciplines + mandatory Focus roll), turn durations, heat/AP modifiers, and strict Category PP ticks.
  • character_life_encumbrance_and_travel —Carried gear mass vs. endurance limits, Newtonian D = V × T march solver, and inverse proportional Efficiency (Table #2.9).
  • character_life_wounds_and_healing — Tables #3-25 & #3-25.1 healing and attribute recovery, Pharmaceuticals (endbleed, bioxin, instacast, and Human/Eebek-gated grim_reaper), shock, and unconsciousness thresholds.
  • character_life_performance_points — Inspect, award, or spend Performance Points at 1:1 Category Experience, 5:1 Skill Aptitude, and 10:1 Attribute with strict category isolation.
  • character_life_aging — Table #2.8 species lifespan brackets, aging attribute deltas, and CO disease resistance checks.

Adventure Setup & Squad / aiPC Management (6 Tools)

  • adventure_initialize_session — Initialize Formula Approach scenarios (andromedian-rose, sedna-rendezvous, carakuss-frontier, or custom).
  • adventure_get_state — Read active milestones, Disclosures/Epiphany progress, and environmental hydration/efficiency clocks.
  • adventure_advance_milestone — Complete Little Accomplishments, deduct Table #2.10 perceived-heat water, update Table #2.9 efficiency, and unlock Disclosures.
  • adventure_escalate_to_combat — Escalate milestone scenes into EncounterStore combat (Type I Static / Type II Dynamic NPCs) or sync combat outcomes back to Character Life.
  • adventure_trigger_pacing_event — Keep the Action Alive: advances hazard clock, narrows choices to two tactical options, and steps down Procedure (3 → 2 → 1).
  • squad_manage_state — Create, inspect, and update Squad rosters, pc / aiPC control modes, Tactical Doctrines, aiPersona, and combat loadouts.

5-Step Tactical Combat State Machine (9 Tools)

  • machina_create_encounter — Launch Carakuss Dawn Ambush, Andromedian Rose, or custom multi-faction combat encounters.
  • machina_get_encounter_state — Inspect live round/turn order, Action/Agility Points, stances, ammunition, and anatomical wound penalties.
  • machina_step1_surprise — Resolve Step 1 Surprise and sleeping operative wake checks.
  • machina_step2_primary_attack — Resolve Step 2 Initiative and Procedure 3 >30 margin lockouts.
  • machina_step3_action_ap — Spend Action/Agility Points on movement (including Silent stealth), stance/cover transitions, weapon swaps, and reloads.
  • machina_step4_preview_to_hit — Preview deterministic Marksmanship, Table #3.1 Range, Table #3.2 Adversity, Net To-Hit%, and Lore Guardrails before committing an attack.
  • machina_step4_and_5_resolve_attack — Execute To-Hit roll, Placed vs. Random Hit Location (enforcing sightless Wrist Laser rules), Table #3.3 Tissue DP, KAR / Prism Suit laser reflection, and Segment Trauma.
  • machina_apply_triage — Apply Field Medkit (-8 DP) or Grim Reaper (-14 DP, Human/Eebek xenobiology gated) stabilization.
  • machina_advance_turn_or_round — Advance to the next active combatant or replenish round AP.

Canonical Resources, Prompts & Discovery Endpoints

  • 12 MCP Resources: machina://rules/procedures, machina://tables/weapons, machina://tables/armors, machina://tables/species-combat, machina://presets/encounters, genesis://tables/character-life, genesis://tables/medical-and-healing, genesis://tables/chargen, genesis://tables/star-travel, genesis://species/catalog, genesis://equipment/catalog, and genesis://adventures/catalog.
  • 3 GM Prompts: genesis_living_world_narrator, genesis-gm-conductor, and explain-procedure-tiers.
  • Site-Wide Machine-Readable Indexes: https://genesisrpg.com/llms.txt (concise LLM index), https://genesisrpg.com/llms-full.txt (full-text rulebook & lore corpus), and https://genesisrpg.com/search-index.json (structured JSON archive).