Logo vun mnehmos.rpg.mcp

mnehmos.rpg.mcp

Communautéit
Mnehmos

A rules-enforced RPG backend that turns any LLM into a game master who can't cheat.

EditeurMnehmos
Repositorymnehmos.rpg.mcp
SproochTypeScript
Forks
31
Stären
43
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    mnehmos.rpg.mcp stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    43 Stären an 31 Forks aus dem verlinkte Repository.

mnehmos.rpg.mcp: Agentic Embodied Simulation Kernel

npm version License: ISC TypeScript MCP Tests Tools

A rules-enforced RPG backend that turns any LLM into a game master who can't cheat.


What Is This? (Start Here)

You are the player. The AI is the dungeon master.

You talk to an AI (Claude, GPT, etc.) in natural language. You say things like "I attack the goblin" or "I search the room for traps." The AI narrates what happens and describes the world.

The difference from pure AI storytelling: This engine enforces the rules. When you attack, it actually rolls dice, checks armor class, calculates damage, and updates HP in a real database. The AI can't just decide you hit or miss—the math happens, and both you and the AI see the result.

What can you actually do?

  • Explore procedurally generated worlds with 28+ biome types
  • Fight enemies using D&D 5e-style combat (initiative, AC, damage rolls, death saves)
  • Cast spells with real slot tracking—if you're out of slots, you can't cast
  • Manage inventory with equipment slots, weight, and item properties
  • Complete quests with tracked objectives and rewards
  • Interact with NPCs who remember your conversations across sessions
  • Everything persists—close the game, come back tomorrow, your character is exactly where you left them

Who is this for?

  • Solo RPG players who want AI-driven adventures with mechanical integrity
  • People frustrated with AI RPGs that fall apart when you ask "wait, how much HP do I have?"
  • Developers building AI game integrations who need a reference implementation

How do I play?

  1. Install the MCP server (see Installation below)
  2. Connect it to Claude Desktop (or any MCP-compatible client)
  3. Tell the AI: "Let's start a new game. Create a character for me."
  4. Play naturally—the AI handles narration, the engine handles mechanics

v1.0 Release (January 2026)

81% Tool Reduction: 195 → 36 Tools (31 Consolidated + 5 Meta/Event)

This release consolidates 195 individual tools into 31 action-based tools plus 5 standalone meta/event tools using:

  • Action enums - Each tool handles multiple operations via an action parameter
  • Fuzzy matching - Typo-tolerant action matching with suggestions
  • Guiding errors - Clear feedback when actions don't match

Before: create_character, get_character, update_character, delete_character, list_characters... After: character_manage with action-based CRUD, progression, and source-backed creation options

Key Metrics

MetricBeforeAfterChange
MCP Tools1953681.5% reduction
Tests1,2422,214+78% coverage
Token overhead~50K~6-8K85% reduction

Meta-Tools for Discovery

Four standalone tools support discovery and real-time events:

ToolPurpose
search_toolsSearch tools by keyword, category, or capability
load_tool_schemaLoad full parameter schema before first use
subscribe_to_eventsSubscribe to PubSub event topics (combat, quest, etc.)
unsubscribe_from_eventsUnsubscribe from event topics

Architecture Philosophy

This engine implements the Event-Driven Agentic AI Architecture:

┌─────────────────────────────────────────────────────────────────────────────────────────┐
│                                                                                         │
│   EVENT                                                                                 │
│     │                                                                                   │
│     ▼                                                                                   │
│   ┌───────────┐     ┌───────────┐     ┌────────────┐     ┌───────────┐     ┌─────────┐ │
│   │  OBSERVE  │ ──▶ │  ORIENT   │ ──▶ │   DECIDE   │ ──▶ │    ACT    │ ──▶ │VALIDATE │ │
│   │           │     │           │     │            │     │           │     │         │ │
│   │ MCP Read  │     │ LLM Brain │     │Orchestrator│     │ MCP Write │     │ Engine  │ │
│   │  Tools    │     │  Analyze  │     │   Plan     │     │   Tools   │     │  Rules  │ │
│   └───────────┘     └───────────┘     └────────────┘     └───────────┘     └────┬────┘ │
│         ▲                                                                       │      │
│         │                                                                       │      │
│         └───────────────────────────────────────────────────────────────────────┘      │
│                                    WORLD STATE                                         │
│                                  (updates & loops)                                     │
│                                                                                         │
└─────────────────────────────────────────────────────────────────────────────────────────┘

The Embodiment Model

Biological SystemRPG-MCP ComponentRole
BrainLLM Agent (external)Strategic reasoning, planning, interpretation
Nervous SystemEngine + OrchestratorValidates intent, enforces constraints, routes actions
Reflex ArcConstraint ValidatorBlocks impossible actions before execution
Sensory OrgansObservation ToolsgetObservation, queryEntities, getWorldSnapshot
MusclesAction ToolsproposeAction, moveEntity, attack, interact
EnvironmentWorld State + PhysicsSQLite-persisted, deterministic, forkable reality

Key invariant: LLMs propose intentions. The engine validates and executes. LLMs never directly mutate world state.


Consolidated Tools Reference (31 Tools)

Character & Party

ToolActionsDescription
character_managecreate, get, update, delete, list, options, add_xp, level_upCharacter CRUD plus pinned SRD creation mechanics
party_managecreate, get, update, delete, add_member, remove_member, set_leader, contextParty management and member operations

Combat System

ToolActionsDescription
combat_managecreate, get, end, load, advance, death_save, lair_action, add_participant, remove_participantEncounter lifecycle and initiative
combat_actionattack, cast, move, dash, dodge, disengage, help, readyCombat actions with full D&D 5e rules
combat_mapget_terrain, set_terrain, get_positions, calculate_aoeTactical grid and terrain management

Inventory & Economy

ToolActionsDescription
item_managecreate, get, update, delete, list, search, catalog_search, catalog_get, materializeCustom items plus pinned SRD lookup/materialization
inventory_managegive, remove, transfer, equip, unequip, useInventory operations between characters
corpse_managecreate, get, list, loot, harvest, advance_decay, cleanupDeath and loot mechanics
theft_managesteal, check_stolen, check_recognition, reportTheft with heat tracking

World & Spatial

ToolActionsDescription
world_managegenerate, get, update, list, deleteProcedural world generation
world_mapget_overview, get_region, patch, previewMap queries and modifications
spatial_managelook, generate, update, get_exits, move, list, network_create, network_get, network_listDungeon navigation and room networks

Quests & NPCs

ToolActionsDescription
quest_managecreate, get, list, assign, complete, fail, abandon, add_objective, update_objectiveQuest lifecycle management
npc_manageget_relationship, update_relationship, record_memory, get_history, interactNPC memory and social interactions
aura_managecreate, list, get_affecting, process, remove, expireArea effects and buffs/debuffs

Magic & Rest

ToolActionsDescription
scroll_manageuse, create, identify, get_dc, get_detailsScroll mechanics
rest_managelong_rest, short_restHP and spell slot recovery
concentration_managecheck_save, break, get_state, check_durationSpell concentration tracking

Utility & Meta

ToolActionsDescription
secret_managecreate, get, list, update, delete, reveal, check_conditionsDM secrets with reveal conditions
narrative_manageadd, search, update, get, delete, get_contextStory notes and session history
improvisation_managestunt, apply_effect, get_effects, remove_effect, process_triggers, advance_durations, synthesize, get_spellbookRule of Cool and custom effects
math_managedice_roll, probability, algebra, physicsDice and calculations
strategy_managecreate_nation, get_state, propose_alliance, claim_regionGrand strategy simulation
turn_manageinit, get_status, submit_actions, mark_ready, poll_resultsAsync turn management
spawn_managespawn_character, spawn_location, spawn_encounter, spawn_preset_location, spawn_tacticalEntity and encounter spawning
session_manageinitialize_session, get_contextSession state management
travel_managetravel, loot, restParty movement and field actions
batch_managecreate_characters, create_npcs, distribute_items, execute_workflowBulk operations

