Brilliant Design

v0.1.11
design.brilliant/mcp Checked 1 day ago Published 15 days ago

Design canvas for coding agents: real editable vectors, auto layout, components, export to code.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_selection

Get the IDs and blueprint of currently selected elements on a specific canvas. Returns selected element IDs and their blueprint representation including descendants. A selection past 1,000 elements (descendants included) is summarized: counts by type (`countsByType`), union bounds (`worldBounds`), the first 100 ids and a `note`, beside the true `count`. Use `read` with a `scope` of ids or #refs for full subtrees. (External MCP clients: call `init` first for usage docs. Hosted-CLI and sub-agents have docs pre-loaded.)

ParameterTypeDescription
canvasId *stringCanvas ID to get selection from. REQUIRED.
projectstringOptional: run THIS call against a project other than the session's bound one: a name or key from list_projects (or an unambiguous name/handle substring), or the absolute path of a project folder (one…

export

Export elements in the specified format and return the data. Raster formats (png, jpeg, webp) return an inline image. SVG returns raw SVG markup as text. HTML returns an HTML/CSS snippet as text. PDF returns base64-encoded data as text. Video formats (mp4, mov) write a file (large binary is never inlined) and return its path; use `duration` (seconds, max 30) and `fps` to control length. MOV supports a transparent background; MP4 does not. With `motion` (mp4/mov) it renders a FILM, `Motion/<film>.bm` beside the canvas or at the project root: STATE frames tweened by element name, per-frame bluep…

read

Read the project's documents, each answered as the fence you would send back through edit: a canvas as ```bl with file(path) first and its rows (ids bound), a film as ```bm, a design system as ```ds. A canvas answer lists the films that name it above its fence (`films: Motion/Launch.bm`). Pass `paths` (canvas paths such as "Projects/Dashboard", "Motion/Launch.bm", "Styles/default.ds"), `ids` (element ids or #refs, with their canvas in paths) and/or the filters (query, textContent, type, fillColor, componentName) to find elements across canvases. `format` is "blueprint" (default), "summary" (co…

