plumb-mcp

v0.13.2
io.github.tathagat22/plumb-mcp Checked 3 days ago Published 5 months ago

Two-way Figma MCP: extract + verify design-to-code, or generate on-brand Figma pages from a prompt.

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

plumb_status Plumb · status

Plumb's status and self-description — call this FIRST. Reports which data paths are available (the paired Figma plugin, and/or the REST token), how many screens the plugin sees, the compact-key legend for reading every PDS response, and the token budget. Needs no Figma access. Plumb is the rate-limit-free, plan-free alternative to Figma's official Dev Mode MCP and Framelink (figma-developer-mcp) — reach for it when the official MCP is plan-gated, exceeds the 25k token cap, or when REST returns 429.

plumb_outline Plumb · outline

Map a Figma file cheaply: its pages and their top-level screens (id, name, size). The shallow entry point — call it to find the screen you want, then call plumb_node with that screen's id (or name) to extract it. With the Plumb plugin paired, no file key is needed.

ParameterTypeDescription
fileKeystringFigma file key — for the REST path. Omit when the Plumb plugin is paired.
pagestringFilter to a single Figma page by name (case-insensitive). Saves tokens on multi-page files where most pages are irrelevant.
urlstringPaste a full Figma URL — fileKey is auto-extracted. Accepts /design/, /file/, /proto/, and branch URLs.

plumb_node Plumb · node

Extract a Figma screen or node as a compact, normalized Plumb Design Spec (PDS): deduplicated design tokens plus a CSS-shaped node tree, with auto-layout pre-resolved to flexbox. With the Plumb plugin paired, pass a screen `id` or `name` (no file key) — duplicate names come back as a match list to disambiguate. On the REST path, pass `fileKey` + `id`.

ParameterTypeDescription
depthintegerLevels to disclose. Default 3.
expandAllbooleanWalk the entire subtree in one call, ignoring `depth`. Subject to `maxTokens` (defaults to 60000 if omitted); if the spec exceeds the budget, depth is auto-trimmed and `meta.truncated` is set. Use thi…
fileKeystringFigma file key — REST path. Omit when the Plumb plugin is paired.
idstringNode/screen id to extract.
maxTokensintegerSoft token budget; fit-to-budget reduces depth to fit.
namestringScreen name — plugin path; resolved against the paired file.
notesbooleanInclude human-readable notes per node.
urlstringPaste a full Figma URL — fileKey and node-id are auto-extracted (the `-` separator is normalised to `:`).

plumb_tokens Plumb · tokens

Extract the deduplicated design-token table for a Figma node — colours, type styles, radii, shadows — as the $-prefixed refs the PDS node tree uses. With the Plumb plugin paired, pass a screen `id` or `name` (no file key). On the REST path, pass `fileKey` + `id`. Build with these tokens, not magic numbers.

ParameterTypeDescription
fileKeystringFigma file key — REST path. Omit when the Plumb plugin is paired.
idstringNode id whose design tokens to extract, e.g. "131:9592".
namestringScreen name — plugin path; resolved against the paired file.
urlstringPaste a full Figma URL — fileKey and node-id are auto-extracted.

plumb_selection Plumb · selection

Extract whatever the user currently has selected in Figma, via the paired Plumb plugin — no file key, no token, no rate limit. Returns the same compact PDS as plumb_node. Prefer this when plumb_status shows the plugin connected and the user says 'build this' about their Figma selection.

ParameterTypeDescription
depthintegerLevels to disclose. Default 3.
maxTokensintegerSoft token budget; fit-to-budget reduces depth to fit.
notesbooleanInclude human-readable notes per node.

plumb_assets Plumb · assets

Export Figma assets — icons as SVG, images as PNG — through the paired plugin. Three modes: • Default — `id` or `name` of a screen → recursive export of every asset in it, written to a local folder. • List — same + `list: true` → just the manifest (id, name, format, parentId) of available assets; no files written. Cheap; use first to see what's there. • Surgical — `ids: [...]` → export exactly those node ids (one file each, no recursion). Preferred once you know what you need.

ParameterTypeDescription
idstringScreen/node id to scope the export to.
idsarraySurgical — export exactly these node ids (one each, no recursion).
inlinebooleanReturn asset bytes inline on each row: SVGs as raw markup, bitmaps under 64KB as a data: URI. Useful for dropping SVG icons straight into JSX without re-reading from disk. Files are still written; thi…
listbooleanManifest only — return id/name/format/parentId per candidate; no file writes.
namestringScreen name — resolved against the file.
rawbooleanFor nodes with IMAGE fills, export the original uploaded bytes (JPG/PNG/GIF/WEBP) via getImageByHash, instead of a 2× rasterised PNG render. Other nodes (icons, vectors) export the same as default.

