Magic Hour

io.github.magichourhq由 GitHub 帳號 magichourhq 發布v0.1.1更新於 Nov 4, 2026

Create and edit images and video, generate music, and retrieve existing audio projects.

已驗證Streamable HTTP可網頁執行媒體與設計AI 與機器學習

概覽

AI 產生的概覽

託管版 Magic Hour 伺服器,讓助理用 Magic Hour 額度生成與編輯圖片、影片,製作音樂,並取得已完成的媒體檔案。

可以做什麼
  • 生成與編輯圖片:文生圖、提示詞改圖、放大、大頭照、迷因、換裝與人臉編輯
  • 建立與轉換影片:文生影片、圖生影片、音訊生影片、風格化、放大、翻譯、字幕、對嘴、說話照片、換臉
  • 上傳本機媒體並輪詢任務:預簽章上傳網址、等待工具、內嵌圖片/音訊/影片下載
  • 檢視帳戶與可重用素材:額度餘額與訂閱、已儲存的角色、聲音和品牌套件
  • 讀取工作流程指南,並在指定人臉換臉前進行人臉偵測
適用情境
適合讓助理透過 Magic Hour 製作或編輯行銷圖片、短影片、說話人像或音樂,並輪詢、取回成品檔案。適用於已有 Magic Hour 帳戶、且接受每次生成消耗額度的使用者。
執行需求
遠端 streamable HTTP 端點 mcp.magichour.ai,無需本機安裝。工具呼叫需要驗證:託管 Claude 與 ChatGPT 連接器透過 Magic Hour 網頁應用 OAuth 登入,手動用戶端需在 Authorization Bearer 標頭提供 Magic Hour API 金鑰。生成需要帳戶中有額度。
安裝前請注意
生成會消耗帳戶額度,已完成但不滿意的結果不會自動退還額度,建立前應確認費用與方案權限。刪除工具會不可回復地移除專案與輸出。換臉、對嘴、說話照片和換裝只能用於本人肖像或已獲授權的內容。上傳的媒體和提示詞會傳送到 Magic Hour 的 API,簽章下載網址須按原樣保留。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Magic Hour,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.magichourhq%2Fmagic-hour/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "magic-hour": {
      "type": "http",
      "url": "https://mcp.magichour.ai/"
    }
  }
}

README

Magic Hour MCP Server

OpenAPI-backed MCP server for Magic Hour image and video generation and editing, music generation, uploads, completion waiting and retrieval of existing audio projects.

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.

Connect an agent

Hosted creation endpoint: https://mcp.magichour.ai/

Follow the client setup guide for Claude, Claude Code, Codex CLI or ChatGPT. After connecting, call get_account_info to verify API access and inspect the account before generation; ping alone does not validate the API key.

Try: “Use my portrait to create a cinematic space-pilot still, then animate it with a slow camera push. Keep my face consistent, wait for the render and show the finished video. Check account eligibility and cost before spending credits.”

Use get_workflow_guide for the ordered tool steps and output review. After a tool-name update, refresh the client’s cached tool catalog or reconnect. Use the names returned by tools/list; dated example receipts keep their original IDs. For documentation search while coding, use the separate API Docs MCP.

Docs:

  • Magic Hour agent skills - media workflows, published examples, and recovery guidance
  • 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

Evaluate a paid workflow

Use the workload evaluation guide to compare a finished image or video job, including its inputs, model, settings, output and cost. Check the current model limits and billing options: the dollar cost of consumed credits and the cash needed to fund an account are different. For example, Creator annual costs $144 paid upfront for 144,000 credits, enough for 600 five-second Kling 3.0 videos at 720p with audio off ($0.24 each at full credit use, before tax). Audio, higher resolutions and video-reference inputs cost more credits.

The account read verifies API authorization and returns account information; it is not a request-specific price or eligibility quote. The current MCP tool contract has no such quote operation. A workflow guide does not validate the requested model, source media or plan access. Resolve unclear costs or access before creating a paid project.

For inspectable video examples, the published image-to-video benchmark provides source images, requests, all attempts and downloadable results. It compares models through Magic Hour and does not establish a provider-quality winner or human acceptance of the clips.

Credits and data

MCP generations use Magic Hour account credits. You can buy a one-time credit pack without a subscription; unused credits never expire. Packs include applicable watermark-free exports and commercial use, subject to the Terms and rights in your source content. They do not unlock subscription-only model or resolution access.

Technical failures generally return credits after processing; completed but unsatisfactory results do not automatically return credits. A wait timeout is not proof of project failure—resume with the existing project ID. Payment refunds follow the separate refund policy.