LLM-Driven NPCs (Agents)

ToolActionsDescription
agent_managecreate, get, list, update, delete, resume, health, budget, set_slice, remove_slice, toggle_slice, list_slices, narrate, broadcast, preview_prompt, add_secret, list_secrets, remove_secret, add_journal, get_journal, invoke, replayBind an LLM (OpenAI / OpenRouter) to a character as an autonomous NPC mind. Modular prompt slices (persona/directive/secrets/narrative_feed/recent/character_state), private journal, audit-logged calls, circuit breaker, plain-text intent declarations for DM dispatch. Auto-invokes on initiative when auto_on_turn=true. Emits npc_action events to event_inbox for frontend polling.

Installation

Option 1: npm (Recommended)

bash
npm install mnehmos.rpg.mcp

Option 2: Standalone Binaries

Download pre-built binaries from Releases:

bash
# Windows
.\rpg-mcp-win.exe

# macOS (Intel)
chmod +x rpg-mcp-macos && ./rpg-mcp-macos

# macOS (Apple Silicon)
chmod +x rpg-mcp-macos-arm64 && ./rpg-mcp-macos-arm64

# Linux
chmod +x rpg-mcp-linux && ./rpg-mcp-linux

Option 3: From Source

bash
git clone https://github.com/Mnehmos/rpg-mcp.git
cd rpg-mcp
npm install
npm run build
npm test  # 2214 tests should pass

MCP Client Configuration

Claude Desktop / MCP Clients:

json
{
  "mcpServers": {
    "rpg-mcp": {
      "command": "npx",
      "args": ["-y", "-p", "mnehmos.rpg.mcp@1.0.3", "mnehmos-rpg-mcp"]
    }
  }
}

Security note: pin an explicit package version in args to avoid unintentionally running a newly published release.

Using Binary:

json
{
  "mcpServers": {
    "rpg-mcp": {
      "command": "path/to/rpg-mcp-win.exe"
    }
  }
}

Core Systems

Combat & Encounters

  • Initiative tracking with advantage/disadvantage
  • Spatial combat with grid positioning and collision
  • Opportunity attacks with reaction economy
  • Death saving throws (D&D 5e rules)
  • Damage resistance/vulnerability/immunity
  • Legendary creatures with lair actions and legendary resistances
  • Encounter presets - Pre-balanced encounters by party level

Magic System

  • 15+ SRD spells (Magic Missile, Fireball, Cure Wounds, etc.)
  • Spell slot tracking with class-based progression
  • Warlock pact magic with short rest recovery
  • Concentration tracking
  • Anti-hallucination validation - LLMs cannot cast spells they don't know

Theft & Economy

  • Stolen item tracking with heat levels (burning → cold)
  • Witness recording for theft detection
  • Fence NPCs with buy rates and heat capacity
  • Item recognition - original owners detect their stolen goods

NPC Memory

  • Relationship tracking (familiarity + disposition)
  • Conversation memory with importance levels
  • Context injection for LLM prompts
  • Interaction history across sessions

Improvisation Engine

  • Rule of Cool stunts - "I kick the brazier into the zombies"
  • Custom effects - Divine boons, curses, transformations
  • Arcane synthesis - Dynamic spell creation with wild surge risk

Project Structure

