ApiframeDocs

MCP Server

Connect AI agents to Apiframe with the remote MCP server — generate images, video, and music from Claude, Cursor, and any MCP client.

Apiframe ships a remote MCP (Model Context Protocol) server, so AI agents can generate images, video, and music with plain-language requests — no glue code.

  • Endpoint: https://mcp.apiframe.ai (streamable HTTP)
  • Authentication: your regular API key in the X-API-Key header — the same key as the REST API (see Authentication)
  • Billing: identical to the REST API. Tool calls submit the same jobs, deduct the same credits, and share your account's rate limits. Failed jobs are auto-refunded.

Setup

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "apiframe": {
      "url": "https://mcp.apiframe.ai",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}
claude mcp add --transport http apiframe https://mcp.apiframe.ai \
  --header "X-API-Key: YOUR_API_KEY"

Claude Desktop's Add custom connector dialog cannot send an API key (OAuth only, unless you have Anthropic's Request-headers beta). Use a local stdio bridge instead — add to claude_desktop_config.json:

{
  "mcpServers": {
    "apiframe": {
      "command": "npx",
      "args": [
        "mcp-remote", "https://mcp.apiframe.ai",
        "--header", "X-API-Key: YOUR_API_KEY"
      ]
    }
  }
}

Restart Claude Desktop after saving. If your Claude build shows Request headers in that dialog, you can skip the bridge: name Apiframe, URL https://mcp.apiframe.ai, header x-api-key = your key. Leave OAuth blank.

Any client that speaks streamable HTTP can connect directly:

# Streamable HTTP endpoint
url: https://mcp.apiframe.ai

# Authentication: sent on every request
headers:
  X-API-Key: YOUR_API_KEY

Replace YOUR_API_KEY with a key from the dashboard.

Tools

ToolWhat it does
generate_imageCreate images from a prompt with any image model (Midjourney, Flux, Nano Banana, GPT Image, …)
generate_videoCreate video clips with any video model (Kling, Veo, Sora, Hailuo, Wan, …)
generate_musicCreate music with any music model (Suno, Udio, ElevenLabs, Lyria, …)
edit_imageInpaint or outpaint an image (flux-fill-pro)
upscale_imageUpscale an image (topaz-image-upscale, clarity-upscale)
upscale_videoUpscale a video (topaz-video-upscale)
remove_backgroundRemove an image background (bria-bg-remove, 851-bg-remove)
get_jobFetch a job's status and results
list_modelsDiscover models, credit costs, and per-model parameters

list_models is the entry point: it reports each model's id, credit cost range, supported aspect ratios / durations / resolutions, and the parameter names (paramIds) that the generation tools accept in their params object. Agents are instructed to call it before generating.

Async jobs and polling

Generation is asynchronous, exactly like the REST API:

  1. A generation tool returns { jobId, status: "QUEUED" } immediately. Credits are deducted at submission.
  2. The agent polls get_job until status is COMPLETED or FAILED.
  3. Completed jobs include CDN URLs in result. Failed jobs are refunded automatically.

Generation tools and get_job accept an optional wait_seconds (0–25): the server polls internally before responding, so a fast image job can finish within a single tool call. Video and music jobs typically take longer (1–6 minutes) — agents poll get_job for those.

Typical completion times: images 10–60 s, video 1–6 min, music 1–3 min.

Validation and errors

Tool arguments are assembled into the same request bodies as the REST endpoints and validated with the same schemas — parameter names, allowed values, and error messages match the REST docs exactly. Validation failures return per-field issues without deducting credits.

Notes

  • The MCP server is stateless: no session is stored between requests, and any request can be retried safely (submissions create new jobs — poll get_job rather than resubmitting).
  • JWT dashboard tokens are not accepted on the MCP endpoint; use an API key (X-API-Key or Authorization: Bearer).
  • Claude Desktop custom connectors need OAuth or Anthropic's Request-headers beta to send that key. Until then, bridge with mcp-remote (see Setup). ChatGPT connectors (OAuth) are not supported yet.
  • Midjourney/Suno/Udio actions (upscale variants, extend, cover), LoRA training, file uploads, and webhooks are REST-only for now — see the REST API docs.

On this page