Cloudflare Image MCP
Leverages Cloudflare Workers AI for image generation, enabling AI agents to generate and edit images using various models via MCP tools and an OpenAI-compatible API.
Provides self-hosted S3-compatible object storage for generated images, with automatic expiry and management through MCP tools.
Offers an OpenAI-compatible API for image generation and editing, allowing clients like OpenWebUI to use the server as a drop-in replacement for OpenAI's image endpoints.
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.
Cloudflare Image MCP
OpenAI-compatible image generation API + Streamable HTTP MCP server powered by Cloudflare Workers AI.
๐ Features
OpenAI-Compatible API:
/v1/images/generations+/v1/images/editsendpointsMCP Protocol Support: HTTP transport with SSE (streamable)
10 Image Generation Models: FLUX, SDXL, Stable Diffusion, and more
Multiple Tasks: Text-to-image, image-to-image (masked edits supported)
Web Frontend: Interactive UI for image generation
Self-Hosted MinIO Storage: Replaces Cloudflare R2 with a self-hosted MinIO instance running on Docker/Coolify with automatic image expiry.
Related MCP server: Flux Cloudflare MCP
๐ฆ What's Included
cloudflare-image-mcp/
โโโ workers/ # Cloudflare Worker (API + MCP + Frontend)
โโโ e2e/ # Playwright E2E tests๐ Quick Start
Prerequisites
Deploy this MCP server to your Cloudflare account (takes 5 minutes): ๐ Deployment Guide
Note your worker URL after deployment:
https://cloudflare-image-workers.<your-subdomain>.workers.devIf you set
API_KEYSduring deployment, you'll need the key for authentication.
MCP Client Configuration
Below are the configuration guides for different MCP clients. This server uses HTTP/SSE transport (not stdio) since it runs on Cloudflare Workers.
Add to your claude_desktop_config.json:
{
"mcpServers": {
"cloudflare-image": {
"url": "https://your-worker.workers.dev/mcp"
}
}
}If using API key authentication:
{
"mcpServers": {
"cloudflare-image": {
"url": "https://your-worker.workers.dev/mcp?key=your-api-key"
}
}
}Add the MCP server:
claude mcp add cloudflare-image https://your-worker.workers.dev/mcpWith API key:
claude mcp add cloudflare-image https://your-worker.workers.dev/mcp?key=your-api-keyGo to: Settings โ Cursor Settings โ MCP โ Add new global MCP server
{
"mcpServers": {
"cloudflare-image": {
"url": "https://your-worker.workers.dev/mcp"
}
}
}Open Cline โ Click MCP Servers icon โ Installed tab โ Advanced MCP Settings
Add to cline_mcp_settings.json:
{
"mcpServers": {
"cloudflare-image": {
"url": "https://your-worker.workers.dev/mcp"
}
}
}This server implements the MCP HTTP/SSE transport. Configure your client with:
Transport: HTTP/SSE (streamable)
URL:
https://your-worker.workers.dev/mcpAuth (if API_KEYS set): Add
?key=your-api-keyto the URL
๐ Usage
OpenAI-Compatible API
curl -X POST "https://your-worker.workers.dev/v1/images/generations" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-api-key" \
-d '{
"model": "@cf/black-forest-labs/flux-1-schnell",
"prompt": "A beautiful sunset over mountains",
"n": 1,
"size": "1024x1024"
}'And it can be used for OpenWebUI's image generation feature and image edits feature:

MCP Tools
Available Tools:
list_models- List all available modelsdescribe_model- Get model parameters and limitsrun_model- Generate images
Connect via MCP:
{
"mcpServers": {
"image-gen": {
"url": "https://your-worker.workers.dev/mcp"
}
}
}Web Frontend
Open your worker URL in a browser for an interactive UI.

๐จ Supported Models
๐ Detailed Model Specifications โ โ Full parameter reference, feature comparison, and capability matrix.
Model | Tasks | Provider |
FLUX.1 [schnell] | text-to-image | Black Forest Labs |
FLUX.2 [klein] | text-to-image, image-to-image | Black Forest Labs |
FLUX.2 [dev] | text-to-image, image-to-image | Black Forest Labs |
SDXL Base 1.0 | text-to-image, image-to-image (img2img + masked edits) | Stability AI |
SDXL Lightning | text-to-image | ByteDance |
Dreamshaper 8 LCM | text-to-image, image-to-image (img2img) | Lykon |
Lucid Origin | text-to-image | Leonardo |
Phoenix 1.0 | text-to-image | Leonardo |
SD 1.5 Img2Img | image-to-image (img2img) | Runway ML |
SD 1.5 Inpainting | image-to-image (requires mask) | Runway ML |
๐ Documentation
Document | Description |
Step-by-step deployment instructions | |
Self-hosted MinIO & Coolify deployment instructions | |
Environment variables and API tokens | |
Detailed API usage examples | |
MCP protocol and tools reference | |
REST endpoints documentation |
๐งช Testing
# Run E2E tests against staging/production
npm run test:e2e:staging
npm run test:e2e:production๐ง Development
# Type check
npm run build
# Run E2E tests
npm run test:e2e:staging๐ License
MIT
Built with:
MinIO / S3 Object Storage (Self-hosted replacement for R2)
Credits: Migrated to self-hosted MinIO S3 from the original project: tan-yong-sheng/cloudflare-image-mcp.
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
MCP server for Flux AI image generation
Cloudflare Workers MCP server: ai-model-router
MCP server for Qwen Image 3 AI image generation
Cloudflare Workers MCP server: ai-gateway
Related MCP Servers
- AlicenseBqualityDmaintenanceA TypeScript-based MCP server that enables text-to-image generation using Cloudflare's Flux Schnell model API.15MIT
- AlicenseBqualityDmaintenanceAn MCP server that enables AI assistants to generate images using Black Forest Labs' Flux model via Cloudflare Workers.1MIT
- AlicenseCqualityDmaintenanceAn MCP server that generates images based on text prompts using Black Forest Lab's FLUX model, allowing for customized image dimensions, prompt upsampling, safety settings, and batch generation.31MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server for image generation and editing using Cloudflare Workers AI, providing OpenAI-compatible APIs and support for multiple models.16 npmMIT