media-gen
Enables photorealistic image generation via gpt-image-1 and video generation via Sora from text prompts using an OpenAI API key.
media-gen
An MCP server for Claude Code with two paths to media: a free, Claude-authored rendering path (SVG/HTML → image, canvas animation → video) that needs no API keys, and an optional bring-your-own-key (BYOK) path for photorealistic image/video generation via OpenAI, Gemini, or fal.ai.
What it is
render_image and render_video take content you author — SVG markup,
an HTML document, or a JavaScript draw(ctx, t, frame) function — and turn
it into a PNG/JPEG/WebP or MP4 on disk, using a headless, network-blocked
Chromium and ffmpeg. These always work, cost nothing, and are ideal for
diagrams, charts, UI mockups, and motion graphics. They are not
photorealistic — they render exactly what you draw.
generate_image and generate_video call out to a real image/video model
(gpt-image-1/Sora, Imagen/Veo, or FLUX/Kling) to produce photorealistic
media from a text prompt. These only appear as tools when you've configured
at least one provider key, and each call costs real money on your account.
list_providers reports which BYOK providers are configured and what
models/capabilities each exposes.
Related MCP server: distribea-mcp
Setup
npm install
npx playwright install chromium
npm run buildThis installs dependencies, downloads the headless Chromium build used for
SVG/HTML rendering, and compiles TypeScript to dist/.
Connecting to Claude Code
A .mcp.json is already checked into the repo root, so Claude Code will
pick it up automatically when you run it from this project directory:
{
"mcpServers": {
"media-gen": {
"command": "node",
"args": ["dist/index.js"],
"env": {
"MEDIA_OUTPUT_DIR": "${MEDIA_OUTPUT_DIR}",
"OPENAI_API_KEY": "${OPENAI_API_KEY}",
"GEMINI_API_KEY": "${GEMINI_API_KEY}",
"FAL_KEY": "${FAL_KEY}"
}
}
}
}Alternatively, register it manually from any directory:
claude mcp add media-gen -- node <absolute-path-to>\dist\index.jsApprove the server when Claude Code prompts you, then run claude mcp list
to confirm media-gen shows as connected.
BYOK keys
All keys are optional and read from the environment only — they are never written to disk, logged, or echoed back in tool output or the startup message (which prints provider names, never values).
Env var | Enables |
|
|
|
|
|
|
With no keys set, only the free render_image/render_video/list_providers
tools are registered; generate_image/generate_video don't appear until at
least one key is present. Set keys in .mcp.json's env block (they expand
from your shell environment) or via claude mcp add ... -e KEY=value.
Tool reference
Tool | Purpose | Key params |
| Render SVG or HTML you author to an image file |
|
| Render an MP4 from a JS canvas |
|
| Photoreal image from a text prompt (BYOK) |
|
| Photoreal video from a text prompt (BYOK) |
|
| List configured BYOK providers and their models | none |
Manual E2E check
Free (no keys needed) — try these prompts in a Claude Code session:
"render an SVG diagram of a login flow as an image"
"render a 3-second bouncing ball video"
Paid (uses your configured key, costs real money):
"generate a photo of a lighthouse (uses your key)"
Confirm the output file appears under generated-media/ and that Claude
describes seeing the returned image inline.
Limits
render_video: duration ≤ 60s, frame budget < 3600 frames, resolution ≤ 1080p.render_image: width/height ≤ 4096px per side.generate_video(BYOK): polling caps out after 10 minutes per provider job.Rendered (
render_*) output is never photorealistic — for photoreal results you needgenerate_*with a configured provider key.
Available Tools
3 toolslist_providersA
List configured BYOK generation providers, their models and capabilities.
Inputs: no named parameters.
render_imageA
Render SVG markup or a full HTML document (authored by you) to an image file on disk. Use for illustrations, diagrams, charts, UI mockups, typographic cards. Not photorealistic.
Inputs: source (required), width, format, height, +2 more.
render_videoA
Render an MP4 from JavaScript canvas animation code you author. Provide draw(ctx, t, frame) as a pure function of time t in seconds (deterministic — no requestAnimationFrame, no Date.now). Optional setup(ctx) runs once. Use for motion graphics, animated diagrams, explainers. Returns file path plus sample frames.
Inputs: draw_code (required), fps, width, height, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
The three tools have distinct purposes: render_image produces static images, render_video produces animated video, and list_providers enumerates backend providers. There is no overlap or ambiguity between them.
Tool names follow a consistent snake_case verb_noun convention: render_image, render_video, list_providers. The verb precisely indicates the action and the noun indicates the output or resource, making the pattern predictable.
With exactly three tools, this server is tightly scoped to its media generation purpose and carries no redundant tools. Each tool earns a clear place in the set.
The server covers the apparent core workflow: discover available providers, render static visual assets, and render animated video assets. Since rendering is a stateless generate-to-file operation, no update/delete/list-generated-files tools are required for the declared scope.
Maintenance
Related MCP Connectors
Generate images, GIFs, videos, and PDFs from HTML, URLs, or templates — from your AI agent.
Generate images, video, music and voice from your CLI or AI agent. On-brand AI media toolkit.
Generate images and video from Claude with one API key.
Transform video, audio and images, and generate media from prompts. FFmpeg, captions, models.
Related MCP Servers
- AlicenseAqualityBmaintenanceRender HTML/CSS/JS/SVG animations into high-quality MP4 videos. Exposes render tools to AI agents using Playwright (Chromium) and FFmpeg, running locally or remote.22MIT

distribea-mcpofficial
AlicenseNot gradedqualityCmaintenanceGenerates images, video, music, and voice from plain-language prompts, shipping them production-ready as optimised WebP with SEO alt text, directly in your terminal or AI agent.166 npm1MIT- AlicenseAqualityDmaintenanceRender HTML/CSS to PNG/JPG/WebP directly from Claude Desktop, Claude Code, Cursor, or any MCP-compatible client.256 npmMIT
- AlicenseNot gradedqualityCmaintenanceLets AI agents generate images and videos through a self-hosted studio connected to the user's own fal.ai, Kie.ai or Higgsfield API keys, with tools for exploring models, submitting image and video jobs, waiting on results and importing media from URLs. Runs over HTTP with bearer-token authentication, so agents such as Claude Code, Codex, Cursor or Claude Desktop can create and retrieve media while provider keys stay encrypted server-side.1MIT