RPG MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@RPG MCP Server start a new fantasy adventure"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
RPG MCP Server
An immersive Role-Playing Game server built on the Model Context Protocol (MCP), designed to work with AI assistants like Claude to create interactive storytelling experiences.
Features
🎮 Game Tools
The server provides 7 core tools for building and managing RPG games:
createGame- Initialize a new RPG gameSet up initial game state (characters, world, inventory, etc.)
Auto-generates unique game ID
updateGame- Update game stateSupports nested field paths (e.g.,
characters[0].level,world.location)Real-time change tracking with Delta system
Game Over Support: If a state update results in game over (e.g., HP reaches 0, bad ending), set
isGameOver=trueand provide agameOverReason. The server will return a special Game Over UI with an empathetic explanation and suggestions for improvement.
getGame- Retrieve current game stateAccess complete game state at any time
progressStory- Advance the narrativeRecord current situation and events
Manage narrative flow
promptUserActions- Present action choices to usersDynamic Choices: Always present 2-4 options that mix positive and negative outcomes for dynamic, engaging gameplay. Each option should have distinct consequences and risk/reward tradeoffs.
Generate interactive UI
Web-based action selection interface
selectAction- Process user selectionsApply chosen actions to game state
Automatically record game history
selectRestart- Restart the game after game overCalled when player clicks Restart button on Game Over screen
Provides game summary and context for creating a new game
AI agent receives guidance to create a contextually relevant new adventure
🎯 User Interaction
Basic Game Flow
createGame → progressStory → promptUserActions → selectAction → updateGame → progressStory → ...Game Over & Restart Flow
When a game ends (e.g., character HP reaches 0 or story reaches an ending):
updateGame (isGameOver=true) → Game Over UI displayed →
User clicks Restart button → selectRestart →
AI creates new game with context → progressStory → ...The restart flow includes:
Context Preservation: Previous game summary is provided to the AI
AI-Suggested Continuation: AI can create thematically related or evolved adventures
One-Click Restart: No manual intervention needed from the player
Empathetic Messaging: Game Over screen explains what happened and suggests improvements
Interactive UI
Web-based Selection Interface: Beautiful UI automatically generated with story progression
Real-time Change Display: Visual feedback for recent changes via Delta system
Game Over Screen: When the game ends, a special UI explains why, what could have been done differently, and includes a Restart button
Game History: Automatically saves last 10 situation-choice records
Restart Button: Interactive button on Game Over screen that triggers
selectRestarttool
Example Game Scenario
// 1. Create Game
{
"title": "Wizard's Adventure",
"characters": [
{"name": "Elara", "level": 1, "hp": 100, "mp": 50, "class": "Wizard"}
],
"world": {"location": "Magic Academy", "time": "morning", "weather": "sunny"},
"inventory": [{"name": "Magic Staff", "type": "weapon"}]
}
// 2. Progress Story
"Elara discovers an ancient spellbook in the academy library..."
// 3. Present Choices (always mix positive/negative outcomes)
[
"Read the spellbook (may gain power, but risk a curse)",
"Tell the professor (safe, but lose a chance for secret knowledge)",
"Leave it where it is (avoid risk, but miss opportunity)",
"Try to sell it secretly (potential reward, but risk being caught)"
]
// 4. Update game state after user selection
"characters[0].hp": 0, // triggers game over
"isGameOver": true,
"gameOverReason": "Elara triggered a powerful curse from the spellbook and lost all HP. If you had chosen to consult the professor or left the book alone, you might have avoided this fate."Related MCP server: MCP Think
MCP Client Requirements
Essential Requirements
MCP Protocol Support: MCP SDK 0.5.0 or higher
MCP-UI Integration: HTML resource rendering support
Tool Execution: Ability to execute all 6 game tools
Recommended Clients
Claude Desktop (officially supported)
MCP-UI compatible clients
Alternative: synaptic-flow and other MCP-UI compatible clients
Claude Desktop Setup
Step 1: Locate Configuration File
Platform-specific config file locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Step 2: Edit Configuration File
{
"mcpServers": {
"rpg-game-server": {
"command": "npx",
"args": ["rpg-mcp-server"],
"env": {
"NODE_ENV": "production"
}
}
}
}Step 3: Restart Claude Desktop
Completely quit and restart Claude Desktop to apply the configuration.
Step 4: Test the Setup
Hi! Can you create a fantasy RPG game for me?Installation & Usage
Global Installation (Recommended)
npm install -g rpg-mcp-serverLocal Development
git clone <repository-url>
cd rpg-mcp-server
npm install
npm run build
npm startTesting with MCP Inspector
npm run inspectorTechnology Stack
TypeScript - Type safety and developer experience
MCP SDK - Model Context Protocol implementation
MCP-UI - Interactive web UI generation
Node.js - Runtime environment
System Requirements
Node.js 18.0.0 or higher
npm 9.0.0 or higher
MCP-compatible client
License
MIT License - see LICENSE file for details.
Available Tools
7 toolscreateGameA
Create a new RPG game with complete initial state. Returns the created game with assigned gameId. Use updateGame or progressStory next to continue the game flow.
Inputs: initialStateInJson (required).
getGameA
Retrieve the complete current state of a game by its ID. Use this tool anytime to inspect the game state.
Inputs: gameId (required).
progressStoryA
Advance the game narrative and set the current story progress. This tool should be called after createGame or updateGame. Use promptUserActions next to present choices to the user.
Inputs: gameId (required), progress (required).
promptUserActionsA
Present the user with 2-4 meaningful action options that MIX POSITIVE AND NEGATIVE OUTCOMES for dynamic, engaging gameplay. Each option should offer distinct consequences and risk/reward tradeoffs. This tool should be called after progressStory to complete the story cycle and wait for user input. Use selectAction next after the user selects an option.
IMPORTANT: Create options that vary in approach and consequences:
Include both favorable and unfavorable outcome possibilities
Offer cautious vs risky strategies
Provide different character alignment choices
Ensure options feel contextually relevant to the current situation
Inputs: gameId (required), options (required).
selectActionA
Process the user's selected action from the UI and continue the game flow. This tool should be called after promptUserActions when the user makes a selection. Use updateGame next to reflect the result of the action.
Inputs: gameId (required), selectedIndex (required), selectedOption (required).
selectRestartB
Restart the game after game over. Retrieves final game state summary and instructs to create a new game. This should be called when the player clicks the Restart button on the Game Over screen.
Inputs: gameId (required).
updateGameA
Update a specific field in the game state and return the complete updated game state. Supports nested property updates using path notation. If the update results in game over (e.g., character HP reaches 0, story reaches bad ending), set isGameOver=true. Use progressStory next to advance the narrative.
Inputs: value (required), gameId (required), fieldSelector (required), isGameOver, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a distinct, non-overlapping purpose: createGame initializes, getGame retrieves state, progressStory advances narrative, promptUserActions presents choices, selectAction processes user input, selectRestart handles restart, and updateGame modifies state. No ambiguity between tools.
All tool names follow a consistent camelCase verb_noun pattern (e.g., createGame, progressStory, promptUserActions). Names are descriptive and predictable.
With 7 tools, the set is well-scoped for an RPG server, covering essential operations (create, read, update, progression, user interaction, restart) without unnecessary bloat or gaps.
The tools form a complete lifecycle: create → progress → prompt → select → update → (loop or restart). All necessary stages for dynamic narrative gameplay are present, and the flow is clearly documented.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Official remote MCP server for Archivist AI TTRPG campaign memory: characters, sessions, and more.
MCP server for Argo RPG Platform — connects AI assistants to campaign data via OAuth2
MCP server for AI dialogue using various LLM models via AceDataCloud
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA Model Context Protocol (MCP) server for the Discord integration with MCP-compatible applications like Claude Desktop.622MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that provides AI assistants like Claude with a dedicated space for structured thinking during complex problem-solving tasks.MIT
- AlicenseNot gradedqualityBmaintenanceA Model Context Protocol server that integrates with FoundryVTT, allowing AI assistants to interact with tabletop gaming sessions through natural language to query actors, roll dice, generate content, and manage game worlds.1,051 npm36MIT
- AlicenseBqualityNot gradedmaintenanceA comprehensive Model Context Protocol server for managing Dungeons & Dragons campaigns with tools for characters, NPCs, locations, quests, combat encounters, and session tracking.3016MIT