Workflows
There are two 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.
Workflow A — Prompt-based
Starting from scratch:Workflow B — Code-first
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.