Cloudflare Image MCP

Cloudflare Image MCP

Image generation MCP server running on Cloudflare Workers, supporting multiple models like FLUX and SDXL with OpenAI-compatible endpoints.

Category
访问服务器

README

Cloudflare Image MCP

Deploy to Cloudflare Workers

OpenAI-compatible image generation API + Streamable HTTP MCP server powered by Cloudflare Workers AI.

🌟 Features

  • OpenAI-Compatible API: /v1/images/generations + /v1/images/edits endpoints
  • 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

  1. Deploy this MCP server to your Cloudflare account (takes 5 minutes): 👉 Deployment Guide

  2. Note your worker URL after deployment:

    https://cloudflare-image-workers.<your-subdomain>.workers.dev
    
  3. If you set API_KEYS during 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-key to 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:

OpenWebUI image generation

OpenWebUI image_edits

MCP Tools

Available Tools:

  • list_models - List all available models
  • describe_model - Get model parameters and limits
  • run_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.

Frontend


🎨 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:

Credits: Migrated to self-hosted MinIO S3 from the original project: tan-yong-sheng/cloudflare-image-mcp.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选