MAGI-2 MCP Server

Let an AI agent create MAGI-2 videos for you. Add one remote MCP server with your API key, then ask for a clip in plain language; the agent submits the task, waits and returns the video link.

MCP · Streamable HTTP Endpoint: https://magi2.studio/mcp

The MCP server uses the same API key, credits and limits as the REST API. Each tool call is a normal API request, so every task also appears in your API call logs.

Set up in three steps

1. Get an API key

Create a key in the dashboard. Use a separate key for agents so their tasks are easy to tell apart in the logs. → Open API keys

2. Add the server to your client

Pick your client and paste the config, replacing YOUR_API_KEY with your key.

Bash
claude mcp add --transport http magi2 https://magi2.studio/mcp --header "Authorization: Bearer YOUR_API_KEY"
Connect MAGI-2 to Claude Code
# Register the MAGI-2 server with your API key
$ claude mcp add --transport http magi2 https://magi2.studio/mcp --header "Authorization: Bearer YOUR_API_KEY"
Added HTTP MCP server magi2 with URL: https://magi2.studio/mcp to local config
# Check that the connection works
$ claude mcp list
magi2: https://magi2.studio/mcp (HTTP) - ✓ Connected
0:08 / 0:08

3. Ask for a video

Restart the client if needed, then try a request like this:

"Use MAGI-2 to make a 6-second 9:16 clip of a barista pouring latte art in slow motion, with café ambience, and give me the video link when it is done."

Tools

magi2_generate_video

Creates a video task and returns its task_id and the credits charged. The video is not in this response: the agent polls magi2_get_task.

ArgumentJSON
  • promptstringOptional

    Shot description: subject, action, camera, style and sound. Up to 15,000 characters. Optional only with first_frame_url.

  • durationintegerOptional

    Whole seconds, 4–30. Defaults to 5.

  • aspect_ratiostringOptional

    16:9, 9:16, 1:1, 4:3, 3:4 or 21:9. Ignored with first_frame_url. Defaults to 16:9.

  • generate_audiobooleanOptional

    Synchronized audio on or off. Defaults to true.

  • first_frame_urlstringOptional

    Public image URL used as the first frame.

  • last_frame_urlstringOptional

    Public image URL used as the last frame; needs first_frame_url.

  • image_urlsstring[]Optional

    Up to 10 public reference image URLs.

  • video_urlsstring[]Optional

    Up to 5 public reference video URLs.

  • audio_urlsstring[]Optional

    Up to 5 public reference audio URLs.

  • seedintegerOptional

    Optional integer seed for more repeatable results.

magi2_get_task

Returns IN_PROGRESS, SUCCESS (with the MP4 URL) or FAILED (with the reason; credits refunded).

ArgumentJSON
  • task_idstringRequired

    The task_id returned by magi2_generate_video.

magi2_list_tasks

Lists recent tasks for this API key with status, credits and video URLs, so an agent can find a task it lost track of.

ArgumentJSON
  • pageintegerOptional

    Page number. Defaults to 1.

  • limitintegerOptional

    Tasks per page, 1–100. Defaults to 10.

How a request runs

  1. The agent calls magi2_generate_video once. Credits are charged and a task_id comes back within seconds.
  2. The agent calls magi2_get_task every 20–30 seconds. Most clips are ready within a few minutes.
  3. On SUCCESS the agent returns the MP4 link; on FAILED it reports the reason and the credits are refunded automatically.

Pricing

Same as the REST API: 18 credits per second of 1080p output in every mode. A 5-second clip is 90 credits and a 10-second clip is 180 credits.

Limits and good practice

  • Inputs must be public http(s) URLs; agents cannot attach local files directly.
  • Every magi2_generate_video call is billed. Tell your agent not to resubmit while a task is still IN_PROGRESS.
  • The server is stateless (Streamable HTTP, JSON responses). No sessions or server-sent events are needed.

FAQ

Which clients are supported?

Any MCP client that supports remote HTTP servers with custom headers, including Claude Code, Cursor, VS Code, Codex and Windsurf. Claude Desktop works through mcp-remote.

Is the MCP server free?

Connecting and listing tools is free. Generating videos uses credits from the same balance as the API and the studio.

Can I send the key in a different header?

Yes. Authorization: Bearer YOUR_API_KEY is preferred, and an x-api-key header is also accepted.

Where can I see what my agent generated?

In the API call logs in your dashboard. Pick the key the agent uses to see every request, status, cost and video.

MAGI-2 is a video model published by Sand.ai. Magi2 Studio is an independent service that runs it through a third-party API provider; it is not operated by, affiliated with or endorsed by Sand.ai.