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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。