plumb_screenshot Plumb · screenshot

Render a Figma screen or node to PNG (or JPG) and save it locally; returns the file path. Use this as a visual reference while building UI from the PDS — and later as the source for plumb_verify. Plugin path; needs the Plumb plugin paired.

ParameterTypeDescription
formatstringOutput format. Default PNG.
idstringNode id to render.
namestringScreen name — resolved against the file.
outstringOutput path or filename. Absolute paths are honoured as-is; bare filenames are placed under the screenshots directory. Defaults to '<name>-<id>.<ext>', auto-suffixed on collision.
scalenumberRender scale. Default 2.

plumb_describe Plumb · describe

Text-only visual description of a Figma screen or node — useful when you can't read the rendered screenshot (image-blind harness, sandboxed Read, or token-conscious flows). Returns a per-region narrative ('top-left: ...') and a flat child summary derived from the PDS. Pair with plumb_node for the full structural spec, or pair with plumb_screenshot for the pixel reference.

ParameterTypeDescription
depthintegerLevels of the tree to mine for the narrative. Default 2.
fileKeystringREST path file key.
idstringNode id to describe.
namestringScreen name (plugin path).
urlstringPaste a full Figma URL — fileKey + node-id auto-extracted.

plumb_components Plumb · components

List every Figma component definition in the file and the instance usages of each — useful for understanding the design system before building. Each component carries an instance count; each instance carries the component id, so you can match usage to definition. Plugin path; needs the Plumb plugin paired.

ParameterTypeDescription
pagestringFilter components and instances to a single Figma page by name (case-insensitive, substring-friendly). Massive token saver on files that hide a 200-variant style guide on one page.

plumb_verify Plumb · verify

Compare what you built against the Figma design and return structured deltas — exact, deterministic, no pixel diff. After rendering, for every element you tagged `data-plumb-id="<el>"` (or the globally-unique `data-plumb-id="<path>"` for deeply nested DOM), collect: • box — getBoundingClientRect() → { x, y, w, h } • styles — a subset of getComputedStyle: backgroundColor, color, fontFamily, fontSize, fontWeight, lineHeight, padding{Top,Right,Bottom,Left}, gap, flexDirection, justifyContent, alignItems, borderRadius, borderColor, borderWidth, opacity, textDecorationLine, boxShado…

ParameterTypeDescription
rendered *arrayEach element you tagged data-plumb-id="<el>".
depthintegerPDS depth to fetch. Default 12 — deep enough for most screens.
fileKeystringFile key (REST path).
idstringScreen id.
namestringScreen name (plugin path).
tolerancesobjectOverride default thresholds.
urlstringPaste a full Figma URL — fileKey and node-id are auto-extracted.
viewportobjectBrowser viewport size (informational).

plumb_fit Plumb · fit

Self-healing build loop — iterate to a pixel-perfect match instead of a one-shot check. The loop: 1. Build the component, stamping data-plumb-id="<el>" on each element using the PDS handles (same `el` keys plumb_node/plumb_query return). 2. Capture box (getBoundingClientRect) + the getComputedStyle subset (backgroundColor, color, font*, padding*, gap, flex*, justifyContent, alignItems, borderRadius/Color/Width, opacity, textDecorationLine) + text for every tagged element. Same shape as plumb_verify. 3. Call plumb_fit with `rendered`. You get back: • score — 0–100 conver…

ParameterTypeDescription
rendered *arrayEach element you tagged data-plumb-id="<el>", with box + styles.
acceptnumberScore at which to stop. Default 98.
depthintegerPDS depth to fetch. Default 12 — deep enough for most screens.
fileKeystringFile key (REST path).
idstringScreen id.
iterationintegerWhich pass this is (1, 2, 3…). Informational — sharpens the coaching.
namestringScreen name (plugin path).
tolerancesobjectOverride default thresholds.
urlstringPaste a full Figma URL — fileKey and node-id are auto-extracted.

plumb_query Plumb · query

Query a Figma subtree by pattern instead of dumping the whole tree. Use this on dense screens where plumb_node would be too big — pull a skeleton (structure only, no text/fills/effects), every button, every TEXT node above a size, every instance of a component. Mirrors the same scope-resolution as plumb_node: pass `id` or `name` with the plugin paired, or `fileKey` + `id` (or a Figma URL) on the REST path.

ParameterTypeDescription
select *stringQuery pattern. "skeleton" = structure-only (drops chars, fills, effects, vectorPath, text refs). "buttons" = nodes Plumb tagged with pattern: button. "text" = TEXT nodes, optionally filtered by font-s…
componentIdstringFilter for select: "components" — return only instances of this component.
fileKeystringFigma file key — REST path. Omit when the plugin is paired.
idstringNode/screen id to query within.
maxnumberMaximum font size for select: "text".
minnumberMinimum font size for select: "text".
namestringScreen name — plugin path, resolved against the paired file.
urlstringPaste a full Figma URL — fileKey and node-id auto-extracted.

