Logo von mnehmos.rpg.mcp

mnehmos.rpg.mcp

Community
Mnehmos

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

HerausgeberMnehmos
Repositorymnehmos.rpg.mcp
SpracheTypeScript
Forks
31
Sterne
43
Verfügbare Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Links
  • Tools mit KI-Workflows verbinden

    mnehmos.rpg.mcp stellt MCP-Funktionen bereit, die kompatible KI-Clients und Agenten nutzen können.

  • Verfügbare Tools: 0

    Unten finden Sie die aufrufbaren Aktionen. Namen und Beschreibungen werden angezeigt, sofern der Server sie bereitstellt.

  • Konfiguration zum Kopieren

    Nutzen Sie die Installationsbeispiele, um diesen Server in Ihrem bevorzugten MCP-Client zu konfigurieren.

  • Open-Source-Kennzahlen

    Kennzahlen des verlinkten Repositorys: Sterne (43) und Forks (31).

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


Installation

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

mnehmos.rpg.mcp MCP mit mehreren KI-Modellen nutzen

TypingMind bindet MCP-Tools auf Arbeitsbereichsebene ein. Sobald mnehmos.rpg.mcp verbunden ist, können Sie die Integration mit verschiedenen KI-Modellen in TypingMind verwenden, statt sie für jedes Modell separat einzurichten. Diese MCP-Integration läuft lokal über den TypingMind-MCP-Konnektor auf Ihrem Gerät.

Einrichtungsanleitung für den lokalen Konnektor

Nutzen Sie diese Option, wenn der MCP-Server Zugriff auf lokale Dateien, Apps oder private Ressourcen auf Ihrem Computer benötigt.

1

MCP-Einstellungen öffnen

Gehen Sie in TypingMind zu „Einstellungen“, „Erweiterte Einstellungen“ und dann „Model Context Protocol“ und wählen Sie „Konnektor einrichten“.

  1. Öffnen Sie TypingMind in Ihrem Browser.
  2. Klicken Sie auf das Symbol „Einstellungen“.
  3. Gehen Sie zu „Erweiterte Einstellungen“.
  4. Öffnen Sie den Abschnitt „Model Context Protocol“.
  5. Klicken Sie auf „Konnektor einrichten“ und wählen Sie „Dieses Gerät“.
Einrichtungsbildschirm des TypingMind-MCP-Konnektors mit ausgewählter Option „Dieses Gerät“
2

Konnektor-Befehl ausführen

Wählen Sie „Dieses Gerät“, kopieren Sie den Befehl aus TypingMind und führen Sie ihn im Terminal aus. Lassen Sie den Prozess laufen, solange Sie MCP verwenden.

  1. Kopieren Sie den in TypingMind angezeigten Einrichtungsbefehl.
  2. Öffnen Sie „Terminal“ (macOS) bzw. „Windows Terminal“ (Windows).
  3. Fügen Sie den Befehl ein und führen Sie ihn aus.
  4. Bestätigen Sie die Paketinstallation, wenn Sie im Terminal zum Fortfahren aufgefordert werden.
  5. Lassen Sie das Terminalfenster geöffnet und den Prozess darin laufen, solange Sie MCP-Tools verwenden.
3

mnehmos.rpg.mcp als Server hinzufügen

Wenn der Konnektorstatus „Bereit“ anzeigt, klicken Sie auf „Server bearbeiten“ und fügen Sie die MCP-Server-Konfiguration ein.

  1. Warten Sie, bis der Konnektorstatus „Bereit“ anzeigt.
  2. Klicken Sie auf „Server bearbeiten“.
  3. Fügen Sie die MCP-Server-Konfiguration für mnehmos.rpg.mcp ein.
  4. Speichern Sie die Serverliste.
  5. Aktualisieren Sie die Ansicht, um bei Bedarf zu prüfen, ob der Konnektor weiterhin bereit ist.
MCP-Einstellungen in TypingMind mit aktivem Server und der Schaltfläche „Server bearbeiten“
{
  "mcpServers": {
    "mnehmos-rpg-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mnehmos.rpg.mcp"
      ]
    }
  }
}
4

