# rpg-mcp
## 基本信息
- Slug: `mnehmos-rpg-mcp`
- Source: modelscope
- Publisher: @Mnehmos/rpg-mcp
- Categories: autonomous-agents / games-and-gamification / knowledge-and-memory
- Hosted: No
- License: MIT License
- Source URL: https://www.modelscope.cn/mcp/servers/@Mnehmos/rpg-mcp
## 简介
暂无描述。
## 安装提示

```bash
EVENT OBSERVE ORIENT DECIDE ACT VALIDATE MCP Read LLM Brain Orchestrator MCP Write Engine Tools Analyze Plan Tools Rules WORLD STATE (updates & loops)
```

## MCP Server 详情

# RPG-MCP: Agentic Embodied Simulation Kernel

[![License: ISC](https://img.shields.io/badge/license-ISC-blue.svg)](LICENSE)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-blue.svg)]()
[![MCP](https://img.shields.io/badge/MCP-Compatible-green.svg)]()
[![Tests](https://img.shields.io/badge/tests-800%2B%20passing-brightgreen.svg)]()
[![Tools](https://img.shields.io/badge/MCP%20tools-145+-blue.svg)]()

**A deterministic, schema-driven, multi-world simulation engine for embodied AI agents.**

RPG-MCP is not a gameit's a **world kernel**. It provides the physics, constraints, persistence, and deterministic execution layer that allows LLM agents to inhabit a simulated reality with real bodies, real limits, and real consequences.

---

## What's New (December 2025)

### Latest Release
- **145+ MCP Tools** - Complete RPG mechanics coverage with new composite tools
- **800+ Passing Tests** - Comprehensive test coverage across all systems
- **Composite Tools (TIER 1)** - Reduce token overhead by 80-95% for common workflows
- **Preset Systems** - 1100+ creature presets, 50+ encounter presets, 30+ location presets
- **Schema Shorthand (TIER 2)** - Token-efficient position/stats parsing
- **Batch Repository Methods** - Optimized for world generation workflows
- **Location Presets** - Tavern, dungeon, temple, market presets with full population
- **Encounter Presets** - Level-scaled encounters (goblin ambush, undead crypt, dragon's lair)

### Core Systems
- **Full Spellcasting System** - 15+ SRD spells, class progression, slot tracking
- **Theft & Fence System** - Heat decay, witness tracking, black market economy
- **Corpse & Loot System** - Decay states, harvestable resources, loot tables
- **NPC Memory System** - Relationship tracking, conversation history, context injection
- **Improvisation Engine** - Rule of Cool stunts, custom effects, arcane synthesis
- **Legendary Creatures** - Lair actions, legendary resistances, boss mechanics
- **Death Saving Throws** - Full D&D 5e rules with stabilization
- **Spatial Navigation** - Room networks, terrain-aware POI placement
- **Narrative Memory Layer** - Session notes, plot threads, NPC voices, foreshadowing
- **Currency System** - Gold/silver/copper with auto-conversion

---

## 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 System | RPG-MCP Component | Role |
|-------------------|-------------------|------|
| **Brain** | LLM Agent (external) | Strategic reasoning, planning, interpretation |
| **Nervous System** | Engine + Orchestrator | Validates intent, enforces constraints, routes actions |
| **Reflex Arc** | Constraint Validator | Blocks impossible actions before execution |
| **Sensory Organs** | Observation Tools | `getObservation`, `queryEntities`, `getWorldSnapshot` |
| **Muscles** | Action Tools | `proposeAction`, `moveEntity`, `attack`, `interact` |
| **Environment** | World State + Physics | SQLite-persisted, deterministic, forkable reality |

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

---

## Features

### Core Systems

**Multi-tenant & Multi-world**
- Isolated projects (`projectId`) and parallel worlds (`worldId`)
- Fork worlds for branching timelines or "what-if" simulations

**Embodied Entities**
- Position, velocity, orientation in 3D space
- Stats, inventories, status effects, controller links
- Sensory radius, line-of-sight, perception limits

**Intent-Based Actions**
- Agents submit intentions: `MOVE_TO`, `ATTACK`, `CAST_SPELL`, `INTERACT`
- Engine validates against physics, rules, and constraints
- Invalid actions rejected with structured feedback

**Deterministic Physics**
- Collision detection, projectile trajectories, movement costs
- Reproducible world stepssame inputs always yield same outputs
- Full audit trail: snapshots, event logs, action history

### 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
- **Rest mechanics** restore spell slots and HP

### Theft & Economy

- **Stolen item tracking** with heat levels (burning  cold)
- **Witness recording** for …

