Logo di 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.

Pubblicato daMnehmos
Repositorymnehmos.rpg.mcp
LinguaTypeScript
Fork
31
Stelle
43
Strumenti disponibili
0
Tipo di trasportostdio
Categorie
LicenzaMIT
Link
  • Collega gli strumenti ai flussi di lavoro IA

    mnehmos.rpg.mcp mette a disposizione funzionalità MCP utilizzabili da client e agenti IA compatibili.

  • Strumenti disponibili: 0

    Esplora le azioni richiamabili qui sotto, con nomi e descrizioni se il server li fornisce.

  • Configurazione pronta da copiare

    Usa gli esempi di installazione per configurare questo server nel tuo client MCP preferito.

  • Indicatori di interesse della comunità open source

    Stelle: 43; fork: 31 (repository collegato).

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


Installazione

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

Usa mnehmos.rpg.mcp MCP con più modelli AI

TypingMind collega gli strumenti MCP a livello di area di lavoro: una volta connesso mnehmos.rpg.mcp, puoi usarlo con diversi modelli IA in TypingMind, senza configurarlo separatamente per ogni modello. Questa integrazione MCP viene eseguita localmente sul tuo dispositivo tramite il connettore MCP di TypingMind.

Guida alla configurazione del connettore locale

Usa questo metodo quando il server MCP deve accedere a file locali, app o risorse private sul tuo computer.

1

Apri le impostazioni MCP

In TypingMind, vai su Impostazioni, Impostazioni avanzate, poi su Model Context Protocol e scegli Configura connettore.

  1. Apri TypingMind nel tuo browser.
  2. Fai clic sull'icona Impostazioni.
  3. Vai a Impostazioni avanzate.
  4. Apri la sezione Model Context Protocol.
  5. Fai clic su Configura connettore e scegli Questo dispositivo.
Schermata di configurazione del connettore MCP di TypingMind con l’opzione «Questo dispositivo» selezionata
2

Esegui il comando del connettore

Scegli Questo dispositivo, copia il comando da TypingMind ed eseguilo nel terminale. Lascia il processo in esecuzione mentre usi MCP.

  1. Copia il comando di configurazione mostrato da TypingMind.
  2. Apri Terminale su macOS o Windows Terminal su Windows.
  3. Incolla ed esegui il comando.
  4. Conferma l'installazione del pacchetto se il terminale ti chiede di procedere.
  5. Tieni aperta la finestra del terminale con il processo in esecuzione mentre usi gli strumenti MCP.
3

Aggiungi mnehmos.rpg.mcp come server

Quando lo stato del connettore è Pronto, fai clic su Modifica server e incolla la configurazione del server MCP.

  1. Attendi che lo stato del connettore sia Pronto.
  2. Fai clic su Modifica server.
  3. Incolla la configurazione del server MCP di mnehmos.rpg.mcp.
  4. Salva l'elenco dei server.
  5. Se vuoi verificare che il connettore sia ancora pronto, aggiorna la pagina.
Impostazioni MCP di TypingMind con un server attivo e il pulsante Modifica server
{
  "mcpServers": {
    "mnehmos-rpg-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mnehmos.rpg.mcp"
      ]
    }
  }
}
4

Usa la connessione con diversi modelli

Salva l'elenco dei server, apri Plugin, abilita gli strumenti MCP di mnehmos.rpg.mcp, poi seleziona un modello IA supportato in TypingMind e usa gli strumenti in chat o assegnali a un agente IA.

  1. Apri la pagina Plugin in TypingMind.
  2. Abilita gli strumenti MCP di mnehmos.rpg.mcp.
  3. Avvia una chat e scegli il modello IA che vuoi usare.
  4. Usa gli strumenti MCP in chat o assegnali a un agente IA.
  5. Passa a un altro modello IA quando serve, senza riconnettere MCP.
Chat di TypingMind che usa gli strumenti MCP abilitati con un modello IA selezionato
Puoi usare mnehmos.rpg.mcp per aiutarmi con questa attività?
mnehmos.rpg.mcp
Certo. L’ho letto.
Ecco cosa ho trovato con mnehmos.rpg.mcp.

Domande frequenti

A cosa serve il server MCP mnehmos.rpg.mcp?

mnehmos.rpg.mcp è un server MCP che consente ai client IA compatibili di accedere a strumenti e informazioni di contesto esterni. In TypingMind puoi aggiungere questo server MCP una sola volta e rendere disponibili i suoi strumenti nella tua area di lavoro IA.

Posso usare il server MCP mnehmos.rpg.mcp con più modelli IA in TypingMind?

Sì. TypingMind collega gli strumenti MCP a livello di area di lavoro, quindi puoi usare mnehmos.rpg.mcp con diversi modelli IA come Claude, ChatGPT, Gemini o altri modelli che hai configurato in TypingMind, senza dover configurare il server MCP separatamente per ogni modello.

Perché usare il connettore MCP mnehmos.rpg.mcp con TypingMind?

TypingMind è una delle migliori interfacce per chattare con gli LLM perché riunisce più modelli IA, prompt, plugin, agenti IA, chiavi API e strumenti MCP in un'unica area di lavoro. Collegando mnehmos.rpg.mcp, puoi usare i suoi strumenti MCP con i tuoi modelli preferiti e mantenere organizzato il tuo flusso di lavoro in chat su TypingMind.

Come collego il server MCP mnehmos.rpg.mcp a TypingMind?

mnehmos.rpg.mcp funziona tramite il connettore MCP locale di TypingMind. È la soluzione ideale quando il server MCP deve accedere a file locali, app desktop, strumenti da riga di comando o risorse private sul tuo computer.

Quali strumenti offre il server MCP mnehmos.rpg.mcp in TypingMind?

mnehmos.rpg.mcp mette a disposizione funzionalità MCP che puoi attivare dalla pagina Plugin di TypingMind e usare in chat o assegnare agli agenti IA.

Devo condividere le mie chiavi API con TypingMind per usare il server MCP mnehmos.rpg.mcp?

No. TypingMind privilegia il funzionamento in locale e ti permette di mantenere il controllo su fornitori di modelli, chiavi API, prompt e configurazione MCP. Se mnehmos.rpg.mcp richiede l'autenticazione, aggiungi le intestazioni, le impostazioni OAuth o la configurazione locale necessarie per quel server MCP quando crei la connessione.

Server MCP correlati

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