Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to the Magic Patterns MCP server

Vendor MCP
Open markdown

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 app
Scalekit's or your own

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. 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>
  3. Create the Magic Patterns MCP connection

    In AgentKit > Connections, create a Magic Patterns MCP connection. The name you give it is the connection_name your code passes. See Configure connections.

    Scalekit credentials are available for Magic Patterns MCP server, so you don't need to register an OAuth app.

  4. 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.actions
    const connector = 'magicpatternsmcp'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { 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 call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'magicpatternsmcp_list_design_systems',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • magicpatternsmcp_get_artifactGets the active artifact for a design, including its ID and list of files.Read-only

    Get 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-only

    Get 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-only

    Get 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-only

    Get 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-only

    Get 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-only

    List 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-only

    List 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-only

    Read 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"].