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

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:
- 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. - 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)
{
"mcpServers": {
"magi2": {
"url": "https://magi2ai.video/api/mcp",
"headers": {
"Authorization": "Bearer m2k_YOUR_API_KEY"
}
}
}
}
Claude Code (terminal)
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)
[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 Name | What Your Agent Uses It For |
|---|---|
magi2_account_status | Reads account email, tier, credit balance, per-second rate, and active limits |
magi2_get_model | Returns live MAGI 2 specs (4–30s, 1080p, 6 aspect ratios, audio, 3 input modes) |
magi2_estimate_cost | Computes exact credits for a target length and compares against your balance |
magi2_upload_image | Imports a public https:// image URL for first/last frame or reference mode |
magi2_generate_video | Submits a MAGI 2 job with idempotent request IDs so retries never double-charge |
magi2_get_generation | Polls render stage and returns the final download URL when finished |
magi2_list_generations | Lists 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:
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.
Frequently asked questions
What is the MAGI 2 MCP server URL?
Which clients work out of the box?
Does generating MAGI 2 videos through MCP or the REST API cost more?
Which tools does the MAGI 2 MCP server expose?
What are the rate limits and key caps?
Can I connect ChatGPT or OAuth-only clients?
Sources
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.



