AI image + video generation for agents: --flag prompt DSL, async generate/poll, x402 pay-per-use.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
One-click editor setup isnβt available for this listing yet β we donβt have a confirmed install command, and weβd rather show nothing than point your editor at the wrong package or host. Follow the projectβs own setup instructions, linked above.
Model Context Protocol server for Maginary β an abstracted OpenRouter for images and video: ~20 model families (GPT-image-2, Seedance 2, Sora 2, Nano Banana Pro, Fluxβ¦) behind one Midjourney-style --flag prompt. 16 tools: full flag catalog, generate / upscale / vary / animate, in-chat signup, billing, and x402 pay-per-use for agents with a wallet.
Maginary uses a Midjourney-style --flag prompt DSL over an async HTTP API. This server:
generate tool that hits POST /api/gens/get_generation + wait_for_generation for polling to a terminal stateThis is an MCP server β you don't run it directly; your AI client (Claude Desktop, Cursor, etc.) launches and talks to it behind the scenes. Just add one config block and start chatting.
In Claude Desktop: settings β developer β edit config. That opens claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\). Add:
Restart Claude Desktop. Ask it to generate an image β it will see Maginary's tools automatically.
No account yet? No problem β Claude will walk you through signup (just give it your email). Already have an API key? Add it to skip that step:
Requires Python 3.10+ and uv. Alternatively: pip install maginary-mcp.
Nothing is required. For the stdio server you'll at most set one variable:
| var | default | meaning |
|---|---|---|
MAGINARY_API_KEY | β | Bearer token from app.maginary.ai/dashboard#api-keys. Skips the in-chat signup flow. Catalog tools work without it. |
MAGINARY_BASE_URL | https://app.maginary.ai/api | Override for staging or self-hosted. |
MAGINARY_MCP_LOG_LEVEL | INFO | Standard Python log level; goes to stderr (stdout is reserved for MCP JSON-RPC). |
The rest only apply when you run the hosted server yourself (maginary-mcp-http, see below). Directory pages that scan the code list them too; ignore them for local use.
| var (hosted only) | default | meaning |
|---|---|---|
MAGINARY_MCP_HOST / MAGINARY_MCP_PORT | 0.0.0.0 / 8642 | Bind address of the HTTP server. |
MAGINARY_PUBLIC_HOST | app.maginary.ai | Sent to the backend as X-Forwarded-Host (with -Proto/-For) when MAGINARY_BASE_URL is an internal address, so the backend builds public URLs. |
MAGINARY_MCP_REQUIRE_AUTH | off | On: every /mcp call needs a Bearer (OAuth token or API key); without one the server answers 401 + WWW-Authenticate pointing at /.well-known/oauth-protected-resource, which is how Claude/ChatGPT start the login. Trade-off: a wallet-only agent has no Bearer to send, so with the gate on it must make its first x402 payment over plain HTTP (POST /api/gens/) and then connect with a key from POST /api/auth/wallet-account/; the 401 body says so. |
MAGINARY_OAUTH_ISSUER | https://app.maginary.ai/o | The authorization server named in the protected-resource metadata (the backend, django-oauth-toolkit). |
MAGINARY_MCP_RESOURCE_URL | https://mcp.maginary.ai/mcp | This server's canonical resource identifier (RFC 8707 audience). Also what /.well-known/mcp/server-card.json advertises. |
Connect a client straight to the hosted server at https://mcp.maginary.ai/mcp.
Zero install β the server is multi-tenant, so each request is scoped to
whatever credential it arrives with. Two ways to authenticate, pick whichever
fits the client:
Connect (OAuth) β for Claude Desktop, claude.ai, and any other client that speaks MCP's OAuth spec. Add the server with no headers at all:
Click "Connect" in the client. It opens a login page on app.maginary.ai,
you sign in and approve the requested scopes, and the client holds the token
from then on β no key to generate or paste. Requires the server to be running
with MAGINARY_MCP_REQUIRE_AUTH=1; without it, no login is asked for at all.
API key β for any client that doesn't do the OAuth dance (or if you'd rather not click through a login), generate a key at app.maginary.ai/dashboard#api-keys and send it yourself:
Both are equivalent once connected β same tools, same account. Catalog tools
work with no credential either way; generate / get_generation /
wait_for_generation need one. Run the hosted server yourself with:
No key at all? Call generate anyway. Out of credits (or no account), the
result is isError: true with the x402 PaymentRequired at the top level
(accepts, resource, β¦) plus error: "payment_required". An x402-capable
MCP client β the x402 SDK's x402MCPSession β signs accepts[0] and calls
the same tool again with the payment in _meta["x402/payment"]. The server
forwards it to the backend as PAYMENT-SIGNATURE; the backend verifies,
settles on Base and, for a wallet with no account, creates one. The settled
result carries the on-chain receipt in _meta["x402/payment-response"] and
x402_receipt. No API key is returned β subsequent requests use wallet-signed
auth headers (X-Wallet-Address, X-Wallet-Signature, X-Wallet-Timestamp)
instead.
The server holds no payment logic; everything is decided by the backend's
/api/gens/ contract.
After the first x402 payment creates the wallet's account, all subsequent requests are authenticated by signing a short message with the wallet's private key. Three headers on every request:
| Header | Value |
|---|---|
X-Wallet-Address | Lowercased 0x EVM address (42 chars) |
X-Wallet-Signature | EIP-191 personal_sign hex over the challenge string |
X-Wallet-Timestamp | Unix seconds (integer) |
The challenge string is:
with <address> lowercased and <timestamp> the same unix seconds sent in
the header. The timestamp must be within 5 minutes of the server's clock
(30 s of future skew tolerated). No API key management needed β the wallet
is the credential.
The hosted server sets no MAGINARY_API_KEY (keys come per-request). It also
serves /health, a human page at GET /, the OAuth protected-resource metadata
and an MCP server card at /.well-known/mcp/server-card.json (live tool list,
auth posture) for directories that scan a bare URL.
The server ships an Agent Skill that
teaches the --flag DSL, model selection, and the async generateβpoll flow:
The skill stands on its own β hosts without MCP get the DSL plus the raw REST
calls (POST /gens/ β poll). With the server connected, Claude instead calls
search_parameters for the authoritative flag list and generate/wait_for_generation
natively. Re-running updates it; local edits are protected unless you pass --force.
Source: src/maginary_mcp/SKILL.md.
list_parameters(category?, status?, include_reserved=false) β enumerate the catalogsearch_parameters(query, category?, include_reserved=false) β text search over names / aliases / desc / examplesget_parameter(name) β full record for one flag (canonical name or alias)list_parameters responses include the categories / statuses taxonomy, and both
list/search responses carry source (live vs bundled-snapshot).
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/maginary-mcp)<a href="https://allmcps.com/mcp/maginary-mcp"><img src="https://allmcps.com/api/badge/maginary-mcp?style=directory" alt="Maginary MCP on AllMCPs" /></a>