media-gen-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
media-gen-mcp
MCP server that exposes SenseNova and Agnes AI image/video generation as separate tool namespaces. Standalone: it talks to the provider HTTP APIs directly, keeps nothing in a database, and needs only an API key per provider.
MCP TypeScript SDK v2 (
@modelcontextprotocol/server2.4.0) — implements the2026-07-28specification and still serves2025-11-25/2025-06-18clients from the same factory.Two transports from one binary: Streamable HTTP (
POST /mcp, stateless per request) and stdio (--stdio, fornpxand local hosts).
Install
The npm package is not published yet; run it straight from this repository:
npx -y github:summerscar/media-gen-mcp --stdio(or npm install -g github:summerscar/media-gen-mcp, then media-gen-mcp --stdio)
Related MCP server: Agnes MCP Server
Configure
Variable | Default | Meaning |
| — | Enables the |
|
| Use |
|
| Image model id |
| — | Enables the |
|
| Agnes API root |
|
| Where generated files are written |
|
| HTTP listener |
|
| HTTP path |
| — | When set, requests need |
| — |
|
|
| Refresh interval for each provider's |
Missing keys are not fatal: the server starts, and only the tools of the provider without a key return an error.
Run
# Streamable HTTP on :3000/mcp
SENSENOVA_API_KEY=... AGNES_API_KEY=... MEDIA_DIR=/data/media node dist/index.js
# stdio (Claude Desktop, Inspector, MCPHub npx, ...)
SENSENOVA_API_KEY=... AGNES_API_KEY=... node dist/index.js --stdioClient configuration for the HTTP endpoint:
{
"mcpServers": {
"media": {
"type": "streamable-http",
"url": "http://192.168.100.134:8086/mcp",
"headers": { "Authorization": "Bearer <MCP_AUTH_TOKEN>" }
}
}
}Tools
Tool | Provider | Purpose |
| SenseNova | text → image |
| SenseNova | 1–5 images + prompt → image |
| Agnes | text → image (2.0 / 2.1 / 2.5 Flash) |
| Agnes | images + prompt → image |
| Agnes | start an async video job, returns |
| Agnes | poll the job and download the finished file |
Image parameters
SenseNova (sensenova_image_generate / _edit): prompt, size (exact
WxH, 512–4096, multiples of 32, ratio ≤ 3:1, or auto when editing),
resolution (2K/4K), aspect_ratio (1:1, 16:9, 9:16, 2:3, 3:2),
output_format, watermark, prompt_extend, self_correction.
Agnes (agnes_image_generate / _edit): prompt, model (any image model id,
default agnes-image-2.5-flash), size (tier 1K/2K/3K/4K, or exact
pixels on 2.0-flash), ratio, return_base64. Edits add images (https URL or
data URI).
No tool accepts a fixed model list: every model parameter is a free string,
validated against the provider's live /models catalog (see Model catalogs).
Video parameters
agnes_video_create: prompt, model (any video model id, default
agnes-video-2.5), mode (text | keyframe | reference),
seconds ("4"–"12", default "5"), size (720P/1080P/1K/2K;
Flash accepts 720P only), aspect_ratio, seed, plus first_frame /
last_frame for keyframe mode and images / audios / videos for reference
mode (2.5: ≤ 8 images, ≤ 3 audios, ≤ 1 video, ≤ 12 files total; Flash: ≤ 5
images, ≤ 3 audios, no video).
Video jobs are asynchronous, so the tool returns at once and you poll
agnes_video_status every 1–2 seconds; once the job completes, the status tool
downloads the MP4 and reports its local path and byte size.
Model catalogs
Model ids are not hardcoded. Each provider's /models endpoint is fetched and
kept in an in-memory cache:
refreshed lazily on first use, and on a timer every
MODEL_LIST_TTL_MS(default 1 h);force-refreshed immediately when a call fails with a model error (unknown / deprecated / renamed id), then retried once — a deprecated model is picked up on the same request, and if it is still gone the error lists the current catalog;
a requested model id is fail-fast validated against the catalog; the configured defaults are always accepted even when the provider does not list them (SenseNova's
u1.6-liteworks this way);if a provider's
/modelsendpoint is unreachable, the stale list is served and validation is skipped rather than blocking generation.
The cache is per-process; restarting the container starts from an empty catalog.
Output handling
Every generated image is downloaded before the tool returns, because provider
CDN links expire (SenseNova: 24 h). Files land in
$MEDIA_DIR/<provider>/<YYYY-MM-DD>/<timestamp>-<rand>.<ext>, but that path is
local to the server: a remote caller cannot read it. The tool result contains:
an
imageblock with the full image as base64 (always inlined, no size cap),a text block with the JSON metadata:
provider_url(the provider CDN link, while it lasts),mime,bytes, realwidth/heightread from the file header, provider, model, mode, elapsed time, tokenusagewhen the provider reports it, and the server-localpathfor stdio callers sharing the volume.
Notes and known provider quirks
SenseNova
/images/editsrequiresimages: [{ "image_url": ... }]; a bare string array is rejected withinvalid arguments.Agnes accepts input images both at the top level and inside
extra_body; this server sends both, and keepsresponse_formatinsideextra_body.sensenova-u1.6-liteis callable even though/v1/modelsdoes not list it (the listing showssensenova-u1.5-lite).nis fixed at 1 on both providers; generate one image per call.SenseNova's
/modelslistssensenova-u1.5-litebut not the working defaultsensenova-u1.6-lite— validation accepts the default even when it is absent.
Development
npm install
npm run typecheck
npm run build
node test/smoke.mjs http://127.0.0.1:3000/mcp sensenova_image_generate '{"prompt":"a red apple"}'test/smoke.mjs connects with @modelcontextprotocol/client, lists tools and
optionally runs one call.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate AI images and videos from your agent: list models, start jobs, and fetch the results.
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
AI image + video generation for agents: --flag prompt DSL, async generate/poll, x402 pay-per-use.
Generate reproducible image, video, and audio assets with leading models and your own provider keys.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables text-to-image and text-to-video generation via the Agnes AI API, with support for multiple models, async video generation, and automatic file downloads.61MIT
- FlicenseAqualityCmaintenanceEnables AI assistants to generate images and videos via the Agnes AI API, supporting text-to-image, image-to-image, and video generation.31-
- 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
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to generate images from text, list available models, and browse generation history over Model Context Protocol via stdio, SSE, and Streamable HTTP transports.-