Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to the MachGen MCP server

Vendor MCP
Open markdown

The MachGen MCP connector routes your AI agent's tool calls to MachGen's own MCP server through Scalekit. Each user signs in to MachGen once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 21 tools.

Tools
21
What they doRead · write · destructive
11 · 10 · 011 read10 write0 destructive
Users sign in with
OAuth app
Your own MachGen MCP server app

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 MachGen MCP connection

    In AgentKit > Connections, create a MachGen MCP connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. Register an OAuth app

    MachGen MCP server connections use your own OAuth app. Register one with MachGen MCP server and add the redirect URI you copied.

    Then enter the app's Client ID and Client Secret on the MachGen MCP connection.

  5. 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 = 'machgenmcp'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize MachGen 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: 'machgenmcp_check_balance',
    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
  • machgenmcp_check_balanceCheck the calling account's current spendable balance.Read-only

    Check balance

    Check the calling account's current spendable balance. The API key identifies exactly one account, so no account needs naming.

    Inputs

    This tool takes no inputs.

  • machgenmcp_download_assetDownload any owned completed MachGen image, video, or audio as a standard MCP file resource.Read-only

    Download asset

    Download any owned completed MachGen image, video, or audio as a standard MCP file resource. Files up to 8 MiB are returned as an embedded binary resource. Larger files return a manifest with an expiring raw HTTPS URL without adding a media ResourceLink to model context. Save that URL with the client's local file/download capability using the returned filename; do not pass it back as media input. Every path preserves MIME type and original bytes. Use this when the user wants a file to save or reuse; get_asset is preview.

    Inputs

    task_idstringrequired
    No description.
  • machgenmcp_get_assetFetch a completed asset for inline preview, plus its URL, size, and image vision bytes when small enough.Read-only

    Get asset

    Fetch a completed asset for inline preview, plus its URL, size, and image vision bytes when small enough.

    Inputs

    task_idstringrequired
    No description.
  • machgenmcp_get_priceQuote what a generation would cost on the calling account, before submitting it.Read-only

    Get generation price

    Quote what a generation would cost on the calling account, before submitting it. Returns the amount that would actually be charged, including any account-specific pricing and active discounts. The API key identifies exactly one account, so no account needs naming. For models that bill reference/input video (Seedance 2.0 R2V), pass input_video_secs (each attached clip's length rounded up to whole seconds, then summed - the billed aggregation) to quote that rate; it adds billed seconds on top of the output duration, and some models apply a minimum total (Kling 4.0 bills max(input + output, k x output) seconds with k = 2). Some models price a task type separately (MiniMax-H3 T2V is cheaper than its I2V/R2V), so pass task_type to quote the surface you will submit.

    Inputs

    heightintegerrequired
    No description.
    modelstringrequired
    No description.
    aspect_ratiostring
    No description.
    audiostring
    No description.
    duration_secsstring
    No description.
    input_video_secsstring
    No description.
    task_typestring
    No description.
    widthstring
    No description.
  • machgenmcp_get_taskCheck a task's status.Read-only

    Get task

    Check a task's status. Poll this after generating. Once a task completes, its image or video is exposed to the inline preview app. Final billing is returned in micro-USD once finished (1 USD = 1000000). billed_micros is cost after refunds; net_cost_micros also subtracts Generation Credit. Images also include vision bytes when small enough. Pass wait_secs to block until the task finishes instead of polling in a loop: the call returns the moment it completes or fails, or once the wait elapses - whichever comes first. A still-running task simply comes back RUNNING, so call again to keep waiting.

    Inputs

    task_idstringrequired
    No description.
    include_imageboolean
    No description.default true
    wait_secsstring
    No description.
  • machgenmcp_get_task_paramsThe exact settings a past task ran with, so you can re-run it with one thing changed rather than reconstructing the request.Read-only

    Get task parameters

    The exact settings a past task ran with, so you can re-run it with one thing changed rather than reconstructing the request.

    Inputs

    task_idstringrequired
    No description.
  • machgenmcp_get_tasksCheck up to 50 distinct task IDs in input order.Read-only

    Get tasks

    Check up to 50 distinct task IDs in input order. Missing or inaccessible tasks return per-item not_found errors. wait_secs waits for all accessible tasks to finish or a shared deadline (maximum 120 seconds). Returns fixed asset URLs without creating temporary links; use get_asset for previews and download links. include_image defaults to false; inline images share a 4 MiB raw image-byte budget; the base64-encoded response can be larger.

    Inputs

    task_idsarrayrequired
    No description.
    include_imageboolean
    No description.default false
    wait_secsstring
    No description.
  • machgenmcp_list_historyBrowse this account's past generations, newest first.Read-only

    List history

    Browse this account's past generations, newest first. Use `search` to match a prompt or task id.

    Inputs

    heightstring
    No description.
    pageinteger
    No description.default 1
    page_sizeinteger
    No description.default 20
    searchstring
    No description.
    task_typestring
    No description.