Cloudflare Image MCP
This server enables AI models to generate and analyze images using Cloudflare Workers AI.
generate_image: Create images from text prompts using models like FLUX.1 Schnell, SDXL Lightning, and DreamShaper. Supports options like custom seed, diffusion steps, output filename, and directory. Generated images are saved to disk and the file path is returned.describe_image: Generate text descriptions of images using models like LLaVA, Moondream, and uForm. Accepts both local file paths and HTTP(S) URLs. Supports custom prompts (e.g., "How many cats are in this image?"), token limits, and temperature settings.list_models: Discover all supported text-to-image and image-to-text models, including their aliases and default settings.
Provides tools to generate images from text prompts and describe images using Cloudflare Workers AI models.
Leverages Cloudflare Workers AI to perform text-to-image and image-to-text tasks, with support for multiple models.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Cloudflare Image MCPGenerate an image of a sunset over mountains"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
opencode-cloudflare-image-mcp
An MCP (Model Context Protocol) server that gives any MCP-capable AI model (Claude Desktop, opencode, etc.) the ability to generate images from text prompts and describe images in text, using Cloudflare Workers AI models.
Features
generate_image — Generate images from text prompts using Cloudflare text-to-image models (FLUX.1 Schnell, SDXL, DreamShaper, and more).
describe_image — Generate text descriptions of images using Cloudflare image-to-text models (LLaVA, Moondream, uForm).
list_models — Discover all supported models with aliases and defaults.
Generated images are saved to disk; the file path is returned to the model.
Image-to-text supports both local file paths and HTTP(S) URLs as input.
Related MCP server: nanobanana-mcp-server
Install via OpenCode Agent
Paste this to your opencode agent to install and configure:
Install the opencode-cloudflare-image-mcp MCP server globally, then add it to my opencode.json config at ~/.config/opencode/opencode.json as a local MCP server with:
- type: local
- command: ["node", "E:/Image-MCP/dist/index.js"] (or your install path)
- environment with CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKENOr manually:
npm install -g opencode-cloudflare-image-mcpThen add to ~/.config/opencode/opencode.json:
{
"mcp": {
"cloudflare-image": {
"type": "local",
"command": ["node", "E:/Image-MCP/dist/index.js"],
"environment": {
"CLOUDFLARE_ACCOUNT_ID": "your-account-id",
"CLOUDFLARE_API_TOKEN": "your-api-token"
},
"enabled": true
}
}
}Note: Use
"environment"not"env"for the env vars in opencode config.
Install (Manual)
npm install -g opencode-cloudflare-image-mcpOr use directly with npx:
npx opencode-cloudflare-image-mcpConfiguration
Environment Variables
Variable | Required | Default | Purpose |
| yes | — | Cloudflare account ID |
| yes | — | Bearer token for API auth |
| no |
| Where generated PNG files are saved |
| no |
| Default text-to-image model |
| no |
| Default image-to-text model |
Getting a Cloudflare API Token
Go to the Cloudflare dashboard.
Navigate to My Profile → API Tokens.
Click Create Token.
Use the Workers AI template, or create a custom token with
Workers AI:Readpermission.Copy the token and set it as
CLOUDFLARE_API_TOKEN.
Your Cloudflare Account ID is visible on the dashboard overview page or any domain's overview page.
Client Configuration
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"cloudflare-image": {
"command": "npx",
"args": ["-y", "opencode-cloudflare-image-mcp"],
"env": {
"CLOUDFLARE_ACCOUNT_ID": "your-account-id",
"CLOUDFLARE_API_TOKEN": "your-api-token"
}
}
}
}opencode / Generic stdio
{
"mcp": {
"cloudflare-image": {
"type": "local",
"command": ["npx", "-y", "opencode-cloudflare-image-mcp"],
"env": {
"CLOUDFLARE_ACCOUNT_ID": "your-account-id",
"CLOUDFLARE_API_TOKEN": "your-api-token"
}
}
}
}Usage
Once connected, the AI model can call these tools:
generate_image
Generate an image of a cyberpunk lizard in a neon-lit cityThe model will call generate_image with the prompt. The image is saved to disk and the file path is returned.
describe_image
Describe the image at /path/to/image.pngOr with a URL:
What's in this image? https://example.com/photo.jpglist_models
What image models are available?Supported Models
Text-to-Image
Alias | Model ID | Default |
|
| yes |
|
| |
|
| |
|
| |
|
|
Image-to-Text
Alias | Model ID | Default |
|
| yes |
|
| |
|
|
Development
pnpm install
pnpm test
pnpm buildLicense
MIT
Available Tools
3 toolsdescribe_imageB
Generate a text description of an image using a Cloudflare Workers AI image-to-text model.
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | Local file path or HTTP(S) URL of the image to describe | |
| model | No | Model alias or full @cf/... id | |
| prompt | No | Instruction, e.g. "How many cats are in this image?" | |
| max_tokens | No | Response length cap | |
| temperature | No | Sampling temperature |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It only states the basic purpose without disclosing behavioral traits like supported image formats, model availability, potential errors, or that it is a read-only operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, no unnecessary words. Efficiently conveys the core purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema, no annotations, and the description is too sparse. It does not explain the output format, how to choose model, or provide any guidance for a 5-parameter tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so all parameters are documented in the schema. The description adds no additional meaning beyond the schema details.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool generates a text description from an image using a specific service (Cloudflare Workers AI). It distinguishes itself from siblings: generate_image (creates images) and list_models (lists available models).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use vs alternatives. The context of siblings implies use for description rather than generation, but no explicit when-not or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_imageB
Generate an image from a text prompt using a Cloudflare Workers AI text-to-image model.
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Random seed for reproducibility | |
| model | No | Model alias (e.g. "flux-schnell") or full "@cf/..." id | |
| steps | No | Diffusion steps | |
| prompt | Yes | Text prompt for image generation | |
| filename | No | Output filename | |
| output_dir | No | Override save directory |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description carries the full burden of behavioral disclosure. It mentions the model type but does not disclose other important behaviors such as default model, output format, potential errors (e.g., content moderation), or performance characteristics. This leaves the agent underinformed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that front-loads the core purpose. No redundant words. However, it could incorporate additional concise information (e.g., output type) without losing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description should ideally mention the return value (e.g., URL or file path). It also does not explain how the 'model' parameter interacts with the sibling tool 'list_models' or provide defaults. For a 6-parameter tool, this minimal description leaves significant gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so each parameter already has a clear schema-level description. The tool description adds no further semantic meaning beyond what is in the schema. Therefore, it meets the baseline of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the verb 'generate', the resource 'image', and the specific mechanism 'from a text prompt using a Cloudflare Workers AI text-to-image model'. This distinguishes it from sibling tools 'describe_image' and 'list_models' which perform different actions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use this tool versus alternatives. The purpose is clear, but there is no mention of prerequisites, limitations, or when not to use it. Sibling tools are different enough that confusion is unlikely, but the lack of guidelines leaves room for improvement.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_modelsA
List supported Cloudflare Workers AI image models.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description implies a safe, read-only operation; no side effects or destructive behavior are suggested, which is appropriate for a list action.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, front-loaded with the verb 'List', no wasted words; perfect conciseness for a simple tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Adequate for a parameterless listing tool, but lacks details on the output structure (e.g., model IDs, names) since no output schema exists; minor gap given simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0 parameters, the baseline is 4; the description adds no parameter info beyond the schema, which is acceptable as there are none to define.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'List supported Cloudflare Workers AI image models' clearly states the action (list) and the resource (supported models), distinguishing it from sibling tools that describe or generate images.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use vs. siblings; the purpose is implied but not formally contrasted, leaving the agent to infer context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v1.0.0- First observed
describe_image - First observed
generate_image - First observed
list_models
TDQS
Scored across 3 tools
Each tool has a distinct purpose: describe_image processes an input image, generate_image creates an image from text, and list_models provides model discovery. No overlap or ambiguity.
All tool names follow a consistent snake_case verb_noun pattern (describe_image, generate_image, list_models), making them predictable and easy to understand.
With only 3 tools, the server is focused but covers core image operations. While slightly thin, it's appropriate for a specialized image AI server and doesn't feel overcrowded.
The server provides generate and describe functionality along with model discovery. Minor gaps exist (e.g., no edit or delete endpoints), but the surface is adequate for basic image generation and description tasks.
Maintenance
Related MCP Connectors
Cloudflare Workers MCP server: ai-eval
Cloudflare Workers MCP server: ai-agent-scratchpad
Cloudflare Workers MCP server: ai-gateway
Cloudflare Workers MCP server: ai-prompt-optimizer
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that enables AI assistants to generate images using Black Forest Labs' Flux model via Cloudflare Workers.1MIT
- AlicenseBqualityBmaintenanceA MCP server that provides AI-powered image generation capabilities through Google's Gemini 2.5 Flash Image model.4399MIT
- FlicenseNot gradedqualityBmaintenanceImage generation MCP server running on Cloudflare Workers, supporting multiple models like FLUX and SDXL with OpenAI-compatible endpoints.-
- AlicenseAqualityAmaintenanceAn MCP server that enables AI image editing and generation using the GPT Image 2 model line via RunAPI, with task polling and pricing checks.589 npmApache 2.0