src/
├── schema/           # Zod schemas: entities, actions, world state
├── engine/
│   ├── combat/       # Encounters, initiative, damage, death saves
│   ├── spatial/      # Grid, collision, movement
│   ├── worldgen/     # Procedural generation (28+ biomes)
│   └── strategy/     # Nation simulation
├── data/
│   ├── creature-presets.ts   # 1100+ creature templates
│   ├── encounter-presets.ts  # 50+ balanced encounters
│   └── items/               # PHB weapons, armor, magic items
├── storage/
│   ├── migrations.ts # SQLite schema definitions
│   └── repos/        # Repository pattern for persistence
├── server/
│   ├── consolidated/ # 31 action-based tools
│   ├── handlers/     # Extracted handler implementations (combat, spatial)
│   ├── consolidated-registry.ts  # Tool registration
│   ├── meta-tools.ts # search_tools, load_tool_schema
│   └── events.ts     # PubSub + MCP notification streaming
└── utils/
    ├── fuzzy-enum.ts      # Action matching with typo tolerance
    └── schema-shorthand.ts # Token-efficient parsing

tests/                # 2214 tests mirroring src/ structure
docs/                 # White paper and LLM spatial guide

Design Principles

  1. LLMs propose, never execute The brain suggests; the nervous system validates.

  2. All action is tool-mediated No direct world mutation. Every change flows through MCP tools.

  3. Validation precedes observation Act → Validate → Observe. The reflex arc pattern.

  4. Deterministic outcomes Same inputs → same outputs. Always reproducible.

  5. Schema-driven everything Zod validates all data at boundaries. Type safety end-to-end.

  6. Anti-hallucination by design LLMs cannot cast spells they don't know or claim damage they didn't roll.

  7. Token efficiency 31 consolidated tools with action routing reduce context overhead by 85%.

  8. Guiding errors Invalid actions return suggestions, not just failures.

Tool-surface policy

The consolidated MCP contracts are the public tool surface. The older world-map helpers in src/server/tools.ts are retained in compatibility mode as an internal adapter because world_map still delegates to their validated world persistence and patch implementation. New public tools must be added to the consolidated contracts, and the adapter matrix is enforced by src/server/legacy-surface-policy.ts.


Test Coverage

bash
npm test
# 2252 tests passing, 7 skipped
# 148 test files
# Coverage across all 36 tools (31 consolidated + 5 meta/event)

Contributing

Contributions welcome! Please:

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/your-feature)
  3. Write tests for new functionality
  4. Follow existing code style (TypeScript + Zod + tests)
  5. Submit a pull request

Roadmap

  • Full spellcasting system with validation
  • Theft and fence economy
  • Corpse and loot mechanics
  • NPC memory and relationships
  • Improvisation engine
  • Tool consolidation (195 → 36)
  • Fuzzy action matching
  • Preset systems (creatures, encounters, locations)
  • WebSocket real-time subscriptions
  • Dialogue tree system
  • Cover mechanics in combat
  • Quest chains with prerequisites

License

ISC — Use freely, attribution appreciated.


Related


Documentation


Installatioun

TypingMind
{
  "mcpServers": {
    "mnehmos-rpg-mcp": {
      "command": "npx",
      "args": [
        "mnehmos.rpg.mcp"
      ]
    }
  }
}

mnehmos.rpg.mcp MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal mnehmos.rpg.mcp verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

mnehmos.rpg.mcp als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu mnehmos.rpg.mcp an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "mnehmos-rpg-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mnehmos.rpg.mcp"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu mnehmos.rpg.mcp. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu mnehmos.rpg.mcp.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat mnehmos.rpg.mcp?
mnehmos.rpg.mcp
Jo. Ech hunn et gelies.
Dat hunn ech mat mnehmos.rpg.mcp fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server mnehmos.rpg.mcp benotzt?

mnehmos.rpg.mcp ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech mnehmos.rpg.mcp MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir mnehmos.rpg.mcp mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat mnehmos.rpg.mcp MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann mnehmos.rpg.mcp verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech mnehmos.rpg.mcp MCP mat TypingMind?

mnehmos.rpg.mcp leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt mnehmos.rpg.mcp MCP an TypingMind zur Verfügung?

mnehmos.rpg.mcp stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir mnehmos.rpg.mcp MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann mnehmos.rpg.mcp eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