media-gen-mcp
Allows generating images using Cloudflare Workers AI.
Allows generating images using Google Gemini (currently unavailable, but implemented and ready to enable).
Allows generating images using Hugging Face Inference API.
Click on "Install 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-gen-mcpGenerate an image of a futuristic city at night."
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-gen-mcp
A personal MCP server that gives OpenCode the ability to generate images and videos mid-conversation — invoked as a tool, not a separate app — using free-tier AI media providers.
Built for generating visual assets and video clips for my own websites, apps, and projects, without paying for API access.
Providers
Provider | Capabilities | Trust level | Status |
image, video |
| active | |
image |
| active | |
image |
| active | |
image |
| unavailable — free-tier image generation quota is policy-set to 0 as of Aug 2026; requires a billed Google Cloud project. Implemented and ready — flip |
trust_level determines how a provider's responses are handled: untrusted providers are unofficial/self-parsed and go through full schema validation before anything else happens; trusted providers use an official SDK assumed to already validate its own response shape. See ARCHITECTURE.md for the full reasoning.
Providers can each have multiple named accounts (e.g. multiple API keys for the same provider) — selectable explicitly per call, no auto-rotation. Some accounts need more than one secret: Cloudflare requires an account ID alongside its API token (account_id_env in config.yaml).
Related MCP server: Krea MCP Server
Setup
This repo isn't published to a public remote yet, so <repository-url> is a placeholder — substitute the URL you actually clone from, don't copy it verbatim. The explicit media-gen-mcp target keeps the following cd correct: a bare git clone defaults to a directory named after the repository, so cd media-gen-mcp only holds if the repo happens to be named media-gen-mcp.
git clone <repository-url> media-gen-mcp
cd media-gen-mcp
python -m venv .venv
.venv/bin/pip install -e .Create a .env file in the project root with whichever providers you plan to use:
AGNES_API_KEY=...
CLOUDFLARE_API_TOKEN=...
CLOUDFLARE_ACCOUNT_ID=...
HUGGING_FACE_API_TOKEN=...
GEMINI_API_KEY=... # optional — provider is currently marked unavailableconfig.yaml maps each of these to a named account per provider — see the file itself, or ARCHITECTURE.md's Config section, for the full schema (multiple accounts per provider, per-provider defaults, hardening limits).
Register with OpenCode
Add to ~/.config/opencode/opencode.json (global, so it's available from any project):
{
"mcp": {
"media-gen-mcp": {
"type": "local",
"command": [
"/absolute/path/to/media-gen-mcp/.venv/bin/python",
"/absolute/path/to/media-gen-mcp/server.py"
]
}
}
}Both paths must be absolute. This is a global config spawned from whatever directory you happen to be working in when OpenCode starts — a relative path only happens to work if you're inside this repo, and silently breaks everywhere else.
Confirm it's connected:
opencode mcp listTools exposed
generate_image(prompt, provider?, account?, project_dir?, output_path?, ...)— generates an image, returns the saved file path.generate_video(prompt, provider?, account?, project_dir?, output_path?, ...)— starts an async video job (Agnes only), returns ajob_idto poll.check_video_job(job_id)— checks/advances a video job; downloads and saves the file once complete.list_providers()— reports configured providers, their status, capabilities, and accounts.
Where a file is saved follows this priority: an explicit output_path → under project_dir/ai-media/ if given → the configured default output directory otherwise.
Project docs
ARCHITECTURE.md— the full design: provider abstraction, trust-level validation, async video job handling, accounts, config schema, and the current state of the system.progress-tracker.md— current build status, the task list, and the incidents/lessons that shaped the decisions above.AGENTS.md— standing conventions for AI coding agents working on this codebase (testing discipline, hard rules, definition of done).
License
Released to the public domain under The Unlicense — see UNLICENSE.md. Free to copy, modify, and distribute; provided without warranty.
Status
Personal v1, built for a single user. Secrets live in a repo-adjacent .env; not currently packaged for distribution to other users or other machines (see ARCHITECTURE.md's "Future: distribution" note for what that would need). Deterministic image editing (background removal, overlays, compositing) is explicitly out of scope — this project only generates media.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceAn MCP server for AI-powered media generation using Google Gemini, enabling creation of images, videos, music, and speech directly from AI agents.4MIT
- AlicenseAqualityDmaintenanceMCP server for Krea.ai enabling AI image and video generation using models like Flux, Hailuo, Runway, Kling, and others via natural language prompts.9208Apache 2.0
- Alicense-qualityCmaintenanceA production-ready MCP server that provides AI-powered image generation through multiple providers including Gemini and Jimeng AI with intelligent provider selection.MIT
- AlicenseAqualityDmaintenanceMCP server for AI-powered media generation: images, videos, audio, and upscaling using 99 AI models.6MIT
Related MCP Connectors
MCP server for Hailuo (MiniMax) AI video generation
MCP server for Flux AI image generation
MCP server for Google Veo AI video generation
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/creative-nam/media-gen-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server