battlemap-mcp
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., "@battlemap-mcp Furnish this room as a tavern with a bar, tables, and barrels"
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.
battlemap-mcp: a Dungeondraft MCP server
An AI collaborator for your Dungeondraft maps: a local bridge that lets your AI assistant (Claude Desktop, Claude Code, Codex, OpenCode, or any other MCP client) build, inspect, and refine the map you have open, using assets you already own.
Documentation: knownframe.com/battlemap-mcp/docs · Setup video: install it in five minutes (YouTube)
Sped up 11×; the full build took about five minutes. Watch the narrated build (YouTube).
Support creators first
This is a local automation layer for your own Dungeondraft map-making session. It does not generate original assets or art for you; it drives what you already own in Dungeondraft. Please buy and support Dungeondraft, and support the artists whose asset packs you use.
Related MCP server: foundry-cli
Supported mods
battlemap-mcp notices these Dungeondraft mods when they are loaded and works with them. Without them, nothing changes.
Mod | What your assistant does with it |
Unofficial Patch by Moulk | Resizes maps up to 200 tiles a side and uses the Above Lights layer. Keeps your Free Transform shapes and groups when it moves or copies objects, and leaves the patch's extra terrain slots alone. |
Custom Snap Mod by Lievven | Reads your square, hex or custom grid and, when you ask, places things on it, as your cursor would. It never changes your snap settings. |
Soft Shadows by Moulk | Adds, adjusts and removes soft shadows on objects, walls and paths, and keeps your own shadows when it moves, edits, deletes, undoes or copies them. Roof and pattern shadows are left as you set them. |
Theme Search by Moulk | Searches objects by theme, such as "kitchen" or "tavern". |
Better Terrain Tool by Moulk | Keeps its painted layers in place when a map is trimmed from the left or top, and saves its latest layers. |
Sketch Tool by Moulk | Keeps your sketch notes out of the map images it exports, as Dungeondraft's own Export does. |
Animated Doors by CePeU | Marks free-standing doors and objects as animated doors, changes their settings, and keeps those settings when it copies them. Doors set into walls are left out, as the mod leaves them. Its animated Universal VTT comes only from the mod's own Export window. |
Some steps depend on a mod's version, and run only on the versions they were checked against. Details: Using other mods.
What you can make
Build a whole map from a brief, plan an encounter together, furnish one room, export to or rebuild from a Universal VTT file, or hand off tedious placement. See example prompts.
Videos
Install it in five minutes with the Claude desktop app
Two ways to update: by hand, or by asking Claude Code
Build a tavern, from a short brief to a lit map
Build a harvest feast hall that turns into an ambush, with default assets and asset packs side by side
All of them, plus Shorts: knownframe.com/battlemap-mcp/videos · the YouTube playlist.
Get started
You need Dungeondraft 1.2.0.1 and an AI app that can run local MCP servers, on the same computer. Follow Get started, then the Windows, macOS or Linux guide. Downloads are on the Releases page. Prefer to watch? The setup video installs everything with the Claude desktop app, start to finish.
Install with uv or pip
If you have uv or Python 3.11 or newer, you can install the server from PyPI instead of downloading a companion (from 1.5.0):
uv tool install battlemap-mcp
uv tool update-shellThen, in a new terminal and with Dungeondraft closed:
battlemap-mcp install
battlemap-mcp setup --client claude-codeThis installs the server. The Dungeondraft mod is a second step, which the tool does for you: install copies it into your mods folder (or ask your assistant to install the bridge), and you still enable it in Dungeondraft. setup also takes codex and opencode.
Upgrade with uv tool upgrade battlemap-mcp, then run battlemap-mcp install --force and battlemap-mcp setup --client claude-code --force (which updates the skills), and restart Dungeondraft and your AI app. The PyPI page also covers uvx, pipx and pip.
Debian and Ubuntu package
From 1.5.0, each release has a battlemap-mcp_<version>_amd64.deb for 64-bit Intel/AMD Linux. Download it from Releases, then:
sudo apt install ./battlemap-mcp_<version>_amd64.debThe package installs the program only. Then, as yourself (not with sudo) and with Dungeondraft closed:
battlemap-mcp installbattlemap-mcp setup --client claude-codeinstall copies the mod into your mods folder, and you enable it in Dungeondraft. setup also takes codex and opencode. With a map open, check the connection with battlemap-mcp doctor --live --brief.
There is no package repository, so to update, install the next release's .deb the same way. Then run battlemap-mcp install --force and battlemap-mcp setup --client claude-code --force. sudo apt remove battlemap-mcp removes the program and leaves your settings, the mod and the skills. The package has not been tried with the editor on a native Linux desktop yet.
Update
From 1.5.0, a downloaded companion can update in one step: ask your assistant to update, or run battlemap-mcp update in its folder. It shows what it will do and waits for your yes. Moving to 1.5.0 from an older version, and every other kind of install, uses that install's own upgrade; see Update or remove and how updates are checked.
Include your asset packs
Install from Claude
Use the Claude desktop extension or the Claude Code plugin: see Install from Claude.
Platform limits
Emoji on Windows. A request containing an emoji, such as a text label, is refused and nothing runs, even though the error says the command may have run. Dungeondraft on Windows does not keep emoji in labels either.
A pack's first load. The first time Dungeondraft loads an asset pack, building its preview pictures can crash it (seen on Windows, macOS and Linux). Start it again and reopen the map; pictures already made are kept.
See Platform limits.
If something does not work
See Troubleshooting.
Documentation
Tool reference: every tool, generated from the server
For contributors: Bridge protocol, Developer installation, Building releases, Contributing, Changelog.
Glama listing
battlemap-mcp is listed on Glama, where you can browse its tools and its quality score before installing.
Affiliation and legal
battlemap-mcp is an independent, unofficial project and is not sponsored, operated, or endorsed by Megasploot or Tailwind Games, LLC. It does not include or redistribute Dungeondraft software, maps, or art assets. See Legal and attribution.
Available Tools
106 toolsadd_floorA
Draw a solid floor shape — the bordered room floors a built map is made of.
rect: [x, y, w, h] in woxels, or points: [[x,y], ...] for any outline.
invert: cut a hole in the floor instead of adding to it.
This is a different system from terrain and from patterns. Terrain is the
painted ground beneath everything; a pattern is a tiled surface; a floor
shape is a solid slab with an outlined edge, which is what makes a room read
as a built interior rather than a patch of ground. Reach for it when walling
a room, and paint terrain outside it.
Like terrain and water it is a layer, not an object: there is nothing to
select or delete, so use invert to take one back.
A native floor is not a pattern: it carries its own border WALL and can use
Dungeondraft's smart tiles. Unset options keep whatever the tool holds.
smart_tile_id: which floor style. Read the options from
list_tool_controls('FloorShapeTool') — they are ids, not names.
wall_asset: the Walls asset used for this floor's own border wall.
wall_color: hex tint for that border wall.
bevel: bevel the border wall's corners.
Inputs: rect, bevel, invert, points, +3 more.
add_levelB
Add a new level (floor) to the map. Returns its id and label.
Inputs: label.
add_lightA
Add a light at a woxel position. Returns the new element id.
color: '#rrggbb' (default warm). energy: brightness.
range: the Range Dungeondraft's own Light tool shows, which its saved map
and a VTT export record too. get_element and list_elements report it
in the same units.
asset: optional Lights gradient/cookie texture path.
snap: 'none', 'grid' or 'auto'; see get_snap_settings.
lights: up to 100 {x, y, color, energy, range, shadows, asset} entries,
added as ONE undo step and all-or-nothing; the other arguments are then
ignored. Returns `ids`. A light for an object: place_object(light=...).
modify_object changes a placed light's color, energy, range and shadows.
Inputs: x, y, snap, asset, +5 more.
add_portalB
Add a door/window portal at a woxel position. Returns the new element id.
By default the portal MOUNTS on the nearest wall and the wall cuts a gap around it (like placing a door by hand).
Inputs: asset (required), x, y, flip, +7 more.
add_roofA
Add a roof from its RIDGE LINE. Returns the new element id.
sunlight: shade the roof's faces from a sun direction. This is what makes a
roof read as a solid volume rather than a flat patch of tiles, and it is
worth setting on any exterior building.
sun_angle: degrees the light comes FROM. Use ONE angle for every roof on a
map — two buildings lit from different directions read as a mistake
immediately.
sun_contrast: 0 is flat, higher is starker.
IMPORTANT: `points` is the roof's ridge (the peak line), NOT a footprint to
trace. DD builds a complete, self-closing roof that slopes down `width`
woxels perpendicular to each side of the ridge, with hips/gables off the
ridge ends. The footprint covered = the ridge's bounding box expanded by
`width` on every side.
To roof a building W x H: put the ridge along the LONG axis, centered, and
set width = half the SHORT dimension so the eaves reach the side walls. The
ridge should be shorter than the long wall by ~width at each end (so the end
hips land on the short walls). Two points that are close together give a
near-pyramid (a square hip roof).
asset: a Roofs asset path (list_assets('Roofs')). type: 0=gable, 1=hip,
2=dormer. Roofs render above everything (z 800). Undoable as a create.
Inputs: asset (required), points (required), type, width, +4 more.
add_textA
Add a text label at a woxel position. Returns the new element id and size.
size: font size in points (default ~32). color: '#rrggbb' (default black).
font: a DD font name; omit to keep the default font.
On Windows, leave emoji out: the request is refused and nothing is added,
even though the error says it may have run.
Inputs: text (required), x, y, font, +2 more.
add_waterA
Add a body of water — a pond, pool, river bend, moat, or flooded room.
rect: [x, y, w, h] in woxels, or points: [[x,y], ...] for a shoreline.
invert: erase water inside the outline instead of adding it. Water is a
layer, not an object — there is nothing to select and delete — so this is
how you take a pond back or cut an island out of one.
Water is a polygon layer, not a brush stroke: you give it a closed outline
and the whole enclosed area becomes water. Give exactly one of:
rect: [x, y, w, h] in woxels, for a rectangular pool.
points: [[x, y], ...] with at least 3 points, for an irregular shape — a
pond, a river bend, a cave lake. The outline closes automatically.
Call it repeatedly to build up several separate bodies of water. When the
level's existing water shares one style (set_water_style), new water takes
it too and the response says `matched_level_style`.
Inputs: rect, invert, points.
arrange_objectsA
Lay furniture out against a wall, around a table, or on a surface, in ONE undo step.
Fitted to each asset's DRAWN area (list_assets `drawn`, the target's
opaque bounds), never its canvas, so a shelf sits flush to its wall.
`assets` are used in turn, repeated to `count`.
mode='along_wall': backs a row against a wall, fronts into the room.
along: [[x0, y0], [x1, y1]], the stretch of wall to line. The nearest
parallel wall within 96 woxels is used and reported; `warnings` names
any other wall that close (a double wall where two build_room rooms
meet: pass wall_id). Corners and portals are kept `margin` (32) clear.
toward: a point on the room side; needed when the wall is not a loop.
count omitted fills the stretch. gap: fixed spacing, centred; omitted,
spare room is shared evenly.
mode='around': seats `count` (4) assets around target_id, each facing it.
shape 'auto' is round when the table's name says round, else rect
(seats per side by length). clearance: gap from the table's drawn edge,
negative tucks under (-16). jitter adds a few degrees and woxels so the
table does not read as a grid.
mode='on_surface': sets `count` (3) items inside target_id's drawn area,
`margin` (12) from its edge, turned a little, not overlapping. Layer
defaults to one above the surface: 1100 over a 900 surface only with the
Unofficial Patch, else refused.
facing: where each asset's front points at rotation 0. 'down' is how
Dungeondraft's own furniture is drawn; pack art may differ, so look, and
pass the facing it has. The reply says which was used.
dry_run: plan only, place nothing. Returns `objects` (with ids when
placed), `skipped` for items with no room, and `seed`. One undo() reverses
it; color is baked at placement, as in place_object.
Inputs: mode (required), assets (required), gap, seed, +14 more.
build_roomA
Build a room in one call: a looped wall AND a matching floor on the SAME path.
Because the wall and floor share the boundary, the floor meets the wall
exactly (no gap) — like the UI's combined wall+floor trace. Provide ONE of:
rect: [x, y, w, h] axis-aligned rectangle, or
points: [[x,y], ...] a polygon (>= 3 points), all in woxels (the wall
centerline; the wall covers the floor's outer edge).
wall_asset: a Walls asset path (omit for the default).
floor: 'pattern' (a tiled floor; floor_asset + floor_category), 'terrain'
(paints terrain into floor_slot; floor_asset assigns the slot texture),
or 'none' for walls only.
floor_asset: the floor texture. floor_category: pattern bank for floor=
'pattern' (e.g. 'Simple Tiles', 'Smart Tiles', 'Materials').
floor_color: optional '#rrggbb' tint (pattern floors). Omitted, a greyscale
or red colour mask texture gets a neutral brown, as in place_pattern.
wall_type: 0=auto, 1=manual, 2=cave. wall_joint: 0=sharp, 1=bevel, 2=round.
snap: 'none', 'grid' or 'auto'; see get_snap_settings. A rect
gets all four corners on the grid (on hex, the far one may shift).
shared_walls: 'split' (default) leaves out the parts of the boundary an
existing wall on this level already covers, so two rooms side by side
share ONE wall and a door placed on it opens in a VTT export. Only a
wall of the same wall_type (and of wall_asset, when given) is shared.
A boundary walled all round gets only its floor (refused with
floor='none'). The shared wall belongs to the room built first:
deleting it later leaves this room open on that side. 'keep' always
draws the full loop.
Returns { wall_id, floor_id?, points }, or, when walls were shared,
{ wall_ids, shared_edges, floor_id?, points } (wall_ids may be empty).
On a map with more walls than one read covers, walls_considered and
shared_walls_note say how many were checked for sharing.
Inputs: rect, snap, floor, points, +8 more.
checkpointA
Mark the start of a request, so all of it can be undone in one call.
Call it before a multi-step change (a room, a set piece, a pass of
lighting). rollback_checkpoint(label) then undoes every edit THIS session
made since, newest first, and reports what it reversed. Reusing a label
moves the mark to now.
Inputs: label (required).
clear_capturesA
Remove every server-generated screenshot, export, and asset preview, and every trace image it wrote but the newest.
This only deletes regular files directly in Dungeondraft's `mcp_output`
directory whose names the server generates. It never recurses into the
directory or removes other files a user has placed there. The newest trace
is kept because the open map probably uses it; a map whose trace file is
gone still opens, without its trace.
Inputs: no named parameters.
clear_cavesA
Wipe the entire cave layer back to solid rock.
Removes all carved caves at once (the whole cave system), rebuilding the
mesh. Undoable like dig_cave. Use this instead of filling regions back with
dig_cave(dig=False) when you want to reset all caves.
Inputs: no named parameters.
clear_selectionB
Clear the current selection in Dungeondraft.
Inputs: no named parameters.
create_image_packA
Build a native, reusable .dungeondraft_pack of named, tagged PNG objects.
Writes only into Dungeondraft's configured asset folder (Settings > Assets),
never to an arbitrary path. filename: bare NEW .dungeondraft_pack name in
that folder; existing files are never overwritten. name: pack title related
to the map/project. Each image needs an absolute PNG path, a library name,
and descriptive tags (e.g. furniture, workshop, oak). PNG alpha is kept.
pack_id: optional eight alphanumeric characters; generated if omitted.
This creates a complete pack; it does not edit third-party archives. To
extend a collection, rebuild from the full image list under a new filename.
Prefer a new id during a live session; Dungeondraft caches loaded pack ids.
After writing, ask the user to restart Dungeondraft so it mounts the pack
(an Assets window rescan is untested), then prepare_map_with_packs with the
returned id. This tool does not refresh
the editor or change the open map's included packs. search_pack_contents can
already list the new archive from disk. Embedded import_image objects stay
map-local; these pack assets become searchable library entries once included.
Inputs: name (required), images (required), filename (required), author, +1 more.
crop_mapA
Crop the map to a window of TILES, rect=[x, y, w, h], from any side.
The tile at (x, y) becomes the new top-left and everything moves with it.
Choose the window with the user first: keep the focal area, routes and
whole rooms (get_composition_snapshot, then screenshot or fit_elements).
Without confirm this only previews: the new size, and per kind the ids of
what lies wholly outside (`outside`, deleted on confirm) and what crosses
the edge (`crossing`, kept as it is: a wall or path running off the map
is not cut, so mention it, and delete or redraw it if the user wants).
Patterns cannot be listed, so a pattern outside stays, off the map.
confirm=true saves the map and copies the file beside it (`backup`), since
a crop cannot be undone, then crops through Dungeondraft's own resize and
deletes what was outside, one undo step per 100 (`undo_steps`). Earlier
undo history is cleared, because every element moved. If a step fails the
reply says `changed: "partial"` or `"unknown"` with what is left: follow
its `next`, never just call crop_map again. Only the current level is
cleaned of what lies outside; every level is cropped.
Inputs: rect (required), confirm.
delete_elementA
Delete any element from the map by id. Reversible with undo().
The element is detached rather than destroyed, so undo() puts it back
exactly where it was, with its id intact.
To take back what a place_prefab, scatter_objects or build_room just made,
call undo() once instead of deleting its pieces: each of those is ONE undo
step, but only while it is still the latest undoable operation. Anything
done since has to be undone first, which may not be what you want.
It leaves the map on the NEXT frame, so a get_status immediately after may
still count it. Read the count back a moment later, not in the same breath.
Terrain, water and floor shapes are layers, not elements: they have no id
and cannot be deleted. Paint over them, or draw them again with invert.
Inputs: id (required).
delete_elementsA
Delete many elements in ONE call and ONE undo step. Reversible with undo().
Deleting one at a time costs a call and an undo slot each, and a large group
can push everything built before it out of the history's reach.
Before reaching for this on something you just created: a place_prefab,
scatter_objects, place_objects or build_room call is already a single undo
step, so undo() takes the whole thing back while it is the latest
operation. Use this for elements from different calls, or older work.
Up to 100 ids. Every id is resolved before anything is deleted: if one is
unknown the batch changes nothing and names it, rather than leaving you to
work out how far it got.
Inputs: ids (required).
delete_levelA
Delete a level (floor) by its id (see list_levels). Not undoable.
Refused when it would remove the map's only level.
Inputs: id (required).
dig_caveA
Carve a cave along a path with the Cave Brush (the dig/blast tool).
Dungeondraft caves are a separate layer: you dig open floor out of solid
rock, and DD auto-generates the rocky wall border + debris around the opening.
points: a list of [x, y] woxel points the cave runs through (>= 1). A single
point digs one circular chamber; multiple points dig a connected tunnel
(rasterized as a constant-width ribbon, like paint_path). radius: half-width
in woxels (default 256 = ~1 tile). dig: True carves open cave; False fills it
back to rock. ground_color / wall_color: optional cave floor/wall tints
("#rrggbb"). texture: optional Caves floor asset (see
list_assets(category="Caves")). The mesh rebuilds automatically.
Inputs: points (required), dig, radius, texture, +2 more.
draw_pathA
Draw a path/road/river through a list of [x, y] woxel points. Returns the new element id.
asset: a Paths asset path from list_assets(category='Paths').
smoothness: optional curve smoothing. width: optional width scale multiplier.
A wall-textured path looks like a wall but carries no line of sight into a
VTT export. Where vision matters, run a real draw_wall along it too.
End treatments, which are what make a path read as part of the world rather
than a strip laid on top of it:
fade_in / fade_out: the path's opacity fades at its start / end. Use where a
trail should disappear into undergrowth or run off the map edge, instead
of stopping at a hard rectangular cut.
grow / shrink: the path's WIDTH tapers at its start / end. A stream that
narrows upstream, a track that widens as it approaches a gate.
Set these per path, here: changing the PathTool's own options beforehand
does not affect what this draws.
snap: 'none', 'grid' or 'auto'; see get_snap_settings.
Inputs: asset (required), points (required), grow, snap, +7 more.
draw_wallA
Draw a wall through a list of [x, y] woxel points. Returns the new element id.
asset: optional Walls asset path. loop: close into a loop (e.g. a room).
type: 0=auto, 1=manual, 2=cave. joint: 0=sharp, 1=bevel, 2=round.
snap: 'none', 'grid' or 'auto'; see get_snap_settings.
Inputs: points (required), loop, snap, type, +4 more.
duplicate_objectB
Duplicate an object by id, offset by (dx, dy) woxels. Returns the new element id.
snap: rounds dx, dy to the nearest whole grid steps; see get_snap_settings.
Inputs: id (required), dx, dy, snap.
export_dd2vttA
Write the open map as a Universal VTT file (.dd2vtt) for Foundry, Roll20, Arkenforge and other VTTs. Read-only for the map.
Contains the map image (rendered like export_map), its walls as sight
lines broken at each door and window, every portal (closed = an openable
door, open = a window, which is all a VTT can tell), lights, the ambient
light, and an outline for each object that blocks light.
path: absolute .dd2vtt or .uvtt file to write, in a folder that exists
(any other extension becomes .dd2vtt). Omitted: beside the saved map,
named after it. An existing file is refused unless overwrite=true.
ppi: pixels per grid square in the image (Foundry's default is 100).
grid: draw the grid into the image; VTTs usually draw their own.
Object outlines are the drawn area's bounding box, coarser than
Dungeondraft's own export. Check `vtt_reversed_portals` from
validate_floorplan first: a door left open arrives as a window.
Inputs: ppi, grid, path, timeout, +1 more.
export_mapA
Render the entire current map to a clean image (no UI) and return it.
ppi controls resolution (pixels per grid cell): higher = sharper but larger/slower.
Dungeondraft abandons any export wider or taller than 16384 px without a
word, so one that large is refused up front with the highest ppi this map
allows.
format: 'png' (default), 'jpg' or 'webp'. quality (1-100, default 90)
applies to jpg and webp.
grid: False for a gridless image, the usual deliverable for sharing and
for VTTs that draw their own grid; True to force it on. Omitted, the
export matches the editor. The editor's grid is put back afterwards.
The render is a tracked operation: this waits up to `timeout` seconds
(max 600). If that runs out, the error names the operation; collect the
image with get_export rather than exporting again. While an export renders,
edits, camera moves and screenshots are refused — the exporter renders by
moving the camera, and any of those would corrupt the image.
max_px: shrink the long edge of the image RETURNED to you. The file written
to disk keeps the resolution `ppi` asked for, so this costs the delivery
nothing — it only makes the copy you look at smaller. `ppi` is the knob
that makes the render itself faster.
For a Universal VTT file (.dd2vtt) with walls, doors and lights, use
export_dd2vtt.
Inputs: ppi, grid, format, max_px, +2 more.
fill_regionA
Fill only a region with a terrain slot (e.g. floor a single room), in woxel coords.
Unlike fill_terrain (whole level), this paints inside a shape. Provide ONE of:
rect: [x, y, w, h] axis-aligned rectangle, or
points: [[x,y], ...] a polygon (3 to 2000 points). Split a larger outline
into polygons that share edges; a shared edge paints each pixel once.
asset: optional Terrain asset to assign to the slot first.
rate: paint strength 0..1 (1 = fully replace). Undoable via undo().
Inputs: rate, rect, slot, asset, +1 more.
fill_terrainA
Flood-fill the whole current level with a terrain slot.
If asset is given, it is assigned to the slot first.
The usual first ground call is fill_terrain(asset=<base material>) on the
default slot 0: that replaces the base under everything and leaves slots
1-3 free for roads, yards and worn edges painted on top with fill_region.
Inputs: slot, asset.
fit_elementsA
Frame the whole map, or a group of elements, then screenshot() to see it.
ids: omit to frame the entire map — this is the normal way to look at your
work. Pass ids to frame just those elements instead; ids without a
position are skipped and listed in the 'missing' field.
pad: extra margin as a fraction (0.15 = 15%). The zoom is the closest
Dungeondraft zoom level that still fits, at most 800%.
Prefer this over set_camera: it computes the zoom for you, and set_camera's
zoom is woxels-per-pixel, which runs backwards from the intuition that a
bigger number means closer.
Inputs: ids, pad.
focus_elementA
Center the camera on an element by id (works for any kind, including text).
zoom: optional Camera2D factor to apply (LARGER = zoomed OUT), landing on
the nearest Dungeondraft zoom level as in set_camera. Follow with
screenshot() to verify a specific element (e.g. a door cut into a wall).
Inputs: id (required), zoom.
generate_dungeonA
Run Dungeondraft's own procedural generator: a whole layout in one call.
design: "Dungeon" for rooms and corridors, "Cave" for organic caverns.
Omit to use whatever the app's Map Wizard currently has selected.
floor / wall: texture indices from generator_options. They must be passed
HERE rather than set beforehand — enabling the generator resets the
wizard's pickers, so a choice made earlier is discarded. Set the numeric
dials with generator_options first; those do survive.
The response reports the design actually generated, read back from the
wizard — not the one requested.
This REPLACES the level's layout, so run it FIRST, on an empty map, after
set_map_size and before placing anything by hand. Re-generating works, but
Dungeondraft's own UI does not offer it: treat it as a do-over on an
undecorated map, not a way to iterate on work.
It gives structure, not a finished map. Character comes from scatter,
shadow paths along the walls, floor shapes and terrain.
Inputs: wall, floor, design.
generator_optionsA
Read or set the Map Wizard's generator dials.
Call with no arguments to list them: each dial's current value, min, max and
step, plus which design is selected. Only dials the current design actually
shows are listed — a cave has Boundary, Complexity and Density; a dungeon
adds the Floor and Wall pickers — so list them AFTER choosing the design.
name + value sets a "number" dial — Boundary, Complexity and Density —
to a value inside its min..max. The response reports what it became.
"list" dials (Floor and Wall) are reported here but set through
generate_dungeon's floor= and wall= arguments, not here. Enabling the
generator resets the wizard's pickers, so a selection made beforehand is
discarded.
Effects, strongest first: Complexity and Density transform a cave; on a
dungeon both raise room and corridor count substantially; Boundary trades
map coverage for compactness.
Set these before generate_dungeon; they are the difference between a
sprawling open cavern and a tight warren.
Inputs: name, value.
get_cameraA
Report the editor camera: world-center position [x,y], zoom, and viewport size.
zoom is a Camera2D factor where LARGER = zoomed OUT (zoom 0.5 magnifies 2x,
zoom 2.0 shows twice as much). Use this to read the view before adjusting it.
zoom_label is the real zoom as a percentage. If Dungeondraft's own zoom menu
shows something else (it opens maps at 80% labelled 100%), zoom_menu says
what the user sees there.
Inputs: no named parameters.
get_caveA
Read the selected level's cave floor/entrance cell counts and actual colours.
Entrances are a separate blast mask that removes rocky borders; they do not carve floor. Counts describe bitmap cells, not distinct rooms or openings.
Inputs: no named parameters.
get_composition_snapshotA
Describe the current map's spatial structure for generation or review.
Returns map bounds, a fixed 3-by-3 grid, every kind's element count, occupied grid cells, and geometric bounds. It is a compact factual summary of the map currently open in Dungeondraft, not an aesthetic score or a substitute for a whole-map export and focused screenshot.
Inputs: no named parameters.
get_elementA
Get details (kind, position, rotation, scale, asset) for a single element by id.
Objects carry `bounds` and `opaque_bounds`, [x0, y0, x1, y1] in woxels after
scale and rotation. `bounds` is the asset's whole canvas; `opaque_bounds`
is the part its art actually covers. Fit a bed, rug or shadow to the
opaque bounds of the objects it goes under, not to their positions.
Inputs: id (required).
get_exportA
Wait for an export that export_map started, and return its image.
Use it when export_map ran out of time: the render carries on in
Dungeondraft, and exporting again would only be refused until it finishes.
Raises if the export failed, with the reason.
max_px: as in export_map — shrinks only the copy returned to you.
Inputs: operation_id (required), max_px, timeout.
get_map_styleA
Read map-wide building wear and grid style from the world's actual textures.
Returns canonical names, texture paths, and available choices. A custom texture with no built-in name is reported as null with its path retained. Grid style chooses the line pattern; it does not toggle grid visibility.
Inputs: no named parameters.
get_operationA
Status of an export: state is rendering, completed or failed.
Also reports `chunks_rendered`, `elapsed_ms`, the output `path`, the
`pixels` it renders to and, on failure, `error`. Without an id, returns the
`current` export (or null) and the `recent` settled ones. The bridge keeps
the last 16 and forgets them when a map is opened or Dungeondraft restarts.
Inputs: operation_id.
get_recent_nodesA
List the ids Dungeondraft has assigned to nodes it created, newest last.
Use this to learn the ids of things you did NOT place one at a time —
the contents of a prefab, everything a generated dungeon produced. Without
it those can only be counted, not moved, modified or deleted.
Pass `since` from a previous call's `next_since` to get only what is new.
`dropped_older` means the log wrapped and some ids were lost — read it more
often, or take the ids straight off `place_prefab` / `generate_dungeon`,
which report their own.
since: return assignments after this sequence number (0 = everything held).
limit: maximum rows to return.
Inputs: limit, since.
get_save_directoryA
Where save_map writes, and whether that directory exists.
`configured` is the user's setting (may be empty); `effective` is what will
actually be used, and `exists` describes THAT one. With no setting, it is a
`battlemap-mcp` folder inside Dungeondraft's own map directory — created
on demand, so this works with no setup and keeps generated maps separate
from hand-made ones.
`configured_missing` means the setting points at a directory that is gone.
Saving falls back to the default rather than failing, and `note` says so;
clear the setting with set_save_directory("") or point it somewhere real.
Inputs: no named parameters.
get_skillA
Step-by-step map-making procedures: interiors, outdoor scenes, lighting, materials, composition, visual review and rebuilding from a .dd2vtt.
Call with no arguments to list them, each with when to use it. Before
building or reviewing a map, read the one that fits the request:
get_skill(name="..."). It ends with the files it links to (shared
references, other skills); read those with get_skill(file="...") when it
tells you to. Plain markdown comes back.Inputs: file, name.
get_snap_settingsA
Report the grid the user snaps to. Read-only.
Dungeondraft's snapping (and the Custom Snap Mod's square or hex grid)
moves the MOUSE, so coordinates you pass are placed exactly as given.
Placement tools take `snap` to match the user's grid instead:
'none' place exactly where asked. Pass it only when the user asks for
exact coordinates; otherwise leave snap out, and the user's
Placements choice in Dungeondraft's Battlemap MCP Bridge panel applies.
'auto' snap to the Custom Snap Mod's grid when the user has snapping
on and the mod enabled - where their own cursor would land.
Otherwise nothing moves, and the reply says why.
'grid' snap to the mod's grid if it is enabled, else to the grid
Dungeondraft's own tool uses: the tile (256) for walls, rooms,
lights, moves and prefabs, the half tile (128) for objects,
doors and windows, paths and copies. Ignores the S toggle.
Returns vanilla_snapping, mod_loaded, mod_enabled, preset, `placements`
(the panel's default for an omitted snap, with a note on using it) and `grid`
(geometry square/hex_h/hex_v/isometric, interval, offset, radial mode).
Isometric snaps as horizontal hex where the mod does (snaps_like), and is
otherwise reported and never applied.
On a hex map, build on that lattice and say so. Never change the user's
snap settings; they are theirs.
Inputs: no named parameters.
get_statusA
Report the current map: whether one is open, its size and center in woxels, per-type element counts, and level info.
Call this first — map_center is the default placement point, and counts
tell you what's already on the map.
`map_file` is the path the map was loaded from, "" if it has never been
saved. open_map replaces what is loaded, so read this before opening
another map if you mean to come back.
`saving.in_flight` is true while Dungeondraft is writing the file. Writes
are refused during that window because edits made mid-save are dropped from
it — wait and retry rather than treating the refusal as an error.
`paused` true means the user paused AI edits in Dungeondraft's Battlemap MCP Bridge
panel: reads still work, edits are refused. Say so and wait for them.
`settings` is what they chose there (update check, capture retention,
default snap) and whether an environment variable overrides it.
`unofficial_patch` says whether Moulk's Unofficial Patch mod is loaded and
its version. When it is, layer 1100 and maps up to 200 tiles are
available. `dialog_open` true means a popup is holding Dungeondraft's
input: if an edit seems ignored, ask the user to close it.
Inputs: no named parameters.
get_terrainA
Read the terrain back: sample the painted terrain on a grid.
rect: [x, y, w, h] in woxels; omit for the whole map.
samples: grid resolution per side, 2-64 (16 = 256 points).
Returns a `weights` grid, row-major from the rect's top-left. Each point is
[slot0, slot1, slot2, slot3], read directly from the splat image's RGBA
channels and summing to ~1, and `slots`: the texture each of those four
slots holds.
Slot 0 is the BASE: whatever slots 1-3 leave unclaimed shows slot 0's
texture. So [1, 0, 0, 0] means "all slot 0" — and what that looks like
depends entirely on `slots[0]`. On a new map every slot holds limestone, so
it is ground nobody chose; after fill_terrain(asset=grass) it is grass. The
weights cannot tell those apart, which is why `slots` is reported.
paint_terrain(slot=0) is accepted by the engine but never raises slot 0's
weight; fill_terrain(slot=0) replaces the base instead.
Slots 4-7 live in a second splat image, reported as weights2. All eight
weights are one blend: painting any slot takes weight from the other
seven. A slot 4-7 needs a texture (set_terrain_slot) before it is painted.
This is the only way to check terrain without a screenshot — use it to
confirm a fill or paint landed where you meant, and to see what ground you
inherited on a map you did not build.
render: also report how the GPU draws it (shader, bound textures, and at
`at` = [x, y] the CPU and GPU weights), for ground that reads wrong.
Inputs: at, rect, render, samples.
get_tool_layerA
Read which layer a tool draws on, and the range of layers that exist.
Layers stack: lower numbers sit under higher ones. Values run from -500 to
900 in steps of 100 (`min`, `max` and `step` in the response), plus
`extra_layers` such as the Unofficial Patch's 1100 when present. 100 is the
default for every tool except MaterialBrush, which starts at -400 so floors
sit under everything.
tool: e.g. "ObjectTool", "PathTool", "PatternShapeTool". A tool without
layers is refused, and the error lists the ones that have them.
Inputs: tool (required).
import_dd2vttA
Rebuild a Universal VTT export (.dd2vtt) on the open map.
Without confirm it only reads the file and reports what it would do.
Show the user, then call again with confirm=true. It recreates:
- walls from line_of_sight, rejoined through each doorway so doors mount;
- portals at their exported width: closed ones (a VTT's doors) as
portal_asset, open ones (its windows) as window_asset. The export has
no door/window field, so a map that had them reversed comes in
reversed; compare with the trace;
- lights (colour, range, intensity, shadows) and the ambient light;
- the export's image as a trace under the map (trace=false to skip).
It never picks art: `blockers` lists each sight-blocking object outline
(objects_line_of_sight) as center, rotation, length and width in
woxels. Place a matching blocking object on each with place_objects.
The map must be the export's size (`tiles`); resize=true resizes it
first. A region export is cropped to its region. Build on a new map:
portals mount on the nearest wall, existing walls included.
wall_color: hex tint for the walls, matched to the trace. Empty takes
Dungeondraft's default wall tint, a dark grey, so light walls such as
sandstone come out dark. Set it here: changing it later means redrawing
the walls and re-adding their doors.
One checkpoint, "import_dd2vtt", precedes the edits:
rollback_checkpoint("import_dd2vtt") undoes them, except a resize, the
ambient light and the trace. Hide the trace with
set_trace_image(clear=true) before the final save_map.
Inputs: path (required), trace, walls, lights, +8 more.
import_imageA
Place a local PNG on the map as an object, as dragging it in would.
path: absolute path to a PNG the user named; never guess one.
x, y: centre in woxels; width, height: unrotated size in woxels.
Omit height to keep the aspect ratio. The size includes transparent
margins. rotation is degrees. Alpha is kept.
The saved map holds the image, so it reopens without the file. The
returned id works with move, modify, duplicate, delete, undo and
checkpoints. The image does not join the asset library, so list_assets
will not find it. Reimporting changed bytes makes a new texture.
PNG only: at most 32 MiB, 8192 px per side and 16 million pixels.
For a reusable tagged library entry, use create_image_pack instead.
Inputs: x (required), y (required), path (required), width (required), +6 more.
inspect_dungeondraft_installationA
Report bridge-install health; by default, no token or live connection is used.
Check the folder recorded as `[Mods] mods_directory` in config.ini, or the
platform default when none is set. Dungeondraft can also discover built-in
mods, so `other_copies` must not be assumed inactive; one whose status is
`duplicate` sits beside the bridge in the loaded folder. A bridge is found
by its manifest under any folder name. Multiple discovery
paths in a log are ambiguous; their order does not identify the loaded copy.
status: healthy | outdated (unmodified, but older than this package) |
modified | unknown | missing.
This compares files on disk and reports historical evidence from the latest
editor log. Log evidence is not proof of the current process. To learn which
bridge Dungeondraft is actually
RUNNING, call ping: its `bridge_current` hashes the live source. This check
never launches Dungeondraft. With live=True, authenticate a read-only ping
to report the executing mod's root, process ID and source identity separately
from historical log evidence. Older bridges may not report their location.
Inputs: live.
inspect_map_fileA
Summarise a .dungeondraft_map file without opening it. Read-only.
Works with Dungeondraft closed, and on maps the user downloaded or was
sent. Reports what a render cannot show:
- `packs`: each pack the map includes, whether it is installed and how
many textures use it. `packs_missing` are not installed: those
elements will be missing when the map opens. Check this before opening
someone else's map.
- `packs_used_but_not_included`: elements Dungeondraft drops on load.
- per level: element counts, ambient light, terrain slot shares,
materials by layer and coverage, paths by texture, width and layer,
the most used objects with their scales, lights (range in the editor's
units) and portals, with `vtt_reversed`: doors left open or windows
closed, which swap roles in a VTT export.
- `warnings`: each of the above that will cause a visible problem, and
why `installed` is null if the pack folder could not be read.
compare_to: a second map to compare with, e.g. a rebuild and its
original. `comparison` lists count changes, objects and paths only in
one map, scale and terrain share changes.
Lists stop at 25 entries per kind; counts are complete.
Inputs: path (required), compare_to.
install_dungeondraft_bridgeA
Install or update the bundled bridge mod in Dungeondraft's mods folder.
This is how a Claude Desktop extension or Claude Code plugin user gets
the mod, and how they update it after updating the companion.
1. Call with no mods_dir: `candidates` lists the folders Dungeondraft
loads, the one it is configured to use first.
2. Call with mods_dir to preview: show the user `actions`.
`requires_force` true means a bridge is already there.
3. Once the user agrees, call again with confirm=true, and replace=true
if a bridge is already there. The old one is moved to a backup outside
the mods folder, never deleted.
`other_copies` are further bridges in that folder under other names (an
older install, a fork with the same mod id); Dungeondraft would load
them too. With the user's agreement, add move_other_copies=true and each
is backed up beside the replaced one (`other_copy_backups` in the
preview), never deleted and never inside the mods folder. Do not move
them by hand.
It never starts Dungeondraft or changes a map. The user must then fully
quit and reopen Dungeondraft and open a map; ping's `bridge_current`
confirms the new bridge is the one running.
Inputs: confirm, replace, mods_dir, move_other_copies.
list_asset_categoriesA
List asset categories, with how many assets each actually holds.
Read `populated` — a category can exist and be empty. "Patterns" ships empty
in a vanilla Dungeondraft and fills from asset packs, so choosing it by name
gets you nothing and no explanation. `counts` gives the full picture.
Counts depend on which packs THIS MAP includes, not on what is installed.
On a map that includes none, every category is core-only. See
list_asset_packs.
Inputs: no named parameters.
list_asset_packsA
Which asset packs are installed, and which this map can actually use.
Dungeondraft scopes packs per MAP: a map includes a set of packs, chosen when
it was created, and `list_assets` only ever offers assets from those. A map
that includes none sees roughly 1800 core assets however large the user's
library is — which is easy to miss, because nothing fails. It just quietly
builds everything from vanilla.
Check `installed_but_not_in_this_map` at preflight. If it is non-empty, say
so before building: those assets are unreachable here, and anything placed
from one would not survive a reload. `get_status.asset_packs` carries the
same signal as two numbers.
To choose between them by what they contain, not by name, use
search_pack_contents. To USE them, the map has to include them — see
prepare_map_with_packs, which writes a copy of the open map that includes
the packs and opens it.
Inputs: no named parameters.
list_assetsA
List asset paths in a category, optionally filtered by a case-insensitive substring.
category: e.g. 'Objects', 'Walls', 'Paths', 'Terrain', 'Lights', 'Portals', 'Roofs'.
search: substring matched against the asset path ('chair', 'door', 'grass').
Pass a returned path, verbatim, as the 'asset' of the create tools.
searches: up to 8 terms instead of `search` (more is refused; split the
call). Results come under `results`, keyed by term, sharing a budget of 80
paths (`per_term_limit`): for choosing a handful, not reading the catalogue.
Results depend on the packs THIS MAP includes: none gives the ~1800 core
assets, a full library over a hundred thousand. If a search comes up thin,
search_pack_contents before concluding an asset does not exist.
`colorable` lists INDEXES into `assets` of assets with a colour mask: they
take `color` at placement, and the mask shows red without one. Colour
cannot be changed afterwards — check before choosing.
`sizes` [w, h] is each asset's canvas and `drawn` [x, y, w, h] the part its
art covers, in woxels at scale 1, parallel to `assets`. Pack art often fills
under half its canvas, so fit spacing, rugs and shadows to `drawn`.
`colorable_scanned` false: too many to scan for colour or size; narrow it.
match_mode: 'substring' (default, contiguous); 'tokens' (every word, any
order: "table round" finds round_table_01); 'fuzzy' (tokens plus
resemblance, so "barrle" lands; ranked, with `scores`, cut at min_score).
None understand meaning: "mug" will not find a tankard. A blank term is
retried only under words naming the same thing (rug/carpet, armour/armor);
`matched_with` says which matched, `also_tried` lists misses.
vanilla_only: core assets only, so packs cannot crowd them out of a page.
pack: id or name of a pack this map includes (list_asset_packs); results
come from it alone. Others are refused, naming the choices.
theme: a theme's words, with the Theme Search mod.
Inputs: pack, limit, theme, search, +5 more.
list_checkpointsB
Open checkpoints: label, whose, steps since, and whether rollback still reaches them.
Inputs: no named parameters.
list_elementsA
List elements currently on the map with their ids, positions, rotation, scale and asset.
kind: one of 'objects', 'walls', 'lights', 'paths', 'portals', 'roofs', 'texts'.
Use the returned ids with move_element / modify_object / delete_element / select_elements.
include_points: also return each wall's and path's polyline. Walls and paths
are shapes, not points — without this they report a meaningless single
position (a real hand-built map lists every wall at [0, 0]). Off by
default because a map can hold hundreds of paths and the coordinates
swamp the listing; get_element always includes them for one element.
offset: skip this many before returning, for paging through a large map.
include_bounds: give objects `opaque_bounds` too, as get_element does. It
reads every texture's pixels once, so ask only when fitting something.
Objects carry `bounds`, [x0, y0, x1, y1] in woxels after scale and
rotation: where the canvas reaches.
`total` is how many elements of this kind exist, `count` how many came back,
and `truncated` says plainly that there are more. Read `total`, not `count`,
before concluding anything about the whole map.
Inputs: kind, limit, offset, include_bounds, +1 more.
list_levelsA
List the map's levels (floors) with their index, id and label, plus the current index.
Inputs: no named parameters.
list_prefabsA
List Dungeondraft's pre-composed prefabs — furnished groups, ready to place.
Prefabs are whole assemblies rather than single objects: a market stall, a
set of tavern tables, a stack of crates, a well. Placing one is usually far
better than composing the same thing from a dozen `place_object` calls, and
it looks composed because a human composed it.
Returns the available `sets`, the `current_set`, and the `prefabs` in it.
set: switch to this set before listing (see `sets` in the response).
Inputs: set.
list_tool_controlsA
List a Dungeondraft tool's UI controls — its real, operable surface.
Every tool exposes its buttons, dropdowns, toggles and colour pickers as
named controls. This shows their ids and types, which is what `tool_action`
and `set_tool_option` operate on.
tool: e.g. 'SelectTool', 'PrefabTool', 'FloorShapeTool', 'MaterialBrush',
'MapSettings', 'Environment', 'LightTool', 'TraceImage'.
Inputs: tool (required).
log_markerA
Write a line into Dungeondraft's log to separate phases of a test run.
Pairs with set_verbose: mark a phase, run some commands, then read the log
between markers to see exactly what the engine reported for that phase.
Inputs: text (required).
merge_wallsA
Join two matching open walls sharing one endpoint, in ONE undo step.
The first ID survives; the second is removed. Mounted doors/windows retain
their IDs, appearance and positions. Returns id, removed_ids, portal_ids,
point_count. Supports automatic/manual wall runs and corners. Both walls
must be on the current level with matching styles. Rejects loops, cave walls,
T-junctions, overlaps and self-intersections before changing the map.
Each input wall may contain up to 512 points. Undo restores both original
walls and portal attachments; switch to their level before undo/redo.
Inputs: ids (required).
modify_objectA
Modify an existing object's scale, rotation (degrees), color, shadow and/or light-blocking by id.
block_light: whether this object STOPS light passing through it. A drawn
shadow and a light block are different things — a crate stack with a
shadow but no block still lets a lantern light the room through it. Set
it on anything solid enough to stand behind: crates, bookcases, screens,
a wagon. get_element reports it back.
modulate: nonempty values are refused because the tint does not survive
saving and reopening.
color is REFUSED: colour is baked at placement and cannot be changed
afterwards, here or in Dungeondraft's own UI. Set it in place_object.
layer: move an existing object to a layer VALUE (multiple of 100, -500..900,
or 1100 with the Unofficial Patch).
Unlike colour this IS changeable after placement, and it is how a map built
before layers were assigned correctly gets repaired.
A LIGHT takes color, energy, range and shadows (as add_light), and they do
change after placement; nothing else applies to it.
Inputs: id (required), color, layer, range, +7 more.
move_elementA
Move any element to a new woxel position by id.
snap: 'none', 'grid' or 'auto'; see get_snap_settings. Detail placed by
scatter_objects stays loose unless you pass snap.
Inputs: x (required), y (required), id (required), snap.
move_elementsA
Move many elements by the same offset, in one call and ONE undo step.
Use it for anything that moves as a group: a prefab (its `ids` come back
from place_prefab), a scattered cluster, a furnished corner. Moving them one
at a time costs a call and an undo slot each.
ids: element ids, up to 1000.
dx, dy: offset in woxels (256 = one tile).
rotation: optional degrees around the group geometry's bounding-box centre,
or around pivot_x/pivot_y when both are supplied; translation follows.
Walls keep their saved geometry and carry mounted doors/windows with them.
Duplicate ids move once. Text anchors move while labels stay upright.
Cave-generated walls and mounted portals without their wall are reported
in `unsupported`, with reasons. Returns `moved`, `missing`, `unsupported`,
the applied offset/rotation and pivot. Inspect these before repeating a prefab.
snap: rounds dx, dy to the nearest whole grid steps; see get_snap_settings.
A group of only scatter_objects detail stays loose unless you pass snap.
Inputs: dx (required), dy (required), ids (required), snap, +3 more.
open_mapA
Open a .dungeondraft_map file, replacing whatever is currently open.
Refused while the open map has edits made through the bridge since its
last save; the error says so. Then save_map first, or, only after the user
agrees to lose those edits, pass discard_unsaved=true. Edits made by hand
in Dungeondraft are not counted, so ask before opening over their work.
Loading is asynchronous AND it restarts the bridge: mods load after the map
does, so the bridge briefly stops answering and can come back on another
port. By default this waits until the map Dungeondraft reports open is the
one you asked for, and returns its size and level.
`opened: false` means that had not happened in time. The load may still be
running: read `note` and poll get_status rather than opening again.
wait=False returns as soon as the command is accepted.
path: absolute path to a .dungeondraft_map file.
Inputs: path (required), wait, discard_unsaved.
paint_materialA
Paint a MATERIAL patch along a brush stroke. Returns what it painted.
Materials are their own system — irregular patches of stone, earth, lava or
moss with their own borders — and they are not terrain and not patterns.
A Materials asset passed to place_pattern makes a PATTERN, not a material.
Choose between them deliberately:
terrain ground that must BLEND into neighbouring ground
pattern a tiled floor inside a building
material a sculpted patch with its own edge, sitting on top of ground
water actual water
points: the stroke, in woxels. One point is a single dab.
asset: a Materials path from list_assets(category='Materials').
size: brush radius in mesh CELLS, 1-6 (larger is refused: the engine
throws and paints nothing). A cell is typically one tile, so size 6
paints roughly twelve tiles across PER DAB. Start at 1-2 and look.
layer: which material layer to paint into, -500 to 900 by 100. Materials
on different layers stack rather than merge. -300 and below draw UNDER
floors (add_floor, build_room); on a floor, paint at -200 or above.
smooth: smooth the patch's edge, versus following the material's own
texture.
erase: remove this material along the stroke instead of adding it.
The response reports `cell_size_woxels` and `covered_woxels` so the brush
size can be reasoned about on the ground. There is no "did it land" flag,
because the engine offers no reliable one: verify a stroke by looking at it.
Each call is one undo step.
Inputs: asset (required), points (required), size, erase, +2 more.
paint_pathA
Paint a continuous terrain stroke (a road/trail) along a polyline in one call.
asset is a TERRAIN asset, not a Paths one — this paints ground, it does not
lay a Paths element. Use draw_path for that.
points: a list of [x, y] woxel corners the path runs through (>= 2). The
bridge rasterizes a uniform ribbon of constant width by measuring each
pixel's distance to the nearest segment, so the route comes out smooth with
clean edges — no gaps or double-painted overlaps. Prefer this over stamping
many paint_terrain dabs for any line/road.
radius: half-width of the stroke in woxels. rate: peak strength 0..1 with a
soft falloff to the edges so it blends. asset: optional Terrain asset to
assign to the slot first (else set it with set_terrain_slot). Undoable.
Inputs: points (required), rate, slot, asset, +1 more.
paint_terrainA
Paint a soft circular terrain brush of a slot at a woxel position.
radius: brush radius in woxels. rate: peak strength 0..1 at the center, with
a smooth falloff to the rim so strokes blend. asset: optional Terrain asset
to assign to the slot first (else set it with set_terrain_slot). Undoable.
For a hard-edged region instead of a brush, use fill_region.
Inputs: x, y, rate, slot, +2 more.
pingA
Check the bridge is up, and whether it is the bridge in this package.
`bridge_current` compares a hash of the source Dungeondraft is actually
RUNNING with this package's mcp_bridge.gd. It is the only reliable answer to
"is Dungeondraft on the latest bridge?", because Dungeondraft loads mods from
a folder the user chooses and a file check can look in the wrong one.
False: Dungeondraft is running other code. Restart it to load a change, or
reinstall into the folder it loads (inspect_dungeondraft_installation).
None: the running bridge is too old to report its source.
New bridges also report bridge_root (Dungeondraft's Global.Root for the
executing mod) and process_id. These identify the running copy and process;
they do not imply that files subsequently changed on disk are already loaded.
`companion_version` is this server's release; `bridge_version` is the one
in the running bridge's .ddmod (absent from bridges before 1.4). When they
differ, `version_note` says which to update.
`update_available` appears when a newer release has been published: pass
its message to the user. On their yes, update_companion updates a
downloaded companion; other installs get their own steps in the message.
`duplicate_installs` appears when Claude has this server installed more
than one way: pass its message to the user too.
Inputs: no named parameters.
place_objectA
Place an object (prop) on the current map. Returns the new element id.
If you place a colourable asset WITHOUT a colour, the response comes back
with `colorable: true` and `mask_fraction`, and its note says whether the
object is a flat red shape or just has red accents.
Colour is baked at placement, so the fix is to delete it and place it
again with `color`. Choose one that suits the object (a blue banner, a
green tablecloth); if nothing fits better, Dungeondraft's own default is
#6b3834.
asset: an Objects asset path from list_assets(category='Objects').
x, y: woxel coordinates; defaults to map center. rotation: degrees.
sorting: 0=over, 1=under. snap: 'none', 'grid' or 'auto'; see get_snap_settings.
Two different tints, do not confuse them:
color: '#rrggbb', Dungeondraft's own colourable-asset colour — the same
thing the app's colour picker sets. Only assets carrying the colourable
attribute respond to it (including colorable carpets and crystals). On any
other asset it is stored and never renders.
modulate: retained for compatibility, but nonempty values are refused because
Dungeondraft does not preserve this tint when saving and reopening.
layer: which layer the object is drawn on — a VALUE, a multiple of 100 from
-500 to 900 (also 1100, Above Lights, when get_status.unofficial_patch is
loaded), not a menu index. 100 is the default and where most objects
belong. Raise it to put something ON a surface: a floor pattern sits on
100, so a mug placed on 100 can be buried by it, while 200 puts the mug
above. `sorting` only reorders siblings within one layer and cannot do
this. The response reports the layer the object actually landed on.
light: {color, energy, range, shadows, asset} as in add_light, made at the
object's position in the same undo step: a lantern and its glow. The
reply carries `light_id`.
Inputs: asset (required), x, y, snap, +8 more.
place_objectsA
Place many objects at chosen positions in ONE call and ONE undo step.
Use it whenever you know where several things go: a row of tables, the
dressing on a bar, eight trees ringing a clearing. Each entry takes the
same arguments as place_object and behaves identically.
`scatter_objects` is for RANDOM arrangement over an area; this is for
deliberate positions.
Up to 100 entries in `objects`. Every asset is checked before anything is
placed, and if one entry fails the whole batch is rolled back, so the map
never holds a half-finished batch whose ids you were not told.
file: an absolute path to a JSON file of the same entries (a list, or
{"objects": [...]}), up to 1000. Use it when a script computed the
positions: write the file and pass its path instead of copying hundreds
of entries into the call. The reply is compact: `placed`, `id_ranges`
([first, last] runs of ids) and `colorable_without_color`.
Returns `objects`: one {id, position, layer} per entry, in the order you
passed them (with `light_id` for an entry that has a `light`), plus `ids`.
Entries placed from a colourable asset with no color are listed in the
note: those are flat red, and colour cannot be added afterwards. Give each
one a color that suits it; if nothing fits better, Dungeondraft's own
default is #6b3834.
One undo() reverses the whole batch while it is the latest operation.
snap applies to every entry with an x and y; see get_snap_settings.
A batch placed entirely at scale 1.0 on quarter turns comes back with an
`arrangement_note`: most placements read better with slight variation.
Inputs: file, snap, objects.
place_patternA
Place a tiled floor/pattern shape (the Building Tool's "Floor" / Pattern Shape).
Draws an actual tiled floor (wood planks, tile, brick, ...) that renders
BELOW objects, distinct from terrain. Provide ONE of:
rect: [x, y, w, h] axis-aligned rectangle, or
points: [[x,y], ...] a polygon (>= 3 points), all in woxels.
asset: a pattern asset path from list_assets(category=...).
category: which asset bank — 'Patterns', 'Patterns Colorable', 'Materials',
'Simple Tiles', or 'Smart Tiles'.
color: '#rrggbb' tint. Omit it and a greyscale texture, or one drawn as a
red colour mask (tileset_diamond, _ornate, _wood_damaged), gets a
neutral brown, while one with its own colours (marble, painted tile) is
left untinted; the reply's texture_greyscale and texture_red_mask say
which.
rotation: pattern rotation in degrees.
z: persistent layer VALUE, a multiple of 100 from -500 to 900.
Default -100 sits below objects. Arbitrary z offsets cannot survive saving.
Inputs: asset (required), z, rect, color, +3 more.
place_prefabA
Place one of Dungeondraft's pre-composed prefabs by name.
Call list_prefabs first to see what exists — names must match exactly.
Reach for this before hand-composing a common furnished unit. A tavern's
tables, a market stall, a smithing setup or a well already exist as prefabs
and will look better assembled than placed piece by piece.
ALWAYS pass x and y. A prefab otherwise lands wherever its author saved it,
usually near the map's top-left corner. With x and y the prefab's centre
lands there, and `placement` in the response reports what moved. If it
still lands wrong, undo() removes the whole prefab in one step while it is
the latest operation.
name: exact prefab name from list_prefabs.
set: optionally switch set first.
x, y: woxel point to centre the prefab on. Pass both or neither.
rotation: degrees to turn the whole prefab about its centre.
snap: snaps the centre x, y; see get_snap_settings.
Placement transforms walls with their mounted portals, paths, roofs,
patterns, objects, lights, freestanding portals, and text anchors (labels
stay upright). Cave-generated walls and unsupported elements are listed
in placement.skipped with reasons in placement.unsupported. Inspect those
and the footprint before repeating. To shift or rotate the group afterwards,
use move_elements with the returned ids — one call, one undo step.
Inputs: name (required), x, y, set, +2 more.
prepare_map_with_packsA
Copy the open map into one that INCLUDES asset packs, and open it.
Dungeondraft scopes packs per map and a map's set is fixed when it is
created, so a map made without packs can never reach them — list_assets on
it returns only the ~1800 core assets. This writes a copy whose header
includes the packs and opens that copy, which is how a map gets a library.
Do this BEFORE building. The copy carries the open map across untouched, so
running it on an empty scratch map costs nothing, while running it on a
finished map means continuing in the copy from here on.
filename: bare name for the new map, in the configured save directory.
packs: pack ids to include, from list_asset_packs or search_pack_contents.
REQUIRED — choose them. The copy keeps the open map's packs and adds
these. Including every installed pack is costly on a large library, and
one pack can dominate the catalogue. Pick by what the brief needs;
adding more later means preparing another copy.
The open map is saved first so the copy is current. Assets from a pack the
map does not include are not merely hidden: placing one produces an object
Dungeondraft erases on load, so include the packs rather than reaching past
them. A pack's first load can crash Dungeondraft until its thumbnails are
made: pass any `thumbnail_warning` on.
Inputs: filename (required), packs.
preview_assetsA
LOOK at candidate assets before committing to one. Read-only.
Asset names are not reliable descriptions: `bench_01` is a stone bench, and
that is easy to miss until it is placed in a timber tavern.
Returns ONE contact sheet, so comparing N candidates costs one image. Cells are laid out
row-major **in the order you passed them**, so you already know which is
which — pass the candidates in a deliberate order.
Assets drawn on a BLUE-GREY ground are colourable: what you are seeing is
the unpainted red mask, not the asset's real colour. It will render in
whatever `color` you pass at placement, and flat red if you pass none.
Everything else sits on neutral grey and is showing its actual art.
Use this when CHOOSING a material family — the structural, supporting and
accent families a map commits to — not before every placement. A map uses
few distinct assets and repeats each many times, so the decisions worth
looking at are a handful per map.
A thumbnail on a plain ground will not tell you how something reads against
your floor under your lighting. It catches the gross mistake (stone where
you wanted wood); the map render still settles the subtle one.
assets: paths from list_assets or search_pack_contents, at most 32.
category must match them.
columns: 1-8. cell_px: 32-256, the size each asset is fitted into.
true_scale: draw every asset at ONE scale, set by the largest, so relative
sizes show; `woxels_per_cell` says what a cell spans.
Returns the sheet and JSON: per asset, in order, `sizes` [w, h] woxels at
scale 1 and `drawn` [x, y, w, h], the opaque part (Objects only).
Inputs: assets (required), cell_px, columns, category, +1 more.
redoA
Re-apply the last edit reversed by undo().
`redone: false` with `skipped` means that step's elements were already
gone: it was dropped, not re-applied. Call redo again for the next one.
Inputs: no named parameters.
repair_terrainA
Rebuild a level's terrain splat when the engine dropped it. Destructive.
Only needed on a map whose terrain has already been lost. Symptom: every
terrain call answers "the terrain splat image is empty", and Dungeondraft's
log carries `Expected data size of N bytes in Image::create()` at load.
That happens when a map was resized while its terrain was not. The splat
keeps the pixel dimensions it was created with, the mismatch is silent
until the map is next opened, and Godot then refuses the image and drops
every painted stroke — while the save that produced it reported success.
set_map_size now resizes the rasters with the map, so new maps do not reach
this state; this repairs one that already did.
It does not recover anything. The painted terrain is gone before this runs;
all it restores is a usable surface to paint on, so the terrain has to be
laid down again afterwards. Nothing else on the map is touched.
force: blank a splat that is already usable. This throws away working
terrain, so it is off by default.
Inputs: force.
rollback_checkpointA
Undo every edit this session made since checkpoint(label), in one call.
Refuses and changes nothing when another session (a second chat, another
assistant) edited after the mark, or when history, which keeps 1000 steps
and 64 MB of terrain snapshots, no longer reaches it. Edits outside history, such
as tool_action, water or a map resize, cannot be reversed; the reply lists
them under `not_reversible`; steps whose elements were already gone are
dropped and listed under `skipped`, and steps an undo since the mark took
away come back, under `redone`. Tell the user what was and was not undone.
Edit replies carry `checkpoint_warning` as the mark nears the history
limit: save_map then.
Inputs: label (required).
sample_colorsA
Read the mean colour at map points, to match tints by number, not by eye.
For a rebuild: compare the source image with your build at the same
points (a floor patch, a wall, each rug) and adjust tints until max_diff
is a few levels. Tints judged by eye came out 10-20% too saturated.
points: up to 64 [x, y] map woxels, on what you want to compare.
dd2vtt: path to the Universal VTT export the map was rebuilt from. Its
image is the source, aligned as import_dd2vtt placed it.
export: 'latest' samples your newest export_map render, or name an
export file; '' skips it. Export with grid=False at the source's
pixels-per-grid (source_ppg in the reply), after each tint change:
with the grid drawn, identical floors differed by up to 22 levels.
radius: half-width in woxels of the square averaged around each point
(default 32, an eighth of a tile). Keep it inside one surface.
Returns each point's colour per source and, with both, diff_rgb (export
minus source, per channel: positive is lighter or more of that channel)
and max_diff. Both images include lighting; compare like with like.
Inputs: points (required), dd2vtt, export, radius.
save_mapA
Save the map. Use this often — it is how work survives a crash.
filename: a bare name (".dungeondraft_map" is added if missing), written
into the configured save directory — see get_save_directory. Omit it to
save over the map already open.
The map you have open can always be overwritten; that is the point, and it
is how you check in progress as you go. A file that EXISTS and is not your
open map is refused, so a plausible-sounding name cannot destroy someone
else's map. Pass overwrite=True only when the user has actually asked to
replace that file.
A map that has never been saved has no path, so saving it needs a filename:
without one Dungeondraft opens a modal Save As dialog, and a modal freezes
this bridge until a human closes it.
Writing is asynchronous, so by default this waits until Dungeondraft
reports it finished writing THIS path and returns `completed: true`. While
a save is in flight Dungeondraft DROPS edits from the file, so the bridge
refuses to change the map until it lands.
`completed: false` means the save did not confirm in time. It is probably
still running: read `note`, poll get_status, and do NOT call save_map
again — a second write of the same file is the one thing that cannot help.
wait=False returns as soon as the save starts, for a caller that tracks
`saving.in_flight` itself.
If Dungeondraft does not start a save at all, this raises instead of
replying. Read the message, because the two causes need opposite action:
busy (retry in a few seconds), or wedged after a save crashed inside
Dungeondraft — then nothing can be written this session, a restart is the
only way out and it loses unsaved work, so stop building and tell the user.
Any edit made while a save is unfinished also carries a `save_warning`.
Inputs: wait, filename, overwrite.
scatter_objectsA
Scatter objects randomly over a rectangular area, with jittered scale and rotation.
This is the tool to reach for when a space should look furnished or lived-in
rather than placed-at-coordinates: foliage, rubble, crates, clutter, debris.
Placing twenty objects individually reads as a grid; this does not.
assets: one or more Objects asset paths from list_assets(category='Objects').
Each placement picks one at random, so pass a few related assets for variety.
rect: [x, y, w, h] in woxels. 256 woxels = 1 tile.
count: how many to place (1-500).
scale_min / scale_max: random scale range per object.
rotation_min / rotation_max: random rotation range in degrees.
min_gap: minimum woxel distance between placements. Use it to stop clumping;
too large for the area and you get fewer than `count` (the response says so).
color: optional '#rrggbb' applied to every placement, baked at placement
and never changeable afterwards. Only colourable assets respond — see
place_object.
seed: fixes the arrangement so a run is reproducible. Pass one when you want
to adjust a single parameter and compare, rather than reshuffling everything.
layer: layer VALUE for every placement (multiple of 100, -500..900, or 1100
with the Unofficial Patch). Same
meaning as in place_object; 100 is the default.
wall_margin: keep each object's drawn art at least this many woxels off
every wall (0 = art may touch, never cross). The rect bounds only
centres, so without it a tree's crown lands over a wall.
avoid_rects: up to 32 [x, y, w, h] areas no object's art may reach into:
a path, a doorway, a building.
With either, the reply counts `kept_out` attempts.
Returns the ids placed, how many attempts it took, and a note if it could not
fit the requested count.
Inputs: rect (required), assets (required), seed, color, +10 more.
screenshotA
Capture the current Dungeondraft window (the on-screen view) and return it as an image.
Fast; shows exactly what's visible including the current camera framing —
so AIM FIRST, or you photograph whatever the last call left on screen:
focus_element(id) for one thing, fit_elements() for the whole map. For a
clean full-map render without UI, use export_map.
Or aim in the same call: rect=[x, y, w, h] frames that area (woxels; the
longer side fits), or center=[x, y] with tiles_across=N looks at N tiles
of width around a point. Either alone keeps the other's current value.
Zoom moves in fixed steps, so the view may show more than asked, not less
(up to the widest zoom). The camera stays there afterwards.
max_px: shrink the image's long edge to this before returning it. Omit for
the full capture. Worth setting when you are checking placement or
coverage rather than judging materials and detail — a smaller image is a
cheaper thing to look at, and every image stays in the conversation.
The result also names the saved file, at full resolution. The user does not
see the image you receive, so when they ask to see the map, give them that
path. Captures are kept until newer ones replace them (20 by default;
exports are counted separately).
Inputs: rect, center, max_px, tiles_across.
search_pack_contentsA
Search INSIDE every installed asset pack, including packs this map lacks.
list_assets sees only the packs this map includes, and list_asset_packs
only names the rest. Use this at preflight, or when list_assets comes up
thin, to choose packs by what they contain. Read-only; Dungeondraft need not
be running.
Terms match asset paths and the pack's own tags. match_mode: 'tokens'
(every word, any order) or 'substring'. Not synonyms: "mug" will not find
a tankard.
Per term, `matched_by_pack` counts every match in each pack, and `best`
holds the top paths (`limit` per term, 80 shared), grouped by pack.
`packs_found` says, for each pack with a match, whether this map includes
it and whether the running Dungeondraft has it loaded.
Packs whose authors opted out of third-party tools reading them are not
searched; they are listed under `not_searched`.
A path from a pack the map does not include cannot be placed here. To use
it: preview_assets to look, then prepare_map_with_packs(filename,
packs=[ids]), which keeps the map's current packs and adds these. A pack
Dungeondraft has not loaded cannot be included until it is.
packs: limit the search to these pack ids.
Inputs: searches (required), limit, packs, category, +1 more.
select_elementsA
Select the given element ids in Dungeondraft's UI (replaces the current selection).
Inputs: ids (required).
select_toolA
Select a tool in Dungeondraft's UI, as clicking its button would.
Mostly useful for leaving the editor on a sensible tool when you are done,
so the person who takes over is not looking at whichever tool your last
call happened to need.
tool: exact tool name, e.g. "ObjectTool", "SelectTool", "WallTool".
Inputs: tool (required).
set_ambient_lightA
Set the map's ambient light colour — the single biggest lever on mood.
A cold blue-grey reads as night or a dungeon; warm amber reads as lamplight
or dusk; a neutral grey lets the placed sources carry the colour. A fresh
map's white is flat glare rather than daylight, so decide rather than leave
it. Whatever you pick, look at a render afterwards: the mood is yours, but
every zone that hosts play has to read at the table. This is map-wide, not
a placed light source (use add_light for those).
It is also functional, not just cosmetic: Universal VTT exports carry
lighting into Foundry and similar tools, so this affects the map at its
destination.
color: '#rrggbb'.
Inputs: color (required).
set_animated_doorA
Mark objects or free-standing portals as CePeU's Animated Doors, or change them.
Needs the Animated Doors mod (ping reports animated_doors); refused
without it. Its own Export window writes the animated Universal VTT;
export_dd2vtt does not carry the animation.
Only objects and free-standing portals on the current level can be doors.
A wall-mounted door cannot: an opening door would show the wall under it.
Leave a gap in the wall and place the door in it with
add_portal(mount='free', rotation=...) or place_object.
enabled: true declares a door, using the mod's defaults for anything not
given; false removes it and takes no other setting. Other settings change
declared doors only.
hinge: 'a' or 'b', the end it turns on (a: left or top edge of the
unrotated image). swing: 'left' or 'right'. axis: 'width' or 'height', the
image axis along the door. door_type: 'door', 'secret' or 'window'.
animation: swing, slide, swivel, ascend or descend. state: 'closed',
'open' or 'locked' (exported start state; the art does not move).
double_door: two leaves. extension: 0-180, 90 is normal strength.
hinge_offset_a/_b: crop inward from each end, in woxels.
One undo step for all ids; all are checked before any changes.
get_element(id) reports animated_door. duplicate_object copies it.
Inputs: ids (required), axis, hinge, state, +8 more.
set_cameraA
Pan and/or zoom the editor camera. Returns the resulting camera state.
x, y: world (woxel) center to move the view to (omit to keep current).
zoom: Camera2D factor (LARGER = zoomed OUT). It lands on the nearest of
Dungeondraft's own zoom levels, 4 / percent: 0.5 = 800%, 4 = 100%, 40 = 10%.
zoom_label in the reply is the zoom the editor's zoom menu then shows.
Follow with screenshot() to see the framed view.
Inputs: x, y, zoom.
set_cave_entranceA
Open or restore a circular section of cave border, as one undoable edit.
Place the centre at an existing cave edge in woxels. radius is the half-width
(0 < radius <= 2048), rounded to cave cells. open=False removes the blast
mask, restoring the border; neither mode digs or fills cave floor. Dig the
approach first with dig_cave, then inspect a screenshot of the mouth.
The edit belongs to the selected level. Undo requires that same level and
unchanged bitmap dimensions. Returns the actual number of changed cells.
Inputs: x (required), y (required), open, radius.
set_gridA
Show or hide the grid in the editor view. Returns {grid_visible, grid_toggle}.
It works the View menu's own grid checkbox, so the menu and the screen
agree; grid_toggle is that checkbox's state. This changes only what the
editor (and so screenshot) shows. Exports keep their own `grid` option and
put the editor grid back afterwards.
It is not saved: neither the map file nor Dungeondraft's settings keep it,
so opening a map or restarting Dungeondraft shows the grid again.
Inputs: visible (required).
set_levelA
Switch the active level (floor) by its id (see list_levels).
Use the `id` field, not `index`: they are different numbers. Adding a level
puts it at index 0 with a higher id, and deletions leave gaps in the ids.
Inputs: id (required).
set_map_sizeA
Resize the current map, in TILES (a tile is 256 woxels).
Uses Dungeondraft's own Change Map Size resize, so every level's terrain,
cave and floor-tile rasters are resized and the saved map reopens. Each
side must be 8 to 128 tiles, or 1 to 200 with the Unofficial Patch loaded
(get_status.unofficial_patch). The top-left origin is kept: the map grows or
shrinks on the right and bottom, nothing placed is moved, and shrinking
does not delete what ends up outside. Set the size before laying out.
To trim from the top or left too, use crop_map.
Inputs: width (required), height (required).
set_map_styleA
Set optional finishing effects across the map, as one undoable edit.
building_wear: none, dust, grime, noise, scratched. Applies to building
floors/walls across every level; use only when that global effect fits.
grid_style: dashes, dotted, narrow_line, thick_line. Changes the grid's
line pattern, not whether the grid is visible or included in an export.
Omitted fields keep their current values. Both fields are validated before
editing, and the response reads actual world textures. Use get_map_style
before changing a map and inspect a screenshot/export afterwards. Undo and
redo restore both values together, even after switching levels.
Inputs: grid_style, building_wear.
set_save_directoryA
Set the directory save_map writes into. Pass "" to clear it.
Persisted per install, so it survives restarts — a directory inside a
temporary folder keeps being the answer long after the folder is gone.
The directory must already exist; this will not create one. If it
disappears later, saving falls back to Dungeondraft's own map directory
and both get_save_directory and the save reply say so.
Inputs: path (required).
set_soft_shadowA
Add, change or remove Moulk's Soft Shadows on objects, walls and paths.
Needs the Soft Shadows mod (ping reports soft_shadows); refused without
it. One undo step for all ids; all are checked before any changes.
enabled: false removes the shadow. An element without one starts from
the mod's current defaults for its kind; one with a shadow keeps its other
settings.
opacity: 0-2 (above 1 darkens the blurred edge). offset: [x, y] in woxels,
where the shadow falls. color: '#rrggbb'.
settings: any other key of that element's shadow, such as blur for
objects, or softness and spread for walls and paths. get_element(id)
lists an element's soft_shadow keys once it has one; an unknown key is
refused. Prefer a modest offset (20-60) and opacity (0.4-0.8).
Inputs: ids (required), color, offset, enabled, +2 more.
set_terrain_blendingA
Choose how terrain slots blend into one another on this level.
enabled: True for smooth blending (slots fade into each other), False for
textured (the blend follows the material's own texture, giving a grainier,
more natural seam).
This is a per-level setting that affects every terrain edge already painted,
not just the next one, so choose it before painting rather than after.
get_terrain reports the current value as `smooth_blending`.
Inputs: enabled (required).
set_terrain_slotC
Assign a Terrain asset to a terrain slot index so it can be filled/painted with that slot.
Inputs: asset (required), slot.
set_tool_layerA
Set which layer a tool draws on, for everything it places afterwards.
Use it to put a rug under furniture, a bridge over water, or roots below
the ground. Call get_tool_layer first to see the current layer and the
range.
Check `applied` in the response: Dungeondraft silently keeps its current
layer if it will not accept the one you asked for, and the response reports
what the tool actually holds rather than what you requested.
tool: e.g. "ObjectTool", "PathTool", "PatternShapeTool".
layer: layer VALUE, a multiple of 100 from -500 to 900 — not a menu index —
or 1100 when the Unofficial Patch is loaded.
Inputs: tool (required), layer (required).
set_tool_optionA
Set a value on a Dungeondraft tool's control.
Pass exactly one of:
item text of an entry in an OptionButton or ItemList, by its
visible name
item_index that entry's POSITION instead. Texture selectors and
FloorShapeTool's SmartTileId have blank labels, so they
cannot be named by text at all
item_metadata substring of an entry's metadata. A texture menu item holds
its ASSET PATH there, so this picks a texture by path —
which is usually what you actually mean
color '#rrggbb' for a colour picker. Some colour controls wrap the
picker in a container; this reaches through it
pressed true/false for a toggle, e.g. 'Bevel', 'Shadow'
value a number for a slider
Call list_tool_controls first — control ids and types vary per tool, and the
value kind must match the control.
This is the DIAGNOSTIC surface, for controls with no typed tool of their
own. Where a typed tool exists, use it: it validates, reads its result back
and is undoable, none of which this is.
Inputs: tool (required), control (required), item, color, +4 more.
set_trace_imageA
Put a reference image under the map to trace over. Returns what applied.
For reconstructing an approved sketch, a published floor plan, or a
hand-drawn dungeon. Load it, size it against the grid, drop its opacity so
your own work reads over it, then build on top — and hide it before the
final render, because it is a guide, not part of the map.
path: an ABSOLUTE path to an image on the machine running Dungeondraft.
scale: size multiplier. Set it so a known distance on the image matches the
grid; guessing here is what makes a traced plan come out the wrong size.
opacity: 0 invisible, 1 opaque. Around 0.3-0.5 is usually enough to follow
without drowning what you are drawing.
center: centre the image on the map.
clear: remove the trace image.
position: [x, y] in woxels (256 per grid square): where the image's
centre sits, applied after center and scale. Centre it, read the reply's
`position`, then set a position that puts a grid line drawn on the image
on a map grid line. It sets rather than nudges, so repeating the call is
harmless. A later center moves the image back to the map's centre and
discards it.
Loading an image shows it and clear hides it. `visible` says whether it is
drawn now and `image_size` is null if the image did not load. Exports never
include it.
The trace SAVES with the map: its absolute path, scale, opacity and position
go into the file and it reloads next time. Anyone else who opens the map gets
a path that doesn't exist on their machine, and a large reference makes every
open slow. Call set_trace_image(clear=true) before the final save_map.
A path Windows can't open (260+ characters, typical of agent temp folders)
is copied to a short path in the bridge's output folder first; the response
says so under `copied_from`.
Inputs: path, clear, scale, center, +2 more.
set_verboseA
Turn per-command log bracketing on or off inside Dungeondraft.
When on, the mod writes `>>> cmd {args}` before each command and
`<<< cmd ok|ERR ...` after. Godot writes engine errors to the same log with
no indication of what provoked them, so this is what lets an error line be
attributed to the command that caused it. Use it when auditing or
debugging; leave it off otherwise.
Inputs: on.
set_water_styleA
Style this level's water: what KIND of water it is. Returns the result.
Geometry first (add_water), then this. A muddy river, a clear shallow, a
peat swamp and a deep cold pool are the same mesh with different colour.
deep_color / shallow_color: hex, e.g. '#12304f'. Deep is the body, shallow
is the edge; the gap between them is most of the character.
blend_distance: how far the shallow colour reaches in from the shoreline.
Small is an abrupt drop-off, large is a gradual wade.
border: draw the shoreline border. Off suits a swamp or a flooded floor
where the edge should be indefinite.
Per LEVEL: every body of water on this level is restyled, and water drawn
later on a level whose bodies share one style takes that style too. The
response reads the style back off the water bodies, which are what the map
saves; `bodies` is how many there are, and `mixed_styles` means they differ.
Inputs: border, deep_color, shallow_color, blend_distance.
tool_actionA
Press a button control on a Dungeondraft tool.
This is the escape hatch for capabilities with no dedicated tool. Notably
SelectTool's batch operations, which act on the current selection (use
select_elements first): 'Copy', 'Paste', 'Mirror', 'Lock', 'Separate',
'Merge Walls', 'Make Prefab', 'Delete'.
Prefer a purpose-built tool where one exists — they validate input and
return ids. Call list_tool_controls to see what a tool offers.
Buttons that need a selection will report being disabled rather than
silently doing nothing.
Merge Walls can join compatible manual walls (draw_wall type=1). Walls
with mounted doors/windows are refused because native merging deletes
portals on absorbed walls. Generic actions do not enter bridge undo history.
Inputs: tool (required), control (required).
undoA
Reverse the LATEST undoable edit (create / delete / move / modify / terrain / cave).
The bridge keeps its own undo/redo stack of 1000 steps, independent of
Dungeondraft's Ctrl+Z. A whole place_prefab, scatter_objects, build_room or
move_elements call is one step, so one undo reverses all of it — provided
nothing undoable has happened since. Undo always takes the newest step; it
cannot target an older one.
`undone: false` with `skipped` (the step's kind) means that step's
elements were already gone (deleted in Dungeondraft, or a level removed):
it was dropped, not reversed. Call undo again for the step before it.
Inputs: no named parameters.
update_companionA
Update this companion to the latest release, when the user asks for it.
1. Call with no arguments to preview. Pass `tell_user` to the user in
your own words and ask them. confirm=true is refused until this
server has returned that preview; the user's say is their answer to
you and their client's approval of the call.
2. Only on their yes, call again with confirm=true. It downloads this
computer's release, checks it against the release's signed list of
files, and sets it up beside this version. Nothing running is
replaced; the new version starts with the user's next chat.
3. When the reply's `next` says so, show the user `bridge.output` and,
on their yes, call with confirm=true and install_bridge=true. The
new mod loads when they fully quit and reopen Dungeondraft.
Always pass `tell_user` on: it says when to restart the chat or
Dungeondraft, and reports an earlier update that did not start
(`previous_attempt`). `state` is current, available, ready, staged,
refused, manual, update_elsewhere, disabled or unavailable. For a Python
package, the .deb, a Claude Code plugin or a Claude Desktop extension,
`tell_user` gives the steps for that install instead, and nothing is
downloaded here. There is no way to choose another source or version.
Inputs: confirm, install_bridge.
validate_floorplanA
Check a floorplan's structure BEFORE furnishing it. Read-only.
Answers the questions element counts cannot: is every room reachable, does
every door open onto something, and is there a way in from outside. A sealed
room and a connected one have identical counts.
Returns the enclosed regions with their area and bounds, which portals each
touches, and `findings`:
sealed_regions enclosed areas with no route from outside, even
with every door treated as open. Usually a missing
door, or one that missed its wall.
portals_not_in_a_wall a door touching no wall — what a failed wall-mount
looks like. It cuts no opening in anything.
portals_to_nowhere a door whose two sides are the same region, so it
connects nothing.
exterior_openings portals connecting a region to the outside. A
window counts too, so a building listed here may
still have no way IN. Check the assets.
vtt_reversed_portals a door with closed=false or a window with
closed=true: in a VTT export it acts as the other.
Delete it and add_portal again without `closed`.
`ok` is true when nothing in the first three lists appeared. Treat it as a
gate: no furniture, foliage or dressing until it passes, because repairing
structure after furnishing means moving everything twice.
Doors are analysed as openings regardless of their `closed` flag — that
controls light, not movement.
cell_woxels: analysis resolution, 64 (a quarter tile) by default. Smaller
is more exact and slower; a value above a door's width can seal doorways
and report false failures.
min_room_tiles: ignore enclosed areas below this, so the sliver between two
nearly-touching walls is not reported as a room.
Inputs: cell_woxels, min_room_tiles.
validate_placementsA
Find objects that intrude on the architecture. Read-only.
Use it after furnishing, before judging the render by eye. These defects
look correct in every element count and placement response.
crossing_walls real footprint on BOTH sides of a wall. Flush against
a wall is correct and never reported.
wall_caps posts and beams on layer 700+ over a wall or a wall
join: the caps the skills ask for. Advice.
wall_mounted paintings, wall lanterns, curtains on their wall;
faces_room false = turned around.
blocking_portals an object in a doorway or across a window.
unmeasurable no texture_size, so not checked: not the same as clean.
stacked two LARGE objects in one place on one layer (crates in
crates). Deliberate pairs land here too. Advice.
adrift_fixtures torches, tapestries, hearths away from any wall.
Matched by name: read the distance and decide.
surface_overflow dressing reaching past the table, desk or counter it
stands on. A draped cloth lands here too. Advice.
lone_kit_parts one part of a multi-piece fixture without its sibling:
bedding without a frame, a hearth base without its
chimney, a curtain without its rod. Advice.
A tankard on a table is NOT reported: it is on a higher layer. Footprints
are rotation-aware. A finding is evidence, not a verdict: a hearth set INTO
a thick wall is deliberate and will be reported.
tolerance_woxels: how far past a wall's centre line an object may reach on
both sides before it counts as crossing. The default (24) keeps flush
furniture quiet; lower it to catch shallower intrusions.
Inputs: tolerance_woxels.
validate_sceneA
Check that the map has ground and that its light has causes. Read-only.
Two failures that a render shows but cannot diagnose, and that no element
count can show at all:
bare_ground open ground with no terrain painted on it. Terrain is the
one part of a map with no element count, so a building
standing in an unpainted void reports as a complete,
correct map everywhere else. Cells occupied or enclosed by
walls are skipped — an interior is floored with patterns,
not terrain, and would otherwise read as bare on a
perfectly finished map.
lights every light, split into `explained` (something nearby could
be emitting it) and `unexplained` (nothing could). A pool
of warm light on bare boards with no candle, hearth or
lantern reads as a mistake immediately, and a viewer
notices before they can say why.
Lights match emitters by asset NAME, so read it as a prompt: an oddly named
source reads as unexplained. `explained` names the asset it credited.
`arrangement` is advice and never affects `ok`: how many objects sit at
scale 1.0 on quarter turns, and how much of the map the build covers.
`art_families` is advice too: objects, walls and terrain slots counted per
pack (`core` is the stock library). Packs are drawn in different styles,
so counts outside the family the plan chose are worth a look.
Outdoors, remember the global condition is itself a source. Under daylight
the open ground needs no local sources at all; at night it wants the light
to come from things that are in the scene.
samples: grid resolution per side for the terrain read, 2-64. Higher is
slower and finds smaller gaps.
emitter_reach: how close (in woxels) an emitter must be to account for a
light. One tile by default — a light is meant to sit on its source.
Inputs: samples, emitter_reach.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 106 tools
The set contains many closely related tools—place_object/place_objects/arrange_objects/scatter_objects/place_prefab, fill_terrain/fill_region/paint_terrain, and export_map/screenshot/export_dd2vtt—whose boundaries are explained but still require careful reading. With 106 tools, an agent faces real misselection risk even though no two tools are pure duplicates.
Names are overwhelmingly snake_case and action-oriented (get_, list_, set_, place_, draw_, validate_), with no camelCase or case-mixing. A handful of bare verbs/nouns (checkpoint, undo, redo, ping, screenshot) and varied verbs (add/place/build/draw) are minor deviations from a strict verb_noun rule.
At 106 tools this is far beyond a manageable MCP surface; the rubric's 50+ threshold is exceeded by more than double. The domain is complex, but agents will struggle to select among so many tools, and many are specialized utilities or diagnostic escape hatches.
The surface is unusually comprehensive: map lifecycle, element CRUD, terrain/water/caves, assets/packs, validation, VTT import/export, and installation are covered. Minor gaps remain, such as no direct new-map creation and limited typed modification for walls/paths/roofs, though generic tool_action/set_tool_option and redraw workflows provide workarounds.
Maintenance
Related MCP Connectors
Connect any AI to your Foundry VTT world: actors, combat, dice, journals, tokens, compendiums.
Create AI Characters and generate their DM and comment replies from any MCP client.
AI fantasy map generator for D&D: battle maps, dungeons, cities and world maps from a description.
1MCP server for Argo RPG Platform — connects AI assistants to campaign data via OAuth2
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceConnects Claude Desktop to Foundry VTT for AI-powered campaign management, enabling natural language interaction with game data including quest creation, character management, compendium searches, and dice rolling. Provides 20 MCP tools for seamless integration between Claude and your tabletop RPG sessions.88MIT
- FlicenseBqualityBmaintenanceMCP server for managing Foundry VTT journal content (entries, categories, pages) and listing actors, enabling AI-assisted world-building via natural language commands.19-

SagaSmith D&D MCPofficial
AlicenseNot gradedqualityFmaintenanceA local MCP server for Dungeons & Dragons campaign management, combining core runtime with skill and module-generation packs. It enables campaign creation, module generation and import, rule and skill searching via tools, resources, and prompts.Apache 2.0- AlicenseNot gradedqualityCmaintenanceEnables local-first, source-cited AI answers about your TTRPG campaign lore from your own documents, usable in Discord, Foundry VTT, or any MCP client while refusing to invent information outside your sources.MIT