Back
Guides & Reviews

MAGI 2 MCP & API Guide: Generate Videos in Claude and Cursor

Updated Dec 1, 20264 min read

Summary

With the hosted MAGI 2 MCP server at https://magi2ai.video/api/mcp, you can generate 4–30 second 1080p videos with native audio directly inside Claude, Cursor, Claude Code, or Codex using one prepaid m2k_ API key. Generations use the exact same 6 credits/second rate as the website with zero API markup, and every finished clip syncs automatically to My Videos.

TL;DR

  • Connecting Claude Desktop: Open the custom connector flow on our /mcp page and paste your Authorization: Bearer m2k_... header under Advanced settings.
  • Connecting Cursor or Claude Code: Add https://magi2ai.video/api/mcp with a Bearer token in ~/.cursor/mcp.json or run claude mcp add from your terminal.
  • Calling from scripts or CI: Use the same m2k_ API key against the REST endpoints to submit, poll every 15 seconds, and download finished 1080p MP4s.
  • Cost and safety guardrails: Prepaid credits only (6 credits/second, max 6 submissions/min, max 3 rendering at once, up to 5 active keys) so a leaked key cannot trigger an unbounded bill.
On this page
  1. Prerequisites before connecting
  2. Configure MAGI 2 MCP in Cursor, Claude and Codex
  3. The seven tools exposed to your agent
  4. Your first prompt in Claude or Cursor
  5. Pricing, rate limits and refund rules
  6. MAGI 2 MCP vs the REST API
  7. Frequently asked questions
Studio dark close-up of matte wireless headphones under warm rim lighting

If you already write scripts, storyboards, or product copy inside Claude or Cursor, switching tabs to paste prompts into a web studio slows everything down. The hosted MAGI 2 MCP server at https://magi2ai.video/api/mcp connects your AI coding or chat agent directly to Sand.ai's MAGI 2 (officially written MAGI-2) on Magi2AI so it can estimate cost, import public reference images, submit 4–30 second 1080p videos with native audio, and poll until the MP4 is ready.

Every endpoint, tool name, rate limit, and credit price below matches our live setup on magi2ai.video/mcp as of December 1, 2026.

Prerequisites before connecting

Setup takes two minutes and does not require a recurring subscription just to create a key:

  1. Create an API key. Open Account → API keys and generate a key. Keys start with m2k_ and are shown only once, so save yours immediately in a password manager or environment variable.
  2. Hold enough prepaid credits. Every MAGI 2 API generation costs the same 6 credits per second as the website (a 4-second clip is 24 credits; a 10-second clip is 60 credits). Check balances or top up on the pricing page.

Because Magi2AI is strictly prepaid, a leaked key can never run up an unbounded invoice—and you can revoke any key instantly from /account#api-keys.

Configure MAGI 2 MCP in Cursor, Claude and Codex

You can copy interactive configs on the MAGI 2 MCP setup page, or paste the exact snippets below.

Cursor (~/.cursor/mcp.json or .cursor/mcp.json)

JSON
{
  "mcpServers": {
    "magi2": {
      "url": "https://magi2ai.video/api/mcp",
      "headers": {
        "Authorization": "Bearer m2k_YOUR_API_KEY"
      }
    }
  }
}

Claude Code (terminal)

BASH
claude mcp add --transport http magi2 https://magi2ai.video/api/mcp \
  --header "Authorization: Bearer m2k_YOUR_API_KEY"

Claude Desktop / Web Custom Connector

Open magi2ai.video/mcp, click Add to Claude to open the pre-filled connector form for https://magi2ai.video/api/mcp, and add Authorization: Bearer m2k_YOUR_API_KEY under Advanced settings.

Codex (~/.codex/config.toml)

TOML
[mcp_servers.magi2]
url = "https://magi2ai.video/api/mcp"
bearer_token_env_var = "MAGI2_API_KEY"

Export MAGI2_API_KEY=m2k_YOUR_API_KEY in your shell before launching Codex. OAuth-only connectors without custom Bearer headers (such as ChatGPT connectors) are not supported yet.

The seven tools exposed to your agent

Once connected, your agent discovers seven tools automatically—you never have to type raw tool names in chat:

