Skip to main content
The Magic Patterns MCP server offers the following tools. The recommended workflow for making code changes is:
  1. get_design (url) or create_blank_design to obtain an editorId and artifactId
  2. create_new_artifact (editorId) to create a safe edit session
  3. read_files (artifactId) to understand existing code before making changes
  4. write_files / edit_files (artifactId) to make changes
  5. compile_artifact_changes (artifactId) to compile
list_design_systems
Tool
Lists the design systems available to the authenticated user. Returns both built-in (reserved) design systems (like Base, Shadcn, MUI) and any custom design systems you have created or have access to.
Use this tool to discover available design systems before creating a design. You can then pass the ID or name to create_design or create_blank_design.
create_blank_design
Tool
Creates a new blank Magic Patterns design with default scaffold files. No AI agent is involved — the design is immediately ready.
The response includes editorId and artifactId so you can skip calling get_design afterwards.
create_design
Tool
Creates a new Magic Patterns design from a natural language prompt. The AI generates a complete UI component or page based on your description.
This tool creates a new design and waits for the AI to generate the initial code. The response includes the design ID, URLs, and a list of generated files.
You can specify a design system by name (e.g., “Shadcn”, “MUI”) or by ID. If no design system is specified, your default design system is used.
This tool requires credits to use.
get_design
Tool
Retrieves metadata about a Magic Patterns design, including its name, editorId, active artifactId, and a list of all available files.Use this tool first to obtain the editorId and artifactId needed for subsequent operations.
create_new_artifact
Tool
Creates a new artifact by cloning the current active artifact for the given editor. The new artifact becomes the active artifact automatically.
Call this before making any file changes so the user can easily revert to the previous artifact if needed.
list_files
Tool
Lists all files in a Magic Patterns artifact.
read_files
Tool
Reads the contents of one or more files from a Magic Patterns artifact.
Always read files before making changes with write_files or edit_files.
write_files
Tool
Creates or overwrites files in a Magic Patterns artifact. Does not compile — call compile_artifact_changes when done.
edit_files
Tool
Edits existing files in a Magic Patterns artifact by replacing their full contents. Returns an error if a file is not found. Does not compile — call compile_artifact_changes when done.
compile_artifact_changes
Tool
Compiles the current source files in a Magic Patterns artifact. Call this after finishing all file changes with write_files and/or edit_files.
update_design_from_prompt
Tool
Sends a general natural language prompt to update a Magic Patterns design. The Magic Patterns AI interprets your prompt and applies changes to the design.
Use this when you want to provide high-level instructions in plain language instead of writing code directly. This tool sends a prompt, not direct code edits.
This tool requires credits to use.