Skip to main content
Glama
RPG MCP Server

RPG MCP Server

by jnaskali

RPG MCP Server

A simple MCP (Model Context Protocol) server for playing RPGs with Large Language Models. It provides tools for dice rolling, success checks, and random event generation.


Example screenshot of RPG MCP in use


Features

  • check_success(probability, critical_rate) - Determines success/failure with optional critical results

  • roll_dice(expr) - Rolls dice using standard RPG notation (e.g., '1d6', '2d8+3')

  • generate_event() - Generates random RPG events for plot twists and surprises

  • list_tools() - Lists all available tools

Related MCP server: Dice Roller MCP Server

Installation

Prerequisites

  • Python 3

  • uv - A fast Python package installer

Setup

  1. Clone the repository:

git clone https://github.com/jnaskali/rpg-mcp.git
cd rpg-mcp
  1. Install dependencies with uv:

uv sync

Configuration

Add the following to your MCP client's configuration file (e.g., mcp.json in Claude Desktop or other MCP-compatible clients):

{
  "mcpServers": {
    "rpg-mcp": {
      "command": "/usr/bin/uv",
      "args": [
        "run",
        "python",
        "app.py"
      ],
      "cwd": "/PATH_TO/rpg-mcp/"
    }
  }
}

Replace /PATH_TO/rpg-mcp/ with the actual path to your rpg-mcp directory.

Usage

Once configured, the LLM can call the tools to:

  • Roll dice for attacks, damage, or skill checks

  • Determine action outcomes with customizable success probabilities

  • Generate random events to drive the narrative forward

Example Prompt

Include instructions in your prompt like:

"Call check_success whenever a player character attempts something with a chance of failure, and generate_event to generate a random event at the start of a new scene or when moving to a new location."

The event generation system is inspired by Mythic Game Master Emulator.

IMPORTANT


Tool calling works best with models that support function calling, such as Claude, GPT-4, Mistral, Llama, or Qwen.

Examples

Test the server by asking the LLM to generate a random event. The unique format should make it clear whether the tool is working or if the LLM is hallucinating results.

Screenshot of a working test

Available Tools

6 tools
check_successB

Check for success based on a given probability.

Args: probability: Chance of success (0-100). Default 80. critical_success: Top % range for critical success (0-50). Default 5. critical_failure: Bottom % range for critical failure. Defaults to critical_success value.

Inputs: probability, critical_failure, critical_success.

generate_addressC

Generate random addresses.

Inputs: count, locale.

generate_corporationA

Generate a random corporation name from the local file.

Inputs: no named parameters.

generate_eventA

Generate a random abstract RPG event.

Inputs: no named parameters.

generate_nameA

Generate random modern names. Args: count: Number of names (1-50). gender: 'male', 'female', or 'random'. locale: Locale code (e.g., 'en_US', 'de_DE', 'fr_FR').

Inputs: count, gender, locale.

roll_diceA

Roll dice using RPG notation (e.g., '2d6', '1d20+5').

Inputs: expr (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct purpose: address generation, corporation generation, success checking, dice rolling, event generation, and name generation. There is no overlap between these functions, and check_success vs roll_dice are clearly different mechanics.

    Naming Consistency5/5

    All tool names follow a verb_noun pattern. Four use the 'generate_' prefix, while the other two use clear action verbs ('check_success', 'roll_dice'). The naming is predictable and consistent in structure.

    Tool Count5/5

    Six tools is well within the ideal range for an RPG assistant, covering both generation and resolution without unnecessary bloat. Each tool is useful and distinct, making the set well-scoped.

    Completeness4/5

    The set covers core RPG needs: dice rolling, probability checks, and varied random generation (names, events, addresses, corporations). Some possible additions like item or character generation are missing, but the essential workflows are present.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides comprehensive dice rolling functionality for tabletop games and RPGs, supporting standard dice notation, D\&D ability score generation, advantage/disadvantage rolls, and skill checks against difficulty classes.
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides comprehensive dice rolling, coin flipping, and tabletop RPG mechanics for AI assistants like Claude. It enables real-time tabletop gaming through features such as standard NdM notation, advantage/disadvantage rolls, and D\&D character stat generation.
      1
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI to act as Game Master for tabletop RPGs with deterministic dice, five-tier outcomes, FitD-style stress, combat tracking, clocks, investigations, NPC relationships, and world generation via 134 tools over MCP.
      2
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables tabletop RPG dice rolling through natural language, supporting standard dice formulas, modifiers, exploding dice, and d20 prompts for ability checks, saving throws, attack rolls, and damage rolls.
      -