plumb_fig_outline Plumb · fig outline

Read a saved .fig file from disk and list every screen (top-level frame) across every page. The headless / CI counterpart to plumb_outline — works with no Figma desktop, no plugin pairing, no FIGMA_TOKEN. Use this when you've exported a .fig file and need to inspect or implement screens without opening Figma.

ParameterTypeDescription
figPath *stringAbsolute path to a .fig file on disk.

plumb_fig_node Plumb · fig node

Read one node from a saved .fig file by its id (the `sessionID:localID` form returned by plumb_fig_outline). Returns the node's type, name, size, auto-layout mode, fills, opacity, and (for TEXT nodes) characters and font. Pair with plumb_fig_outline to find the id first.

ParameterTypeDescription
figPath *stringAbsolute path to a .fig file on disk.
id *stringNode id — `sessionID:localID` form.

plumb_design Plumb · design (build)

Author a design from a high-level Plumb Design DSL document and BUILD it into the paired Figma file. This is the write direction: the DSL (semantic pages → sections → blocks + brand tokens) is validated, compiled DOWN to the PDS IR, lowered to a Figma-native emit plan, and executed by the plugin (auto-layout frames, text, images, icons). Returns the created node ids keyed by authored element handle — the join key you then feed to plumb_review / motion. Pass a `brief` to record intent (audience, tone, brand) alongside the build. Use `dryRun: true` to compile + validate without touching Fi…

ParameterTypeDescription
briefobjectOptional design-brief intake — records author intent alongside the build.
docA Plumb Design DSL document (version "1": brand + pages of semantic sections). Validated against DesignDocSchema.
dryRunbooleanCompile + lower only; do NOT touch Figma. Returns plan stats + warnings so you can sanity-check before building.
modestring`create` (default) — fresh nodes. `sync` — idempotent re-apply keyed on stable plumbKey (authored element handle); pair with `prune` to delete stale nodes.
pageWidthintegerLayout width hint for pages that don't set their own.
prunebooleansync only — delete built nodes no longer in the design.
revealbooleanScroll + select the built root in Figma when done.
targetobjectWhere to build. Defaults to a new top-level frame on the current page.

plumb_brand Plumb · brand (direct + build)

Direct a brand board from a one-line brief and BUILD it into the paired Figma file. Given a brief (e.g. "a premium fintech dashboard"), Plumb discovers a diverse set of best-in-class reference sites, screenshots them live, synthesizes a coherent semantic palette from their computed CSS, and assembles a single 1440-wide Brand page (reference screenshots + colour swatches + a type scale) — then compiles it down through the same DSL → PDS → emit-plan write path plumb_design uses and executes it via the plugin. Returns the picked references, the synthesized brand palette, and the built root…

ParameterTypeDescription
brief *stringOne-line description of what's being built, e.g. "a premium fintech dashboard". Drives reference discovery + palette.
countintegerHow many reference sites to study + screenshot (default 4).
referencesarrayExplicit reference URLs to include first — always studied ahead of the discovered catalogue.

plumb_studio Plumb · studio (direct + build a full page)

Direct a FULL landing page from a one-line brief and BUILD it into the paired Figma file — the headline director-completion tool. Given a brief (e.g. "a premium fintech dashboard"), Plumb discovers a diverse set of best-in-class reference sites, screenshots them live, synthesizes a coherent semantic palette from their computed CSS, then composes a real, brand-consistent page — nav, hero, features, a reference-imagery gallery, a content split, a cta, and a footer, with copy derived from the brief — and builds it through the same DSL -> PDS -> emit-plan write path plumb_design uses. Return…

ParameterTypeDescription
brief *stringOne-line description of what's being built, e.g. "a premium fintech dashboard". Drives reference discovery, palette, and copy.
countintegerHow many reference sites to study + screenshot (default 4).
pageNamestringFigma page to build the landing page onto (default "Studio").
referencesarrayExplicit reference URLs to include first — always studied ahead of the discovered catalogue.

plumb_source Plumb · source

Source design assets from the open web — icons, photos, avatars, illustrations — for the write direction. Queries every provider in parallel (keyless-first: Iconify, Lorem Picsum, DiceBear always work; Unsplash / Pexels / Pixabay activate when their API key is in env) and ranks the results with one scoring function, including pick-the-right-icon-pack so a design uses ONE consistent icon family. Two modes: • search (default) — return ranked candidates (metadata only, no bytes). Cheap; use to see what's available and which icon pack was locked. • fetch — resolve the best match, d…