Verbindung modellübergreifend nutzen

Speichern Sie die Serverliste, öffnen Sie „Plugins“ und aktivieren Sie die MCP-Tools von mnehmos.rpg.mcp. Wählen Sie dann ein beliebiges unterstütztes KI-Modell in TypingMind und verwenden Sie die Tools im Chat oder weisen Sie sie einem KI-Agenten zu.

  1. Öffnen Sie die Seite „Plugins“ in TypingMind.
  2. Aktivieren Sie die MCP-Tools von mnehmos.rpg.mcp.
  3. Starten Sie einen Chat und wählen Sie das KI-Modell, das Sie verwenden möchten.
  4. Nutzen Sie die MCP-Tools im Chat oder weisen Sie sie einem KI-Agenten zu.
  5. Wechseln Sie bei Bedarf zu einem anderen KI-Modell, ohne die MCP-Verbindung erneut herzustellen.
TypingMind-Chat mit aktivierten MCP-Tools und einem ausgewählten KI-Modell
Können Sie mir mit mnehmos.rpg.mcp bei dieser Aufgabe helfen?
mnehmos.rpg.mcp
Gerne. Ich habe es gelesen.
Das habe ich mit mnehmos.rpg.mcp gefunden.

Häufig gestellte Fragen

Wofür wird der MCP-Server mnehmos.rpg.mcp verwendet?

mnehmos.rpg.mcp ist ein MCP-Server, über den kompatible KI-Clients auf externe Tools und Kontext zugreifen können. In TypingMind können Sie diesen MCP-Server einmal hinzufügen und seine Tools in Ihrem KI-Arbeitsbereich verfügbar machen.

Kann ich den MCP-Server mnehmos.rpg.mcp mit mehreren KI-Modellen in TypingMind verwenden?

Ja. TypingMind bindet MCP-Tools auf Arbeitsbereichsebene ein. So können Sie mnehmos.rpg.mcp mit verschiedenen KI-Modellen wie Claude, ChatGPT, Gemini oder anderen in TypingMind konfigurierten Modellen verwenden, ohne den MCP-Server für jedes Modell separat einzurichten.

Warum den MCP-Server mnehmos.rpg.mcp mit TypingMind nutzen?

TypingMind ist eine der besten Oberflächen für LLM-Chats, da es mehrere KI-Modelle, Prompts, Plugins, KI-Agenten, API-Schlüssel und MCP-Tools in einem Arbeitsbereich vereint. Sobald mnehmos.rpg.mcp verbunden ist, können Sie die zugehörigen MCP-Tools mit Ihren bevorzugten Modellen nutzen und Ihre Chat-Abläufe in TypingMind übersichtlich organisieren.

Wie verbinde ich den MCP-Server mnehmos.rpg.mcp mit TypingMind?

mnehmos.rpg.mcp wird über den lokalen MCP-Konnektor von TypingMind angebunden. Das ist die beste Wahl, wenn der MCP-Server auf lokale Dateien, Desktop-Apps, Befehlszeilentools oder private Ressourcen auf Ihrem Computer zugreifen muss.

Welche Tools stellt der MCP-Server mnehmos.rpg.mcp in TypingMind bereit?

mnehmos.rpg.mcp stellt MCP-Funktionen bereit, die Sie auf der Plugins-Seite in TypingMind aktivieren und im Chat verwenden oder KI-Agenten zuweisen können.

Muss ich meine API-Schlüssel mit TypingMind teilen, um den MCP-Server mnehmos.rpg.mcp zu verwenden?

Nein. TypingMind arbeitet vorrangig lokal. Sie wählen Ihre Modellanbieter selbst und behalten die Kontrolle über Ihre API-Schlüssel, Prompts und MCP-Konfiguration. Falls mnehmos.rpg.mcp eine Authentifizierung erfordert, fügen Sie beim Erstellen der Verbindung die erforderlichen Header, OAuth-Einstellungen oder die lokale Konfiguration für diesen MCP-Server hinzu.

Ähnliche MCP-Server

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