Workflows
There are three 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.
Workflow A — Prompt-based
Starting from scratch: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 thedesign_system_authoring_guide prompt first for the full file contract.
Important Guidance
General Tools
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
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). Pollget_design_statusevery 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.
Resolves a Magic Patterns URL to an editor ID.
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.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.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.Lists the artifact version history for a design. Returns the most recent 20 versions.
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.
- Compiles all source files (bundling for preview)
- Sets the artifact as active (appears in editor and preview)
- Adds a version entry to the design timeline
Artifact Tools
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.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.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.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. 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.mdis the special “Setup” rule)
index.tsx, library.ts, registry.ts, etc.) are stripped automatically if sent.
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.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.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.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.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.