Skip to main content
Glama

Providers supported (image models only):

  • OpenRouter (default) — Gemini Flash Image, FLUX 2, Sourceful Riverflow, GPT-5 Image

  • Together AI — FLUX.1 Schnell/Dev/Pro, Stable Diffusion XL

  • Replicate — FLUX Schnell, FLUX 1.1 Pro, SDXL, Ideogram

  • fal.ai — FLUX Dev/Schnell/2 Pro, Recraft V3

Quick Start

No install needed — just use npx:

OPENROUTER_API_KEY="sk-or-v1-..." npx -y mcpimg

Related MCP server: jgkme/kilo-image-gen-mcp

Tools

generate_image

Generate an image from a text prompt.

Parameter

Type

Description

prompt

string (required)

Text description of the image

model

string

Model ID (e.g. google/gemini-2.5-flash-image)

provider

string

openrouter (default), together, replicate, fal

aspect_ratio

string

1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3

image_size

string

1K (default), 2K, 4K

negative_prompt

string

What to exclude (not all providers support this)

seed

number

Random seed for reproducibility

save_to

string

Custom file path to save the image

list_providers

List all configured providers and their available image models.

Parameter

Type

Description

provider

string

Filter by provider name


Setup for AI Agents / IDEs

Claude Code

claude mcp add --scope user --transport stdio image-gen \
  --env OPENROUTER_API_KEY=sk-or-v1-xxx \
  -- npx -y mcpimg

Or create .mcp.json in your project root:

{
  "mcpServers": {
    "image-gen": {
      "command": "npx",
      "args": ["-y", "mcpimg"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-v1-..."
      }
    }
  }
}

Cursor

Edit ~/.cursor/mcp.json:

{
  "mcpServers": {
    "image-gen": {
      "command": "npx",
      "args": ["-y", "mcpimg"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-v1-..."
      }
    }
  }
}

Claude Desktop

Edit the config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • Linux: ~/.config/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "image-gen": {
      "command": "npx",
      "args": ["-y", "mcpimg"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-v1-..."
      }
    }
  }
}

OpenCode (by SST)

Edit ~/.config/opencode/opencode.json or opencode.json in project root:

{
  "mcp": {
    "image-gen": {
      "type": "local",
      "command": ["npx", "-y", "mcpimg"],
      "environment": {
        "OPENROUTER_API_KEY": "sk-or-v1-..."
      },
      "enabled": true,
      "timeout": 120000
    }
  }
}

Charm Crush

Add to crush.json in your project root:

{
  "mcp": {
    "image-gen": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "mcpimg"],
      "env": {
        "OPENROUTER_API_KEY": "sk-or-v1-..."
      }
    }
  }
}

Charm Mods

Edit mods.yml (mods --settings):

mcp-servers:
  image-gen:
    command: [npx]
    args:
      - -y
      - mcpimg
    env:
      - OPENROUTER_API_KEY=sk-or-v1-...

Any MCP-compatible agent

This server uses stdio transport (JSON-RPC over stdin/stdout). Any agent that supports MCP stdio can use it:

npx -y mcpimg

# Required environment variables (at least one)
OPENROUTER_API_KEY=...    # OpenRouter (default)
TOGETHER_API_KEY=...      # Together AI
REPLICATE_API_TOKEN=...   # Replicate
FAL_KEY=...               # fal.ai

Using Multiple Providers

Set multiple API keys to use different providers:

export OPENROUTER_API_KEY="sk-or-v1-..."
export TOGETHER_API_KEY="..."
export FAL_KEY="..."

Then specify the provider when generating:

generate_image(prompt="a cat", provider="together", model="black-forest-labs/FLUX.1-schnell")

Environment Variables

Variable

Provider

Required

OPENROUTER_API_KEY

OpenRouter

At least one

TOGETHER_API_KEY

Together AI

provider key

REPLICATE_API_TOKEN

Replicate

is required

FAL_KEY

fal.ai

IMAGE_OUTPUT_DIR

—

Optional. Default: ~/generated-images/

License

MIT

Available Tools

2 tools
generate_imageGenerate ImageC

Generate an image from a text prompt. Uses OpenRouter by default. Supports multiple providers: openrouter, together, replicate, fal.

Inputs: prompt (required), seed, model, save_to, +4 more.

list_providersList Image ProvidersB

List all configured image generation providers and their available models

Inputs: provider.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools are clearly distinct: list_providers is a read-only discovery call, while generate_image performs the actual generation action. An agent can trivially tell which one to invoke for a given need.

    Naming Consistency5/5

    Both tools follow a consistent verb_noun snake_case pattern (list_providers, generate_image), matching the conventions used in the descriptions' provider references. No stylistic deviations.

    Tool Count3/5

    Two tools is on the thin side for the stated scope: listing providers and generating images leaves no room for variations, edits, or batch operations. It is defensible for a narrow text-to-image wrapper but borderline per the rubric.

    Completeness4/5

    The core lifecycle of discovering providers and generating an image is covered, with sensible multi-provider support. Gaps like image editing/variations, batch generation, or generation status are absent but not fatal to the primary use case.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers