Read, edit and export Dungeondraft maps; convert Universal VTT (.dd2vtt) into Foundry VTT scenes
An MCP server that lets Claude (or any MCP client) read, edit and export Dungeondraft maps. It works directly on .dungeondraft_map files, so Dungeondraft doesn't need to be running. It also converts Universal VTT exports (.dd2vtt) into Foundry VTT v13 scenes.
Ask things like "build a small tavern in the north-east corner of my crossroads map", "make a night version of this map", or "turn this dd2vtt into a Foundry scene".
Not affiliated with Dungeondraft or Megasploot. For live editing inside a running Dungeondraft, see battlemap-mcp. The two work well side by side.
| Tool | What it does |
|---|---|
list-maps | Finds .dungeondraft_map files in the configured folders |
inspect-map | Summary: size, levels, element counts, terrain, packs, most-used assets. Can list elements (node id, asset, grid position) by type and area |
list-assets | Searches built-in assets and installed asset packs by words, category, tag or pack |
add-objects | Places props at grid positions (rotation, scale, mirror, layer, shadow, tint) |
add-walls | Adds wall polylines or closed rooms, with doors and windows; can also add doors to an existing wall |
add-floors | Adds floor patterns (planks, cobble, tiles) over a rectangle or polygon |
build-room | Builds a closed wall, a matching floor and doors in one step |
add-lights | Adds point lights (range in squares, colour, intensity) |
add-paths | Adds path assets along grid points |
set-terrain | Sets terrain slot textures (1–8), fills a level, or paints rectangles, circles and lines with soft edges |
set-environment | Sets ambient light (presets: day, overcast, dusk, night, dark) for day/night variants |
remove-elements | Removes elements by type within an area, or by node id (supports dry_run) |
duplicate-map | Copies a map to start a variant |
export-dd2vtt | Builds a .dd2vtt from the map's walls, doors and lights plus an image exported from Dungeondraft |
dd2vtt-to-foundry-scene | Turns a .dd2vtt into a Foundry v13 scene JSON (grid, walls, doors, lights) and extracts the image |
Every edit tool accepts level (key, index or label; the default is the first level) and dry_run.
All tools use grid squares measured from the map's top-left corner, with x to the right and y down. (3, 4) is a grid intersection, and (3.5, 4.5) is the centre of the square in column 3, row 4. Fractions are allowed. Dungeondraft stores 256 px per square internally, and the server converts for you. Object positions are object centres. Rotation is in degrees clockwise. Light range, path width and terrain feather are in squares.
DD_MCP_ROOTS, which defaults to your Documents folder. .. paths and links that point outside are rejected. The Dungeondraft install and asset folders are read-only.<map>.bak-YYYYMMDD-HHMMSS (UTC).pack.json sets allow_3rd_party_mapping_software_to_read: false are listed by name only: their contents aren't indexed, and only pack.json is read, to fill in the map's asset manifest when you use them.Requires Node.js 20 or newer.
claude mcp add dungeondraft -s user -e DD_MCP_ROOTS="/path/to/your/maps" -- npx -y dungeondraft-mcp
Add this to claude_desktop_config.json (Settings → Developer → Edit Config), then restart Claude Desktop:
{
"mcpServers": {
"dungeondraft": {
"command": "npx",
"args": ["-y", "dungeondraft-mcp"],
"env": {
"DD_MCP_ROOTS": "C:\\Users\\you\\Documents\\Dungeondraft"
}
}
}
}
On Windows, if Node isn't on your PATH, use the full path, e.g. "command": "C:\\Program Files\\nodejs\\npx.cmd".
git clone https://github.com/casancam/Dungeondraft-MCP.git && cd Dungeondraft-MCP
npm install && npm run build
claude mcp add dungeondraft -s user -e DD_MCP_ROOTS="/path/to/maps" -- node "$PWD/dist/index.js"
| Variable | Default | Meaning |
|---|---|---|
DD_MCP_ROOTS | your Documents folder | Folders the server may read and write maps in, separated by ; |
DUNGEONDRAFT_DIR | auto-detected (see below) | Dungeondraft install folder (the one containing Dungeondraft.pck), used to list and validate built-in assets |
DD_ASSET_DIRS | none | Your Dungeondraft asset folder(s) with *.dungeondraft_pack files, separated by ;. Set this to use custom packs |
DUNGEONDRAFT_DIR is auto-detected at C:\Program Files\Dungeondraft (verified), and also at /opt/Dungeondraft and /Applications/Dungeondraft.app/Contents/Resources (both unverified). Without it the server still works, but built-in asset names aren't checked before they're written.
dd2vtt-to-foundry-scene on it. Set image_src to the path the image will have in Foundry, e.g. maps/tomb.png.<name>.foundry-scene.json.Light radii use dim = range × grid distance and bright = dim / 2. Dungeondraft bakes lighting into the image, so pass include_lights: false if the Foundry lights look doubled. Windows are exported as doors, because .dd2vtt doesn't tell them apart.
export-dd2vtt is for when you changed walls, doors or lights after exporting. Dungeondraft is needed to render the map image, so export a PNG/WEBP of the whole map from Dungeondraft and point the tool at it. docs/foundry-import.md describes what a live in-Foundry importer would need.
set-terrain warns when a stroke is hidden under one.export-dd2vtt doesn't write objects_line_of_sight.npm install
npm run fixtures # download public sample maps used by some tests (not redistributed)
npm test # vitest
npm run build
node scripts/smoke.mjs # end-to-end over MCP stdio on a temp copy of the test map
The tests use a real Dungeondraft 1.2.0.1 map (test/fixtures/mcp_test.dungeondraft_map), public sample maps (formats 2 and 3, up to 14 MB and 4 levels), and synthetic asset packs. They check:
.dd2vtt exportsTests that need a Dungeondraft install or the downloaded samples are skipped when those are missing. File-format notes and how each claim was verified are in docs/research.md.
MIT
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y dungeondraft-mcpMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-casancam-dungeondraft-mcp": {
"command": "npx",
"args": [
"-y",
"dungeondraft-mcp"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referencedungeondraft-mcpnpmio.github.casancam/dungeondraft-mcp works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.