Trust & Data Use explains Magic Hour's no-training policy for customer prompts, uploads and outputs, and feature-dependent retention.

Setup

sh
pip install -e .

Run locally

sh
python main.py

Local MCP endpoint:

text
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:

text
https://api.magichour.ai

Tool discovery is public. Tool calls require authentication. Hosted Claude and ChatGPT OAuth connectors handle the token after you sign in and authorize access. For manual bearer clients, include your Magic Hour API key:

text
Authorization: Bearer <magic_hour_api_key>

Agents can discover the hosted server card at:

text
https://mcp.magichour.ai/.well-known/mcp/server-card.json

Environment variables:

sh
MAGIC_HOUR_API_BASE_URL=https://api.magichour.aiMAGIC_HOUR_OPENAPI_PATH=docs/openapi.jsonMCP_OAUTH_ISSUER_URL=https://mcp.magichour.aiMCP_OAUTH_RESOURCE_URL=https://mcp.magichour.ai

Override MAGIC_HOUR_API_BASE_URL to use a mock or another API base:

sh
MAGIC_HOUR_API_BASE_URL=https://api.sideko.dev/v1/mock/magichour/magic-hour/latest python main.py

Read-only workflow guidance

get_workflow_guide accepts video-face-swap, image-editor, image-to-video, video-generator, lip-sync, ugc-ads, talking-photo or media-apis. It returns inputs, product and API documentation URLs, exact creation-tool names, ordered steps, example requests, follow-up edits and review criteria. It makes no API request, spends no credits and does not verify account access. Like other tools, it requires the existing authentication flow.

Clients can also discover the public magic-hour://workflows/index resource and read magic-hour://workflows/{workflow}. UGC uses create_spoken_ad_video with a prepared image, script and supported duration; image composition is a separate Image Editor call. Keep the returned project ID and use wait_for_video_project to retrieve the finished file.

For example, ask for image-to-video to animate an approved product photo directly, review the finished clip and reuse it for a later edit. Edit the still only when the requested appearance must change or a source problem prevents the shot. The talking-photo guide requires a portrait and an existing audio file; text alone cannot start that tool. Guides describe workflows, not prevalidated generated outputs or account eligibility.

This helps assistants that connect to this server select workflows; it does not establish a recommendation or ranking benefit in unconnected consumer assistants.

OAuth

