The Magic Patterns MCP connector routes your AI agent's tool calls to Magic Patterns's own MCP server through Scalekit. Each user signs in to Magic Patterns once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 23 tools.
- Tools
- 23
- What they doRead · write · destructive
- 10 · 8 · 510 read8 write5 destructive
- Users sign in with
- OAuth
- OAuth app
- Scalekit's or your own
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the Magic Patterns MCP connection
In AgentKit > Connections, create a Magic Patterns MCP connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Scalekit credentials are available for Magic Patterns MCP server, so you don't need to register an OAuth app.
Authorize a user and make your first call
quickstart.mts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'import { createInterface } from 'node:readline/promises'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'magicpatternsmcp'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize Magic Patterns MCP:', link)const rl = createInterface({ input: process.stdin, output: process.stdout })await rl.question('Press Enter after authorizing...')rl.close()// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'magicpatternsmcp_list_design_systems',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "magicpatternsmcp"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Magic Patterns MCP:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="magicpatternsmcp_list_design_systems",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user signs in once. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toolmagicpatternsmcp_get_artifactGets the active artifact for a design, including its ID and list of files.Read-onlyGet Artifact
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 before reading files or creating a new artifact branch.
Inputs
editorIdstringrequired- The editor ID of the design to retrieve the active artifact for.
magicpatternsmcp_get_design_statusGets the current status of a design: whether AI generation is active, the active artifact ID, and available files.Read-onlyGet Design Status
Gets the current status of a design: whether AI generation is active, the active artifact ID, and available files. Call this before starting new work on an existing design, and to poll for completion after create_design (with prompt) or send_prompt. Returns isGenerating, activeArtifactId, and availableFiles.
Inputs
editorIdstringrequired- The editor ID from create_design or get_editor_id_from_url. Use this to identify which design to check status for.
magicpatternsmcp_get_design_systemResolves a design system's active artifact and lists its files.Read-onlyGet Design System
Resolves a design system's active artifact and lists its files. Design systems are collaborative, so the active artifact ID can change between calls; always call this first rather than reusing a cached artifact ID. Returns the artifactId (to pass as baseArtifactId to write_design_system_files), the persisted files, and whether there are unpublished changes.
Inputs
designSystemIdstringrequired- The design system ID (ds-...). Use list_design_systems to discover available design systems.
magicpatternsmcp_get_editor_id_from_urlResolves a Magic Patterns URL to an editor ID.Read-onlyGet Editor ID from URL
Resolves a Magic Patterns URL to an editor ID. Use this when the user shares a Magic Patterns link and you need the editorId for subsequent operations like send_prompt or get_design_status. Supported formats: "magicpatterns.com/c/<id>", "https://www.magicpatterns.com/c/<id>", "project-<slug>.magicpatterns.app", "magicpatterns.com/s/<canvasId>?nodeIds=<nodeId>".
Inputs
urlstringrequired- The Magic Patterns URL to resolve to an editor ID. Supported formats: magicpatterns.com/c/<id>, https://www.magicpatterns.com/c/<id>, project-<slug>.magicpatterns.app, magicpatterns.com/s/<canvasId>?nodeIds=<nodeId>.
magicpatternsmcp_get_inspiration_documentLoads a Magic Patterns inspiration document by its ID.Read-onlyGet Inspiration Document
Loads a Magic Patterns inspiration document by its ID. An inspiration document is a set of design concepts (variants), each a self-contained HTML sketch of a UI direction. Use this to check whether concepts are ready, or to fetch a concept's current html before revising it with inspiration_update_variant.
Inputs
inspirationIdstringrequired- The Magic Patterns inspiration document ID (the <id> in magicpatterns.com/inspiration/<id>).
magicpatternsmcp_list_design_systemsLists the design systems available to the authenticated user, including built-in presets (Base, Shadcn, MUI) and any custom design systems.Read-onlyList Design Systems
Lists the design systems available to the authenticated user, including built-in presets (Base, Shadcn, MUI) and any custom design systems. Use this to resolve a design system name to its ID before calling create_design.
Inputs
This tool takes no inputs.
magicpatternsmcp_list_version_historyLists the artifact version history for a design, returning the most recent 20 versions with their artifact IDs, version labels, and titles.Read-onlyList Version History
Lists the artifact version history for a design, returning the most recent 20 versions with their artifact IDs, version labels, and titles. Use skip to paginate backwards. Each version corresponds to a snapshot of the design's code at a point in time.
Inputs
editorIdstringrequired- The editor ID of the design whose version history to list.
skipnumber- Number of recent versions to skip for pagination. Defaults to 0 (most recent). Increment by 20 to paginate backwards through version history.default
0
magicpatternsmcp_read_artifact_filesReads the contents of one or more files from an artifact.Read-onlyRead Artifact Files
Reads the contents of one or more files from an artifact. Always read files before making changes with write_artifact_files. The code is meant as a starting point and should be adapted to the user's project style, frameworks, and conventions.
Inputs
artifactIdstringrequired- The artifact ID to read files from. Obtain this from get_artifact or get_design_status.
fileNamesarrayrequired- Array of file names or paths to read from the artifact. Example: ["App.tsx", "components/Button.tsx"].
magicpatternsmcp_read_design_system_filesReads the contents of one or more files from a design system's active artifact, such as components/<Name>/index.tsx, index.css, tailwind.config.js, or rules/<slug>.md.Read-onlyRead Design System Files
Reads the contents of one or more files from a design system's active artifact, such as components/<Name>/index.tsx, index.css, tailwind.config.js, or rules/<slug>.md. Call get_design_system first to discover available file names, and always read before editing.
Inputs
designSystemIdstringrequired- The design system ID (ds-...).
fileNamesarrayrequired- Array of file names/paths to read, as listed by get_design_system. Example: ["components/Button/index.tsx", "index.css"].
magicpatternsmcp_read_recent_message_historyReads the recent chat item history for a design, returning the last 10 chat items (user prompts, AI responses, artifact versions, edits).Read-onlyRead Recent Message History
Reads the recent chat item history for a design, returning the last 10 chat items (user prompts, AI responses, artifact versions, edits). Use the skip parameter to paginate backwards. Code contents are omitted; use read_artifact_files for full file contents.
Inputs
editorIdstringrequired- The editor ID of the design to read chat history from.
skipnumber- Number of recent items to skip for pagination. Defaults to 0 (most recent). Increment by 10 to paginate backwards through history.default
0
magicpatternsmcp_create_designCreates a new Magic Patterns design.WriteCreate Design
Creates a new Magic Patterns design. With a prompt, kicks off AI generation (poll get_design_status to track progress). Without a prompt, creates a blank design with scaffold files instantly. Optionally fork an existing design via templateId, and specify a design system by name or ID.
Inputs
designSystemstring- Optional design system name (e.g. 'Shadcn', 'MUI'). Resolved case-insensitively. designSystemId takes precedence if both provided.
designSystemIdstring- Optional design system ID. Use list_design_systems to discover IDs.
imageUrlsarray- Optional image URLs as visual references (only used with prompt).
namestring- Optional name for the design. Defaults to 'Untitled'.
promptstring- Optional natural language prompt for AI generation. If omitted, a blank design with scaffold files is created instantly.
templateIdstring- Optional editor ID of an existing design to fork as a template. Get the ID from the design URL or via get_editor_id_from_url.
magicpatternsmcp_create_design_systemCreates a new, blank design system owned by the authenticated user and returns its ID plus editor URL.WriteCreate Design System
Creates a new, blank design system owned by the authenticated user and returns its ID plus editor URL. Seeds an empty initial version so files can be written into it immediately via write_design_system_files. This creates a BLANK design system; forking from an existing one is not supported.
Inputs
namestringrequired- The name of the new design system, e.g. 'Acme Design System'.
logostring- Optional logo URL for the design system. Defaults to a placeholder image if omitted.
magicpatternsmcp_create_inspiration_documentCreates a Magic Patterns inspiration document and returns a shareable magicpatterns.com/inspiration/<id> link that renders 1-8 design concepts side by side.WriteCreate Inspiration Document
Creates a Magic Patterns inspiration document and returns a shareable magicpatterns.com/inspiration/<id> link that renders 1-8 design concepts side by side. Concepts can be declared as placeholders (name/description only) and filled in later with inspiration_add_variant, or published fully in one call by including html inline for each concept.
Inputs
filesarrayrequired- The 1-8 concepts to publish or declare. Each entry is {"name": "...", "description": "...", "html": "..."}; omit html to declare a placeholder concept to fill later via inspiration_add_variant.
baselineobject- Optional baseline the variants diverge from: a faithful recreation of the current UI plus pinned invariants. Shape: {"html": "...", "focus": "...", "sharedCopy": "...", "baselineStyle": "..."}. Only html is required.
repositoryUrlstring- Optional GitHub repository URL the concepts were generated from, kept for context.
titlestring- Optional short label for what the concepts explore, e.g. 'Projects list empty state'.
magicpatternsmcp_create_new_artifactCreates a new artifact by cloning an existing artifact, setting it as the active artifact for the design.WriteCreate New Artifact
Creates a new artifact by cloning an existing artifact, setting it as the active artifact for the design. Use this before making file changes with write_artifact_files so the user can revert to the previous artifact. Always get the current active artifact ID from get_design_status or get_artifact first.
Inputs
artifactIdstringrequired- The artifact ID to clone from (typically the active artifact from get_artifact or get_design_status).
namestringrequired- A short title for this version, phrased as the change about to be made (e.g. 'Swap hero CTA to solid variant'). Shown in the design timeline and versions dropdown.
descriptionstring- Optional longer note on what is about to change and why, shown above the version in chat. Prefer describing what actually shipped via publish_artifact's description instead; use this for a session that may not reach publish.
magicpatternsmcp_create_slide_deckCreates a new Magic Patterns slide deck and kicks off AI generation.WriteCreate Slide Deck
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. A prompt is required; generation is long-running, so poll get_design_status rather than waiting synchronously.
Inputs
promptstringrequired- Natural language description of the slide deck to generate, e.g. 'A 10-slide startup pitch deck for a fintech company'.
designSystemstring- Optional design system name (e.g. 'Shadcn', 'MUI'). Resolved case-insensitively. designSystemId takes precedence if both are provided.
designSystemIdstring- Optional design system ID. Use list_design_systems to discover IDs.
imageUrlsarray- Optional image URLs as visual references.
namestring- Optional name for the slide deck. Defaults to 'Untitled'.
magicpatternsmcp_inspiration_add_variantFills in one concept of an existing Magic Patterns inspiration document with its self-contained HTML.WriteInspiration Add Variant
Fills in one concept of an existing Magic Patterns inspiration document with its self-contained HTML. Use after create_inspiration_document to stream concepts in one at a time: the concept renders live on the shared page as soon as its html arrives, and the document flips to 'ready' once every concept is filled.
Inputs
htmlstringrequired- The full, self-contained HTML document (non-empty).
inspirationIdstringrequired- The inspiration document ID returned by create_inspiration_document.
descriptionstring- Optional update to the concept's design direction.
namestring- Optional update to the concept's name.
variantIdstring- The concept ID to fill, from create_inspiration_document. Omit to fill the first still-empty concept.
magicpatternsmcp_publish_artifactCompiles an artifact's source files and sets it as the active artifact for the design.WritePublish Artifact
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 — it bundles files for preview, updates the active artifact in the editor, and adds a version entry to the design timeline.
Inputs
artifactIdstringrequired- The artifact ID to compile and publish.
editorIdstringrequired- The editor ID of the design this artifact belongs to.
descriptionstring- A summary of what changed in this version, written like a commit message in the past tense describing what actually shipped, e.g. 'Swapped the hero CTA to the solid Button variant and dropped the legacy grid'. Always provide this: collaborators open the design without having seen the session, and this is the only prose explaining what changed.
magicpatternsmcp_publish_design_systemPublishes the design system's active artifact as a new immutable version.WritePublish Design System
Publishes the design system's active artifact as a new immutable version. Strict: refuses if the active artifact has validation errors from write_design_system_files; clear all validationErrors first. Returns the new version (major.minor) and whether it is backwards-compatible with the previously published version (a breaking change, such as a removed component or prop, bumps the major version).
Inputs
designSystemIdstringrequired- The design system ID (ds-...).
magicpatternsmcp_inspiration_clear_variantsResets every concept of an existing Magic Patterns inspiration document back to an empty placeholder, dropping each concept's html and its pre-created 'Iterate' room.DestructiveInspiration Clear Variants
Resets every concept of an existing Magic Patterns inspiration document back to an empty placeholder, dropping each concept's html and its pre-created 'Iterate' room. Use this to replace all concepts: clear the document, then stream fresh concepts back in with inspiration_add_variant targeting the returned concept IDs.
Inputs
inspirationIdstringrequired- The inspiration document ID returned by create_inspiration_document.
magicpatternsmcp_inspiration_update_variantRevises a single already-filled concept of a Magic Patterns inspiration document in place, replacing its html (and optionally its name/description).DestructiveInspiration Update Variant
Revises a single already-filled concept of a Magic Patterns inspiration document in place, replacing its html (and optionally its name/description). Use to update a subset of concepts without touching the others; the concept's 'Iterate in Magic Patterns' room is refreshed so it builds from the new html.
Inputs
htmlstringrequired- The full, self-contained HTML document (non-empty).
inspirationIdstringrequired- The inspiration document ID.
variantIdstringrequired- The concept ID to revise, from get_inspiration_document. Targets an existing filled concept (unlike inspiration_add_variant, which fills empty placeholders).
descriptionstring- Optional update to the concept's design direction.
namestring- Optional update to the concept's name.
magicpatternsmcp_send_promptSends a natural language prompt to the Magic Patterns AI for an existing design.DestructiveSend Prompt
Sends a natural language prompt to the Magic Patterns AI for an existing design. The AI generates or updates code and returns immediately with a requestId. Call get_design_status to poll until isGenerating is false. Generation typically takes 2-10 minutes; poll no more than once every 60 seconds.
Inputs
editorIdstringrequired- The editor ID of the design to update.
promptstringrequired- A natural language description of what to create or change.
magicpatternsmcp_write_artifact_filesCreates or overwrites one or more files in an artifact.DestructiveWrite Artifact Files
Creates or overwrites one or more files in an artifact. If a file exists it will be replaced; if it does not exist it will be created. This only saves source files — call publish_artifact after finishing all file changes to compile and activate the artifact.
Inputs
artifactIdstringrequired- The artifact ID to write files to.
filesarrayrequired- Array of files to write.
magicpatternsmcp_write_design_system_filesCreates or overwrites files in a design system.DestructiveWrite Design System Files
Creates or overwrites files in a design system. Incoming files are validated, merged onto the existing artifact (existing files are preserved), compiled, and activated immediately. Components must use the complete trio: components/<Name>/index.tsx, components/<Name>/<Name>.previews.tsx, and components/<Name>/Context.md. Pass the artifactId from get_design_system as baseArtifactId to detect drift; a 409 means someone else changed the design system in the meantime.
Inputs
designSystemIdstringrequired- The design system ID (ds-...).
filesarrayrequired- Array of files to create or overwrite, e.g. [{"fileName": "components/Button/index.tsx", "content": "export function Button() {...}"}].
baseArtifactIdstring- The artifactId from get_design_system. If the active artifact has since changed, the write is rejected with a 409 so it can be re-read and retried.
No tools match.