MCP Server
Connect Claude Code, Claude, or Codex to MachGen and generate from your editor.
MachGen runs a remote MCP server, so an AI assistant can generate images and video, edit past generations, and browse your history directly - no copying prompts between windows.
https://mcp.machgen.aihttps://mcp.machgen.ai/mcp works too, if your client wants an explicit path.
Authenticate with the same API key the REST API uses. Create one under
Settings -> API keys; it looks like MGA_<key_id>:<secret>.
Claude Code
claude mcp add --transport http machgen https://mcp.machgen.ai \
--header "Authorization: Bearer MGA_<key_id>:<secret>"Run /mcp inside Claude Code to confirm the server shows as connected. The
command saves the configuration without checking the credential, so a bad key
shows up as failed here rather than at setup time.
Codex CLI
Add to ~/.codex/config.toml:
[mcp_servers.machgen]
url = "https://mcp.machgen.ai"
bearer_token_env_var = "MACHGEN_API_KEY"Then export the key: export MACHGEN_API_KEY="MGA_<key_id>:<secret>".
What you can ask for
Once connected, ask in plain language - the assistant picks the tools:
- "What video models can do 1080p at 16:9, and what would 5 seconds cost?"
- "Generate a product shot of a ceramic mug on a linen backdrop."
- "Make that warmer and move the mug left."
- "Animate it for 5 seconds with a slow push-in."
- "Give me a link I can send to the team."
How generation works
Generation is asynchronous. The generate tools return a task_id right away and
the assistant polls get_task until it finishes - images in seconds, video
usually in minutes. You will see it check back a few times; that is expected.
When an image completes it comes back inline, so the assistant can actually see the result and iterate on it rather than describing it blind.
Tools
| Tool | What it does |
|---|---|
list_models | Available models with their exact sizes, aspect ratios and durations |
get_price | What a generation would cost on your account, before you run it |
generate_image | Text-to-image, or image-to-image with sources |
generate_video | Text-, image-, reference-, or video-to-video |
edit_image | Edit a previous generation by task id |
get_task | Poll a task; returns the image inline when done |
get_task_params | The exact settings a past task used, to re-run with one change |
list_history | Your past generations |
get_asset | A finished asset's URL, size, and bytes |
create_asset_link | A shareable link that works without signing in |
Asset links
Every finished generation has a stable URL:
https://www.machgen.ai/api/v0/assets/<task_id>That URL requires your credentials, so it opens in your signed-in browser but
not for anyone else. To share a result, ask for a link - create_asset_link
mints a time-limited URL (24 hours by default, up to 7 days) that works without
signing in. It grants read access to that one asset and nothing else, so it is
safe to paste into a message; your API key never leaves your machine.
Rate limits
MCP calls draw on the same per-user budget as the REST API, so heavy tool use and heavy API use share one allowance.