Mirva MCP server

Your AI agent, on your boards.

The Mirva MCP server connects Claude Code, Claude Desktop, Cursor, Codex and any other MCP client to your Mirva account. Your agent reads your boards, paints on canvases, arranges cards and asks Mirva for images, on the same live board your team sees.

Claude Code →One command in a terminal.Claude Desktop →An entry in its config file.Cursor →An entry in mcp.json.Tool reference →All 57 tools, with their arguments.

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.

Terminal
claude mcp add mirva --scope user -e MIRVA_API_KEY=your-api-key -- npx -y @mirva/mcp

Claude Desktop

Settings › Developer › Edit Config opens claude_desktop_config.json. Add Mirva under mcpServers, then restart Claude.

claude_desktop_config.json
{
  "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.

~/.cursor/mcp.json
{
  "mcpServers": {
    "mirva": {
      "command": "npx",
      "args": [
        "-y",
        "@mirva/mcp"
      ],
      "env": {
        "MIRVA_API_KEY": "your-api-key"
      }
    }
  }
}

Codex

Add Mirva to ~/.codex/config.toml.

~/.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.
ArgumentTypeWhat it is
limitnumberMaximum rows to return. 1 to 100. Default 25.
SDK
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.
ArgumentTypeWhat it is
shortIdrequiredstringThe drawing shortId, as it appears in its URL.
SDK
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.
ArgumentTypeWhat it is
shortIdrequiredstringThe drawing shortId.
SDK
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.
ArgumentTypeWhat it is
shortIdrequiredstringThe board or canvas to render.
layerIdintegerCapture 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.
maxDimnumberLongest 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.
SDK
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.
ArgumentTypeWhat it is
boardIdrequiredstringBoard to inspect.
xnumberBoard-space left edge of the region. Requires y, w and h.
ynumberBoard-space top edge of the region.
wnumberRegion width. At least 1.
hnumberRegion height. At least 1.
SDK
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.
ArgumentTypeWhat it is
boardIdrequiredstringBoard to draw the section on.
xnumberBoard-space left edge. Default 0.
ynumberBoard-space top edge. Default 0.
wnumberWidth in board units. At least 1. Default 1600.
hnumberHeight in board units. At least 1. Default 1200.
namestringSection title, shown on the board. At most 64 characters.
colornumber | stringHex tint, e.g. "#C0392B" (default grey).
SDK
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.
ArgumentTypeWhat it is
boardIdrequiredstringBoard to pin the note on.
textrequiredstringNote text. Newlines start new lines. At most 100000 characters.
xrequirednumberBoard-space left edge.
yrequirednumberBoard-space top edge.
wnumberWidth in board units. At least 1. Default 500.
hnumberHeight in board units. At least 1. Default 500.
fontSizenumberText size in board units. At least 1. Default 40.
colornumber | stringNote colour as "#rrggbb".
SDK
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.
ArgumentTypeWhat it is
boardIdrequiredstringBoard holding the note.
layerIdrequiredintegerLayer id from list_board_elements.
textrequiredstringReplacement text. Newlines start new lines. At most 100000 characters.
fontSizenumberText size in board units. Omit to keep the note's own. At least 1.
SDK
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.
ArgumentTypeWhat it is
boardIdrequiredstringBoard holding the card.
drawingIdrequiredstringCanvas, video or 3D model shortId to place or move.
xrequirednumberBoard-space left edge.
yrequirednumberBoard-space top edge.
wrequirednumberWidth in board units; height follows the card aspect.
SDK
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.
ArgumentTypeWhat it is
boardIdrequiredstringBoard holding the object.
layerIdrequiredintegerLayer id from list_board_elements.
xnumberNew board-space left edge. Omit to keep.
ynumberNew board-space top edge. Omit to keep.
wnumberNew width. Omit to keep. At least 1.
hnumberNew height. Omit to keep. At least 1.
SDK
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.
ArgumentTypeWhat it is
boardIdrequiredstringBoard the objects are on.
layerIdsrequiredinteger[]Layer ids of the board objects to copy; a section brings the objects inside it.
cutbooleanCut instead of copy: the objects leave this board once the copy holds them, and the first paste places them as themselves.
htmlbooleanAlso answer the clip as a browser copy writes it (text/html), for the person to paste in a tab of this site.
SDK
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.
ArgumentTypeWhat it is
boardIdrequiredstringBoard to paste onto.
clipboardIdstringHandle copy_cards answered with; or give clip.
clipstringBoard objects the person copied in a browser of this site, as the text/html the copy wrote; instead of clipboardId. At most 16000000 characters.
xnumberBoard-space x of the pasted objects' centre; with y, or neither.
ynumberBoard-space y of the pasted objects' centre; with x, or neither.
SDK
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.
ArgumentTypeWhat it is
boardIdrequiredstringBoard shortId to add the canvas to.
widthnumberCanvas width in pixels. 64 to 8192. Default 1920.
heightnumberCanvas height in pixels. 64 to 8192. Default 1080.
namestringCanvas name. Default "New canvas".
backgroundstringFill as "#rrggbb", or a named editor background.
xnumberBoard-space left edge of the card. Requires y; omit both to place in free space.
ynumberBoard-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.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
namestringLayer name. At most 64 characters. Default "Mirva layer".
freebooleanLet go of the layer at once, for the person to take and draw on.
aboveLayerIdintegerPut the layer just above this layer of the canvas. Default: on top.
unlessCoveredbooleanMake no layer when the layers above it would hide the canvas; say which instead.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas or board shortId holding the layer.
namestringNew layer name.
visiblebooleanShow or hide the layer.
lockedbooleanA locked layer takes no edits until unlocked.
opacityLockedbooleanKeep the layer's existing alpha: paint changes colour, never coverage.
clippingGroupbooleanClip the layer to the alpha of the layer below it.
opacitynumberLayer opacity. 0 to 1.
modestringBlend 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.
layerIdrequiredintegerLayer id, from list_board_elements.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
orderrequiredinteger[]Every layer id, topmost first.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
layerIdrequiredintegerLayer to read.
SDK
await mirva.tools.copy_layer({ drawingId: 'DRAWING_ID', layerId: 0 });
duplicate_layerCopy a canvas layer, pixels and all, as a new layer above it.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
layerIdrequiredintegerLayer to duplicate.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
layerIdrequiredintegerThe upper layer, which merges into the one below it.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
layerIdrequiredintegerPaint layer to trim.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
layerIdrequiredintegerPaint layer to empty.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringDrawing shortId.
layerIdsrequiredinteger[]Layer ids to remove.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
widthnumberNew width in pixels; the canvas keeps its own when omitted. 1 to 8192.
heightnumberNew height in pixels; the canvas keeps its own when omitted. 1 to 8192.
xnumberNew left edge in the canvas's current coordinates; unchanged when omitted.
ynumberNew top edge in the canvas's current coordinates; unchanged when omitted.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
SDK
await mirva.tools.undo_edit({ drawingId: 'DRAWING_ID' });
redo_editRedo the last edit this session undid with undo_edit.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
layerIdrequirednumberLayer 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.
colorstringHex brush colour. Default "#E74C3C".
sizenumberBrush diameter in pixels. At least 1. Default 8.
hardnessnumberEdge hardness; lower feathers the stroke. A preset supplies its own. 0 to 1. Default 0.9.
opacitynumberStroke opacity. A preset supplies its own. 0 to 1. Default 1.
flownumberPaint per stamp; below 1 the stroke builds up where it overlaps itself. A preset supplies its own. 0 to 1. Default 1.
spacingnumberStamp 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.
sizePressurebooleanScale the stamp by each point's pressure (default false).
minSizenumberWith sizePressure, the smallest stamp as a fraction of the size. A preset supplies its own. 0 to 1. Default 0.2.
modestring"draw" (default) paints the shapes; "erase" removes paint along them with the same brush settings, colour ignored.
toolstring"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).
stretchnumberblend only: how far each stamp drags the paint it picked up. A preset supplies its own. 0 to 1. Default 0.4.
paintnumberblend 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.
presetstringA 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.
shapestringTip 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.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
kind"rect" | "ellipse"The shape to draw. Default "rect".
xrequirednumberLeft edge of the shape's box, in canvas pixels.
yrequirednumberTop edge of the shape's box.
wrequirednumberBox width in canvas pixels.
hrequirednumberBox height in canvas pixels.
fillbooleanFill the shape rather than stroke its outline. Default true.
strokeWidthnumberOutline width in pixels; used when fill is false. 1 to 100. Default 5.
colorstringHex colour. Default "#E74C3C".
opacitynumberOpacity. 0 to 1. Default 1.
layerIdrequiredintegerPaint layer to draw on.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
textrequiredstringThe text; newlines break lines.
xrequirednumberLeft edge of the text block in canvas pixels.
yrequirednumberTop edge of the text block in canvas pixels.
sizenumberFont size in canvas pixels. 4 to 512. Default 32.
fontstringFont family name from list_brush_presets' font list. Default "Inter".
colorstringText colour as "#rrggbb". Default "#000000".
boldbooleanBold weight. Default false.
italicbooleanItalic style. Default false.
align"left" | "center" | "right"Horizontal alignment within the block. Default "left".
lineHeightnumberLine height as a multiple of the font size. 0.5 to 4. Default 1.2.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
xrequirednumberClick position in canvas pixels.
yrequirednumberClick position in canvas pixels.
colorstringHex fill colour. Default "#E74C3C".
opacitynumberFill opacity. 0 to 1. Default 1.
toleranceintegerHow far a pixel may differ from the clicked colour, per channel. 0 to 255. Default 0.
contiguousbooleanFill only the connected region; false fills every matching pixel. Default true.
antiAliasbooleanSoften 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".
layerIdrequiredintegerPaint layer to fill on.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
imagestringBase64 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.
clipboardIdstringPixels 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.
exactbooleanCrop to the rect verbatim rather than re-centring on aspect mismatch. Default false.
featherbooleanFade the edges so the paste blends. Default false.
rotatenumberTurn 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.
flipbooleanMirror the source across its vertical axis before pasting. Default false.
namestringLayer name.
belowLayerIdintegerPlace 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.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
xrequirednumberCanvas pixel to read, in the canvas's own coordinates.
yrequirednumberCanvas pixel to read, in the canvas's own coordinates.
radiusnumberHalf-width of the sampling square; 0 reads the single pixel, as the eyedropper does. 0 to 8. Default 0.
layerIdintegerRead one layer's own pixels instead of the composite the canvas shows.
SDK
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.
ArgumentTypeWhat it is
tool"brush" | "eraser" | "pencil" | "blend"Which tool's presets to list. Default "brush".
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
layerIdrequirednumberPaint layer to filter.
filterrequired"gaussianBlur" | "motionBlur" | "hueSaturationLightness" | "brightnessContrast" | "curves"The filter to run.
radiusnumbergaussianBlur: blur radius in pixels. 0 to 100.
distancenumbermotionBlur: blur distance in pixels. 0 to 2000.
anglenumbermotionBlur: direction in degrees, counterclockwise, as the editor's filter dial shows it. -180 to 180.
huenumberhueSaturationLightness: hue shift in degrees. -180 to 180.
saturationnumberhueSaturationLightness: saturation shift. -100 to 100.
lightnessnumberhueSaturationLightness: lightness shift. -100 to 100.
brightnessnumberbrightnessContrast: brightness shift. -150 to 150.
contrastnumberbrightnessContrast: 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.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
rotatenumberRotation in degrees, clockwise, about the layer centre. -360 to 360. Default 0.
flip"horizontal" | "vertical"Mirror the layer about its own centre.
scalenumberUniform scale factor about the layer centre. 0.01 to 100. Default 1.
dxnumberHorizontal move in canvas pixels. -100000 to 100000. Default 0.
dynumberVertical move in canvas pixels. -100000 to 100000. Default 0.
layerIdrequiredintegerPaint layer to transform.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
xrequirednumberLeft edge of the area.
yrequirednumberTop edge of the area.
wrequirednumberWidth of the area, at least 2.
hrequirednumberHeight of the area, at least 2.
modestringHow the area combines with the current selection: replace (default), add, subtract or intersect.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
xrequirednumberLeft edge of the area.
yrequirednumberTop edge of the area.
wrequirednumberWidth of the area, at least 2.
hrequirednumberHeight of the area, at least 2.
modestringHow the area combines with the current selection: replace (default), add, subtract or intersect.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas 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".
antiAliasbooleanSoften the outline's edge pixels, as the lasso's anti-alias option does. Default false.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
layerIdrequiredintegerLayer whose pixels become the selection, from list_layers.
SDK
await mirva.tools.select_layer_content({ drawingId: 'DRAWING_ID', layerId: 0 });
select_allSelect the whole canvas.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
SDK
await mirva.tools.select_all({ drawingId: 'DRAWING_ID' });
deselectDrop the canvas selection so edits reach the whole canvas again.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
SDK
await mirva.tools.deselect({ drawingId: 'DRAWING_ID' });
invert_selectionSelect what is not selected on the canvas and release what is; needs a selection.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas shortId.
layerIdrequiredintegerPaint layer whose selected pixels are erased.
SDK
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.
ArgumentTypeWhat it is
documentIdrequiredstringDocument shortId.
SDK
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.
ArgumentTypeWhat it is
boardIdrequiredstringBoard to place the document on.
contentrequiredstringMarkdown. First "# heading" becomes the title. At most 100000 characters.
documentIdstringExisting document shortId to overwrite. Omit to create one.
versionstringThe version read_document returned for documentId.
xnumberBoard-space left edge. Requires y. A document card is 900 wide and A4-proportioned, so leave that much room.
ynumberBoard-space top edge. Requires x.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas or board shortId.
SDK
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.
ArgumentTypeWhat it is
drawingIdrequiredstringCanvas or board shortId.
textrequiredstringThe comment. At most 2500 characters.
xrequirednumberAnchor x.
yrequirednumberAnchor y.
canvasIdstringOn a board: shortId of the canvas card the comment pins to.
SDK
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).
ArgumentTypeWhat it is
threadIdrequiredstringThe thread.
textrequiredstringThe reply. At most 2500 characters.
SDK
await mirva.tools.reply_comment({ threadId: 'THREAD_ID', text: 'TEXT' });
resolve_commentMark a comment thread resolved, or open it again.
ArgumentTypeWhat it is
threadIdrequiredstringThe thread.
resolvedrequiredbooleantrue resolves the thread, false reopens it.
SDK
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: …").
ArgumentTypeWhat it is
boardIdrequiredstringBoard shortId.
SDK
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.
ArgumentTypeWhat it is
boardIdrequiredstringBoard shortId.
labelrequiredstringWhat the version is, as the history lists it. At most 64 characters.
SDK
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.
ArgumentTypeWhat it is
boardIdrequiredstringBoard shortId.
versionrequiredstringVersion id, from list_board_versions.
SDK
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.
ArgumentTypeWhat it is
boardIdrequiredstringBoard shortId.
versionrequiredstringVersion id, from list_board_versions.
objectsstring[]Object ids (uid) from board_version_changes; omit to restore the whole version.
bystringAn author from board_version_changes (by.author): restore the objects that author changed last.
keystringThe key board_version_changes returned.
SDK
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.
ArgumentTypeWhat it is
messageIdrequiredstringmessageId of the agent reply, from get_messages.
SDK
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.
ArgumentTypeWhat it is
boardIdstringBoard shortId to scope the session to. Omitted = an unscoped chat.
SDK
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.
ArgumentTypeWhat it is
channelNamerequiredstringChannel, e.g. "ai-session/<id>" or "drawing/<shortId>".
messagerequiredstringMessage 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.
SDK
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.
ArgumentTypeWhat it is
channelNamerequiredstringChannel to read.
limitnumberMaximum messages to return. 1 to 100. Default 20.
SDK
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.
ArgumentTypeWhat it is
fileIdrequiredstringfileId from a get_messages files entry.
SDK
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.

Terminal
MIRVA_API_KEY=your-api-key npx -y -p @mirva/mcp mirva-mcp-viewer

Troubleshooting

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.