reaui-mcp
v0.3.0MCP 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Project 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Project directory relative to the workspace root |
system * | string | null | Full 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
strict | boolean |
reaui_init_components Initialize reusable components
Add a catalog to an existing document directory; upgrades v2 to v3, keeps v4, never overwrites existing definitions.
| Parameter | Type | Description |
|---|---|---|
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.
| Parameter | Type | Description |
|---|---|---|
name * | string | Human readable document name |
path * | string | Document directory, relative to the workspace root, e.g. "demo" |
components | boolean | Initialize a reusable component catalog (v3, or retain v4 with a system) |
height | integer | Desktop artboard height, default 1024 |
pageId | string | First page id, lowercase kebab-case. Defaults to "main" |
pageName | string | Display name of the first page |
system | string | Optional complete reaui-design-system JSON package embedded before page generation |
width | integer | Desktop 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.
| Parameter | Type | Description |
|---|---|---|
pageId * | string | Page id, lowercase kebab-case; written to pages/<pageId>.page.tsx |
path * | string | Document directory, relative to the workspace root |
source * | string | Full 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Document directory or .reaui file, relative to the workspace root |
depth | integer | Maximum node depth, Page root is 0; omit for the full tree |
page | string | Page 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Document 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Document directory, relative to the workspace root |
force | boolean | Overwrite an existing file |
out | string | Output .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.
| Parameter | Type | Description |
|---|---|---|
file * | string | .reaui file path, relative to the workspace root |
out * | string | Target directory for the unpacked document |
force | boolean | Write 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Document directory, relative to the workspace root |
out | string | Output 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.
| Parameter | Type | Description |
|---|---|---|
after * | string | Modified document directory |
before * | string | Baseline 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.
| Parameter | Type | Description |
|---|---|---|
name * | string | Document name |
pages * | array | One or more pages, written in order |
path * | string | Document directory, relative to the workspace root |
components | string | Optional complete static components/main.components.tsx source |
height | integer | Desktop artboard height, default 1024 |
out | string | Output .reaui path, defaults to <path>.reaui |
system | string | Optional complete reaui-design-system JSON package; pages can reference its --rea-ds-* variables |
width | integer | Desktop artboard width, default 1440 |