Documentation

API Reference

Complete documentation for integrating Image MCP into your AI workflows.

🤖 For AI Agents & LLMs

1. Overview

Image MCP is a hosted Model Context Protocol (MCP) server that provides AI agents with image generation capabilities. It uses the MCP standard for seamless integration with LLM applications.

🔌
Zero Config
Just add the endpoint URL
🎨
5 AI Models
Gemini, GPT-5, FLUX.2
âš¡
CDN Delivery
Fast global image access

2. Authentication

Image MCP requires an API key for authentication. Get your API key from the Dashboard.

🔑 Credit System: Each image generation costs 10 credits. New accounts receive free credits to get started.

HeaderAuthorization
FormatBearer YOUR_API_KEY
Get API KeyDashboard → API Keys

3. Quick Start

💡 Replace YOUR_API_KEY with your actual API key from the Dashboard.

For Cursor

.cursor/mcp.json
{
  "mcpServers": {
    "image-mcp": {
      "url": "https://imagemcp.io/api/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}

For Claude Desktop

Terminal
claude mcp add --transport http --header "Authorization: Bearer YOUR_API_KEY" image-mcp https://imagemcp.io/api/mcp

4. API Endpoint

URLhttps://imagemcp.io/api/mcp
ProtocolModel Context Protocol (MCP)
TransportStreamable HTTP
MethodPOST
AuthenticationAuthorization: Bearer YOUR_API_KEY

5. Tools

generate_image

Generate an image from a text prompt

Parameters

prompt
requiredstring

Text description of the image to generate

model
optionalstring

Model ID to use. Default: google/gemini-3-pro-image-preview

Response

{
  "url": "https://cdn.../generated/1234-abc.png",
  "model": "google/gemini-3-pro-image-preview",
  "prompt": "A serene Japanese garden...",
  "filename": "1234-abc.png"
}

6. Available Models

google/gemini-3-pro-image-previewdefault
Gemini 3 Pro Image Preview
Google's latest multimodal model with high-quality image generation
openai/gpt-5-image
GPT-5 Image
OpenAI's state-of-the-art image generation model
black-forest-labs/flux.2-flex
FLUX.2 Flex
Black Forest Labs flexible diffusion model for varied outputs
black-forest-labs/flux.2-pro
FLUX.2 Pro
Black Forest Labs professional-grade diffusion model
google/gemini-2.5-flash-image
Gemini 2.5 Flash Image
Google's fast multimodal model optimized for speed

7. Prompts

generate-image

Basic image generation prompt

description
requiredstring

User's description of the desired image

generate-image-detailed

Detailed generation with style parameters

subject
requiredstring

Main subject of the image

style
optionalstring

Art style (e.g., photorealistic, cartoon, oil painting)

mood
optionalstring

Mood or atmosphere (e.g., dramatic, peaceful, vibrant)

lighting
optionalstring

Lighting conditions (e.g., sunset, studio, neon)

8. Resources

mcp://image-mcp/models

Returns a list of all available image generation models.

Response
{
  "models": [
    { "id": "google/gemini-3-pro-image-preview", "name": "Gemini 3 Pro Image Preview" },
    { "id": "openai/gpt-5-image", "name": "GPT-5 Image" },
    { "id": "black-forest-labs/flux.2-flex", "name": "FLUX.2 Flex" },
    { "id": "black-forest-labs/flux.2-pro", "name": "FLUX.2 Pro" },
    { "id": "google/gemini-2.5-flash-image", "name": "Gemini 2.5 Flash Image" }
  ]
}

9. Examples

Basic Image Generation

MCP Tool Call
{
  "name": "generate_image",
  "arguments": {
    "prompt": "A majestic snowy mountain peak at sunrise, photorealistic, golden hour lighting, dramatic clouds"
  }
}

With Specific Model

MCP Tool Call
{
  "name": "generate_image",
  "arguments": {
    "prompt": "Cyberpunk cityscape with neon lights reflecting on wet streets, futuristic",
    "model": "black-forest-labs/flux.2-pro"
  }
}

Example Prompts for Best Results

Portrait: "Professional headshot of a confident business executive, studio lighting, neutral gray background, sharp focus"

Landscape: "Alpine lake at golden hour with snow-capped mountains, oil painting style, peaceful atmosphere"

Product: "Minimalist wireless earbuds floating on gradient background, soft shadows, product photography, clean aesthetic"

Fantasy: "Ancient dragon with crystalline scales perched on a mountain, bioluminescent details, epic fantasy art"

10. Error Handling

ErrorCauseSolution
No image URL foundModel failed to generateTry a different model or simplify prompt
API error: 429Rate limitedWait and retry
API error: 500Model service issueTry a different model