mnehmos.rpg.mcp logo

mnehmos.rpg.mcp

Community
Mnehmos

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

PublisherMnehmos
Repositorymnehmos.rpg.mcp
LanguageTypeScript
Forks
31
Stars
43
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    mnehmos.rpg.mcp exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    43 stars and 31 forks from the linked 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


Installation

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

Use mnehmos.rpg.mcp MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once mnehmos.rpg.mcp is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add mnehmos.rpg.mcp as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the mnehmos.rpg.mcp MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "mnehmos-rpg-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mnehmos.rpg.mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the mnehmos.rpg.mcp MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the mnehmos.rpg.mcp MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use mnehmos.rpg.mcp to help me with this task?
mnehmos.rpg.mcp
Sure. I read it.
Here is what I found using mnehmos.rpg.mcp.

Frequently asked questions

What is the mnehmos.rpg.mcp MCP server used for?

mnehmos.rpg.mcp is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use mnehmos.rpg.mcp MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use mnehmos.rpg.mcp with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use mnehmos.rpg.mcp MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With mnehmos.rpg.mcp connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect mnehmos.rpg.mcp MCP to TypingMind?

mnehmos.rpg.mcp runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does mnehmos.rpg.mcp MCP provide in TypingMind?

mnehmos.rpg.mcp exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use mnehmos.rpg.mcp MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If mnehmos.rpg.mcp requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