API Reference / MCP

Let your agent design and render.

PixelDrive ships a hosted Model Context Protocol server. Point Claude, Cursor, VS Code, or any MCP client at one URL and your assistant can browse templates, design them, and render branded images on demand — using the same templates and credits as the REST API.

Endpoint: https://pixeldrive.pro/mcp · transport: Streamable HTTP

Listed in the official MCP Registry as pro.pixeldrive/pixeldrive

Connect

First, create a token in API tokens. Then add the server with one command or click:

Claude Code — one command

claude mcp add --transport http pixeldrive https://pixeldrive.pro/mcp \
  --header "Authorization: Bearer pdrv_your_token"

Cursor & VS Code — one click

Installs the server, then swap the placeholder token for yours in the client’s MCP settings.

Any MCP client — paste the config

{
  "mcpServers": {
    "pixeldrive": {
      "url": "https://pixeldrive.pro/mcp",
      "headers": { "Authorization": "Bearer pdrv_your_token" }
    }
  }
}

Claude Desktop — proxy the remote server over stdio

Claude Desktop talks stdio, so wrap the remote URL with mcp-remote:

{
  "mcpServers": {
    "pixeldrive": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote", "https://pixeldrive.pro/mcp",
        "--header", "Authorization: Bearer pdrv_your_token"
      ]
    }
  }
}

Authentication

The MCP server uses the same Bearer token as the REST API — one secret per account, created and revoked from API tokens. Send it as Authorization: Bearer pdrv_…. The token is hashed at rest; a missing or revoked one returns 401. Every render is attributed to your account and spends from your credit balance.

What your agent can do

26 tools — the full editor and renderer, callable by prompt. Your agent can go from “make me a launch graphic” to a finished PNG without you touching the editor.

Discover & inspect

describe_capabilitiesWhat the editor + renderer support (element types, fit modes, limits)
list_templatesYour templates
get_templateA template’s full element tree
get_template_variablesThe variables (payload keys) a template exposes
list_gallery_templatesBrowse the starter gallery
list_fontsAvailable fonts
list_rendersYour recent renders

Find assets

search_photosSearch stock photos
search_iconsSearch the icon library
attach_image_from_urlPull in any external image by URL

Design & edit templates

create_templateNew blank template at a given size
duplicate_templateClone an existing template
add_elementAdd a text, image, SVG, or shape
add_elementsAdd many elements in one call
update_elementChange any element’s properties
duplicate_elementClone an element
reorder_elementChange z-index / stacking order
remove_elementDelete an element
update_pagePage size, background, settings
mark_as_variableExpose an element as a render variable (payload key)

Lay out

align_elementsAlign elements to the canvas
stack_elementsStack in a row or column
place_relativePosition one element relative to another

Render

preview_imageFree, ephemeral render the model can see while iterating
generate_imageFinal saved render — returns a permanent URL (1 credit)
generate_batchMany final images at once (billed per image)

Credits

Only final renders cost credits. Everything an agent does while iterating is free:

preview_imagefreeEphemeral preview the model sees while iterating — never billed.
generate_image1 creditFinal saved render. A cache hit (same template + payload) is free.
generate_batch1 / imageBilled per generated image; cache hits in the batch are free.
everything elsefreeListing, designing, searching, marking variables — all free.

Out of credits returns 402. Top up on the billing page.

Capability introspection

Agents don’t have to guess. describe_capabilities returns a machine-readable manifest of what the editor and renderer support — element types, text auto-fit modes, the override fields, output format, and limits — so the model can plan a valid design before it builds. Pair it with get_template_variables to learn a specific template’s exact payload keys.

Example

Once connected, just ask:

List my PixelDrive templates, then generate an image from the
"product-launch" template with the headline "Spring Sale", the
price "$49", and the hero image from this URL: https://…/shoe.png

The agent calls list_templates get_template_variables preview_image (free, to check) → generate_image and hands you back a permanent PNG URL.

Troubleshooting

401 UnauthorizedTokenMissing/expired token. Create one in API tokens and put it in the Authorization header.
Tools don’t appearRestartRestart the client after editing config. Confirm the URL is exactly https://pixeldrive.pro/mcp.
Render didn’t saveToolpreview_image is free + ephemeral; use generate_image for a permanent URL.
402 Payment RequiredCreditsOut of credits — top up on the billing page.