Media Creation MCP
Submits image and video generation tasks to an OpenAI-compatible multimodal gateway, enabling model-based media creation with multi-reference inputs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Media Creation MCP generate a cinematic image of a futuristic city at sunset"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Media Creation MCP (media-creation-mcp)
Production-grade Model Context Protocol (MCP) server for multimodal AI image & video creation, supporting both local
stdioand remoteStreamable HTTP + OAuth 2.0transports, stateful multi-shot storyboard continuity, idempotent async task execution, and AES-256-GCM encrypted credential storage.
面向多模态 AI 创作(文生图 / 图生视频 / 多参考图分镜编排)的生产级 MCP 服务端,兼容 Claude Code / Claude Desktop / ChatGPT / Codex / Cherry Studio 等主流 Agent 客户端。
Core Highlights
Dual Transport + Full OAuth 2.0 (
stdio&Streamable HTTP)Local mode (
stdio) for CLI / desktop agents using environment-injected API keys.Remote mode (
--http) with OAuth 2.0 Dynamic Client Registration, PKCE (S256), CSRF-protected browser consent page, and strict Host/Origin validation.
Stateful Multi-Shot Continuity (
prepare_story_shot)Zero-cost, side-effect-free continuity planner that merges story brief, character reference sheets, and shot start/end states into deterministic generation payloads and returns
next_shot_context.Solves character & visual drift in long multi-shot video workflows by persisting shot context into local project files instead of relying on fragile chat memory.
Idempotent Async Execution & Key-Fingerprint Recovery
Enforces client-supplied
operation_iddeduplication to prevent accidental duplicate billing/generations on retries.Binds async tasks to SHA-256 credential fingerprints so clients can resume polling (
get_task) seamlessly across reconnects or credential alias renames.
Defense-in-Depth Security
AES-256-GCM Encrypted Vault (
lib/store.mjs) with file locking (proper-lockfile),0700data directories, and0600file permissions; user API keys never leak to the LLM context.SSRF & Attachment Guard (
lib/attachment-download.mjs) usingipaddr.jsDNS pinning + private IP range blocking + streaming byte limits.Signed Ephemeral Uploads (
create_upload_link/get_upload) for clients that cannot forward chat attachments directly to MCP tools.
Related MCP server: MiniMax MCP JS
Architecture
flowchart LR
subgraph Clients["MCP Clients"]
C1["Claude Code / Codex (stdio)"]
C2["ChatGPT / Claude / Cherry Studio (HTTP + OAuth)"]
end
subgraph Server["media-creation-mcp (Node.js >= 22)"]
T1["MCP Server & Tool Router\n(lib/server.mjs)"]
OA["OAuth 2.0 + CSRF Consent\n(lib/oauth.mjs)"]
CT["Storyboard Continuity Planner\n(lib/continuity.mjs)"]
EN["Async Media Engine + Idempotency\n(lib/media.mjs)"]
UP["Signed Upload & SSRF Guard\n(lib/uploads.mjs, attachment-download.mjs)"]
ST["AES-256-GCM Vault + Lock\n(lib/store.mjs)"]
end
GW["OpenAI-Compatible Multimodal Gateway\n(Image / Video Models)"]
C1 --> T1
C2 --> OA --> T1
T1 --> CT
T1 --> EN
T1 --> UP
EN --> ST
OA --> ST
EN --> GWMCP Tools & Prompts
Primitive | Type | Billing | Purpose |
| Tool | Free | Query available image/video models, pricing, and multi-reference limits per credential group |
| Tool | Free | Merge brief, character references, and start/end states into next-shot generation params + |
| Tool | Paid | Submit async image generation / multi-reference editing task with |
| Tool | Paid | Submit async video generation task (first-frame or multi-reference) with |
| Tool | Read-only | Poll task progress and retrieve local file paths or signed ephemeral download links |
| Tool (HTTP) | Free | Issue a 30-min signed web upload link (up to 14 images, 10 MB each) for clients without attachment forwarding |
| Tool (HTTP) | Free | Resolve uploaded images into |
| Prompt | Free | 6-step guided workflow: storyboard → cost estimate → character sheet → per-shot continuity → review → delivery |
Quick Start
Requirements
Node.js
>= 22
Install & Run Tests
npm install
npm testThe test suite (test/*.test.mjs) covers:
media.test.mjs: async submission, idempotentoperation_id, key-fingerprint recovery, artifact expirycontinuity.test.mjs: multi-shot character sheet & state carryover (prepare_story_shot)references.test.mjs: multi-reference image limits, first-frame conflict validation, upload flowsclients.test.mjs: end-to-endstdioclient &Streamable HTTP + OAuth 2.0handshake + CSRF/Origin defensesafety.test.mjs: SSRF DNS/IP blocking, redirect guards, upload byte limits, disk capacity protection
1. Local stdio Mode (e.g. Claude Code / Claude Desktop)
export MEDIA_API_BASE_URL="https://your-gateway.example.com/v1"
export MEDIA_API_KEY="sk-your-key"
export MEDIA_MCP_DATA_DIR="$HOME/.local/share/media-creation-mcp"
node media-creation-mcp.mjsClaude Code registration example:
claude mcp add --scope user --transport stdio media-creation -- node /abs/path/to/media-creation-mcp.mjs2. Remote Streamable HTTP + OAuth Mode
export MEDIA_MCP_PUBLIC_URL="https://mcp.example.com"
export MEDIA_API_BASE_URL="https://api.example.com/v1"
export MEDIA_MCP_DATA_DIR="/var/lib/media-creation-mcp"
export MEDIA_MCP_STORAGE_KEY="$(openssl rand -base64 32)"
export PORT=18780
node media-creation-mcp.mjs --httpSee deploy/README.md for systemd and Nginx reverse-proxy templates.
Project Structure
media-creation-mcp/
├── media-creation-mcp.mjs # CLI entrypoint (stdio & --http server)
├── lib/
│ ├── server.mjs # MCP tool/prompt definitions & Express HTTP router
│ ├── media.mjs # Async media engine, idempotency, artifact lifecycle
│ ├── continuity.mjs # Multi-shot storyboard state & character continuity planner
│ ├── oauth.mjs # OAuth 2.0 provider, PKCE & CSRF-protected consent flow
│ ├── store.mjs # AES-256-GCM encrypted JSON vault with file locking
│ ├── uploads.mjs # Streaming multipart upload handler with byte caps
│ ├── attachment-download.mjs # SSRF-hardened attachment fetcher (DNS pinning + IP filter)
│ └── pages.mjs # HTML UI templates for OAuth consent & uploads
├── test/ # 6 end-to-end & security test suites (node --test)
└── deploy/ # systemd & Nginx production deployment templatesLicense
MIT
Available Tools
5 toolsgenerate_image生成图片ADestructiveIdempotent
用 Grok Imagine、Midjourney 或分组中其他按张计价的图片模型生成图片,会产生上游模型调用费用,返回 estimated_cost_usd。已适配型号可用 reference_images 编辑或融合图片,先查 list_media_models 的素材上限;部分 GPT Image 已接入多图。立即返回 task_id,用 get_task 取结果。Midjourney 按当前每次 4 张估价,实际扣费以使用记录为准;其他图片模型可选 1–4 张。只有用户明确要求创作时调用。
Inputs: model (required), prompt (required), operation_id (required), n, +7 more.
generate_video生成视频ADestructiveIdempotent
用 Grok Imagine、Seedance 或 Kling 生成视频,会产生上游模型调用费用,返回 estimated_cost_usd。image 表示首帧;reference_images 表示不固定首帧的参考图。Grok、已适配 Seedance 与 Kling Omni 支持多参考图,数量和组合限制先查 list_media_models;Seedance 首帧与普通参考图不能混用。视频素材编辑暂未开放,上游编辑端点实测返回 HTTP 404;不要调用 video。长片先 prepare_story_shot,逐镜复用人物和衔接设定。立即返回 task_id,每约 5 秒用 get_task 续查。只有用户明确要求创作时调用。
Inputs: model (required), prompt (required), operation_id (required), image, +8 more.
get_task查询创作任务ADestructiveIdempotent
查询已有 task_id,返回状态和作品的本地路径或限时下载链接。视频完成后查询可能触发现有网关的一次性结算;不创建新生成任务。重复查询不会重复提交。
Inputs: task_id (required).
list_media_models查看 AI 创作模型ARead-onlyIdempotent
只读查询各密钥分组中当前可用的图片、视频模型及参数限制,不产生生成费用。
Inputs: no named parameters.
prepare_story_shot准备人物与分镜衔接ARead-onlyIdempotent
不收费、不生成:按 AI 创作网页的规则,把项目设定、人物基准图、起止状态合并成下一镜生成参数。将返回的 next_shot_context 保存到本地项目文件并在后续镜头传回,避免依赖聊天记忆;素材不兼容时明确报错,不丢弃人物图。
Inputs: model (required), prompt (required), operation_id (required), n, +10 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
The five tools split cleanly along lifecycle lines: discovery (list_media_models), planning (prepare_story_shot), execution (generate_image/generate_video), and polling (get_task). The only soft spots are generate_image vs generate_video, which share reference_images semantics, estimated_cost_usd, and task_id return behavior, requiring prose warnings (e.g. 'do not call video for editing') to keep them apart.
All five names follow a strict verb_noun snake_case pattern (list_, prepare_, generate_, generate_, get_). Verb choice is also semantically consistent: list/get for reads, prepare for non-billable assembly, generate for billable creation, which reinforces the cost-safety contract.
Five tools is well-scoped for a media generation server: one discovery tool, one cost-free planning tool, two generation tools split by modality, and one task poller. No tool looks redundant, and the small surface keeps the 'only call when the user asks to create' rule enforceable.
The core loop is closed: find models and limits, assemble shot parameters, submit a billable job, poll for the artifact. Minor gaps remain—there is no tool to list recent tasks, cancel/retry a job, or query usage/billing records, even though the descriptions defer actual charges to '使用记录' that no tool exposes.
Maintenance
Related MCP Connectors
Generate and edit images, video, voice, lip-sync and 3D models from your AI agent.
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Image, video, music and text generation across 100+ models through one endpoint.
Generate images, video, music and voice from your CLI or AI agent. On-brand AI media toolkit.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables MCP-capable chats and agents to generate images, video, and audio through OpenAI, Google Gemini, fal.ai, and Cloudflare Workers AI, optionally routed via Cloudflare AI Gateway. Supports image editing, asynchronous video jobs, and text-to-speech with per-request provider and model overrides, and can run over stdio or streamable HTTP.4MIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible clients to generate images and videos, synthesize text-to-speech audio, and clone or design custom voices. It also supports flexible output handling (URLs or local files) and multiple transport modes including stdio, REST, and SSE.431 npmMIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to generate images from text prompts, list available models, and view generation history through stdio, SSE, or Streamable HTTP transports.-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to generate images, list available models, and view generation history over the Model Context Protocol via stdio, SSE, or Streamable HTTP transports.-