Skip to main content
Glama
b19805652
by b19805652

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.

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

  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.

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/mcp

With API key:

claude mcp add cloudflare-image https://your-worker.workers.dev/mcp?key=your-api-key

Go 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/mcp

  • Auth (if API_KEYS set): Add ?key=your-api-key to 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:

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.

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

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/b19805652/cloudflare-image-mcp-s3'

If you have feedback or need assistance with the MCP directory API, please join our Discord server