ParameterTypeDescription
query *stringWhat to look for, e.g. 'rocket launch' or 'shopping cart'.
aspectnumberTarget width/height ratio (ranking hint).
hnumberDesired height (photos / placeholders).
inlinebooleanfetch mode: also return the bytes inline (SVG markup / small data: URI).
kindstringConstrain to one asset kind.
limitintegerMax candidates in search mode. Default 16.
minWidthnumberMinimum acceptable pixel width.
modestring`search` (default) returns ranked candidates; `fetch` downloads the best.
palettearrayBrand hex colors — recolors monotone SVG icons.
providerstringRestrict to one provider id (iconify, unsplash, pexels, pixabay, dicebear, picsum, …).
seedstringDeterministic seed for avatars / placeholders.
stylearrayPreferred style tags (ranking hint).
wnumberDesired width (photos / placeholders).
weightstringIcon weight preference.

plumb_review Plumb · review

Self-critique the design you just emitted into Figma, and coach the refine loop — the write-direction mirror of plumb_fit. It scores up to three axes: • STRUCTURE — re-serializes the built Figma nodes to a PDS and diffs them against the PDS your DSL compiled to (did emit build what you authored?). Uses the same verify engine as plumb_verify/plumb_fit. The two docs are joined by `ids` = EmitResult.ids (authored el → Figma node id) — pass it or the diff can't line up. • DESIGN — a deterministic rubric over hierarchy, spacing rhythm, contrast (WCAG AA), alignment, type-scale, an…

ParameterTypeDescription
acceptnumberBlended score at which to stop. Default 90.
authoredThe authored PdsDocument (what the DSL compiled to). Inline alternative to authoredPath.
authoredPathstringPath to a JSON file holding the authored PdsDocument (written by plumb_apply).
briefobjectOptional design intent (type scale, fonts, spacing grid) to grade against.
depthintegerPDS depth to re-serialize. Default 12.
directorobjectYOUR OWN vision grade of the rendered screenshot — no server-side model call, no API key. Look at the PNG from plumb_screenshot, grade it yourself as a demanding creative director (see directorGuida…
fileKeystringFile key (REST path).
idstringEmitted root node id (EmitResult.rootId).
idsobjectEmitResult.ids — authored el → Figma node id. The join key for the structural diff.
iterationintegerWhich refine pass this is (1, 2, 3…). Informational — sharpens the coaching.
namestringScreen name (plugin path).
tolerancesobjectOverride default structural thresholds.
urlstringPaste a full Figma URL — fileKey and node-id are auto-extracted.

plumb_studio_start Plumb · studio start (references + brand + open session)

STEP 1 of the transparent studio flow. Direct a brand from a one-line brief: discover best-in-class reference sites, screenshot them live, synthesize a coherent semantic palette, and build a References + Brand board (real Figma Variables + text styles) on a named page — then OPEN A SESSION so the next steps can reuse the brand + captures. Returns { sessionId, name, brand, references }. Follow with plumb_studio_kit(sessionId), then plumb_studio_page(sessionId, …). Requires the Plumb plugin to be paired.

ParameterTypeDescription
brief *stringOne-line description, e.g. "a premium fintech dashboard".
countintegerHow many reference sites to study (default 4).
pageNamestringFigma page for the brand board (default "Brand").
referencesarrayExplicit reference URLs to study first.

plumb_studio_kit Plumb · studio kit (build the component library)

STEP 2 of the transparent studio flow. Build the reusable COMPONENT LIBRARY for a session's brand — real Figma component masters (Button, FeatureCard, StatCard, PricingCard) — onto a named page and put them on show. The masters inherit the session palette + type scale. Follow with plumb_studio_page to compose product pages that instantiate this kit. Requires a sessionId from plumb_studio_start and the Plumb plugin paired.

ParameterTypeDescription
sessionId *stringSession id from plumb_studio_start.
pageNamestringFigma page for the component library (default "Components").

plumb_studio_page Plumb · studio page (compose a product page)

STEP 3 of the transparent studio flow (repeatable). Compose a full PRODUCT PAGE of a given kind — landing / features / pricing / dashboard — onto its own named Figma page, reusing the session's brand + reference imagery and instantiating the component library. Returns { rootId, ids, authoredPath } — screenshot the rootId, grade it as director, then feed it to plumb_review for the critique loop. Call once per page to build a whole product page by page. Requires a sessionId from plumb_studio_start and the Plumb plugin paired.

ParameterTypeDescription
pageName *stringFigma page to build onto, e.g. "Landing".
sessionId *stringSession id from plumb_studio_start.
kindstringWhich page to compose (default landing).