reaui-mcp

v0.3.0
@xtcel/reaui-mcp Checked 1 day ago Published 16 days ago

MCP server for REA UI: let any AI agent create, validate and pack editable .reaui design documents.

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

reaui_get_system Read the project design system

Read the complete embedded project system, or null when none is set. This project snapshot is authoritative for generation.

ParameterTypeDescription
path *stringProject directory or .reaui file relative to the workspace root

reaui_set_system Set or remove the project design system

Adopt a complete reaui-design-system package in a project directory. Pass null to remove. Validates all page/component token references before writing; does not publish a library version.

ParameterTypeDescription
path *stringProject directory relative to the workspace root
system *string | nullFull JSON package including schemaVersion, revision and hash; null removes the system

reaui_audit Audit design editability

Read-only heuristic suggestions for hierarchy, names, component reuse and editable SVG geometry. Separate from format validation.

ParameterTypeDescription
path *string
strictboolean

reaui_init_components Initialize reusable components

Add a catalog to an existing document directory; upgrades v2 to v3, keeps v4, never overwrites existing definitions.

ParameterTypeDescription
path *string

reaui_init Create a design document

Create a minimal valid .reaui document (rea.json + one page TSX) at the given path. Use this before writing page content. Returns the created path and exit code.

ParameterTypeDescription
name *stringHuman readable document name
path *stringDocument directory, relative to the workspace root, e.g. "demo"
componentsbooleanInitialize a reusable component catalog (v3, or retain v4 with a system)
heightintegerDesktop artboard height, default 1024
pageIdstringFirst page id, lowercase kebab-case. Defaults to "main"
pageNamestringDisplay name of the first page
systemstringOptional complete reaui-design-system JSON package embedded before page generation
widthintegerDesktop artboard width, default 1440

reaui_write_page Write a page and validate it

Write TSX source for one page, add it to the manifest if new, then validate immediately and return structured errors. This is the main tool for generating design content: the page must only use @rea/design primitives with static props and Tailwind className.

ParameterTypeDescription
pageId *stringPage id, lowercase kebab-case; written to pages/<pageId>.page.tsx
path *stringDocument directory, relative to the workspace root
source *stringFull page source. Must default-export a <Page> that only uses @rea/design primitives

reaui_read Read a document outline

Read what a document actually contains: every page with its artboards and a flat layer list carrying designId, kind, display name, parent, absolute box, text, instance values and className. Use this before editing an existing document instead of guessing from a preview HTML. Pass page to narrow to one page and depth to trim deep nesting.

ParameterTypeDescription
path *stringDocument directory or .reaui file, relative to the workspace root
depthintegerMaximum node depth, Page root is 0; omit for the full tree
pagestringPage id to read; omit to read every page

reaui_validate Validate a document

Validate a document directory or a .reaui file. Returns structured errors with code, path, message and hint. Passing validation means the REA UI editor will open the file.

ParameterTypeDescription
path *stringDocument directory or .reaui file, relative to the workspace root

reaui_pack Pack a document into .reaui

Pack a validated document directory into a single .reaui file (ZIP). Only call after validation passes. Returns the output path and byte size.

ParameterTypeDescription
path *stringDocument directory, relative to the workspace root
forcebooleanOverwrite an existing file
outstringOutput .reaui path. Defaults to <path>.reaui next to the directory

reaui_unpack Unpack a .reaui file

Unpack a .reaui file into a document directory so pages can be edited one by one.

ParameterTypeDescription
file *string.reaui file path, relative to the workspace root
out *stringTarget directory for the unpacked document
forcebooleanWrite into a non-empty directory

reaui_preview Render a self-contained HTML preview

Render a validated document into a single self-contained preview.html with inline CSS. Useful for showing the result to a human without opening the editor.

ParameterTypeDescription
path *stringDocument directory, relative to the workspace root
outstringOutput HTML path, defaults to preview.html in the workspace root

reaui_diff Compare two design sources

Compare two document directories and report what changed, so an agent can confirm it only touched the intended scope.

ParameterTypeDescription
after *stringModified document directory
before *stringBaseline document directory

reaui_create_design Create a complete design in one call

End-to-end: create the document, write every page, add pages to the manifest, validate, then pack into a .reaui file. Returns validation errors without packing if any page is invalid. Use this for the common "generate a multi-page design" request; use reaui_write_page for iterative edits.

ParameterTypeDescription
name *stringDocument name
pages *arrayOne or more pages, written in order
path *stringDocument directory, relative to the workspace root
componentsstringOptional complete static components/main.components.tsx source
heightintegerDesktop artboard height, default 1024
outstringOutput .reaui path, defaults to <path>.reaui
systemstringOptional complete reaui-design-system JSON package; pages can reference its --rea-ds-* variables
widthintegerDesktop artboard width, default 1440