Openrouter Image Gen
FreeNot checkedMCP server for generating images using OpenRouter API, supporting models like Gemini 2.5 Flash. Enables image generation with flexible options like saving to lo
About
MCP server for generating images using OpenRouter API, supporting models like Gemini 2.5 Flash. Enables image generation with flexible options like saving to local files.
README
An MCP (Model Context Protocol) server that provides image generation capabilities through the OpenRouter API, supporting models like Gemini 2.5 Flash Image Preview.
Features
Image Generation: Generate images using Google Gemini 2.5 Flash Image Preview
Flexible Options:
- Save generated images to local files
Installation
- Clone the repository:
git clone https://github.com/a13.team/openrouter-image-gen-mcp.git
cd openrouter-image-gen-mcp
- Install dependencies:
npm install
- Build the TypeScript code:
npm run build
- Set up your OpenRouter API key:
export OPENROUTER_API_KEY="your-api-key-here"
You can get an API key from OpenRouter.
Configuration for Claude Desktop
Add the following to your Claude Desktop configuration file:
macOS/Linux
Location: ~/.config/claude/claude_desktop_config.json
Windows
Location: %APPDATA%\Claude\claude_desktop_config.json
Cursor IDE Configuration
Location: ./cursor/mcp.json
{
"mcpServers": {
"openrouter-image-gen": {
"command": "node",
"args": ["/path/to/openrouter-image-gen-mcp/dist/index.js"],
"env": {
"OPENROUTER_API_KEY": "your-api-key-here"
}
}
}
}
Replace /path/to/openrouter-image-gen-mcp with the actual path to your installation directory.
Available Tools
1. generate_image
Generate images using AI models.
Parameters:
prompt(required): Text description of the image to generatemodel: Model to use (default:google/gemini-2.5-flash-image-preview)n: Number of images to generate (1-4, default: 1)size: Image dimensions (default:1024x1024)save_to_file: Save images locally (default: false)filename: Base filename for saved imagesshow_full_response: Include full base64 data in response (default: false, returns concise info only)
Example:
{
"prompt": "A serene Japanese garden with cherry blossoms",
"model": "google/gemini-2.5-flash-image-preview",
"save_to_file": true,
"filename": "japanese_garden"
}
Note: Gemini image generation works through the chat completions API. The model will generate an image based on your prompt and return it as a URL or base64 data in the response. The size parameter is not used for Gemini models.
2. list_models
List all available image generation models.
Development
Build
npm run build
Run in development mode
npm run dev
Start the server
npm start
API Documentation
Troubleshooting
401 Authentication Error
If you get a 401 error, check:
- Your API key is correctly set in the environment or Claude Desktop config
- The API key starts with
sk-or-(OpenRouter format) - The API key is valid and has not expired
- You have credits available in your OpenRouter account
Test your API key loading:
node test-api-key.js
Common Issues
- API Key not loading: Make sure the
OPENROUTER_API_KEYis set in your Claude Desktop config'senvsection - Model access denied: Some models require specific permissions or higher tier accounts
- Image not generating for Gemini: Gemini uses the chat completions endpoint, not the images endpoint
License
WTFPL - Do What The Fuck You Want To Public License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Else Models:
`google/gemini-3-pro-image-preview`
`google/gemini-2.5-flash-image`
`google/gemini-2.5-flash-image-preview`
Installing Openrouter Image Gen
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/dev66613/openrouter-image-gen-mcpFAQ
Is Openrouter Image Gen MCP free?
Yes, Openrouter Image Gen MCP is free — one-click install via Unyly at no cost.
Does Openrouter Image Gen need an API key?
No, Openrouter Image Gen runs without API keys or environment variables.
Is Openrouter Image Gen hosted or self-hosted?
A hosted option is available: Unyly runs the server in the cloud, no local setup required.
How do I install Openrouter Image Gen in Claude Desktop, Claude Code or Cursor?
Open Openrouter Image Gen on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
ARA
Generate images, video and audio from any AI agent — one connector.
by ARAOmni Video
An MCP server that transforms LLM-enabled IDEs into professional video editors by pre-processing footage into text proxies, generating motion graphics via HTML/
by buildwithtazaYouTube
Transcripts, channel stats, search
by YouTubeEverArt
AI image generation using various models.
by modelcontextprotocolgpu-bridge/mcp-server
Unified GPU inference API with 30 AI services (LLM, image gen, video, TTS, whisper, embeddings, reranking, OCR) as MCP tools. Pay-per-use via x402 USDC or API k
by gpu-bridgehamflx/imagen3-mcp
A powerful image generation tool using Google's Imagen 3.0 API through MCP. Generate high-quality images from text prompts with advanced photography, artistic,
by hamflxmerterbak/Grok-MCP
MCP server for xAI's [Grok API](https://docs.x.ai/docs/overview) with agentic tool calling, image generation, vision, and file support.
by merterbakSureScaleAI/openai-gpt-image-mcp
OpenAI GPT image generation/editing MCP server.
by SureScaleAIYangLiangwei/PersonalizationMCP
Comprehensive personal data aggregation MCP server with Steam, YouTube, Bilibili, Spotify, Reddit and other platforms integrations. Features OAuth2 authenticati
by YangLiangweiAceDataCloud/MCPFlux
Flux AI image generation and editing (Black Forest Labs) via Ace Data Cloud API.
by AceDataCloudCompare Openrouter Image Gen with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All media MCPs
