A Model Context Protocol (MCP) server for managing D&D 5e game mechanics, character data, and providing DM assistance through structured tools and APIs.
This project implements Phase 0 (Foundational Mechanics) of the D&D DM MCP Server, focusing on basic CRUD operations for character management, dice rolling mechanics, and combat engine fundamentals. The server provides a CLI interface for game masters to manage their campaigns programmatically.
- Python 3.11 or higher
- Poetry for dependency management
- Clone the repository
- Copy
.env.exampleto.envand configure as needed - Install dependencies:
poetry install
poetry run python -m src.main# Create a new character
poetry run python -m src.cli character create --name "Gandalf" --class "Wizard" --level 5
# List all characters
poetry run python -m src.cli character list
# Get character details
poetry run python -m src.cli character get --name "Gandalf"
# Update character
poetry run python -m src.cli character update --name "Gandalf" --level 6
# Delete character
poetry run python -m src.cli character delete --name "Gandalf"# Roll dice
poetry run python -m src.cli roll 1d20+5
poetry run python -m src.cli roll 3d6# Start combat session
poetry run python -m src.cli combat start
# Add combatants
poetry run python -m src.cli combat add --name "Gandalf" --initiative 15
# Process turn
poetry run python -m src.cli combat turnRun tests:
poetry run pytest[License information to be added]