Tool NameWhat Your Agent Uses It For
magi2_account_statusReads account email, tier, credit balance, per-second rate, and active limits
magi2_get_modelReturns live MAGI 2 specs (4–30s, 1080p, 6 aspect ratios, audio, 3 input modes)
magi2_estimate_costComputes exact credits for a target length and compares against your balance
magi2_upload_imageImports a public https:// image URL for first/last frame or reference mode
magi2_generate_videoSubmits a MAGI 2 job with idempotent request IDs so retries never double-charge
magi2_get_generationPolls render stage and returns the final download URL when finished
magi2_list_generationsLists recent jobs so your agent can recover after a chat disconnect or timeout

Every finished MAGI 2 clip also appears inside My Videos on the website, so you can review or download outputs from either interface.

Your first prompt in Claude or Cursor

Ask your agent in plain English—or pair it with our MAGI 2 Prompt Guide so the agent compiles positive-state shot beats before calling magi2_generate_video:

Prompt template
Check my Magi2AI balance and estimate a 10-second 16:9 MAGI 2 video first. If I have enough credits, generate a documentary medium shot of a rain-washed coastal lighthouse at dusk with warm rotating beacon light, crashing ocean surf, and steady wind ambience, holding a clean wide silhouette for the final second.

Your agent checks magi2_estimate_cost (60 credits for 10 seconds), submits the job, and polls until completion—typically 3 to 10 minutes.

Pricing, rate limits and refund rules

Verified December 1, 2026, the MAGI 2 MCP server and companion REST API share one transparent rule set:

  • Cost: 6 credits per second at 1080p with native audio (zero separate API markup; reference images and reference videos add zero extra seconds).
  • Rate limit: Up to 6 submissions per minute across all your keys.
  • Concurrency: Up to 3 videos rendering simultaneously per account.
  • Keys: Up to 5 active m2k_ keys per account, each showing its last-used timestamp on /account#api-keys.
  • Moderation & refunds: Prompts are moderated before submission; rejected, failed, or timed-out jobs are not charged (or refund automatically).

MAGI 2 MCP vs the REST API

Use MAGI 2 MCP when an AI assistant (Claude, Cursor, Claude Code, Codex) is drafting prompts, checking balances, and pulling finished clips into a creative or coding session. Use the REST API (curl, Python, and Node examples live on /mcp) when a deterministic backend script or scheduled job needs to submit renders, poll every 15 seconds, and store MP4 files without an LLM in the loop. Both share the same m2k_ key, credits, and /create#my-videos history.

Share this guideFound it useful? Pass it along.

Frequently asked questions

What is the MAGI 2 MCP server URL?
The remote endpoint is https://magi2ai.video/api/mcp. Authenticate requests with an Authorization: Bearer m2k_... header generated from your Magi2AI account page.
Which clients work out of the box?
Any MCP client that supports remote HTTP servers with custom Bearer headers—including Claude custom connectors, Cursor (~/.cursor/mcp.json), Claude Code, and Codex (~/.codex/config.toml)—works immediately.
Does generating MAGI 2 videos through MCP or the REST API cost more?
No. Verified December 1, 2026: MAGI 2 MCP and REST API generations cost the exact same 6 credits per second as Magi2AI Studio, with no extra API fee. Failed or timed-out jobs are refunded automatically.
Which tools does the MAGI 2 MCP server expose?
Seven tools: magi2_account_status, magi2_get_model, magi2_estimate_cost, magi2_upload_image, magi2_generate_video, magi2_get_generation, and magi2_list_generations.
What are the rate limits and key caps?
Each account can hold up to 5 active m2k_ keys, submit up to 6 generations per minute across all keys, and run up to 3 videos rendering concurrently. All usage is strictly prepaid.
Can I connect ChatGPT or OAuth-only clients?
Not yet. The server authenticates via Bearer API keys only, so clients requiring OAuth-only connectors without custom Authorization headers are not supported yet.

Sources

  1. Magi2AI: Magi2AI MCP Server & REST API Setup Page
  2. Model Context Protocol: Model Context Protocol Specification
  3. Sand.ai: MAGI-2: A 480B Frontier Video Generation Model
  4. Sand.ai on GitHub: MAGI-2-preview Official Prompt Rules (Apache-2.0)

What changed on this page

  • First published covering the seven MCP tools, Claude/Cursor/Claude Code/Codex configs, rate limits, and 6 credits/second prepaid billing verified on December 1, 2026.

Discover more

View all