magic-hour-mcp
MCP Server for Magic Hour's API
Documentation
Magic Hour MCP Server
OpenAPI-backed MCP server for Magic Hour image, video, and audio generation.
At startup, this server reads `docs/openapi.json` and builds MCP tools with
`FastMCP.from_openapi()`. The OpenAPI spec supplies endpoint coverage, while
Magic Hour MCP policies add agent-facing guidance for async polling, uploads,
and project downloads.
Docs:
- `user.md` - hosted endpoint user guide
- `integration-handoff.md` - FastAPI mount checklist
- `docs/detailed-step-by-step-integration.md` - full backend integration guide
- `docs/api-reference.md` - generated API reference
Setup
pip install -e .Run locally
python main.pyLocal MCP endpoint:
http://127.0.0.1:8000/This local dev server runs at `/`, not `/mcp`. The host app adds `/mcp` when it mounts the server.
By default, requests go to the production Magic Hour API:
https://api.magichour.aiTool discovery is public. Tool calls must include your Magic Hour API key:
Authorization: BearerAgents can discover the hosted server card at:
https://mcp.magichour.ai/.well-known/mcp/server-card.jsonEnvironment variables:
MAGIC_HOUR_API_BASE_URL=https://api.magichour.ai
MAGIC_HOUR_OPENAPI_PATH=docs/openapi.json
MCP_OAUTH_ISSUER_URL=https://mcp.magichour.ai
MCP_OAUTH_RESOURCE_URL=https://mcp.magichour.aiOverride `MAGIC_HOUR_API_BASE_URL` to use a mock or another API base:
MAGIC_HOUR_API_BASE_URL=https://api.sideko.dev/v1/mock/magichour/magic-hour/latest python main.pyOAuth compatibility
The optional OAuth shim validates a Magic Hour API key and uses that key as the
access token. Production requires `MCP_OAUTH_ISSUER_URL` and
`MCP_OAUTH_RESOURCE_URL`. See `docs/future-oauth-support.md` for deployment
limits.
Public OAuth clients can use the stateless `POST /register` compatibility endpoint.
Test with MCP Inspector
1. Start the server.
2. Run:
npx @modelcontextprotocol/inspector3. In Inspector:
4. Call `ping`.
5. Call `video_assets_generate_presigned_url` or another generated tool.
Notes:
- FastMCP generates endpoint tools from OpenAPI at startup.
- Creation tools return `id` and `credits_charged` immediately.
- OpenAPI `operationId` values are normalized to descriptive snake_case tool names.
- The shared `/v1/files/upload-urls` endpoint is named `video_assets_generate_presigned_url`. It accepts `video`, `audio`, and `image` items.
- Use `wait_for_*_project` to poll jobs. Use `exact_download_urls` exactly as
returned; never append expiration metadata.
- Image and audio wait tools also return inline media when supported.
Rebuild and type-check the MCP App UI with `cd web && npm ci && npm run build`.
File uploads
Magic Hour does not accept raw file bytes inside tool arguments. The flow is:
1. Call the generated shared upload-URL tool, `video_assets_generate_presigned_url`
2. Upload the file bytes to the returned `upload_url`
3. Pass the returned `file_path` into the generated creation tool
Direct public media URLs may work, but uploaded `file_path` values are more
reliable. `upload_file_to_presigned_url` handles local files when the server can
read them. Browser chat needs a separate upload UI or bridge; see
`docs/future-chat-ui-handoff.md`.
Frequently asked questions
What is magic-hour-mcp?
magic-hour-mcp is MCP Server for Magic Hour's API
How do I install magic-hour-mcp?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is magic-hour-mcp open source?
Yes — it is hosted on GitHub at https://github.com/magichourhq/magic-hour-mcp and has 2 stars.
Related MCP tools
An LLM agent that conducts deep research (local and web) on any given topic and generates a long report with citations. Built for the Model Context Protocol to
Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth! Python-based implementation. Trusted by 11000+ developers.
AWS MCP Servers — helping you get the most out of AWS, wherever you use MCP. Python-based implementation. Trusted by 6900+ developers.
AI-powered reverse engineering assistant that bridges IDA Pro with language models through MCP. Python-based implementation. Trusted by 4100+ developers.
A simple, secure MCP-to-OpenAPI proxy server Python-based implementation. Trusted by 3500+ developers. Trusted by 3500+ developers.
An MCP server that autonomously evaluates web applications. Python-based implementation. Trusted by 1100+ developers. Trusted by 1100+ developers.
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP