# openrouter-imgen-mcp [Health: Active]

**Category:** 🎥 Multimedia Process  
**Repository:** https://github.com/jtxmp/openrouter-imgen-mcp  
**GitHub Stars:** 2  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/openrouter-imgen-mcp

## Description
MCP server for image generation via OpenRouter — supports quality presets, image editing, batch operations, and multiple models

## Tools
Capabilities this server exposes over MCP:

- **list_image_models** — List available image generation models from OpenRouter with pricing and capabilities.
- **generate_image** — 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.
- **edit_image** — 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.
- **batch_images** — 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).
- **check_balance** — Check your OpenRouter account balance — shows total credits, usage, and remaining balance.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

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

**Requires environment variables:** `OPENROUTER_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What openrouter-imgen-mcp does

openrouter-imgen-mcp gives an MCP-compatible assistant access to OpenRouter image models. It covers both new image creation and transformations of existing images, with controls for model choice, visual style, output dimensions, variations, and saved files.

The server is useful for workflows such as creating product imagery, exploring logo concepts, preparing social media graphics, or changing the background of a supplied photo. OpenRouter provides access to multiple image models through one API key, so a client can use named quality presets or pass a model ID directly.

## How it works

The server runs as an MCP process and receives tool calls from a compatible client. Generation requests can use the `fast`, `balanced`, or `quality` presets, or specify an OpenRouter image model directly. Style keywords map to built-in presets including photo, illustration, watercolor, pixel art, 3D render, anime, sketch, and oil painting.

`generate_image` accepts a prompt and can produce one to four variations. Requests can also select an aspect ratio, image size, and output path or directory. Supported aspect ratios include `1:1`, `2:3`, `3:2`, `16:9`, `9:16`, `4:3`, and `3:4`; supported sizes range from `0.5K` to `4K`.

`edit_image` applies a prompt to an existing image and accepts up to 12 reference images. References may be local files, URLs, or data URIs. `batch_images` combines generation and editing tasks, running as many as 20 jobs with configurable concurrency.

## Setup and configuration

An OpenRouter API key is required. The package can be launched with `npx` and configured in an MCP client's JSON settings:

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

Claude Code can also register it with `claude mcp add`, passing the API key as an environment setting. Optional configuration controls the default model, batch concurrency, cache lifetime, and logging level. Their environment variables are `OPENROUTER_IMG_DEFAULT_MODEL`, `OPENROUTER_IMG_BATCH_CONCURRENCY`, `OPENROUTER_IMG_CACHE_TTL`, and `OPENROUTER_IMG_LOG_LEVEL`.

## Tools and capabilities

- `generate_image`: Create images from text with quality and style presets, variations, aspect ratios, sizes, and file output.
- `edit_image`: Transform an image using a prompt and up to 12 file, URL, or data-URI references.
- `batch_images`: Process up to 20 generation or editing tasks in parallel with concurrency control.
- `list_image_models`: View available image models and their pricing.
- `check_balance`: Inspect the OpenRouter credit balance.

Generated files can receive descriptive names automatically when saved to a path or directory. Input formats include PNG, JPEG, WebP, and GIF.

## Limitations and notes

Batch processing is capped at 20 tasks and has a memory limit of 200 MB. Generation variations are limited to four, and image editing accepts no more than 12 references. OpenRouter usage is charged according to its pricing, including per-token and per-image costs.

The server validates inputs against schemas, checks image URLs for SSRF patterns, blocks directory traversal in file paths, and keeps API keys out of logs and error messages. Development commands use pnpm for installation, building, and tests.

_Full upstream README: https://allmcps.com/mcp/openrouter-imgen-mcp/readme_

