Skip to main content
Glama
jtxmp
by jtxmp

openrouter-imgen-mcp

Give your AI assistant the ability to generate and edit images. One install, multiple models, no vendor lock-in.

Screenshots

Before

After

Before

After

Works with Claude Code, Claude Desktop, Cursor, VS Code, Windsurf, and any MCP client.

Related MCP server: OpenRouter Image Generation MCP Server

Why This

  • One API key, every image model. Gemini, GPT-5, and more through OpenRouter. Switch models with a word, not a code change.

  • Generate, edit, and batch. Text-to-image, image editing with references, and batch operations (up to 20 parallel tasks).

  • Style presets. Say "in watercolor style" or "as pixel art" and get consistent results. 8 built-in styles.

  • Variations. Generate up to 4 takes from one prompt. Pick the best one.

  • Smart file output. Save to a path or a directory. Files get descriptive names automatically.

  • Pay for what you use. OpenRouter's per-token and per-image pricing means no subscriptions.

How to Install

Get an OpenRouter API key, then add the server to your client.

Claude Code

# macOS / Linux
claude mcp add openrouter-imgen-mcp -s user -e OPENROUTER_API_KEY=YOURAPIKEY -- npx -y openrouter-imgen-mcp@latest

# Windows
claude mcp add openrouter-imgen-mcp -s user -e OPENROUTER_API_KEY=YOURAPIKEY -- cmd /c npx -y openrouter-imgen-mcp@latest

Claude Desktop / Cursor / VS Code / Windsurf

Add to your MCP config JSON:

{
  "mcpServers": {
    "openrouter-imgen-mcp": {
      "command": "npx",
      "args": ["-y", "openrouter-imgen-mcp@latest"],
      "env": {
        "OPENROUTER_API_KEY": "YOURAPIKEY"
      }
    }
  }
}

What You Can Do

Simply chat with your assistant:

Generate a product photo of a ceramic mug on a wooden table, warm lighting
Generate 3 variations of a logo concept for a coffee brand, pixel-art style
Edit /path/to/headshot.png: make the background a gradient, keep the subject
Batch generate 5 social media banners: summer sale, back to school, holiday promo,
new arrivals, free shipping. All in illustration style, 16:9, save to ./banners/
List image models. What's cheapest for quick drafts?

Quality Presets

Skip the model IDs. Just say "fast", "balanced", or "quality":

Preset

Model

When to use

fast

Gemini 2.5 Flash

Drafts, iteration, keeping costs low

balanced

Gemini 3 Pro

Day-to-day use (default)

quality

GPT-5 Image

Final deliverables, max fidelity

Or pass any OpenRouter model ID directly:

Generate a cat using model google/gemini-2.5-flash-image

Style Presets

Keywords modifies the style:

Style

What you get

photo

Photorealistic, DSLR, natural lighting

illustration

Clean digital art, vibrant colors

watercolor

Soft washes, paper texture

pixel-art

Retro 16-bit, limited palette

3d-render

Studio-lit, physically based rendering

anime

Cel-shaded, Japanese animation

sketch

Pencil on paper, monochrome

oil-painting

Brushstrokes, impasto, classical

Tools Reference

Convenient tools:

Tool

What it does

generate_image

Text-to-image with quality/style presets, variations (1-4), aspect ratio, file output

edit_image

Transform images with a prompt + up to 12 reference images (files, URLs, data URIs)

batch_images

Run up to 20 generate/edit tasks in parallel with concurrency control

list_image_models

Browse available models with pricing

check_balance

Check your OpenRouter credit balance

Supported output: 1:1, 2:3, 3:2, 16:9, 9:16, 4:3, 3:4 aspect ratios. 0.5K, 1K, 2K, 4K sizes. PNG, JPEG, WebP, GIF inputs.

Headless Configuration

Flag

Env Var

Default

--api-key

OPENROUTER_API_KEY

(required)

--default-model

OPENROUTER_IMG_DEFAULT_MODEL

google/gemini-3-pro-image-preview

--batch-concurrency

OPENROUTER_IMG_BATCH_CONCURRENCY

3

--cache-ttl

OPENROUTER_IMG_CACHE_TTL

300000 (5 min)

--log-level

OPENROUTER_IMG_LOG_LEVEL

