Provides comprehensive tools for managing D&D 5e campaigns, including character sheets, NPCs, combat encounters, quests, locations, and game mechanics like dice rolling
D&D MCP Server - FastMCP 2.8.0+ Compliant
A comprehensive Model Context Protocol (MCP) server for managing Dungeons & Dragons campaigns, built with FastMCP 2.8.0+ for modern compatibility and enhanced performance.
🎯 FastMCP 2.8.0+ Compliance
This server is fully compliant with FastMCP 2.8.0+ and includes:
✅ Modern Decorator-Based Architecture - Uses @mcp.tool
decorators
✅ Automatic Schema Generation - From Python type annotations
✅ Pydantic Field Validation - Rich parameter validation and descriptions
✅ FastMCP CLI Support - Easy installation and development
✅ Type Safety - Full type hints with mypy compatibility
Features
Campaign Management
- Create and manage multiple campaigns
- Switch between campaigns seamlessly
- Track campaign metadata (name, description, DM, setting)
Character Management
- Complete character sheets with D&D 5e stats
- Ability scores with automatic modifier calculation
- Hit points, armor class, and combat stats
- Inventory and equipment management
- Spellcasting support
NPC Management
- Create and track non-player characters
- Manage relationships and locations
- Store descriptions and notes
Location/World Building
- Create detailed locations (cities, dungeons, etc.)
- Track populations, governments, and notable features
- Connect locations and manage geography
Quest Management
- Create quests with objectives and rewards
- Track quest status and completion
- Link quests to NPCs and locations
Combat Management
- Initiative tracking
- Turn-based combat flow
- Combat encounter planning
Session Management
- Session notes and summaries
- Experience and treasure tracking
- Character attendance
Adventure Log
- Comprehensive event logging
- Categorized by event type (combat, roleplay, exploration, etc.)
- Searchable and filterable
- Importance ratings
Game State Tracking
- Current location and session
- Party level and funds
- Combat status
- In-game date tracking
Utility Tools
- Dice rolling with advantage/disadvantage
- Experience point calculations
- D&D 5e mechanics support
Installation
Prerequisites
- Python 3.10+
- FastMCP 2.8.0+
Install with FastMCP CLI (Recommended)
Manual Installation
Usage
Running with FastMCP CLI (Recommended)
Traditional Python
Claude Desktop Configuration
Add to your Claude Desktop MCP configuration:
Or with dependencies:
Available Tools (25+ FastMCP Tools)
Campaign Management
create_campaign
- Create a new campaignget_campaign_info
- Get current campaign informationlist_campaigns
- List all available campaignsload_campaign
- Switch to a different campaign
Character Management
create_character
- Create a new player characterget_character
- Get character sheet detailsupdate_character_hp
- Update character hit pointsadd_item_to_character
- Add items to inventorylist_characters
- List all characters
NPC Management
create_npc
- Create a new NPCget_npc
- Get NPC detailslist_npcs
- List all NPCs
Location Management
create_location
- Create a new locationget_location
- Get location detailslist_locations
- List all locations
Quest Management
create_quest
- Create a new questupdate_quest
- Update quest status or objectiveslist_quests
- List quests (optionally filtered by status)
Game State Management
update_game_state
- Update current game stateget_game_state
- Get current game state
Combat Management
start_combat
- Initialize combat with initiative orderend_combat
- End combat encounternext_turn
- Advance to next participant's turn
Session Management
add_session_note
- Add session notes and summaryget_sessions
- Get all session notes
Adventure Log
add_event
- Add event to adventure logget_events
- Get events (with filtering and search)
Utility Tools
roll_dice
- Roll dice with D&D notation (e.g., "1d20", "3d6+2")calculate_experience
- Calculate XP distribution for encounters
FastMCP 2.8.0+ Features
Type-Safe Tool Definitions
Automatic Schema Generation
FastMCP automatically generates JSON schemas from your Python type annotations, providing:
- Parameter validation
- Rich descriptions for LLMs
- Constraint enforcement (ge, le, pattern, etc.)
- Optional vs required parameter detection
Rich Parameter Validation
Data Storage
The server stores all data in JSON files in a dnd_data
directory:
Example Usage
Creating a Campaign with FastMCP
Creating a Character
Rolling Dice
Development
FastMCP Development Workflow
Adding New Tools
With FastMCP 2.8.0+, adding tools is simple:
FastMCP automatically:
- Registers the tool
- Generates JSON schema
- Handles parameter validation
- Routes requests to your function
Compliance Features
FastMCP 2.8.0+ Specific
- ✅ Modern import syntax:
from fastmcp import FastMCP
- ✅ Decorator-based tools:
@mcp.tool
- ✅ Automatic schema generation from type hints
- ✅ Rich parameter validation with Pydantic
- ✅ FastMCP CLI integration
- ✅ Built-in development server
Type Safety
- ✅ Full type annotations
- ✅ Pydantic model validation
- ✅ MyPy compatibility
- ✅ Runtime type checking
Modern Python
- ✅ Python 3.10+ features
- ✅
Annotated
type hints - ✅
Literal
types for constraints - ✅ Modern async/await patterns
Migration from Raw MCP SDK
This server has been migrated from the raw MCP SDK to FastMCP 2.8.0+ for:
- Simplified Development - Decorator-based instead of manual tool registration
- Better Type Safety - Automatic schema generation from type hints
- Enhanced DX - Built-in development tools and CLI
- Modern Standards - Compliance with latest MCP best practices
License
MIT License
FastMCP 2.8.0+ Compliant ✅ | D&D 5e Compatible 🐉 | Production Ready 🚀
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
A comprehensive Model Context Protocol server for managing Dungeons & Dragons campaigns with tools for characters, NPCs, locations, quests, combat encounters, and session tracking.
Related MCP Servers
- AsecurityAlicenseAqualityA beginner-friendly Model Context Protocol (MCP) server that helps users understand MCP concepts, provides interactive examples, and lists available MCP servers. This server is designed to be a helpful companion for developers working with MCP. Also comes with a huge list of servers you can install.Last updated -3936JavaScriptApache 2.0
- -securityFlicense-qualityModel Context Protocol server that enables LLMs and AI assistants to retrieve real-time Dota 2 statistics, match data, player information, and game metrics through a standardized interface.Last updated -4Python
- -securityFlicense-qualityA Model Context Protocol server that provides tools for interacting with databases, including PostgreSQL, DuckDB, and Google Cloud Storage Parquet files.Last updated -2TypeScript
- -securityAlicense-qualityA Model Context Protocol server that enables interaction with PostgreSQL databases for analyzing setups, debugging issues, managing schemas, migrating data, and monitoring performance.Last updated -6TypeScriptMIT License