This server is an OAuth protected resource only. The authorization server is the Magic Hour web app (https://magichour.ai): users sign in and consent there, and it returns a Magic Hour API key as the access token, which this server passes through to the API. Production requires MCP_OAUTH_ISSUER_URL and MCP_OAUTH_RESOURCE_URL. See docs/future-oauth-support.md.

Test with MCP Inspector

  1. Start the server.
  2. Run:
    sh
    npx @modelcontextprotocol/inspector
  3. In Inspector:
    • Transport: Streamable HTTP
    • URL: http://127.0.0.1:8000/
    • Header: Authorization: Bearer <magic_hour_api_key>
  4. Call ping.
  5. Call get_upload_urls 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 get_upload_urls. 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, get_upload_urls
  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 bytes from the caller or a dedicated upload bridge; the hosted MCP server never reads caller-supplied local filesystem paths. Browser chat needs a separate upload UI or bridge; see docs/future-chat-ui-handoff.md.

MCP voice presets

AI Voice Generator exposes and accepts only exact API voice_name strings in APPROVED_VOICE_NAMES in mcp_magichour/openapi_policies.py. Populate that tuple with verified approved generic/non-celebrity presets to enable the tool on the next deployment. No existing upstream voice is assumed safe. An empty allowlist omits Voice Generator from tool discovery and calls. Voice Cloner is always excluded from MCP.

The MCP policy removes upstream voice descriptions, defaults, examples and SDK snippets at startup and when regenerating docs/api-reference.md. Daily OpenAPI syncs cannot expand the allowlist. Do not edit docs/openapi.json to set MCP voices: it remains the unmodified upstream API snapshot. The main Magic Hour product and the public API are unchanged.

MCP Meme Generator exposes only the generic Random template option, keeping public-figure template names out of its schema.

來源:README.md,提交 47715fa

工具

49

get_workflow_guide

Choose a media workflow

Returns required inputs, ordered steps, example requests and review criteria for eight supported Magic Hour workflows. Use when planning a generation, not to run one. Requires authentication but does not check account eligibility or spend credits.

輸入參數workflow必填

upload_chatgpt_image

Upload attached image

Uploads a PNG, JPEG or WebP image attached in ChatGPT to the connected Magic Hour account. Use this for native ChatGPT photo attachments instead of asking the chat's file runtime to PUT bytes to get_upload_urls. Pass the returned file_path to the existing image or video generation tool. Accepts one image up to 20 MiB. Does not generate media or spend generation credits.

輸入參數image必填

ping

Ping

Checks that the Magic Hour server is reachable. Use for connectivity troubleshooting; it does not validate API credentials or account access. Makes no media or project changes.

無需輸入參數。

wait_for_video_project

Wait for Video Project

Polls a video project until it completes, errors, is canceled or times out. Use with the id returned by a video create tool. Read-only; returns download URLs when complete. After a timeout, resume with the same id rather than creating another generation. Use signed download URLs exactly as returned. Does not inline video content.

輸入參數id必填timeout_secondsmax_inline_downloadspoll_interval_secondsinclude_inline_downloads

wait_for_image_project

Wait for Image Project

Polls an image project until it completes, errors, is canceled or times out. Use with the id returned by an image create tool. Read-only; returns the project and download URLs, with optional inline image previews sharing an 8 MiB total limit. After a timeout, resume with the same id rather than creating another generation. Use signed download URLs exactly as returned.

輸入參數id必填timeout_secondsmax_inline_downloadspoll_interval_secondsmax_bytes_per_downloadinclude_inline_downloads

wait_for_audio_project

Wait for Audio Project

Polls an audio project until it completes, errors, is canceled or times out. Use with the id returned by an audio create tool. Read-only; returns the project and download URLs, with optional inline audio previews sharing an 8 MiB total limit. After a timeout, resume with the same id rather than creating another generation. Use signed download URLs exactly as returned.

輸入參數id必填timeout_secondsmax_inline_downloadspoll_interval_secondsmax_bytes_per_downloadinclude_inline_downloads

fetch_image_download

Fetch Image Download

Fetch a completed project's image as inline MCP image content for compatible clients. Use the exact signed download URL, including query parameters. Requires HTTPS at the configured Magic Hour media host. Read-only; limited to 8 MiB, or a smaller requested max_bytes. Use the signed URL directly for larger files.

輸入參數max_bytesdownload_url必填

fetch_audio_download

Fetch Audio Download

Fetch a completed project's audio as inline MCP audio content for compatible clients. Use the exact signed download URL, including query parameters. Requires HTTPS at the configured Magic Hour media host. Read-only; limited to 8 MiB, or a smaller requested max_bytes. Use the signed URL directly for larger files.

輸入參數max_bytesdownload_url必填

fetch_video_download

Fetch Video Download

Fetch a completed project's video as an embedded MCP binary resource for compatible clients. Use the exact signed download URL, including query parameters. Requires HTTPS at the configured Magic Hour media host. Read-only; limited to 8 MiB, or a smaller requested max_bytes. Use the signed URL directly for larger files.

輸入參數max_bytesdownload_url必填

get_account_info

Get account info

Returns credit balance and subscription details for the connected account. Use to inspect account information before generation. Read-only; this is not a request-specific cost quote or model-eligibility check.

無需輸入參數。

list_saved_items

List saved items

Lists the account's active saved characters, references, voice recordings, moodboards and brand kits, newest first. Reusable paths are in each item's assets[].file_path; temporary signed URLs support preview/download. Read-only; pass next_cursor as cursor for the next page.

輸入參數typelimitcursor

get_upload_urls

Get upload URLs

Creates presigned upload URL and file-path pairs for local media. Use when a generation needs a file the user has locally: upload raw bytes to the returned upload_url, then pass its file_path to the create tool. Does not upload file bytes or start a generation.

輸入參數items必填

get_face_detection_results

Get face detection results

Returns a face-detection job's status and detected faces. Use with the id from detect_faces to inspect progress and choose face mappings before a selected-face swap. Read-only; faces may populate while processing.

輸入參數id必填

detect_faces

Detect faces

Starts an asynchronous face-detection task for a supplied image or video and returns its id and charge information. Use before a selected-face swap, then retrieve its status and detected faces with get_face_detection_results. Current API documentation describes detection as free; pricing may change.

輸入參數assets必填confidence_score

get_video_project

Get video project

Returns a video project's status and, once complete, its download URLs. Use to check progress with the id from a video create tool. Read-only.

輸入參數id必填

delete_video_project

Delete video project

Deletes the video project and attempts to delete its completed output. Cannot be undone; confirm with the user first.

輸入參數id必填

create_talking_photo

Create talking photo

Use only with the user's own likeness or content they are authorized to use. Do not use for impersonation, deception, sexual content, or content involving minors. Animates a still portrait so it speaks an existing audio recording. Use with a portrait photo and an audio file; text alone is not accepted and this tool does not synthesize speech. Starts a background job that costs credits; returns a project id for wait_for_video_project.

輸入參數namestyleassets必填resolutionend_seconds必填start_seconds必填

create_spoken_ad_video

Create spoken ad video

Creates a creator-style spoken ad video from a prepared image and a text script. Use when the image is ready and the dialogue should be generated from text. Starts a background job that costs credits; returns a project id for wait_for_video_project.

輸入參數modelassets必填script必填resolutionend_seconds必填

edit_video

Edit video

Edits the appearance or content of a supplied video segment using a text prompt. Use with a source video, the requested changes and the clip end time. Starts a background job that costs credits; returns a project id for wait_for_video_project.

輸入參數namemodelstyle必填assets必填resolutionend_seconds必填start_seconds

translate_video

Translate video

Translates speech in a supplied video segment into a supported target language. Starts a background job that costs credits; returns a project id for wait_for_video_project.

輸入參數nameassets必填resolutionend_seconds必填start_secondstarget_language必填

upscale_video

Upscale video

Upscales a supplied video segment to a selected output resolution while preserving its aspect ratio. Starts a background job that costs credits; returns a project id for wait_for_video_project.

輸入參數nameassets必填resolution必填end_seconds必填start_seconds

create_animation

Create animation

Creates a stylized animated video with art and camera settings, using a custom prompt or an audio-derived prompt mode. Can use an initial image and audio. Credits depend on frame rate and duration; returns a project id for wait_for_video_project.

輸入參數fps必填namestyle必填width必填assets必填height必填end_seconds必填

create_video_from_audio

Create video from audio

Generates an audio-guided video from a supplied audio track, with an optional starting image and visual prompt. Starts a background job that costs credits; returns a project id for wait_for_video_project.

輸入參數namestyleassets必填resolutionend_seconds必填start_seconds

add_subtitles_to_video

Add subtitles to video

Adds automatically generated subtitles to a supplied video segment using a subtitle preset or custom text styling. Starts a background job that costs credits; returns a project id for wait_for_video_project.

輸入參數namestyle必填assets必填end_seconds必填start_seconds必填

replace_character_in_video

Replace character in video

Use only with the user's own likeness or content they are authorized to use. Do not use for impersonation, deception, sexual content, or content involving minors. Replaces a subject in a video with a character from a reference image, or transfers the video's motion onto that character. Starts a background job that costs credits; returns a project id for wait_for_video_project.

輸入參數namemodelstyleassets必填resolutionend_seconds必填start_seconds

swap_face_in_video

Swap face in video

Use only with the user's own likeness or content they are authorized to use. Do not use for impersonation, deception, sexual content, or content involving minors. Swaps faces in an existing video: all faces with a reference image, or selected faces using detect_faces results. Starts a background job that costs credits; returns a project id for wait_for_video_project.

輸入參數namestyleassets必填end_seconds必填start_seconds必填

create_video_from_image

Create video from image

Animates a supplied image into a video using motion instructions and available model options. Starts a background job that costs credits; returns a project id for wait_for_video_project.

輸入參數nameaudiomodelstyleassets必填resolutionend_seconds必填

create_lip_sync_video

Create lip sync video

Use only with the user's own likeness or content they are authorized to use. Do not use for impersonation, deception, sexual content, or content involving minors. Adjusts an existing video's lip movements to match supplied replacement audio. For a still portrait plus audio, use create_talking_photo. Starts a background job that costs credits; returns a project id for wait_for_video_project.

輸入參數namestyleassets必填end_seconds必填max_fps_limitstart_seconds必填

create_video_from_text

Create video from text

Generates a video from a text prompt, with optional supported reference inputs and model settings. To animate an existing starting image, use create_video_from_image. Starts a background job that costs credits; returns a project id for wait_for_video_project.

輸入參數nameaudiomodelstyle必填referencesresolutionend_seconds必填aspect_ratio

restyle_video

Restyle video

Restyles an existing video clip with an art-style preset or a custom prompt. Supports v1/v2 presets, not v3. Starts a background job that costs credits; returns a project id for wait_for_video_project.

輸入參數namestyle必填assets必填end_seconds必填start_seconds必填fps_resolution

get_image_project

Get image project

Returns an image project's status and, once complete, its download URLs. Use to check progress with the id from an image create tool. Read-only.

輸入參數id必填

delete_image_project

Delete image project

Deletes the image project and attempts to delete its completed output. Cannot be undone; confirm with the user first.

輸入參數id必填

change_clothes_in_photo

Change clothes in photo

Use only with the user's own likeness or content they are authorized to use. Do not use for impersonation, deception, sexual content, or content involving minors. Changes clothing in a person photo using a supplied garment reference image. Costs 25 credits. Starts a background job; returns a project id for wait_for_image_project.

輸入參數nameassets必填

edit_face_in_photo

Edit face in photo

Adjusts facial expression, pose and gaze in a supplied photo using numeric controls. Costs 1 credit per edit; output size depends on the subscription tier. Starts a background job; returns a project id for wait_for_image_project.

輸入參數namestyle必填assets必填

create_gif_or_short_video

Create GIF or short video

Generates a short animation from a text prompt, with GIF, MP4 or WebM output. Costs 50 credits. Starts a background job; returns a project id for wait_for_image_project.

輸入參數namestyle必填output_format

edit_image

Edit image

Edits one or more supplied images using a text prompt. For prompt-only creation use generate_image. Costs credits; returns a project id for wait_for_image_project. Model eligibility depends on the account plan; the default model is not available on every plan.

輸入參數namemodelstyle必填assets必填resolutionimage_countaspect_ratio

generate_headshot

Generate headshot

Creates a headshot from a supplied photo containing one detectable face, with optional appearance instructions. Costs 50 credits. Starts a background job; returns a project id for wait_for_image_project.

輸入參數namestyleassets必填

generate_image

Generate image

Generates one or more images from a text prompt, with model, output size and image count options. Costs credits; returns a project id for wait_for_image_project.

輸入參數namemodelstyle必填resolutionimage_count必填aspect_ratio

upscale_image

Upscale image

Upscales a supplied image 2x or 4x. Cost depends on scale and mode (25-200 credits); returns a project id for wait_for_image_project.

輸入參數namestyleassets必填scale_factor必填

create_meme

Create meme

Creates a meme from a topic and template selection. Costs 10 credits. Starts a background job; returns a project id for wait_for_image_project.

輸入參數namestyle必填

create_qr_code

Create QR code

Creates a stylized QR code from supplied text or a URL and an art-style description. Currently costs 0 credits. Starts a background job; returns a project id for wait_for_image_project.

輸入參數namestyle必填content必填

place_person_in_scene

Place person in scene

Use only with the user's own likeness or content they are authorized to use. Do not use for impersonation, deception, sexual content, or content involving minors. Places a person from one supplied photo into a supplied scene image. Cost depends on resolution (from 50 credits at 640px); returns a project id for wait_for_image_project.

輸入參數nameassets必填resolution必填

swap_face_in_photo

Swap face in photo

Use only with the user's own likeness or content they are authorized to use. Do not use for impersonation, deception, sexual content, or content involving minors. Swaps faces in a supplied photo using a source face image or selected face mappings. Costs 10 credits; output size depends on subscription. Returns a project id for wait_for_image_project.

輸入參數nameassets必填

swap_head_in_photo

Swap head in photo

Use only with the user's own likeness or content they are authorized to use. Do not use for impersonation, deception, sexual content, or content involving minors. Swaps a head from a supplied image onto a supplied body image. Costs 10 credits; returns a project id for wait_for_image_project.

輸入參數nameassets必填max_resolution

remove_image_background

Remove image background

Removes an image's background, optionally replacing it with another supplied image. Costs 5 credits. Starts a background job; returns a project id for wait_for_image_project.

輸入參數nameassets必填

colorize_photo

Colorize photo

Colorizes a black-and-white or faded photo. Costs 10 credits; returns a project id for wait_for_image_project.

輸入參數nameassets必填

get_audio_project

Get audio project

Returns an audio project's status and, once complete, its download URLs. Use to check progress with the id from an audio create tool. Read-only.

輸入參數id必填

delete_audio_project

Delete audio project

Deletes the audio project and attempts to delete its completed output. Cannot be undone; confirm with the user first.

輸入參數id必填

generate_music

Generate music

Generates music from a description, with optional custom lyrics or instrumental-only output. Costs 1 credit per requested second; returns a project id for wait_for_audio_project.

輸入參數namestyle必填duration必填

版本歷史

2
  1. v0.1.1最新Nov 4, 2026
  2. v0.1.0Sep 16, 2026

評分

已滿足適用檢查項的 100%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分