Skip to main content

Workflows

There are four primary ways to use the Magic Patterns MCP tools.

Prompt-based

Delegate creative work to Magic Patterns’ AI. Send a natural language prompt and let the AI generate or update code.

Code-first

Write code directly into artifacts. Create a working branch, edit files, and publish when done.

Design-system authoring

Build a reusable design system by writing components, styling, and rules directly, then publish versioned releases.

Inspiration concepts

Publish a shareable set of side-by-side design concepts, then fill in or revise each concept’s content as you explore directions.

Workflow A — Prompt-based

Starting from scratch:
With an existing design:

Workflow B — Code-first

Workflow C — Design-system authoring

Author a reusable design system (components, styling, and rules) by writing files directly. You write the code here — Magic Patterns does not generate it for you. Load the design_system_authoring_guide prompt first for the full file contract.

Workflow D — Inspiration concepts

Publish a shareable magicpatterns.com/inspiration/<id> link that renders 4 design concepts side by side. The preferred flow declares placeholder concepts first (so the link is publishable immediately), then streams each concept’s content in one at a time.
Slide decks share the design/artifact tooling: create_slide_deck(prompt) kicks off AI generation just like create_design, then you poll get_design_status the same way.

Important Guidance

Collaborative editing: Magic Patterns is a collaborative editor — the user can make changes in the UI at any time. Always call get_design_status before starting new work to get the latest active artifact. Never assume state from a previous call is still current.
Polling: AI generation typically takes 2–10 minutes. Poll get_design_status no more frequently than every 60 seconds. Slow generation is normal — do not treat it as an error.
Design systems — write vs. publish: write_design_system_files is permissive — it saves your files and returns validationErrors without blocking, so you can build incrementally. publish_design_system is strict — it refuses while any validation errors remain. Clear every validationErrors entry before publishing. Design systems are also collaborative: always call get_design_system first and pass its artifactId as baseArtifactId on writes so concurrent edits are detected (a 409 means re-read and retry).

General Tools

list_design_systems
Tool
Lists the design systems available to the authenticated user. Returns both built-in presets (e.g. Base, Shadcn, MUI) and any custom design systems.

Design Tools

create_design
Tool
Creates a new Magic Patterns design. This is the starting point for both workflows.
  • With prompt: Kicks off AI generation (long-running, 2–10 minutes). Poll get_design_status every 60s.
  • Without prompt: Creates a blank design with scaffold files (App.tsx, index.tsx, index.css, tailwind.config.js). Returns immediately.
  • With templateId: Forks an existing design first, then optionally applies the prompt to the fork.
This tool requires credits when used with a prompt.
create_slide_deck
Tool
Creates a new Magic Patterns slide deck and kicks off AI generation. A slide deck is a 16:9, full-bleed, one-slide-at-a-time React presentation where each slide maps to a screen in the canvas.Unlike create_design, a prompt is required — there is no blank-deck path. Generation is long-running (2–10 minutes); poll get_design_status every 60s.
Generation typically takes 2–10 minutes. Poll get_design_status every 60 seconds until isGenerating=false. This tool requires credits.
get_editor_id_from_url
Tool
Resolves a Magic Patterns URL to an editor ID.
get_design_status
Tool
Gets the current status of a design: whether AI generation is active, the active artifact ID, and available files.Always call this before starting new work on an existing design — the user may have changed state since you last checked. Also used to poll for completion after create_design (with prompt) or send_prompt.
When isGenerating=true, wait at least 60 seconds before polling again. Generation can take up to 10 minutes.
send_prompt
Tool
Sends a natural language prompt to the Magic Patterns AI for an existing design. Returns immediately with a request ID. The generation runs in the background.
Check get_design_status first to ensure isGenerating=false before sending a prompt.
Generation typically takes 2–10 minutes. Poll get_design_status every 60 seconds until isGenerating=false. This tool requires credits.
read_recent_message_history
Tool
Reads the recent chat item history for a design. Returns the last 10 items (user prompts, AI responses, artifact versions, edits). Use skip to paginate backwards.Code contents are omitted to keep the response concise — use read_artifact_files to read full file contents.
list_version_history
Tool
Lists the artifact version history for a design. Returns the most recent 20 versions.
publish_artifact
Tool
Compiles an artifact’s source files and sets it as the active artifact for the design. This is the final step in the code-first workflow.
  1. Compiles all source files (bundling for preview)
  2. Sets the artifact as active (appears in editor and preview)
  3. Adds a version entry to the design timeline

Artifact Tools

get_artifact
Tool
Gets the active artifact for a design, including its ID and list of files.Always call this (or get_design_status) to get the latest active artifact — do not rely on a previously cached artifact ID.
create_new_artifact
Tool
Creates a new artifact by cloning an existing one. The new artifact becomes the active artifact.
Call this before making file changes with write_artifact_files so the user can revert to the previous artifact if needed. Always call get_design_status or get_artifact first to get the current active artifact ID.
read_artifact_files
Tool
Reads the contents of one or more files from an artifact.
Always read files before making changes with write_artifact_files so you understand the current state.
write_artifact_files
Tool
Creates or overwrites one or more files in an artifact. If a file exists, it is replaced. If it doesn’t exist, it is created.
This only saves source files — it does not compile or publish. Call publish_artifact after finishing all file changes.

Design System Tools

These tools let an agent author a Magic Patterns design system — a reusable, versioned collection of components, styling, and rules — by writing files directly. This is distinct from the design/artifact tools above: here you write the code, rather than delegating to Magic Patterns’ AI.
Load the design_system_authoring_guide prompt before writing any files. It documents the full file/folder contract (component trios, named-export rules, index.css import order, allowed providers, and more).
A design system’s writable files follow this structure:
  • components/<Name>/index.tsx — component source (PascalCase folder, named exports only)
  • components/<Name>/<Name>.previews.tsx — preview definitions (required per component)
  • components/<Name>/Context.md — AI/usage documentation (required per component)
  • index.css — design system styles / Tailwind imports (editable, cannot be deleted)
  • tailwind.config.js — Tailwind configuration (editable, cannot be deleted)
  • rules/<slug>.md — design rules (rules/setup.md is the special “Setup” rule)
Shell / auto-generated files (root index.tsx, library.ts, registry.ts, etc.) are stripped automatically if sent.
get_design_system
Tool
Resolves a design system’s active artifact and lists its files. Always call this first — design systems are collaborative, so the active artifact ID can change between calls. Never reuse a cached artifactId.
read_design_system_files
Tool
Reads the contents of one or more files from a design system’s active artifact.
Call get_design_system first to discover available file names, and always read files before editing them so you preserve current content.
create_design_system
Tool
Creates a new, blank design system owned by you and returns its ID and editor URL. Seeds an empty initial version so you can immediately write files into it.
This creates a blank design system. Forking from an existing design system is not supported through the MCP. After creating, load the design_system_authoring_guide prompt and write files with write_design_system_files.
write_design_system_files
Tool
Creates or overwrites files in a design system. Incoming files are merged onto the existing artifact (existing files are preserved), then compiled and activated immediately.
This tool is permissive: it saves your files and returns validationErrors without blocking, so you can build incrementally. Fix all validation errors before calling publish_design_system, which is strict.
publish_design_system
Tool
Publishes the design system’s active artifact as a new immutable version.
This tool is strict: it refuses if the active artifact has validation errors. Run write_design_system_files and clear all validationErrors first. A breaking change (e.g. a removed component or prop) bumps the major version; otherwise the minor version is incremented.

Inspiration Tools

These tools publish and manage a Magic Patterns inspiration document — a shareable magicpatterns.com/inspiration/<id> link that renders 4 design concepts (variants) side by side. Each concept is a self-contained sketch of a UI direction.
create_inspiration_document
Tool
Creates an inspiration document and returns a shareable URL. Declare each concept’s name/description without html to publish the link immediately, then stream each concept in with inspiration_add_variant. You may also pass html inline to publish concepts fully in one call.
inspiration_add_variant
Tool
Fills in one placeholder concept with its content. The concept renders live on the shared page as soon as its content arrives; the document flips to “ready” once every concept is filled.
get_inspiration_document
Tool
Loads an inspiration document by its ID. Use this to read concepts back — for example, to implement a specific concept (“Implement Concept B from inspiration <id>”).
A concept is only usable once its status is ready; a non-ready one has empty/partial html.
inspiration_update_variant
Tool
Revises a single already-filled concept in place, replacing its content (and optionally its name/description). Use this to update a subset of concepts without touching the others.
inspiration_clear_variants
Tool
Resets every concept back to an empty placeholder — dropping each concept’s content and its pre-created “Iterate” room. Use this to replace all concepts with a fresh set of directions.

Video Walkthrough

Getting existing code from your codebase into Magic Patterns: