role-playing
Role-playing game server for MCP. Lets AI assistants create, manage, and narrate interactive RPGs with dynamic storylines and character management.
claude mcp add --transport stdio fritzprix-role-playing-mcp-server npx -y rpg-mcp-server \ --env NODE_ENV="production"
How to use
This MCP server powers an immersive role-playing experience. It provides seven core tools to manage RPG games: createGame to initialize a new adventure with characters, world state, and inventory; updateGame to apply state changes (including nested paths) and trigger a Game Over flow when conditions are met; getGame to fetch the current complete game state; progressStory to advance the narrative and log situational context; promptUserActions to present dynamic, risk-reward action options (2-4 choices with positive and negative outcomes) and render a web-based UI; selectAction to apply the chosen action and record history; and selectRestart to restart after a game over, including AI-assisted context for a fresh adventures. The system includes a Delta display for real-time changes, automatic game history of the last ten situations and choices, and an empathetic Game Over UI with guidance for improvement. You can interact through the web UI or via MCP-enabled clients such as Claude Desktop, MCP-UI compatible tools, or other MCP-UI clients. The flow generally follows createGame → progressStory → promptUserActions → selectAction → updateGame → progressStory → … with a dedicated restart path after game over.
How to install
Prerequisites:
- Node.js 18.x or newer
- npm 9.x or newer
- Internet access to fetch the MCP package
Installation steps (recommended):
- Install the MCP server package globally so you can run it from anywhere:
npm install -g rpg-mcp-server
- Start the server locally for development/testing:
rpg-mcp-server
- Alternatively, run with npx (without global install):
npx -y rpg-mcp-server
-
If you want to test integration with Claude Desktop or MCP-UI clients, ensure the client is configured to the server endpoint (default localhost/port as defined by the package) and that the MCP protocol version is compatible (SDK 0.5.0+).
-
Optional: build or run in development mode if provided by the project (check repository for specific build steps):
git clone <repository-url>
cd rpg-mcp-server
npm install
npm run build
npm start
Additional notes
Notes and tips:
- The server exposes delta-style change tracking for real-time feedback on state updates. Use getGame to inspect the full state at any time.
- When an update sets isGameOver to true, a Game Over UI is shown with a description and suggested improvements. Restart via selectRestart to generate a fresh context for a new adventure.
- The promptUserActions tool always generates 2-4 dynamic choices with mixed risk/reward to keep gameplay engaging.
- You can customize environment variables for different deployment environments (e.g., NODE_ENV, API keys) via the mcp_config env block. Ensure sensitive values are securely managed in production.
- The last ten game situations and corresponding user choices are automatically stored for reference and replayability.
Related MCP Servers
any-chat-completions
MCP Server for using any LLM as a Tool
bitbucket
Bitbucket MCP - A Model Context Protocol (MCP) server for integrating with Bitbucket Cloud and Server APIs
time
⏰ Time MCP Server: Giving LLMs Time Awareness Capabilities
unity-editor
An MCP server and client for LLMs to interact with Unity Projects
website-publisher
AI Website builder and publisher MCP. Quickly publish and deploy your AI generated code as real website URL. Support html, css, js, python etc.
xgmem
Global Memory MCP server, that manage all projects data.