ParameterTypeDescription
ancestorsWith disk: each matched row carries its parent chain, board first.
componentNamestringFind instances of a component whose master name contains this substring (case-insensitive).
consumersOfstringWith disk: the id of a component master. Answers each canvas holding a copy of it: the copies, and the canvas row count to weigh a master edit. Set a master's id, not a variant child, for the copies o…
depthSubtree depth per match, in every format. 0 = matched element only, 1 = + immediate children, etc. Omitted: unlimited for "blueprint", the matched elements only for "summary" and "skeleton" (each reco…
disktrue answers from the saved .bl files on a background isolate: it never loads, opens or writes a canvas, whatever its size, so a heavy or closed canvas is safe to read. Rows come as stored, one header…
expandInstancesREAD-ONLY. When true (with format="blueprint"), a component instance is not collapsed to its compact inst() line: its derived children are shown as full lines with their REAL ids so you can inspect an…
fillColorstringFind elements with a fill matching this hex color (e.g. "#FFCC00" for yellow). Perceptual color matching, close shades are included.
formatstringOutput shape per canvas, inside its fence. "blueprint" (default) is the rows with their ids, what edit takes back. "summary" is compact metadata (id, name, type, parentId, parentName, childCount, text…
fullREAD-ONLY. When true (with format="blueprint"), return the COMPLETE vector geometry even for a large path. Default false: a vector whose blueprint would blow the per-readback token budget is summarize…
idsElement IDs (or #refs) to read, the same as listing them in `scope`. `elementIds` is accepted as an alias.
limitMax top-level matches across all canvases. Defaults to 50. It applies with explicit element IDs too.
pathsThe documents to read: canvas paths (e.g. "Projects/Dashboard", .bl optional), films ("Motion/Launch.bm") and design systems ("Styles/default.ds"). Omit with a filter to search every canvas.
patternstringWith disk: a regular expression over each stored row, for what the filters leave unnamed (a font size, a token, an override).
projectstringOptional: run THIS call against a project other than the session's bound one: a name or key from list_projects (or an unambiguous name/handle substring), or the absolute path of a project folder (one…
querystringCase-insensitive substring match on element name AND canvas path. Element matches answer as fences; canvas matches ride the `canvases:` line. Canvas matching only runs when no `paths` are given. With…
sessionIdstringYour session id from init: #refs resolve per session.
subtreeWith disk: each matched row carries its descendants, bounded by depth.
textContentstringCase-insensitive substring match on text element content.
typestringFilter by element type. One of: vector, line, circle, rectangle, text, parent.

list_projects

List every project this user owns, each with its display name, key (a folder path or brilliant-cloud:// key), backing (local/synced/cloud), open state (active tab / background tab / closed), canvas count when known, and whether it is published, with its url, visibility, audience and your role where known. Pass a name or key from this list as the `project` argument on `init` or any canvas tool to work in a project other than the one on screen, including a closed one.

edit

Edit the project's documents. `text` holds one or more fences, applied in order: ```bl (a canvas, blueprint rows: omit ids for new elements, lead with an id or #ref to modify, delete(#ref) to remove, preview(#a, #b) as a row for a screenshot), ```html (a canvas, HTML with inline CSS converted to elements), ```ds (a design system, statements spliced), ```bm (a film, the whole document replaced). The first row of every fence is file(path): file("Projects/Launch"), file("Styles/default.ds"), file("Motion/Launch.bm"). A call holds fences on any number of documents, canvases included, applied in or…

ParameterTypeDescription
backgroundOptional. true answers a `job:` id at once and runs the call on; wait({job}) blocks until it ends and answers its result. An edit waits its turn behind other agents' writes instead of refusing. Use it…
designSystemstringOptional. Design-system mode for this and all later calls (sticky, once set it persists until changed). One of: `"default"` (use the project default DS, token discipline enforced, no bare hex/numerics…
projectstringOptional: run THIS call against a project other than the session's bound one: a name or key from list_projects (or an unambiguous name/handle substring), or the absolute path of a project folder (one…
requestIdstringOptional idempotency key. Pass a stable, unique id for this logical request and REUSE the SAME id if you retry after a timeout or relay error: the retry converges on the original result instead of app…
response_modestringOptional. "full" (default) answers the block result with the blueprint of every affected element, or a read handle when that blueprint runs past 50 rows. "compact" answers the block result with a read…
sessionIdstringYour session id from init (refs and design-system state are per session).
textstringThe fences: ```<bl|bm|ds|html> on its own line, file(path) as the first row, the rows, ``` on its own line. Several fences in one text apply in order.
textFilestringInstead of text: the absolute path of a local file holding the fences, for a block a script generated. Same pipeline and same answer as text, plus a `job:` line. With no requestId the id is a hash of…

create_modify_elements

Retired. A call answers the one line that names the door: edit({ text }) to write, read({ paths }) to read.

ParameterTypeDescription
blockIdstring
canvasIdstring
elementsstring
formatstring
htmlstring
paths
querystring
scope
sessionIdstring

create_html

Retired. A call answers the one line that names the door: edit({ text }) to write, read({ paths }) to read.

ParameterTypeDescription
blockIdstring
canvasIdstring
elementsstring
formatstring
htmlstring
paths
querystring
scope
sessionIdstring

lookup

Retired. A call answers the one line that names the door: edit({ text }) to write, read({ paths }) to read.

ParameterTypeDescription
blockIdstring
canvasIdstring
elementsstring
formatstring
htmlstring
paths
querystring
scope
sessionIdstring

read_objects_result

Retired. A call answers the one line that names the door: edit({ text }) to write, read({ paths }) to read.

ParameterTypeDescription
blockIdstring
canvasIdstring
elementsstring
formatstring
htmlstring
paths
querystring
scope
sessionIdstring

objects_result

Retired. A call answers the one line that names the door: edit({ text }) to write, read({ paths }) to read.

ParameterTypeDescription
blockIdstring
canvasIdstring
elementsstring
formatstring
htmlstring
paths
querystring
scope
sessionIdstring

wait

Wait for a long call to end, instead of sleeping and checking. `job` is the id from a `background: true` call of edit, export or render_ui, or the requestId (or `job:` line) of an edit, also one whose call timed out on your side. Blocks until the job is done or failed and answers its result, the answer the call itself would have given. `running` means your timeout ran out and the job goes on: call wait again. `superseded` means the job ended with an earlier app run or its answer aged out: read the canvas. If this call cannot reach the app at all, the app is down: run scripts/mcp-wait-up.sh.

ParameterTypeDescription
job *stringThe job id.
sessionIdstringYour session id from init: a requestId is per session.
timeoutSeconds to block, default 120, at most 280. 0 answers the state now.

convert_html

Convert HTML with inline CSS to Brilliant blueprint lines WITHOUT creating anything: the exact lines edit (html) would write, per input string, plus the converter's notes. Batch many strings (the frames of a composition) in one call as `frames`. With `layout: true` each frame is also built into a throwaway world and the answer adds every element's laid-out box (x, y, w, h in canvas px, the unrotated box), its rotation, opacity, first solid fill, name, type and text, so the layout is the app's auto layout, never a guess. A `data-id` or `data-key` attribute is the element's NAME (stable identity…

ParameterTypeDescription
framesHTML strings to convert, one per frame, in order. At most 1000 per call and 16 MiB in total.
htmlstringOne HTML string (the one-frame form of `frames`).
layouttrue: build each frame into a throwaway world and answer the laid-out boxes (`elements` per frame). Default false.
projectstringOptional: with `layout` or `tokens`, resolve against a project other than the session's bound one (its fonts and design system), a name or key from list_projects.
sessionIdstringSession ID from init. Optional.
tokenstrue: add the project's design-system tokens resolved per mode as `tokens` (`{ modes, values: { base, light, dark: { key: hex or number } } }`), with or without frames. Default false.

execute_commands

Execute one or more commands by ID. Accepts an array of commands that share a single canvasId. Commands run sequentially, stopping on first error. Use command IDs from the skill docs. Pass previewIds + previewScale: 2 for inline PNG verification. Visually inspect every preview, describe what you see, fix issues. (External MCP clients: call `init` first for usage docs. Hosted-CLI and sub-agents have docs pre-loaded.)

ParameterTypeDescription
commands *Array of commands to execute sequentially.
canvasIdstringTarget canvas ID. Required for every canvas-scoped verb (enforced at dispatch, refused by name when missing); the workspace/app-level verbs (get_canvases, create_canvas, create_folder, list_keybinding…
idsOptional: element IDs applied to every command in the batch that names none of its own. The per-command `commands[i].ids` always wins. `elementIds` is accepted as an alias.
previewIdsElement IDs to include in a PNG preview returned alongside the summary. Omit for no preview.
previewScaleScale factor for the preview image (default 1.0, max 3.0). Use 2.0 for verifying visual details like text or alignment.
projectstringOptional: run THIS call against a project other than the session's bound one: a name or key from list_projects (or an unambiguous name/handle substring), or the absolute path of a project folder (one…
sessionIdstringSession ID for per-session visual feedback. Optional.

get_knowledge

Load design knowledge by key. Blueprint DSL work loads it first; an html fence needs none. Pass keys from the available keys list returned by init (e.g. "blueprint/core", "design/colors", "effects/glass"). By default a key also pulls in its prerequisite docs (its `assumes:` deps); the response names them under "Also auto-loaded" so you can see what was bundled. Pass `includeDependencies: false` to load ONLY the keys you name (the skipped prerequisites are listed so you can request them deliberately).

ParameterTypeDescription
includeDependenciesWhether to auto-load each key's prerequisite docs (its `assumes:` deps). Default true. Set false to load exactly the keys you name and nothing else; the response lists the prerequisites it skipped so…
keysList of knowledge keys to load. See available keys returned by init.
sessionIdstringSession ID for per-session tracking. Optional.

init

Bootstrap a design session. Returns a unique session ID, session context (canvas ID, repo path), and documentation. Call this first. Pass the returned session ID as the `sessionId` argument on every subsequent `edit` / `read` call: this scopes your refs/design-system state AND gives you your own distinct labelled cursor on the canvas (concurrent agents that echo their IDs never share one cursor). Optionally pass a short `agentName` (2-3 words) to label that cursor. Pass `project` (a name or key from `list_projects`) to bind this session to a project OTHER than the one on screen — including a…

ParameterTypeDescription
agentNamestringOptional short display name (2-3 words) for this agent's canvas cursor. Clipped to 32 characters.
projectstringOptional project to bind this session to: an exact name or key from `list_projects`, or an unambiguous name/handle substring, or the absolute path of a project folder (one holding .bl files, or an emp…
visionWhether this client can READ inline images (default true). Set false if you cannot see images: preview requests (a `preview()` row) then return a compact TEXTUAL render summary: each element's bounds…

generate_image

Generate an AI image and apply it as a fill on targetElementId. Target element must already exist — create it first (top-level hosted-CLI agents: emit an `<edit>` block; sub-agents and external MCP clients: call `edit`), then call generate_image with that element's id or #ref. Call get_knowledge(["images/prompts","images/integration","images/references"]) for prompt engineering, quality presets, and parallel-generation guidance. Runs on your own Google key when one is set (Settings > Your own AI > Google), otherwise on Brilliant AI for a signed-in account.

ParameterTypeDescription
canvasId *stringCanvas ID. Required.
aspectRatiostringOutput aspect ratio: "1:1" (default) | "16:9" | "9:16" | "4:3" | "3:4". In batch mode applies to every target unless a target overrides it.
imageSizestring"1K" (default) | "2K" | "4K".
promptstringNatural-language paragraph describing the image.
referenceElementIdsElement IDs to use as reference images (up to 14).
sessionIdstringSession ID for per-session visual feedback. Optional.
targetElementIdstringElement ID to apply the image fill to. Required unless targets is provided.
targetsBatch mode: generate multiple images in parallel (preferred when generating 2+).

generate_svg

Generate editable vector graphics (SVG) from a text prompt and place them on the canvas as native editable shapes. Use for icons, logos, illustrations, diagrams — anything that should stay crisp and remain editable. For photos / realistic images use `generate_image` instead. Optional `referenceElementIds` (up to 4) export to PNG and steer style. Use `n` (1–4) for parallel variations of a single prompt, or `targets` to fan out distinct prompts in parallel. Call get_knowledge(["svg/prompts","svg/integration"]) for prompt patterns and decision rules. Requires Quiver API key.

ParameterTypeDescription
canvasId *stringCanvas ID. Required.
instructionsstringOptional style/behavior instructions for the model.
intentstringA short present-tense line shown beside your cursor while the vector is drawn, e.g. 'Sketching a fox logo'. Optional; derived from the prompt when absent.
nNumber of variations from the single prompt (1–4, default 1). Cheaper than `targets` because it is one API call.
promptstringNatural-language description of the SVG to generate.
referenceElementIdsElement IDs to export as PNG and pass as style references (up to 4).
sessionIdstringSession ID for per-session visual feedback. Optional.
targetsBatch mode: distinct prompts generated in parallel. Use for multiple different SVGs (e.g. "search icon", "settings icon").

vectorize_image

Convert a raster image element on the canvas into editable vector paths. The new vector elements are placed on the canvas; the original raster element is left untouched (delete it manually if no longer needed). Use for: importing PNG/JPEG content the user wants to edit as vectors, cleaning up screenshots into icons, or converting AI-generated raster images into editable shapes. Requires Quiver API key.

ParameterTypeDescription
canvasId *stringCanvas ID. Required.
sourceElementId *stringElement ID (or `#ref`) of the raster element to vectorize. Required.
autoCropAuto-crop the source image before vectorizing (default true).
sessionIdstringSession ID for per-session visual feedback. Optional.

remove_background

Remove the background from real photos on the canvas: the subject keeps its exact pixels (the real face, the real product) and the background becomes transparent, in place, in the same image fill (crop, scale mode and opacity kept). Use it instead of generate_image whenever the image is a real photo and the user wants it cut out: "a real photo, keep the pixels, cut the background". generate_image regenerates the picture and invents new pixels. `ids`: the element ids (or #refs) whose image fills to cut (a frame, group or instance id reaches every image inside it); one request per distinct image…

ParameterTypeDescription
canvasId *stringCanvas ID. Required.
ids *Element IDs (or #refs) holding the image fills to cut; a frame, group or instance id cuts every image inside it. Required.
sessionIdstringSession ID from init. Optional.

add_cutout_outline

Add an outline around the subject of an image whose background was removed (remove_background first): the cutout's visible edge is traced into a new vector element placed directly above the image, aligned with its crop, rotation, flip and scale; stroke only, no fill, outside stroke, round joins (the sticker look). The outline is an ordinary element afterwards (restyle, move or delete it). `ids`: the image element ids (or #refs; a frame, group or instance id reaches the cut images inside it). `color`: optional #RRGGBB stroke color (default plain white). `width`: optional stroke width in px (def…

ParameterTypeDescription
canvasId *stringCanvas ID. Required.
ids *Element IDs (or #refs) of images whose background was removed. Required.
colorstringStroke color #RRGGBB. Optional.
sessionIdstringSession ID from init. Optional.
widthStroke width in px. Optional.

capture_ui

Screenshot a part of Brilliant's own UI (a toolbar, the palette / color picker, a panel) to an image file. Optionally stage commands to drive the UI into a state first, and draw highlight boxes over sub-targets. `target` is a capture-registry id such as "full-ui", "top-toolbar", "left-toolbar", "right-toolbar", "bottom-toolbar", "command-palette", or "ai-chat-panel". Chrome only by default on every host (the canvas area is left empty); pass includeCanvas:true (full-ui only) to composite the GPU canvas underneath. Writes lossless WebP by default. Desktop-only: it writes an image file, so it is…

ParameterTypeDescription
outputPath *stringAbsolute file path to write the image to. REQUIRED.
target *stringCapture-registry id to screenshot (e.g. "command-palette"). REQUIRED. "full-ui" is the whole window: menus, dropdowns, popovers, tooltips and dialogs included (they mount above the panels), so photogr…
cropMarginLogical pixels to expand the cropTo rect on all sides (clamped to image bounds). Default 0.
cropTostringCapture-registry id to crop the result down to. When set, "target" MUST be "full-ui": the full UI is captured (so the panel renders over the real backdrop with true colors), then cropped to this id's…
dimBackgroundDim everything outside the highlight rects to 35% black. Default false.
formatstringImage format: "webp" (default, lossless) or "png".
highlightsBoxes to draw over the capture. Each is either {target: "<registry-id>"} or {rect: [x, y, w, h]} in captured-image logical pixels.
includeCanvasComposite the GPU canvas front buffer under the chrome. Only meaningful for target "full-ui". Default false.
pixelRatioDevice-pixel scale for the capture (default 2).
settleMsMilliseconds to wait after staging before capturing (default 300).
stageCommandsOrdered commands to drive the UI into the desired state before capturing. Same command IDs execute_commands accepts. Executed sequentially; a failure aborts the capture.

list_capture_targets

List the capture-registry ids currently mounted in Brilliant's UI (the valid "target"/"cropTo"/highlight ids for capture_ui). Takes no arguments. Returns a sorted JSON array; each entry is {id, mounted, rect: [x, y, w, h] in logical global pixels, children: [nested ids]}.

render_ui

Render a Brilliant UI component into an EXACT declarative state and capture it to an image file, offscreen, without touching the live app. `component` is a stager id (call list_stagers to enumerate them and their state schemas); `state` is the component-specific declarative state. Optionally draw highlight boxes over sub-targets (the scene registers "ui-stage.*" ids) and override the stage size. Writes lossless WebP by default. Desktop-only: it writes an image file, so it is not available in the web editor.

ParameterTypeDescription
component *stringStager id to render (e.g. "ai-chat-panel"). REQUIRED. Call list_stagers for the available ids and their schemas.
outputPath *stringAbsolute file path to write the image to. REQUIRED.
state *Component-specific declarative state. REQUIRED. See the component's stateSchema from list_stagers.
backgroundOptional. true answers a `job:` id at once and runs the call on; wait({job}) blocks until it ends and answers its result. An edit waits its turn behind other agents' writes instead of refusing. Use it…
formatstringImage format: "webp" (default, lossless) or "png".
heightLogical stage height override (defaults to the stager's defaultSize).
highlightsBoxes to draw over the render. Each is either {target: "<ui-stage.* id>"} or {rect: [x, y, w, h]} in captured-image logical pixels.
pixelRatioDevice-pixel scale for the capture (default 2).
widthLogical stage width override (defaults to the stager's defaultSize).

list_stagers

List the UI Stage components render_ui can render, with each component's default logical size and its declarative state schema. Takes no arguments. Returns a JSON array; each entry is {component, defaultSize: [w, h], stateSchema}.

send_feedback

Open the Brilliant feedback card for the user to review and send. This does NOT send: the card opens, the user presses Send, and you tell them it is open and waiting (never claim it was sent). `message` is OPTIONAL (pre-fill a draft or open empty); `attachments` is tolerated but ignored (nothing about the user's world is ever attached). Feedback is a routing decision, not one surface, and consent scales with what leaves the machine: the user's words move by the user's act, the user's context moves only per-item opt-in, and your own observations ride telemetry, never GitHub or email. Offer it p…

ParameterTypeDescription
attachmentsIgnored in this version; accepted for backward compatibility (nothing about the user's world is ever attached).
messagestringOPTIONAL. The drafted feedback message, in the user's own framing (the user can edit it before sending). Omit to open an empty card.