D&D 5E MCP Server
A D&D 5th Edition content and gameplay-helper server that gives an AI assistant read access to Open5e's spells, monsters, classes, species, equipment, feats, backgrounds and rules, plus encounter-building and character-build tools.
Search everything at once with
unified_search, which ranks and filters results across all content types (spells, monsters, races, classes, weapons, armor, magic items, feats, conditions, backgrounds, sections, spell lists), with optional content-type, sorting, fuzziness and detail controls.Look up spells by name, level (0–9), school or class list, and fetch details for a specific spell.
Browse classes and species: list base classes with features and subclass names, get a class's hit die, proficiencies, features, spell slots and subclasses, search species (including subspecies), and get a species with inheritance resolved.
Find monsters by name, challenge rating, CR range, type or environment — useful for encounter planning.
Search equipment and items: weapons (with finesse/martial filters), armor (category, AC, stealth disadvantage) and magic items (rarity, type, attunement), plus detail lookups.
Explore character options: search and get details for feats and backgrounds.
Consult the rules: search conditions, sections and spell lists, get specific wording by ruleset, and list all conditions or sections.
Build encounters for a DM: generate a balanced encounter for a party size/level/difficulty, or calculate the difficulty of a custom monster list.
Build and compare characters for a player: generate a build (species, class, subclass, background, ability scores, HP, spells, feats, level-by-level plan), compare multiple builds, and get recommendations based on existing party and campaign type.
Check server health with
get_api_statsfor API performance and caching statistics.Scope results to sourcebooks using
ruleset(5e-2014, 5e-2024, a5e) andsourceson all tools exceptget_api_stats.
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., "@D&D 5E MCP Server Build a hard encounter for four level 5 players."
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.
D&D 5E MCP Server
An MCP server that gives AI assistants access to D&D 5th Edition content from the Open5e API: spells, monsters, classes, species, equipment, rules references, plus encounter-building and character-build helpers. It uses Open5e's v2 API.
Requirements
Node.js 20 or newer (developed against Node 26)
Network access to
api.open5e.com
Related MCP server: D&D Knowledge Navigator
Setup
npm install
npm run buildConnecting a client
The server speaks JSON-RPC over stdio. Point your MCP client at the built entry point:
{
"mcpServers": {
"dnd-5e": {
"command": "node",
"args": ["dist/index.js"],
"cwd": "/absolute/path/to/dnd-mcp"
}
}
}Set cwd to wherever you cloned this repository. A starting point is in
mcp.json.
Verify it responds:
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"probe","version":"1"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' | node dist/index.jsTools
Every tool except get_api_stats also takes two optional arguments that
restrict it to some sourcebooks:
ruleset:"5e-2014","5e-2024"or"a5e";sources: Open5e document keys, e.g.["srd-2014", "toh"].
Without them, searches cover every source Open5e serves. Each result carries
a source label (document key, title and ruleset), and lookups by name
prefer the 2024 SRD, then the 2014 SRD. Character builds default to the 2024
SRD only (see ADR-008); pass
ruleset: "5e-2014" or sources: ["srd-2014"] for the older rules. An
unknown ruleset or document is an error. A build that mixes editions, e.g.
sources: ["srd-2024", "open5e"], uses 2014 species and backgrounds the way
the 2024 Player's Handbook allows: the species keeps its traits, and ability
increases come from the background. To add backgrounds without adding
anything else, pass background_sources to generate_character_build, e.g.
background_sources: ["toh"] for Tome of Heroes' 19 backgrounds.
Universal search
Tool | Description | Required |
| Search across all D&D content types (spells, monsters, items, races, classes, etc.) with intelligent ranking and filtering |
|
Spells
Tool | Description | Required |
| Search spells by name, level, school or class list | - |
| Get detailed information about a specific D&D 5E spell |
|
| Get all spells of a specific level |
|
| Get the spells on a class's spell list, lowest level first; filter by |
|
Classes and species
Tool | Description | Required |
| List D&D 5E base classes with their features and subclass names | - |
| Get a class: hit die, proficiencies, features by level, spell slots and subclasses with their features |
|
| Search species, including subspecies whose names omit the parent (Lightfoot for Halfling) | - |
| Get a species with what it inherits resolved: size, speed, combined ability increases, parent traits |
|
Monsters
Tool | Description | Required |
| Search monsters by name, challenge rating, type or environment | - |
| Get monsters by challenge rating |
|
| Get monsters within a challenge rating range, optionally by environment and type |
|
Equipment and items
Tool | Description | Required |
| Search for D&D 5E weapons with property filtering | - |
| Search magic items by name, rarity, category or attunement | - |
| Get detailed information about a specific D&D 5E magic item |
|
| Search for D&D 5E armor with filtering options | - |
| Get detailed information about a specific D&D 5E armor |
|
Character options
Tool | Description | Required |
| Search for D&D 5E feats with filtering options | - |
| Get detailed information about a specific D&D 5E feat |
|
| Search for D&D 5E character backgrounds with filtering options | - |
| Get detailed information about a specific D&D 5E background |
|
Rules reference
Tool | Description | Required |
| Search for D&D 5E conditions and status effects | - |
| Get a condition, with its wording for the requested ruleset |
|
| Get all D&D 5E conditions for quick reference | - |
| Search rules sections by name or text | - |
| Get a rules section by name or key |
|
| List every rules section by name, key and chapter, without the text | - |
DM tools
Tool | Description | Required |
| Build a balanced encounter for a party, sampling monsters from the whole CR range |
|
| Calculate the difficulty of a custom encounter with specific monsters |
|
Player tools
Tool | Description | Required |
| Generate a build: species, class and subclass, background, ability scores, hit points, spells, feats and a level-by-level plan | - |
| Generate and compare multiple character builds with different options |
|
| Get character build recommendations based on party composition and campaign needs |
|
Diagnostics
Tool | Description | Required |
| Get API performance and caching statistics | - |
Development
npm run dev # watch mode
npm run build # compile to dist/
npm run lint # eslint over src/
npm test # unit tests, no network (builds first)
npm run test:integration # live Open5e API tests
npm run test:all # both suitesTests use Node's built-in test runner. test/unit/ mocks fetch, so it runs
offline and fast; test/integration/ exercises the real API and the real server
process. See docs/testing.md.
Known quirks
Duplicate names across books. A search for
fireballreturns every sourcebook's Fireball, each labelled with itssource. Detail lookups pick one (2024 SRD first); passrulesetorsourcesto choose another.Uneven upstream filtering. Open5e ignores many filter parameters and returns the whole collection. The client sends only verified parameters and matches the rest locally; see docs/api-filters.md.
Gaps in Open5e's data are reported, not guessed. Examples: no 2014 SRD spell lists the Paladin, and some Tome of Heroes heritages have no source for their size. Look in a build's
warningsor a species'resolved.unresolved.Builds are opinionated. Game rules (spell slots, hit points, ASIs) come from the SRD, but the scoring choices that pick a class, species or spell are judgment calls, collected in
src/character-build/heuristics.ts. Multiclass builds are not supported;allow_multiclass: trueis rejected.unified_searchcount vs items. Forclassesthe reportedcountcan exceed the number of returned items, because classes are listed whole and then ranked against the query.
Documentation
docs/api-filters.md - per-endpoint Open5e filter support
docs/testing.md - how the suites are organised
docs/adr/ - architecture decision records
docs/history/ - superseded point-in-time reports
CLAUDE.md - guidance for Claude Code
Data source and licence
Content comes from the Open5e API, which serves material published under the
OGL and Creative Commons licences. This server is MIT licensed; the game
content it returns is governed by its own licences. Each item's source
names the document it comes from.
Available Tools
37 toolsbuild_encounterA
Build a balanced D&D 5E encounter using monsters by CR for specified party
Inputs: party_size (required), party_level (required), difficulty (required), environment, +4 more.
calculate_encounter_difficultyC
Calculate the difficulty of a custom encounter with specific monsters
Inputs: party_size (required), party_level (required), monsters (required).
compare_character_buildsC
Generate and compare multiple character builds with different options
Inputs: build_options (required), campaign_type, focus_level.
generate_character_buildC
Generate an optimized character build combining race, class, background, and feats
Inputs: preferred_class, preferred_race, preferred_background, playstyle, +5 more.
get_all_conditionsB
Get all D&D 5E conditions for quick reference
Inputs: no named parameters.
get_all_sectionsB
Get all available D&D 5E rules sections for quick reference
Inputs: no named parameters.
get_all_spell_listsB
Get all available D&D 5E spell lists for quick reference
Inputs: no named parameters.
get_api_statsB
Get API performance and caching statistics
Inputs: no named parameters.
get_armor_detailsB
Get detailed information about a specific D&D 5E armor
Inputs: armor_name (required).
get_background_detailsC
Get detailed information about a specific D&D 5E background
Inputs: background_name (required).
get_build_recommendationsB
Get character build recommendations based on party composition and campaign needs
Inputs: existing_party (required), campaign_type (required), party_level, missing_roles.
get_class_detailsB
Get detailed information about a specific D&D 5E class
Inputs: class_name (required).
get_condition_detailsB
Get detailed information about a specific D&D 5E condition
Inputs: condition_name (required).
get_feat_detailsB
Get detailed information about a specific D&D 5E feat
Inputs: feat_name (required).
get_magic_item_detailsC
Get detailed information about a specific D&D 5E magic item
Inputs: item_name (required).
get_monsters_by_crC
Get monsters by challenge rating
Inputs: challenge_rating (required).
get_monsters_by_cr_rangeA
Get all monsters within a specific challenge rating range for encounter planning
Inputs: min_cr (required), max_cr (required), environment, monster_types, +1 more.
get_race_detailsB
Get detailed information about a specific D&D 5E race
Inputs: race_name (required).
get_section_detailsC
Get detailed information about a specific D&D 5E rules section
Inputs: section_name (required).
get_spell_by_levelC
Get all spells of a specific level
Inputs: level (required).
get_spell_detailsC
Get detailed information about a specific D&D 5E spell
Inputs: spell_name (required).
get_spell_list_detailsC
Get detailed spell list information for a specific D&D 5E class
Inputs: class_name (required).
get_spells_by_classC
Get all spells available to a specific class
Inputs: class_name (required).
get_spells_for_classB
Get detailed spell information for all spells available to a specific class
Inputs: class_name (required), limit.
search_armorB
Search for D&D 5E armor with filtering options
Inputs: query, category, ac_base, stealth_disadvantage, +1 more.
search_backgroundsC
Search for D&D 5E character backgrounds with filtering options
Inputs: query, limit.
search_classesB
Get all D&D 5E classes with comprehensive details
Inputs: no named parameters.
search_conditionsC
Search for D&D 5E conditions and status effects
Inputs: query, limit.
search_featsC
Search for D&D 5E feats with filtering options
Inputs: query, has_prerequisite, limit.
search_magic_itemsC
Search for D&D 5E magic items with filtering options
Inputs: query, rarity, type, requires_attunement, +1 more.
search_monstersB
Search for D&D 5E monsters with filtering options
Inputs: query, challenge_rating, limit.
search_racesC
Search for D&D 5E races with detailed trait information
Inputs: query.
search_sectionsC
Search D&D 5E rules sections for quick rule lookups
Inputs: query, limit.
search_spell_listsB
Search available D&D 5E spell lists by class
Inputs: query, limit.
search_spellsC
Search for D&D 5E spells with advanced filtering options
Inputs: query, level, school, limit, +1 more.
search_weaponsC
Search for D&D 5E weapons with property filtering
Inputs: query, is_martial, is_finesse, limit.
unified_searchA
Search across all D&D content types (spells, monsters, items, races, classes, etc.) with intelligent ranking and filtering
Inputs: query (required), content_types, limit, include_details, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 37 tools
Most tools have distinct purposes, but there is some overlap that could cause confusion. For example, get_spells_by_class and get_spells_for_class appear very similar, and get_all_sections vs. search_sections might be ambiguous. However, the majority of tools target specific resources and actions clearly.
Tool names follow a highly consistent verb_noun pattern throughout, such as get_*_details, search_*, and build_*. There are no deviations in style, making the set predictable and easy to understand at a glance.
With 37 tools, the count is borderline high for a D&D 5E server, which might feel heavy and overwhelming. While the domain is broad, some tools could potentially be consolidated or streamlined to reduce complexity without losing functionality.
The tool surface provides comprehensive coverage of the D&D 5E domain, including CRUD-like operations for characters, encounters, spells, monsters, items, and rules. It supports detailed lookups, searches, and advanced features like encounter building and character optimization, leaving no obvious gaps for agent workflows.
Maintenance
Related MCP Connectors
D&D 5e MCP — wraps the D&D 5th Edition API (free, no auth)
Characters, campaigns, adventures & worlds for D&D 5e/5.5e, Pathfinder, Savage Worlds, Fate, & more.
Connect any AI to your Foundry VTT world: actors, combat, dice, journals, tokens, compendiums.
Dungeons & Dragons (D&D) and TTRPG companion: SessionKeeper sessions, NPCs, wiki, DM prep.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides fast, cached access to comprehensive Dungeons & Dragons 5th Edition data including spells, monsters, classes, races, equipment, and rules through Open5e and D\&D 5e APIs.72MIT
- AlicenseNot gradedqualityDmaintenanceConnects AI assistants to Dungeons & Dragons 5e game information via the Model Context Protocol, enabling queries for spells, monsters, equipment, and more.54MIT
- FlicenseAqualityBmaintenanceEnables D&D 5e game masters and players to access complete game reference data, search spells, monsters, items, and calculate encounter difficulty, all through natural language.468-
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to manage D&D Beyond characters, access campaigns, and look up spells, monsters, items, and more through a reverse-engineered API.MIT