Cloudflare Image MCP
Image generation MCP server running on Cloudflare Workers, supporting multiple models like FLUX and SDXL with OpenAI-compatible endpoints.
README
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/editsendpoints - MCP 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.
๐ฆ 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.dev -
If 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.
<details><summary>Claude Desktop</summary>
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"
}
}
}
</details>
<details><summary>Claude Code</summary>
Add the MCP server:
claude mcp add cloudflare-image https://your-worker.workers.dev/mcp
With API key:
claude mcp add cloudflare-image https://your-worker.workers.dev/mcp?key=your-api-key
</details>
<details><summary>Cursor</summary>
Go to: Settings โ Cursor Settings โ MCP โ Add new global MCP server
{
"mcpServers": {
"cloudflare-image": {
"url": "https://your-worker.workers.dev/mcp"
}
}
}
</details>
<details><summary>Cline</summary>
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"
}
}
}
</details>
<details><summary>Other MCP Clients</summary>
This server implements the MCP HTTP/SSE transport. Configure your client with:
- Transport: HTTP/SSE (streamable)
- URL:
https://your-worker.workers.dev/mcp - Auth (if API_KEYS set): Add
?key=your-api-keyto the URL
</details>
๐ 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 |
|---|---|
| Deployment Guide | Step-by-step deployment instructions |
| MinIO Deployment Guide | Self-hosted MinIO & Coolify deployment instructions |
| Credentials Setup | Environment variables and API tokens |
| Usage Guide | Detailed API usage examples |
| MCP Guide | MCP protocol and tools reference |
| API 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:
- Cloudflare Workers AI
- MinIO / S3 Object Storage (Self-hosted replacement for R2)
- Model Context Protocol
Credits: Migrated to self-hosted MinIO S3 from the original project: tan-yong-sheng/cloudflare-image-mcp.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.