warn

Security

API keys never appear in logs or error messages. File paths block directory traversal. Image URLs are validated against SSRF patterns. Batch operations are memory-capped at 200MB. All inputs are schema-validated.

For Developers

To build for devs:

pnpm install && pnpm build && pnpm test  # 57 tests

License

MIT


Made with <3 at Bitcoin.com

Available Tools

5 tools
batch_imagesB

Generate or edit multiple images in a single call with concurrency control. Each task can be a generation (prompt only) or edit (prompt + reference images).

ParametersJSON Schema
NameRequiredDescriptionDefault
tasksYesArray of image tasks
concurrencyNoMax concurrent API calls (default: 3)

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states that tasks may be generation or edit and that concurrency is controllable, but omits the behavior that matters most for a batch tool: what happens on partial failure (does one bad task abort the rest?), result ordering/correlation to input tasks, and any cost or rate-limit implications.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences, zero waste, with the core purpose front-loaded and the generation-vs-edit distinction immediately after. Nothing is padded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a batch tool with no annotations and no output schema, the description covers purpose but leaves out partial-failure behavior and how results map back to the input tasks—information an agent needs to call and interpret this correctly. Adequate but with real gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and there are only 2 top-level parameters, so the schema already documents the task fields and the concurrency default of 3. The description adds only the notion of 'concurrency control,' no format or semantics beyond the schema—appropriate baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names a specific verb+resource (generate or edit multiple images) and clearly scopes it to batching in a single call, which implicitly separates it from the singular generate_image/edit_image siblings. It does not name those siblings explicitly, so differentiation is inferred rather than stated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied: use this when you have several image tasks to run together rather than one at a time. There is no explicit when-to-use/when-not statement, no guidance on when batch beats looping the single-image tools, and no mention of when the concurrency control matters.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

check_balanceA

Check your OpenRouter account balance — shows total credits, usage, and remaining balance.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden. It discloses the return contents (total credits, usage, remaining balance), which is useful, and implies a safe read. However it says nothing about authentication requirements, rate limits, or whether the data is live/cached.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One front-loaded sentence with an em-dash elaboration; no filler, no redundancy. Appropriate for the tool's simplicity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, but the description substitutes by naming the three values returned, and the zero-parameter schema needs no explanation. Auth/mutability details are the only real gaps, and those are minor for a read-only balance check.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so the baseline is 4. There is no parameter syntax that requires explanation in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (check) and resource (OpenRouter account balance), then enumerates the returned figures. An agent immediately knows what the tool does. It does not need sibling differentiation since the siblings (image generation tools) are unrelated, so a 4 rather than 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the name and description — you call it to inspect account credit status. There is no explicit statement of when to use it, no prerequisites, and no alternatives named, but for a zero-argument read tool the intent is self-evident.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

edit_imageB

Edit or transform existing images using a text prompt and reference images. Supports local file paths, URLs, and data URIs. For best results, expand brief prompts with details about composition, lighting, color palette, and mood before calling — unless the user explicitly asked for a simple/minimal prompt.

ParametersJSON Schema
NameRequiredDescriptionDefault
modelNoModel ID (defaults to Gemini 3 Pro Image Preview)
styleNoVisual style preset to prepend to the prompt
imagesYesReference images: local file paths, HTTP URLs, or data URIs
promptYesWhat to do with the image(s)
image_sizeNoOutput image size
output_pathNoOptional path to save the result. Can be a full file path or a directory (auto-names the file)
aspect_ratioNoOutput aspect ratio

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It usefully discloses accepted input sources (local paths, URLs, data URIs) and prompt-expansion behavior, but says nothing about cost, whether the result is returned inline or written to disk, or what output_path does by default for a generative operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tightly written sentences that front-load the core action and then the prompt-quality tip. Every clause earns its place, with no redundant restatement of the tool name or schema fields.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter generation/edit tool with no annotations and no output schema, the description covers inputs but leaves the output contract and cost/behavior profile unstated. It is minimally adequate given the rich schema, but not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all seven parameters are already documented in the schema, including enums for style, image_size, and aspect_ratio. The description adds no parameter-level detail beyond this baseline, which is acceptable but unremarkable.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb (edit/transform) and resource (existing images via text prompt and reference images). The word 'existing' implicitly distinguishes it from generate_image, though it never names that sibling explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives real guidance on prompt preparation ('expand brief prompts... unless the user explicitly asked for a simple/minimal prompt'), which is useful operating advice. However, it offers no guidance on when to pick this tool over generate_image, batch_images, or how it relates to list_image_models/check_balance, so tool selection is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_imageA

