📇 ☁️ 🏠 - Media generation, editing and asset downloads with OpenAI Images/Videos and Google GenAI (Veo)
media-gen-mcp
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
---
**Media Gen MCP** is a **strict TypeScript** Model Context Protocol (MCP) server for OpenAI Images (gpt-image-1.5, gpt-image-1), OpenAI Videos (Sora), and Google GenAI Videos (Veo): generate/edit images, create/remix video jobs, and fetch media from URLs or disk with smart resource_link vs inline image outputs and optional sharp processing. Production-focused (full strict typecheck, ESLint + Vitest CI). Works with fast-agent, Claude Desktop, ChatGPT, Cursor, VS Code, Windsurf, and any MCP-compatible client.
**Design principle:** spec-first, type-safe image tooling – strict OpenAI Images API + MCP compliance with fully static TypeScript types and flexible result placements/response formats for different clients.
- **Generate images** from text prompts using OpenAI's gpt-image-1.5 model (with gpt-image-1 compatibility and DALL·E support planned in future versions).
- **Edit images** (inpainting, outpainting, compositing) from 1 up to 16 images at once, with advanced prompt control.
- **Generate videos** via OpenAI Videos (sora-2, sora-2-pro) with job create/remix/list/retrieve/delete and asset downloads.
- **Generate videos** via Google GenAI (Veo) with operation polling and file-first downloads.
- **Fetch & compress images** from HTTP(S) URLs or local file paths with smart size/quality optimization.
- **Fetch documents** from HTTP(S) URLs or local file paths and return resource_link/resource outputs.
- **Debug MCP output shapes** with a test-images tool that mirrors production result placement (content, structuredContent, toplevel).
- **Integrates with**: fast-agent, Windsurf, Claude Desktop, Cursor, VS Code, and any MCP-compatible client.
---
✨ Features
- **Strict MCP spec support**
Tool outputs are first-class CallToolResult objects from the latest MCP schema, including:
content items (text, image, resource_link, resource), optional structuredContent, optional top-level files, and the isError flag for failures.
- **Full gpt-image-1.5 and sora-2/sora-2-pro parameters coverage (generate & edit)**
- openai-images-generate mirrors the OpenAI Images create API for gpt-image-1.5 (and gpt-image-1) (background, moderation, size, quality, output_format, output_compression, n, user, etc.).
- openai-images-edit mirrors the OpenAI Images createEdit API for gpt-image-1.5 (and gpt-image-1) (image, mask, n, quality, size, user).
- **OpenAI Videos (Sora) job tooling (create / remix / list / retrieve / delete / content)**
- openai-videos-create mirrors videos/create and can optionally wait for completion.
- openai-videos-remix mirrors videos/remix.
- openai-videos-list mirrors videos/list.
- openai-videos-retrieve mirrors videos/retrieve.
- openai-videos-delete mirrors videos/delete.
- openai-videos-retrieve-content mirrors videos/content and downloads video / thumbnail / spritesheet assets to disk, returning MCP resource_link (default) or embedded resource blocks (via tool_result).
- **Google GenAI (Veo) operations + downloads (generate / retrieve operation / retrieve content)**
- google-videos-generate starts a long-running operation (ai.models.generateVideos) and can optionally wait for completion and download .mp4 outputs. Veo model reference
- google-videos-retrieve-operation polls an existing operation.
- google-videos-retrieve-content downloads an .mp4 from a completed operation, returning MCP resource_link (default) or embedded resource blocks (via tool_result).
- **Fetch and process images from URLs or files**
fetch-images tool loads images from HTTP(S) URLs or local file paths with optional, user-controlled compression (disabled by default). Supports parallel processing of up to 20 images.
- **Fetch videos from URLs or files**
fetch-videos tool lists local videos or downloads remote video URLs to disk and returns MCP resource_link (default) or embedded resource blocks (via tool_result).
- **Fetch documents from URLs or files**
fetch-document tool downloads remote files or reuses local paths and returns MCP resource_link (default) or embedded resource blocks (via tool_result).
- **Mix and edit up to 16 images**
openai-images-edit accepts image as a single string or an array of 1–16 file paths/base64 strings, matching the OpenAI spec for GPT Image models (gpt-image-1.5, gpt-image-1) image edits.
- **Smart image compression**
Built-in compression using sharp — iteratively reduces quality and dimensions to fit MCP payload limits while maintaining visual quality.
- **Resource-aware file output with resource_link**
- Automatic switch from inline base64 to file when the total response size exceeds a safe threshold.