Prototyper UI
Design Bridge

MCP Tools Reference

Complete reference for the 7 Design Bridge MCP tools — create, update, theme, get, list, close, and export.

The Design Bridge adds 7 MCP tools to the Prototyper UI server. All tools are available when the MCP server is running. If the bridge server is reachable, tools use the Yjs-backed bridge for real-time sync. Otherwise, they fall back to file-based sessions.

design_create

Create a new live design session. Returns a session ID and preview URL.

Parameters

ParameterTypeRequiredDescription
namestringYesSession name, e.g. "Login Page"
specstringNoJSON Compose spec string (root + elements)
descriptionstringNoHuman description of the design
themeobjectNoTheme overrides (merged with defaults)

The theme object accepts:

PropertyTypeRangeDescription
huenumber0-360Primary color hue
chromanumber0-0.4Color saturation
grayChromanumber0-0.03Gray tint saturation
radiusnumber0+Border radius in px
fontstring--Font family name

Example

{
  "name": "Signup Form",
  "description": "A registration form with name, email, and password",
  "theme": {
    "hue": 220,
    "radius": 8
  }
}

Response

{
  "sessionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "previewUrl": "http://localhost:4321/?session=a1b2c3d4",
  "revision": 0,
  "source": "bridge"
}

design_update

Update the spec of an active design session. Accepts either a full replacement spec or RFC 6902 JSON Patch operations.

Parameters

ParameterTypeRequiredDescription
sessionIdstringNoSession ID (falls back to active session)
specstringNoFull replacement spec as JSON string
patchesstringNoJSON Patch array (RFC 6902) as JSON string
descriptionstringNoChange description, e.g. "Added submit button"

Provide exactly one of spec or patches, not both.

Patches Format

Patches follow RFC 6902. Common operations:

Add an element:

[
  {
    "op": "add",
    "path": "/elements/submitBtn",
    "value": {
      "type": "Button",
      "props": { "children": "Submit", "className": "w-full" },
      "children": []
    }
  }
]

Change a prop:

[
  {
    "op": "replace",
    "path": "/elements/submitBtn/props/children",
    "value": "Sign Up"
  }
]

Remove an element:

[
  {
    "op": "remove",
    "path": "/elements/submitBtn"
  }
]

Reorder children:

[
  {
    "op": "replace",
    "path": "/elements/form/children",
    "value": ["nameField", "emailField", "passwordField", "submitBtn"]
  }
]

Spec Operations

When connected to the bridge server, patches are converted to granular SpecOp operations for optimal CRDT merging:

OperationDescription
add_elementAdd a new element with parent
remove_elementRemove an element by key
update_propsMerge props into an element
set_propSet a single prop value
remove_propRemove a single prop
reorder_childrenSet the children array
set_rootChange the root element key
replace_specReplace the entire spec

Response

{
  "revision": 3,
  "applied": 2,
  "errors": [],
  "source": "bridge"
}

design_theme

Update the theme of a design session. Accepts natural language descriptions, preset names, or explicit numeric parameters.

Parameters

ParameterTypeRequiredDescription
sessionIdstringNoSession ID (falls back to active session)
descriptionstringNoNatural language, e.g. "warm sunset colors with large rounded corners"
huenumberNoPrimary hue (0-360)
chromanumberNoColor saturation (0-0.4)
grayChromanumberNoGray tint saturation (0-0.03)
radiusnumberNoBorder radius in px
fontstringNoFont family name

When both description and explicit parameters are provided, explicit parameters take precedence.

Natural Language Examples

  • "dark blue professional" — parsed to hue ~220, moderate chroma
  • "warm sunset with rounded corners" — parsed to warm hues, large radius
  • "forest" — resolved from the forest preset
  • "midnight" — resolved from the midnight preset

Example

{
  "description": "clean minimal with Inter font",
  "radius": 6
}

Response

{
  "theme": {
    "hue": 240,
    "chroma": 0.12,
    "grayChroma": 0.005,
    "radius": 6,
    "font": "Inter"
  },
  "description": "Theme with hue 240, chroma 0.12, radius 6px, font \"Inter\"",
  "source": "bridge"
}

design_get

Get details about a design session at varying levels of detail.

Parameters

ParameterTypeRequiredDefaultDescription
sessionIdstringNoactiveSession ID
includeenumNo"summary"Level of detail to return

The include parameter accepts:

ValueReturns
summaryID, name, description, revision, element names, theme
fullEverything including full spec, theme CSS, history
spec-onlyJust the spec
theme-onlyJust the theme parameters and generated CSS

Example

{
  "include": "summary"
}

Response (summary)

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Login Page",
  "description": "A login form with email and password",
  "revision": 5,
  "componentCount": 8,
  "elementNames": ["container", "heading", "emailField", "passwordField", "submitBtn"],
  "theme": {
    "hue": 264,
    "chroma": 0.24,
    "grayChroma": 0.01,
    "radius": 0.625
  },
  "source": "bridge"
}

design_list

List all active design sessions with metadata.

Parameters

None.

Response

{
  "sessions": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Login Page",
      "revision": 5
    },
    {
      "id": "f9e8d7c6-b5a4-3210-fedc-ba9876543210",
      "name": "Dashboard",
      "revision": 12
    }
  ],
  "source": "bridge"
}

design_close

Close a design session. Optionally export the design before closing.

Parameters

ParameterTypeRequiredDefaultDescription
sessionIdstringNoactiveSession ID
exportFirstbooleanNofalseExport as React code before closing

Example

{
  "exportFirst": true
}

Response

{
  "closed": true,
  "exported": {
    "code": "import { Card, CardHeader, ... } from \"@/components/proto\";\n\nexport function LoginPage() { ... }",
    "themeCSS": ":root { --primary: ... }"
  },
  "source": "bridge"
}

When exportFirst is false, the exported field is omitted.


design_export

Export a design session as a React component with optional theme CSS.

Parameters

ParameterTypeRequiredDefaultDescription
sessionIdstringNoactiveSession ID
componentNamestringNoDerived from namePascalCase component name
importPrefixstringNo@/components/protoImport path prefix for components
includeThemebooleanNotrueInclude theme CSS in export

Example

{
  "componentName": "SignupForm",
  "importPrefix": "@/components/ui"
}

Response

{
  "code": "import { Card, CardHeader, CardContent, ... } from \"@/components/ui\";\n\nexport function SignupForm() {\n  return (\n    <Card className=\"p-6\">\n      ...\n    </Card>\n  );\n}",
  "themeCSS": ":root {\n  --primary: 39.11% 0.084 240.8;\n  ...\n}",
  "installDeps": [
    "@prototyperco/ui/card",
    "@prototyperco/ui/button",
    "@prototyperco/ui/text-field"
  ],
  "files": [
    {
      "path": "components/signup-form.tsx",
      "content": "..."
    },
    {
      "path": "styles/theme-tokens.css",
      "content": "..."
    }
  ],
  "source": "bridge"
}

On this page