Verified October 24, 2026 with PraisonAI 1.7.15, MCP 1.30.0, and httpx 0.28.1:
48 discovered tools, authenticated account retrieval, one accepted image creation,
same-ID project retrieval, and download produced a usable 640×640 PNG. Full image
decode passed. Commands exited successfully, including connection cleanup. This
verification used native framework tools without a language model.
Install and configure
Requires Python 3.10 or newer. Copy magic_hour.py and requirements.txt into an empty directory:MAGIC_HOUR_API_KEY. The authenticated endpoint is fixed to
https://mcp.magichour.ai/. Credentials, account fields, prompts, and signed download
URLs are not printed.
Create once
Creation sends your prompt to Magic Hour and spends credits. This command requests one square 640px Flux 2 Klein image, starting at 5 credits:saved: false; keep it for recovery.
Retrieve and download the same project
Use the accepted ID from the command output or state file:complete. If it is still rendering, run the same download command later.
Recovery never creates a replacement job, and an existing output file is not overwritten.
The media download uses the exact returned HTTPS URL with a separate HTTP client,
no API credentials, and no redirects. Signed URLs remain private.
Native framework behavior
The recipe uses the framework’sHTTPStreamMCPClient and invokes its native
HTTPStreamMCPTool callables directly. The client receives the Bearer header through
its supported transport options. Each callable executes one tool call; the recipe
adds no creation retries. PraisonAI telemetry is disabled before import.
This standalone process owns the SDK’s event loop and worker thread. Exit cleanup
awaits the client’s close operation, cancels remaining work on that owned loop,
stops and joins the thread, and closes the loop, including after failed requests.
The example uses direct tool execution rather than a model-backed agent. It does not
demonstrate model planning or paid model inference. For a model-backed workflow, expose
only the tools it needs and require explicit approval for paid creation.
See the pinned framework source and
Magic Hour privacy policy.