Generate an image from a text prompt via OpenRouter. Supports quality presets (fast/balanced/quality) or explicit model IDs. For best results, expand brief prompts with details about composition, lighting, color palette, and mood before calling — unless the user explicitly asked for a simple/minimal prompt.

ParametersJSON Schema
NameRequiredDescriptionDefault
countNoNumber of image variations to generate (1-4). Ask the user how many they want before generating.
modelNoExplicit OpenRouter model ID — overrides quality preset
styleNoVisual style preset to prepend to the prompt
promptYesWhat to generate
qualityNoQuality preset: fast (cheap/quick), balanced (default), quality (best output)balanced
image_sizeNoOutput image size
output_pathNoOptional path to save the PNG. Can be a full file path or a directory (auto-names the file)
aspect_ratioNoOutput aspect ratio

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It discloses the OpenRouter backend and the meaning of the quality presets (cheap/quick vs best output), which is useful. But it omits cost implications, latency, rate limits, and whether the result is returned inline or only via output_path.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, zero filler, front-loaded with the core action and backend. The prompt-expansion caveat follows logically and is appropriately short.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter generation tool with no output schema, the definition should clarify what is returned (image bytes, URL, or a saved file path) and how output_path changes that. The model/preset relationship is covered, but this return-shape gap leaves the definition only adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all 8 parameters are already documented in the schema, establishing a baseline of 3. The description adds one cross-parameter nuance (model overrides the quality preset) that the schema only hints at, but doesn't explain output_path behavior or aspect-ratio/size interaction.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource (generate an image) plus the backend (OpenRouter), and distinguishes its two configuration paths (quality presets vs explicit model IDs). An agent can tell it apart from edit_image, batch_images, and list_image_models without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Offers concrete advice on when to expand a prompt and when not to (simple/minimal user request), which is real usage guidance. However, it says nothing about when to use this tool versus edit_image or batch_images, nor about cost/prerequisite conditions implied by check_balance being a sibling.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_image_modelsB

List available image generation models from OpenRouter with pricing and capabilities.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryNoFilter models by substring match on model ID or name

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states what is listed but not whether results are cached, how fresh pricing data is, whether authentication is required, or if the list is paginated.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single efficient sentence that front-loads the action and resource with no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a simple read-only single-param tool, but with no annotations and no output schema, the description could reasonably say more about return shape or usage context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, with the query parameter fully documented as a substring match. The description adds no parameter details, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear verb+resource: lists image generation models, and specifies source (OpenRouter) and included data (pricing, capabilities). It distinguishes itself from siblings like generate_image by being a read-only catalog operation, though it does not explicitly name them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this versus alternatives or prerequisites. An agent could infer it's for discovering models before calling generate_image, but nothing is stated explicitly.

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.

  1. 5 tool updatesv0.1.1
    • First observedbatch_images
    • First observedcheck_balance
    • First observededit_image
    • First observedgenerate_image
    • First observedlist_image_models

TDQS

A3.7/5.0

Scored across 5 tools

Disambiguation4/5

Each tool has a distinct purpose: listing models, generating, editing, checking balance, and batching. The only mild overlap is batch_images, which subsumes both generate_image and edit_image, so an agent might occasionally debate between batch and single-call tools.

Naming Consistency5/5

All five tools follow a clean verb_noun snake_case pattern (list_image_models, generate_image, edit_image, check_balance, batch_images). The convention is applied uniformly with no style deviations.

Tool Count5/5

Five tools is well-scoped for an image generation/editing server, covering discovery, generation, editing, batching, and account state without redundancy. Each tool clearly earns its place.

Completeness4/5

The surface covers the core lifecycle: model discovery, single and batch generation, editing, and balance checking. Minor gaps like image upscaling, variation, or history/retrieval operations are absent but not essential to the stated purpose.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers