MCP Image Generator v3LIVE

Version 3.0.0 | Stateless Workers Architecture

This is a Model Context Protocol (MCP) server for AI-powered image generation using Cloudflare Workers AI. Built with a stateless architecture for instant startup and reliable operation.

⚡ NEW: Parallel Image Generation

Generate up to 20 images simultaneously with the count parameter! Perfect for batch generation, variations, or rapid prototyping. Performance scales amazingly:

1 Image
~10s
Baseline
5 Images
~22s
2.3x faster
20 Images
~16s
12.5x faster! 🚀

✨ Architecture Highlights

🛠️ Available Tools (6 Total)

1. generate_image PARALLEL

Generate one or more images using AI. Returns immediately with job ID(s) for async processing.

{
  "prompt": "sunset over mountains",
  "model": "flux-schnell",  // optional: flux-schnell | sdxl-lightning | sdxl-base
  "count": 5                // optional: 1-20 images (default: 1)
}
count parameter (NEW!): Generate 1-20 images in parallel using the same prompt. Returns single job_id if count=1, or job_ids array if count>1.

Returns: job_id or job_ids[] in pending status

2. get_job_status

Check the status of an image generation job. Poll this to get results.

{
  "job_id": "abc123-def456-..."
}

Returns: Job details with status (pending/processing/completed/failed) and image_url when done

3. wait_for_completion SYNC

Wait for job(s) to complete automatically. No manual polling needed!

{
  "job_id": "abc123-..."          // Single job
  // OR
  "job_ids": ["abc", "def", ...]  // Multiple jobs (up to 20)
}

Behavior: Polls every 3 seconds. Timeout scales with count (60s + 3s per job). Perfect for AI clients without timing capabilities.

4. generate_image_and_wait EASIEST

One-call convenience: Generate and wait for completion automatically. Supports parallel generation!

{
  "prompt": "futuristic city at night",
  "model": "flux-schnell",  // optional
  "count": 10               // optional: 1-20 images
}

Returns: Completed image(s) with URL(s) when ready. Blocks until done (timeout scales with count).

5. list_generations

Browse successfully completed images (gallery view) with pagination.

{
  "limit": 10,  // optional (1-50, default: 10)
  "offset": 0   // optional (default: 0)
}

Returns: Array of completed generations with metadata, sorted by creation time (newest first)

6. list_jobs

List all jobs with optional status filtering and pagination.

{
  "status": "all",  // optional: all | pending | processing | completed | failed
  "limit": 10,      // optional (1-50, default: 10)
  "offset": 0       // optional (default: 0)
}

Returns: Array of jobs matching the filter, sorted by creation time (newest first)

🔌 Connect Your MCP Client

HTTP Endpoint: POST /mcp (JSON-RPC 2.0)
SSE Endpoint: POST /sse (Server-Sent Events)
Authentication: Bearer token in Authorization header
Server URL: https://mcp-image-generator-v3.webfonts.workers.dev

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "image-generator": {
      "command": "curl",
      "args": [
        "-X", "POST",
        "https://mcp-image-generator-v3.webfonts.workers.dev/mcp",
        "-H", "Content-Type: application/json",
        "-H", "Authorization: Bearer YOUR_AUTH_TOKEN"
      ]
    }
  }
}

Claude Code CLI

Add the server to your config:

claude mcp add image-generator \
  --url https://mcp-image-generator-v3.webfonts.workers.dev/mcp \
  --header "Authorization: Bearer YOUR_AUTH_TOKEN"

Then use prompts like: "Generate 5 variations of a mountain landscape"

MCP Inspector (Testing)

Launch the inspector for debugging:

npx @modelcontextprotocol/inspector \
  https://mcp-image-generator-v3.webfonts.workers.dev/sse \
  -H "Authorization: Bearer YOUR_AUTH_TOKEN"

Cursor IDE

Add to Cursor's MCP settings (Cursor → Settings → MCP):

{
  "image-generator": {
    "url": "https://mcp-image-generator-v3.webfonts.workers.dev/mcp",
    "headers": {
      "Authorization": "Bearer YOUR_AUTH_TOKEN"
    }
  }
}

Better Chatbot

Configure in your Better Chatbot settings:

{
  "url": "https://mcp-image-generator-v3.webfonts.workers.dev/mcp",
  "headers": {
    "Authorization": "Bearer YOUR_AUTH_TOKEN"
  }
}

Programmatic Access (Python/Node.js)

Call directly as an HTTP API:

// Node.js example
const response = await fetch('https://mcp-image-generator-v3.webfonts.workers.dev/mcp', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_AUTH_TOKEN'
  },
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'tools/call',
    params: {
      name: 'generate_image_and_wait',
      arguments: { prompt: 'cyberpunk city', count: 5 }
    }
  })
});

🚀 Quick Start Examples

Single image: "Generate an image of a sunset over the ocean"

Parallel generation: "Generate 10 different abstract patterns"

With specific model: "Generate 3 images of a mountain landscape using sdxl-lightning"

Async workflow: "Start generating 5 images, I'll check back later"

📊 Status

✅ Server is running
✅ All 6 tools registered
✅ Parallel generation enabled (up to 20 images)
✅ Database connected
✅ Queue consumer active
✅ Dual transport support (HTTP + SSE)