How it works
Your MCP client starts the server, @mirva/mcp, on your computer. The server connects to Mirva over one WebSocket with your API key and passes the agent’s tool calls through. Everything runs on Mirva, as you:
- Your permissions, nothing more. The agent opens the boards you can open and makes the edits you may make. There is no separate agent account.
- On the live board. The agent joins a board as a participant, so your team sees its work as it happens, and its edits are part of the board’s history, undone like anyone’s.
- Mirva’s own tools. The tool list comes from Mirva when the client connects, so your agent always has the tools Mirva offers today, with no update to install.
Set it up
Add the server to your client with your API key. Nothing to install first: the client runs it with npx, which comes with Node.js 20 or later.
An API key connects your tools to your Mirva account. Sign in to put yours into the examples below.
Claude Code
Run once in a terminal. --scope user makes Mirva available in all your projects; leave it out for the current one only. /mcp inside Claude Code shows the server and its tools.
claude mcp add mirva --scope user -e MIRVA_API_KEY=your-api-key -- npx -y @mirva/mcpClaude Desktop
Settings › Developer › Edit Config opens claude_desktop_config.json. Add Mirva under mcpServers, then restart Claude.
{
"mcpServers": {
"mirva": {
"command": "npx",
"args": [
"-y",
"@mirva/mcp"
],
"env": {
"MIRVA_API_KEY": "your-api-key"
}
}
}
}Cursor
Add Mirva to ~/.cursor/mcp.json for every project, or to .cursor/mcp.json in a project for that one.
{
"mcpServers": {
"mirva": {
"command": "npx",
"args": [
"-y",
"@mirva/mcp"
],
"env": {
"MIRVA_API_KEY": "your-api-key"
}
}
}
}Codex
Add Mirva to ~/.codex/config.toml.
[mcp_servers.mirva]
command = "npx"
args = ["-y", "@mirva/mcp"]
env = { MIRVA_API_KEY = "your-api-key" }Other clients
Any client that runs MCP servers over standard input and output takes the same three things: the command npx, the arguments -y @mirva/mcp, and MIRVA_API_KEY in the environment. The source is in the mirva-mcp repository.
Try asking
Name a board, or open it in Mirva and say “this board”: the agent finds it by name in your drawings.
- Read my “Character sheets” board and tell me which sections still have no final render.
- Lay out the twelve images in my references folder as a grid in a new “Mood” section.
- Ask Mirva to paint over the sketch on the canvas I am working on, in the house skill, and put the result next to it.
- Go through the open comments on this board and summarise what the art director asked for.
- Save a version of the board, then tidy every section so no card overlaps another.
Tool reference
The 57 tools Mirva offers an agent, by what they work on, each as the agent reads it. The same tools are methods of mirva.tools in the SDK.
Drawings
Find the boards and canvases you can open, and see one as it renders now.
list_drawingsDrawings and boards in the account, newest first.
| Argument | Type | What it is |
|---|---|---|
limit | number | Maximum rows to return. 1 to 100. Default 25. |
await mirva.tools.list_drawings();get_drawingOne drawing or board by shortId: its name, type and timestamps, and for a canvas its stored width and height.
| Argument | Type | What it is |
|---|---|---|
shortIdrequired | string | The drawing shortId, as it appears in its URL. |
await mirva.tools.get_drawing({ shortId: 'SHORT_ID' });open_drawingJoin a drawing as a live participant, the way opening it in the editor does, and report its layers with their bounds, plus who is on it. On a board those bounds are where each card sits, so read them before placing something new. Not a prerequisite: every drawing tool attaches the board it names.
| Argument | Type | What it is |
|---|---|---|
shortIdrequired | string | The drawing shortId. |
await mirva.tools.open_drawing({ shortId: 'SHORT_ID' });render_boardA board as it currently renders, as a PNG — its cards laid out in space, including work other participants have in progress. A canvas is a board of one surface and renders the same way; pass layerId there to render one layer instead of the composite.
| Argument | Type | What it is |
|---|---|---|
shortIdrequired | string | The board or canvas to render. |
layerId | integer | Capture only this layer. Canvases only. |
rect | { x, y, w, h } | Region to capture, in the drawing's own coordinates. On a large board capture in parts: the cost follows how many cards the region covers, and a region holding dozens of them can exceed the deadline. On a canvas the region is clipped to the canvas. |
maxDim | number | Longest edge of the returned image. A canvas renders up to this; a board renders up to the worker's drawing buffer and comes back smaller than asked for when this is larger than that. The result states the size it actually carries. Lower it when the result will be fed back into paste_image, which refuses very large payloads. 1 to 8192. Default 1024. |
await mirva.tools.render_board({ shortId: 'SHORT_ID' });Boards
What is on a board and where, and the cards, sections and notes on it.
list_board_elementsWhat sits on a board and where: every card, document, section and label with its bounds, type and the id of whatever it references. Read this before placing anything, so a new element lands in free space rather than on top of existing work. Omit the region to list the whole board — which is what answers "where is X" and "is anything here twice"; a region answers only what is inside it, so a copy of the same card elsewhere goes unreported.
| Argument | Type | What it is |
|---|---|---|
boardIdrequired | string | Board to inspect. |
x | number | Board-space left edge of the region. Requires y, w and h. |
y | number | Board-space top edge of the region. |
w | number | Region width. At least 1. |
h | number | Region height. At least 1. |
await mirva.tools.list_board_elements({ boardId: 'BOARD_ID' });create_sectionDraw a named region on a board. A section is the board's own grouping element — a titled, coloured rectangle that cards sit inside — so a board reads as labelled areas instead of loose cards. It lands exactly where you put it and does not displace what is already there, so size it around the cards it names.
| Argument | Type | What it is |
|---|---|---|
boardIdrequired | string | Board to draw the section on. |
x | number | Board-space left edge. Default 0. |
y | number | Board-space top edge. Default 0. |
w | number | Width in board units. At least 1. Default 1600. |
h | number | Height in board units. At least 1. Default 1200. |
name | string | Section title, shown on the board. At most 64 characters. |
color | number | string | Hex tint, e.g. "#C0392B" (default grey). |
await mirva.tools.create_section({ boardId: 'BOARD_ID' });add_notePin a sticky note on a board. A note carries its own text, so this is how a board is annotated in place — a direction, a caption, a question against the work it sits beside. It lands exactly where you put it; read list_board_elements first to find clear ground.
| Argument | Type | What it is |
|---|---|---|
boardIdrequired | string | Board to pin the note on. |
textrequired | string | Note text. Newlines start new lines. At most 100000 characters. |
xrequired | number | Board-space left edge. |
yrequired | number | Board-space top edge. |
w | number | Width in board units. At least 1. Default 500. |
h | number | Height in board units. At least 1. Default 500. |
fontSize | number | Text size in board units. At least 1. Default 40. |
color | number | string | Note colour as "#rrggbb". |
await mirva.tools.add_note({ boardId: 'BOARD_ID', text: 'TEXT', x: 0, y: 0 });edit_noteRewrite a note's text, by the layer id list_board_elements reports. A board carries questions as well as answers, and a note that can only be pinned leaves the board contradicting the work beside it once the question is settled. The note keeps its position, size, colour and text size; only the words change.
| Argument | Type | What it is |
|---|---|---|
boardIdrequired | string | Board holding the note. |
layerIdrequired | integer | Layer id from list_board_elements. |
textrequired | string | Replacement text. Newlines start new lines. At most 100000 characters. |
fontSize | number | Text size in board units. Omit to keep the note's own. At least 1. |
await mirva.tools.edit_note({ boardId: 'BOARD_ID', layerId: 0, text: 'TEXT' });place_cardMove a canvas, video or 3D model card already on a board to a new rect, or add one that is not there yet. The card keeps its aspect: width drives the scale and height follows. Use list_board_elements to read what is where first — a rect is taken literally, so overlapping ground is yours to avoid.
| Argument | Type | What it is |
|---|---|---|
boardIdrequired | string | Board holding the card. |
drawingIdrequired | string | Canvas, video or 3D model shortId to place or move. |
xrequired | number | Board-space left edge. |
yrequired | number | Board-space top edge. |
wrequired | number | Width in board units; height follows the card aspect. |
await mirva.tools.place_card({
boardId: 'BOARD_ID',
drawingId: 'DRAWING_ID',
x: 0,
y: 0,
w: 0,
});move_board_objectMove or resize any object already on a board, by the layer id list_board_elements reports. A document, section or note takes the width and height given; a canvas, image, video or 3D model card keeps its proportions and is scaled to the width, or to the height when only that is given. Everything but the geometry is preserved: the object keeps its layer id and content, and a canvas card the canvas it shows.
| Argument | Type | What it is |
|---|---|---|
boardIdrequired | string | Board holding the object. |
layerIdrequired | integer | Layer id from list_board_elements. |
x | number | New board-space left edge. Omit to keep. |
y | number | New board-space top edge. Omit to keep. |
w | number | New width. Omit to keep. At least 1. |
h | number | New height. Omit to keep. At least 1. |
await mirva.tools.move_board_object({ boardId: 'BOARD_ID', layerId: 0 });copy_cardsCopy board objects to the clipboard and get back the id to paste them with: canvases, documents, 3D models, videos, notes, board text and sections (a section brings what is inside it). Canvases, documents and media are held at the version they are at now, so a paste recreates that version whatever they become meanwhile. Nothing moves and nothing travels through you — pass the clipboardId to paste_cards, on this board or another. With cut, the objects leave the board once the copy holds them, and the first paste places them as themselves (back on this board, the same cards). With html, the answer also carries the clip as a browser copy writes it (text/html): put on the system clipboard, the person pastes it in a tab of this site, cards and all. Expires a day after the copy. Read list_board_elements for the layer ids.
| Argument | Type | What it is |
|---|---|---|
boardIdrequired | string | Board the objects are on. |
layerIdsrequired | integer[] | Layer ids of the board objects to copy; a section brings the objects inside it. |
cut | boolean | Cut instead of copy: the objects leave this board once the copy holds them, and the first paste places them as themselves. |
html | boolean | Also answer the clip as a browser copy writes it (text/html), for the person to paste in a tab of this site. |
await mirva.tools.copy_cards({ boardId: 'BOARD_ID', layerIds: [0] });paste_cardsPaste board objects onto a board: those copy_cards put on the clipboard (clipboardId), or those the person copied in a browser tab of this site (clip: the text/html the copy wrote, as the system clipboard holds it). Each canvas, document and media card becomes a new card of this board with the content it had when copied; notes, text and sections are recreated; the first paste of a cut places it as itself. Give x and y for the centre of what lands, or neither for free ground near the board centre. The answer lists anything not recreated, and why.
| Argument | Type | What it is |
|---|---|---|
boardIdrequired | string | Board to paste onto. |
clipboardId | string | Handle copy_cards answered with; or give clip. |
clip | string | Board objects the person copied in a browser of this site, as the text/html the copy wrote; instead of clipboardId. At most 16000000 characters. |
x | number | Board-space x of the pasted objects' centre; with y, or neither. |
y | number | Board-space y of the pasted objects' centre; with x, or neither. |
await mirva.tools.paste_cards({ boardId: 'BOARD_ID' });Canvases and layers
Create canvases and layers, and restack, copy, merge, trim, resize or remove them.
create_canvasAdd a new empty canvas to a board and return its shortId. Omit x/y to have it placed in free space near the middle of the board; give both to pin its top-left corner exactly.
| Argument | Type | What it is |
|---|---|---|
boardIdrequired | string | Board shortId to add the canvas to. |
width | number | Canvas width in pixels. 64 to 8192. Default 1920. |
height | number | Canvas height in pixels. 64 to 8192. Default 1080. |
name | string | Canvas name. Default "New canvas". |
background | string | Fill as "#rrggbb", or a named editor background. |
x | number | Board-space left edge of the card. Requires y; omit both to place in free space. |
y | number | Board-space top edge of the card. Requires x; omit both to place in free space. |
anchor | { x, y } | Board-space point to place the card near when x and y are omitted. |
await mirva.tools.create_canvas({ boardId: 'BOARD_ID' });create_layerAdd a new paint layer to a canvas and claim it for this session, returning its layerId. Canvases only — boards hold cards, not paint layers.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
name | string | Layer name. At most 64 characters. Default "Mirva layer". |
free | boolean | Let go of the layer at once, for the person to take and draw on. |
aboveLayerId | integer | Put the layer just above this layer of the canvas. Default: on top. |
unlessCovered | boolean | Make no layer when the layers above it would hide the canvas; say which instead. |
await mirva.tools.create_layer({ drawingId: 'DRAWING_ID' });set_layerChange a layer's name, visibility, lock, opacity, opacity lock, blend mode or clipping — the properties the layer panel edits, not its pixels or its position. Naming matters on a board: a card placed by a generation lands as "Placed image" and reads as debris until it is named for what it holds.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas or board shortId holding the layer. |
name | string | New layer name. |
visible | boolean | Show or hide the layer. |
locked | boolean | A locked layer takes no edits until unlocked. |
opacityLocked | boolean | Keep the layer's existing alpha: paint changes colour, never coverage. |
clippingGroup | boolean | Clip the layer to the alpha of the layer below it. |
opacity | number | Layer opacity. 0 to 1. |
mode | string | Blend mode: normal, dissolve, darken, multiply, color burn, linear burn, darker color, lighten, screen, color dodge, linear dodge, lighter color, overlay, soft light, hard light, vivid light, linear light, pin light, hard mix, difference, exclusion, subtract, divide, hue, saturation, color or luminosity. |
layerIdrequired | integer | Layer id, from list_board_elements. |
await mirva.tools.set_layer({ drawingId: 'DRAWING_ID', layerId: 0 });reorder_layersRestack a canvas's layers, or a board's cards, sections and notes. Order is top-first: the first id ends up above the rest, matching how the layer list reads. Every layer must be listed.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
orderrequired | integer[] | Every layer id, topmost first. |
await mirva.tools.reorder_layers({ drawingId: 'DRAWING_ID', order: [0] });copy_layerPut one canvas layer's pixels on the clipboard and get back the id to paste them with, plus the bounds they occupied. The pixels stay here — pass the clipboardId to paste_image, on this canvas or another, and nothing travels through you. Expires ten minutes after the copy. Painted layers only — a layer holding a card or reference has no pixels of its own. To see a layer rather than move it, read it with get_media_pixels.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
layerIdrequired | integer | Layer to read. |
await mirva.tools.copy_layer({ drawingId: 'DRAWING_ID', layerId: 0 });duplicate_layerCopy a canvas layer, pixels and all, as a new layer above it.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
layerIdrequired | integer | Layer to duplicate. |
await mirva.tools.duplicate_layer({ drawingId: 'DRAWING_ID', layerId: 0 });merge_layer_downMerge a canvas paint layer into the layer directly below it, as the layer panel's merge down: the lower layer keeps the combined pixels and the upper layer is removed; the result names the surviving layer. Both must be paint layers, not cards or text. Destructive: the two layers cannot be separated again through these tools.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
layerIdrequired | integer | The upper layer, which merges into the one below it. |
await mirva.tools.merge_layer_down({ drawingId: 'DRAWING_ID', layerId: 0 });trim_layerCut a canvas paint layer back to the canvas bounds, dropping pixels that lie outside it and were never visible. Reports the layer's bounds afterwards.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
layerIdrequired | integer | Paint layer to trim. |
await mirva.tools.trim_layer({ drawingId: 'DRAWING_ID', layerId: 0 });clear_layerEmpty a canvas paint layer of its pixels and keep the layer. Destructive: the pixels cannot be recovered through these tools.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
layerIdrequired | integer | Paint layer to empty. |
await mirva.tools.clear_layer({ drawingId: 'DRAWING_ID', layerId: 0 });remove_layersDelete layers from a drawing. This is destructive and cannot be undone through these tools — the editor's own undo does not reach a change made from outside its history. The result lists what was removed, and any layer it could not act on under skipped — a layer absent from the session reports there rather than as removed. On a board a card layer holds a canvas rather than pixels, and removing it removes that canvas too: to take a card off a board while keeping it, move it away with place_card instead. open_drawing reports each card layer's drawingId, which is what would go with it.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Drawing shortId. |
layerIdsrequired | integer[] | Layer ids to remove. |
await mirva.tools.remove_layers({ drawingId: 'DRAWING_ID', layerIds: [0] });resize_canvasResize a canvas as the editor's resize dialog does. width and height are the new size in pixels; x and y move the origin in the canvas's own coordinates and default to the current one, so a plain resize keeps the top-left corner and grows or crops at the right and bottom. Layers keep their pixels; what falls outside the new bounds is hidden, not lost. Sizes up to 8192 a side.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
width | number | New width in pixels; the canvas keeps its own when omitted. 1 to 8192. |
height | number | New height in pixels; the canvas keeps its own when omitted. 1 to 8192. |
x | number | New left edge in the canvas's current coordinates; unchanged when omitted. |
y | number | New top edge in the canvas's current coordinates; unchanged when omitted. |
await mirva.tools.resize_canvas({ drawingId: 'DRAWING_ID' });undo_editUndo this session's last edit on a canvas — a stroke, a fill, a shape, a layer change — the way the editor's undo does. Only what this session drew is undone, never another participant's work; redo_edit brings it back. This is the editor's undo history, unlike undo_agent_edits, which removes the layers an agent's chat reply added.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
await mirva.tools.undo_edit({ drawingId: 'DRAWING_ID' });redo_editRedo the last edit this session undid with undo_edit.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
await mirva.tools.redo_edit({ drawingId: 'DRAWING_ID' });Painting
Strokes, shapes, text and fills with the editor’s own brushes, images composed in, filters and transforms.
draw_shapesPaint onto a canvas layer you own, in canvas coordinates. "path" strokes an arbitrary point sequence — the primitive a brush produces, and what to reach for when nothing simpler fits; the rest are conveniences over it. Strokes are painted pixels, not vector objects: they cannot be moved or restyled afterwards. Create the layer with create_layer first.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
layerIdrequired | number | Layer to paint on, from create_layer. |
shapesrequired | { kind, points, x1, y1, x2, y2, cx, cy, r, x, y, w, h, startAngle, endAngle }[] | Shapes to stroke, in order. |
color | string | Hex brush colour. Default "#E74C3C". |
size | number | Brush diameter in pixels. At least 1. Default 8. |
hardness | number | Edge hardness; lower feathers the stroke. A preset supplies its own. 0 to 1. Default 0.9. |
opacity | number | Stroke opacity. A preset supplies its own. 0 to 1. Default 1. |
flow | number | Paint per stamp; below 1 the stroke builds up where it overlaps itself. A preset supplies its own. 0 to 1. Default 1. |
spacing | number | Stamp distance as a fraction of the size; large values break the stroke into dots. A preset supplies its own. 0.001 to 10. Default 0.2. |
sizePressure | boolean | Scale the stamp by each point's pressure (default false). |
minSize | number | With sizePressure, the smallest stamp as a fraction of the size. A preset supplies its own. 0 to 1. Default 0.2. |
mode | string | "draw" (default) paints the shapes; "erase" removes paint along them with the same brush settings, colour ignored. |
tool | string | "brush" (default) paints round stamps; "pencil" lays hard square pixels with no pressure sizing; "blend" smudges the paint already on the layer along the strokes instead of adding paint (needs paint under the stroke). |
stretch | number | blend only: how far each stamp drags the paint it picked up. A preset supplies its own. 0 to 1. Default 0.4. |
paint | number | blend only: how much of the brush colour each stamp adds while smudging; 0 is a pure smudge. A preset supplies its own. 0 to 1. Default 0. |
preset | string | A brush preset from list_brush_presets, by name or "set/name" (e.g. "soft charcoal", "general/ink"); its settings are the base, and any setting named here overrides it. Without one the plain round brush paints. |
shape | string | Tip shape id, as list_brush_presets reports under tip; overrides the preset's tip. |
brush | { angle, angleJitter, dualAngleJitter, roundness, sizeJitter, minSizeTilt, maxSizeTilt, normalSpread, tangentSpread, hueJitter, saturationJitter, brightnessJitter, foregroundBackgroundJitter, dualSize, dualSpacing, dualNormalSpread, dualTangentSpread, patternDepth, patternScale, patternBrightness, patternContrast, patternMinDepth, anglePressure, angleTilt, angleToDirection, angleInitialDirection, roundnessPressure, roundnessTilt, sizeTilt, flipX, flipY, pixelation, separateSpread, flowPressure, flowTilt, opacityPressure, opacityTilt, colorPressure, colorTilt, dualSeparateSpread, dualFlipX, dualFlipY, patternInvert, patternEachStamp, patternDepthPressure, patternDepthTilt, dualShape, patternShape, dualBlendMode, patternBlendMode } | The brush panel's advanced settings, laid over the preset's and under the named arguments. A field outside its range is refused rather than clamped. |
await mirva.tools.draw_shapes({
drawingId: 'DRAWING_ID',
layerId: 0,
shapes: [{ kind: 'KIND' }],
});draw_shapeDraw a rectangle or an ellipse with exact geometry on a canvas paint layer, filled or as an outline of a given stroke width — the editor's shape tools. Where draw_shapes strokes a rect or circle outline with the brush, this draws the shape itself; use it for a solid block, a clean frame, or a shape a fill_area must not leak out of.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
kind | "rect" | "ellipse" | The shape to draw. Default "rect". |
xrequired | number | Left edge of the shape's box, in canvas pixels. |
yrequired | number | Top edge of the shape's box. |
wrequired | number | Box width in canvas pixels. |
hrequired | number | Box height in canvas pixels. |
fill | boolean | Fill the shape rather than stroke its outline. Default true. |
strokeWidth | number | Outline width in pixels; used when fill is false. 1 to 100. Default 5. |
color | string | Hex colour. Default "#E74C3C". |
opacity | number | Opacity. 0 to 1. Default 1. |
layerIdrequired | integer | Paint layer to draw on. |
await mirva.tools.draw_shape({
drawingId: 'DRAWING_ID',
x: 0,
y: 0,
w: 0,
h: 0,
layerId: 0,
});draw_textSet text with one of the editor's bundled fonts and place it as pixels on a new canvas layer, positioned by its top-left corner. Newlines break lines. Once placed it is paint like any other layer (erase, transform, filter, select on it); the editor's live, editable text layer is not created. Fonts: Inter, Open Sans, Montserrat, Lexend, Lora, Outfit, Roboto Mono, Courier Prime, Caveat, Patrick Hand, Pacifico, Kaushan Script, Bangers, Bungee, Black Ops One, Special Elite, Silkscreen, Galindo, Kavivanar, Rubik Wet Paint, Uncial Antiqua, UnifrakturCook, Klee One, Hachi Maru Pop, Mochiy Pop P One, Noto Sans TC, ZCOOL KuaiLe, Ma Shan Zheng, Zhi Mang Xing, Paperlogy, Cafe24 Syongsyong.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
textrequired | string | The text; newlines break lines. |
xrequired | number | Left edge of the text block in canvas pixels. |
yrequired | number | Top edge of the text block in canvas pixels. |
size | number | Font size in canvas pixels. 4 to 512. Default 32. |
font | string | Font family name from list_brush_presets' font list. Default "Inter". |
color | string | Text colour as "#rrggbb". Default "#000000". |
bold | boolean | Bold weight. Default false. |
italic | boolean | Italic style. Default false. |
align | "left" | "center" | "right" | Horizontal alignment within the block. Default "left". |
lineHeight | number | Line height as a multiple of the font size. 0.5 to 4. Default 1.2. |
await mirva.tools.draw_text({ drawingId: 'DRAWING_ID', text: 'TEXT', x: 0, y: 0 });fill_areaThe paint bucket: flood-fill a canvas paint layer from a point. The region is the connected run of similar colour around the point, within a tolerance; by default it is decided on the layer itself, so an outline drawn with draw_shapes can be filled by clicking inside it. target "all" decides the region against the whole picture and paints it onto the layer; mode "opacity" fills by alpha instead of colour; fillMode "fillRest" paints everything outside the region, "clear" removes the region.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
xrequired | number | Click position in canvas pixels. |
yrequired | number | Click position in canvas pixels. |
color | string | Hex fill colour. Default "#E74C3C". |
opacity | number | Fill opacity. 0 to 1. Default 1. |
tolerance | integer | How far a pixel may differ from the clicked colour, per channel. 0 to 255. Default 0. |
contiguous | boolean | Fill only the connected region; false fills every matching pixel. Default true. |
antiAlias | boolean | Soften the region's edge. Default false. |
target | "active" | "all" | "above" | "below" | Which pixels decide the region: the layer, the whole picture, or a neighbouring one. Default "active". |
mode | "color" | "opacity" | "smart" | What the fill matches on. Default "color". |
fillMode | "fill" | "fillRest" | "clear" | "clearRest" | Whether to fill the region or the rest, and whether to paint or clear. Default "fill". |
layerIdrequired | integer | Paint layer to fill on. |
await mirva.tools.fill_area({ drawingId: 'DRAWING_ID', x: 0, y: 0, layerId: 0 });paste_imageCompose an image into a canvas as a new layer, from image bytes or from a clipboardId copy_layer answered with. Without a rect the image lands at its own size, centred. With one it is cover-cropped to fill that rect — pass exact:true to crop verbatim, or leave it off and a strong aspect mismatch keeps the width and re-centres the height. feather:true fades the edges so a replacement blends into surrounding pixels instead of landing as a hard rectangle.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
image | string | Base64 image bytes: PNG, JPEG, WebP (lossy or lossless) or GIF, decoding to at most 64 MB. Prefer lossy WebP for photographic content — it carries the largest canvas this app allows in under 20 MB, where the same image as PNG is over 100 MB and is refused. Keep PNG for exact pixels or transparency. Scaling the image to the rect it is going into costs nothing either way, since the paste crops to that rect. |
clipboardId | string | Pixels copy_layer put aside, by the clipboardId it answered with, instead of image bytes written out here. The pixels stay on the server, so a copy and a paste move nothing through the caller. Expires ten minutes after the copy. |
rect | { x, y, w, h } | Canvas-space target for the paste. Omit for the image's own size, centred. |
exact | boolean | Crop to the rect verbatim rather than re-centring on aspect mismatch. Default false. |
feather | boolean | Fade the edges so the paste blends. Default false. |
rotate | number | Turn the source by 90, 180 or 270 degrees before it is measured and cropped. Whole quarter-turns permute pixels rather than resample them, so linework survives the turn unsoftened. Default 0. |
flip | boolean | Mirror the source across its vertical axis before pasting. Default false. |
name | string | Layer name. |
belowLayerId | integer | Place the pasted art beneath this existing layer instead of on top. "Beneath" is literal: art under an opaque fill is hidden by it. Compositing a card face wants three layers instead — body, then art above it, then frame details above that. |
await mirva.tools.paste_image({ drawingId: 'DRAWING_ID' });pick_colorRead a colour off a canvas as the editor's eyedropper does: from the composite the canvas shows, or from one layer's own pixels when layerId is given. radius averages the square around the point (0 reads the single pixel). Reports hex and rgb plus alpha, the coverage of the sampled square; nothing painted there reports picked: false.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
xrequired | number | Canvas pixel to read, in the canvas's own coordinates. |
yrequired | number | Canvas pixel to read, in the canvas's own coordinates. |
radius | number | Half-width of the sampling square; 0 reads the single pixel, as the eyedropper does. 0 to 8. Default 0. |
layerId | integer | Read one layer's own pixels instead of the composite the canvas shows. |
await mirva.tools.pick_color({ drawingId: 'DRAWING_ID', x: 0, y: 0 });list_brush_presetsThe brush presets draw_shapes accepts as preset: the editor's own brush sets that every account has, each with its set, name, tip shape and whether it carries a texture. Pass tool "eraser", "pencil" or "blend" for the presets those tools accept; the eraser is draw_shapes with mode "erase", the others its tool argument.
| Argument | Type | What it is |
|---|---|---|
tool | "brush" | "eraser" | "pencil" | "blend" | Which tool's presets to list. Default "brush". |
await mirva.tools.list_brush_presets();apply_filterApply one of the editor's layer filters to a canvas paint layer, as its filter panel does: gaussianBlur (radius), motionBlur (distance, angle), hueSaturationLightness (hue, saturation, lightness), brightnessContrast (brightness, contrast) or curves (curvePoints). With a selection active only the selected pixels are filtered. Values outside the editor's range are refused.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
layerIdrequired | number | Paint layer to filter. |
filterrequired | "gaussianBlur" | "motionBlur" | "hueSaturationLightness" | "brightnessContrast" | "curves" | The filter to run. |
radius | number | gaussianBlur: blur radius in pixels. 0 to 100. |
distance | number | motionBlur: blur distance in pixels. 0 to 2000. |
angle | number | motionBlur: direction in degrees, counterclockwise, as the editor's filter dial shows it. -180 to 180. |
hue | number | hueSaturationLightness: hue shift in degrees. -180 to 180. |
saturation | number | hueSaturationLightness: saturation shift. -100 to 100. |
lightness | number | hueSaturationLightness: lightness shift. -100 to 100. |
brightness | number | brightnessContrast: brightness shift. -150 to 150. |
contrast | number | brightnessContrast: contrast shift. -100 to 100. |
curvePoints | { x, y }[][] | curves: one point list per channel, in the order rgb, red, green, blue. At most 4 items. |
await mirva.tools.apply_filter({
drawingId: 'DRAWING_ID',
layerId: 0,
filter: 'gaussianBlur',
});transform_layerMove, rotate, flip or scale a canvas paint layer as the editor's transform and move tools do. Operations apply in the order rotate, flip, scale, translate and are committed to the layer's pixels; with a selection active only the selected pixels move. Reports the layer bounds before and after. A card, a text layer or an empty layer is refused, as is a hidden, locked or fully transparent one.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
rotate | number | Rotation in degrees, clockwise, about the layer centre. -360 to 360. Default 0. |
flip | "horizontal" | "vertical" | Mirror the layer about its own centre. |
scale | number | Uniform scale factor about the layer centre. 0.01 to 100. Default 1. |
dx | number | Horizontal move in canvas pixels. -100000 to 100000. Default 0. |
dy | number | Vertical move in canvas pixels. -100000 to 100000. Default 0. |
layerIdrequired | integer | Paint layer to transform. |
await mirva.tools.transform_layer({ drawingId: 'DRAWING_ID', layerId: 0 });Selection
Select part of a layer, so a fill, filter, transform or delete applies to it alone.
select_rectSelect a rectangle of a canvas with the editor's selection tool. Strokes, fills, shapes and delete_selection that follow stay inside the selection until it changes or deselect drops it. Coordinates are canvas pixels; each side is at least 2.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
xrequired | number | Left edge of the area. |
yrequired | number | Top edge of the area. |
wrequired | number | Width of the area, at least 2. |
hrequired | number | Height of the area, at least 2. |
mode | string | How the area combines with the current selection: replace (default), add, subtract or intersect. |
await mirva.tools.select_rect({ drawingId: 'DRAWING_ID', x: 0, y: 0, w: 0, h: 0 });select_ellipseSelect the ellipse inscribed in a rectangle of a canvas, as the editor's ellipse selection does. Strokes, fills, shapes and delete_selection that follow stay inside the selection until it changes or deselect drops it. Coordinates are canvas pixels; each side is at least 2.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
xrequired | number | Left edge of the area. |
yrequired | number | Top edge of the area. |
wrequired | number | Width of the area, at least 2. |
hrequired | number | Height of the area, at least 2. |
mode | string | How the area combines with the current selection: replace (default), add, subtract or intersect. |
await mirva.tools.select_ellipse({ drawingId: 'DRAWING_ID', x: 0, y: 0, w: 0, h: 0 });select_lassoSelect a free-form area of a canvas by its outline, as the editor's lasso does: the vertices are joined in order and the outline closes back to the first. Combines with the current selection like select_rect. Coordinates are canvas pixels; three vertices at least.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
pointsrequired | { x, y }[] | Outline vertices in order, three or more; the outline closes by itself. At most 4096 items. |
mode | "replace" | "add" | "subtract" | "intersect" | How the area combines with the current selection. Default "replace". |
antiAlias | boolean | Soften the outline's edge pixels, as the lasso's anti-alias option does. Default false. |
await mirva.tools.select_lasso({ drawingId: 'DRAWING_ID', points: [{ x: 0, y: 0 }] });select_layer_contentSelect the shape of a layer's own pixels, as the editor's "Select layer content" does. This is how an edit is masked to what another layer already covers: a layer's pixels are not a rectangle, an ellipse or an outline the caller could state, so no marquee expresses it. Refused for a card, a text or grid layer, and a layer with no pixels.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
layerIdrequired | integer | Layer whose pixels become the selection, from list_layers. |
await mirva.tools.select_layer_content({ drawingId: 'DRAWING_ID', layerId: 0 });select_allSelect the whole canvas.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
await mirva.tools.select_all({ drawingId: 'DRAWING_ID' });deselectDrop the canvas selection so edits reach the whole canvas again.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
await mirva.tools.deselect({ drawingId: 'DRAWING_ID' });invert_selectionSelect what is not selected on the canvas and release what is; needs a selection.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
await mirva.tools.invert_selection({ drawingId: 'DRAWING_ID' });delete_selectionErase the selected pixels of a canvas paint layer, as the editor's delete does with a selection active. The selection stays for the next edit; undo_edit brings the pixels back.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas shortId. |
layerIdrequired | integer | Paint layer whose selected pixels are erased. |
await mirva.tools.delete_selection({ drawingId: 'DRAWING_ID', layerId: 0 });Documents
Read and write the rich documents on a board.
read_documentA rich document's current content as markdown, its title as the first "# heading", and the version of what it shows. A document longer than 100,000 characters is shown in its first part and says it continues. write_document with that version changes only what this showed.
| Argument | Type | What it is |
|---|---|---|
documentIdrequired | string | Document shortId. |
await mirva.tools.read_document({ documentId: 'DOCUMENT_ID' });write_documentCreate a rich document on a board and write its content as markdown, or write over an existing one. The first "# heading" becomes the document title, so the card on the board is labelled by it. Returns the document id as documentId. Over an existing document, with the version read_document returned the write replaces what that read showed, keeps the rest and anything edited since in what it leaves as it was, and is refused when the document no longer shows what was read; without a version it replaces the whole document.
| Argument | Type | What it is |
|---|---|---|
boardIdrequired | string | Board to place the document on. |
contentrequired | string | Markdown. First "# heading" becomes the title. At most 100000 characters. |
documentId | string | Existing document shortId to overwrite. Omit to create one. |
version | string | The version read_document returned for documentId. |
x | number | Board-space left edge. Requires y. A document card is 900 wide and A4-proportioned, so leave that much room. |
y | number | Board-space top edge. Requires x. |
await mirva.tools.write_document({ boardId: 'BOARD_ID', content: 'CONTENT' });Comments
Review where the work is: read, add, answer and resolve comments.
list_commentsThe comment threads on a drawing: where each is anchored (canvas pixels of the canvas named by childId, or board space when there is none), its opening text, author, reply count and state (open or resolved). Read a thread's replies with get_messages on its channelName.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas or board shortId. |
await mirva.tools.list_comments({ drawingId: 'DRAWING_ID' });add_commentLeave a comment pinned to a point of a drawing, as the editor's comment tool does; it opens a thread others can reply to. On a canvas the point is in canvas pixels. On a board it is in board space, or in a card's canvas pixels when canvasId names the card.
| Argument | Type | What it is |
|---|---|---|
drawingIdrequired | string | Canvas or board shortId. |
textrequired | string | The comment. At most 2500 characters. |
xrequired | number | Anchor x. |
yrequired | number | Anchor y. |
canvasId | string | On a board: shortId of the canvas card the comment pins to. |
await mirva.tools.add_comment({ drawingId: 'DRAWING_ID', text: 'TEXT', x: 0, y: 0 });reply_commentReply in a comment thread of a drawing (a threadId from list_comments or add_comment).
| Argument | Type | What it is |
|---|---|---|
threadIdrequired | string | The thread. |
textrequired | string | The reply. At most 2500 characters. |
await mirva.tools.reply_comment({ threadId: 'THREAD_ID', text: 'TEXT' });resolve_commentMark a comment thread resolved, or open it again.
| Argument | Type | What it is |
|---|---|---|
threadIdrequired | string | The thread. |
resolvedrequired | boolean | true resolves the thread, false reopens it. |
await mirva.tools.resolve_comment({ threadId: 'THREAD_ID', resolved: true });Board versions
Save a board’s state, compare two versions, restore one, and take back what Mirva changed in a turn.
list_board_versionsThe saved versions of a board, newest first: each version's id, label, when it was saved, and whether a person saved it (manual) or it was saved automatically (automatic, among them the ones written before the Mirva agent changed the board, labelled "Before Mirva: …").
| Argument | Type | What it is |
|---|---|---|
boardIdrequired | string | Board shortId. |
await mirva.tools.list_board_versions({ boardId: 'BOARD_ID' });save_board_versionSave the board as it is now as a version, as a person does from the editor's version history: a manual version, kept however many automatic ones follow. Returns its id.
| Argument | Type | What it is |
|---|---|---|
boardIdrequired | string | Board shortId. |
labelrequired | string | What the version is, as the history lists it. At most 64 characters. |
await mirva.tools.save_board_version({ boardId: 'BOARD_ID', label: 'LABEL' });board_version_changesWhat differs between a saved version of a board and the board as it is now, object by object: changed since (its content, placement, stacking order or other data), removed since, or added since, each by its object id (uid) and name, and who made its last change since (by: the author, their name, and the agent when an agent made it — "bot" for this bridge, "mirva" for the Mirva agent — and, for a change the Mirva agent made, the chat message whose request it acted on: chat.channelId, chat.messageId). Also whether you may restore from the version, and the key restore_board_version takes to refuse a board that changed after these changes were read.
| Argument | Type | What it is |
|---|---|---|
boardIdrequired | string | Board shortId. |
versionrequired | string | Version id, from list_board_versions. |
await mirva.tools.board_version_changes({ boardId: 'BOARD_ID', version: 'VERSION' });restore_board_versionBring a saved version of a board back: the chosen objects, the objects one author changed last since the version (by), or the whole version when neither is given. Choosing an object added since removes it. Restoring by author undoes that author's work and leaves everyone else's; an object someone else changed after it is theirs and stays. The board as it is now is saved as a version first, so the restore can itself be undone. With the key from board_version_changes, a board that changed since is not restored and what differs now is returned instead.
| Argument | Type | What it is |
|---|---|---|
boardIdrequired | string | Board shortId. |
versionrequired | string | Version id, from list_board_versions. |
objects | string[] | Object ids (uid) from board_version_changes; omit to restore the whole version. |
by | string | An author from board_version_changes (by.author): restore the objects that author changed last. |
key | string | The key board_version_changes returned. |
await mirva.tools.restore_board_version({ boardId: 'BOARD_ID', version: 'VERSION' });undo_agent_editsRemove the board layers an agent turn added, by the messageId of its reply. A generation places its result on the board wherever it chooses, so a run that produced art you are composing yourself leaves a full-size copy behind; this takes it back out. get_messages reports boardEdits on the replies that have any.
| Argument | Type | What it is |
|---|---|---|
messageIdrequired | string | messageId of the agent reply, from get_messages. |
await mirva.tools.undo_agent_edits({ messageId: 'MESSAGE_ID' });Working with Mirva
Ask Mirva for something, read its reply and the images it made.
create_ai_sessionStart a new Mirva conversation and return its channel. Pass a board shortId to scope the session to that board, so Mirva can see and act on it.
| Argument | Type | What it is |
|---|---|---|
boardId | string | Board shortId to scope the session to. Omitted = an unscoped chat. |
await mirva.tools.create_ai_session();send_messagePost a message to a chat channel. In a Mirva session this is how you ask Mirva to do something; its reply arrives asynchronously — read it back with get_messages.
| Argument | Type | What it is |
|---|---|---|
channelNamerequired | string | Channel, e.g. "ai-session/<id>" or "drawing/<shortId>". |
messagerequired | string | Message text. A channel other than an AI one takes at most 2500 characters. At most 16000 characters. |
images | { data, name, mimeType }[] | Images to attach, as base64. Mirva sees these, so this is how a reference reaches a generation request rather than only being described. At most 10 items. |
await mirva.tools.send_message({ channelName: 'CHANNEL_NAME', message: 'MESSAGE' });get_messagesThe most recent messages in a channel, oldest first. Poll after send_message to read a Mirva reply, which is produced asynchronously. An agent reply also reports what it ran (tools), the images it produced (producedImages) and any layers it added to a board (boardEdits) — a generated image is referenced from the tool record, not attached to the message, so the prose alone understates what happened. Fetch a producedImages fileId with read_message_image.
| Argument | Type | What it is |
|---|---|---|
channelNamerequired | string | Channel to read. |
limit | number | Maximum messages to return. 1 to 100. Default 20. |
await mirva.tools.get_messages({ channelName: 'CHANNEL_NAME' });read_message_imageFetch an image attached to a chat message, by the fileId get_messages reports. This is how a picture the agent produced is actually looked at, and how it is brought back for paste_image.
| Argument | Type | What it is |
|---|---|---|
fileIdrequired | string | fileId from a get_messages files entry. |
await mirva.tools.read_message_image({ fileId: 'FILE_ID' });The viewer
The viewer shows a board exactly as your agent gets it and drives it with the same tools: every picture is a capture and every click is a tool call, so what the viewer cannot do, the agent cannot do either. Run it, then open http://localhost:5177. The key stays in the local process.
MIRVA_API_KEY=your-api-key npx -y -p @mirva/mcp mirva-mcp-viewerTroubleshooting
The client says the server failed to start, or “npx: command not found”
The server runs on Node.js 20 or later. Install it from nodejs.org, then restart the client so it finds npx.
Every tool fails with “Connection closed”
The server closes the connection of a key it does not accept: missing, mistyped, refreshed or removed, or its account’s email not verified. Copy the key again from your account’s API page.
Tools fail with “Board tools are not enabled on this server”
The board tools are not available to your account yet. Your key is fine; the same tools will work once they are.
The agent does not see a tool listed here
The server tells a connected client when its tool list changes; a client that ignores that keeps the list it loaded when it started. Restart it, or reconnect the server (/mcp in Claude Code).
Security
- The API key acts as you: keep it in the client’s configuration, out of shared files and repositories.
- Refresh or remove the key on your API page to stop every client that uses it at once; your own sign-in is not affected.
- Text on a board is content, not instructions: an agent reading a shared board can be asked things by what others wrote there. The agent’s edits are part of the board’s history, and a turn’s edits by Mirva can be undone in one step.
Building something of your own? The SDK and the REST API use the same key.
