GenImgMCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GenImgMCPGenerate a 16:9 hero image of a futuristic city and save it to ./assets/hero.png"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
GenImgMCP ๐จ
Local MCP (Model Context Protocol) server for image generation and editing using the google/gemini-3.1-flash-image model via OpenRouter.
Designed specifically for coding agents (such as Antigravity, Claude Code, Cursor, and other MCP clients), saving images directly to the project's local file system and returning the file path and structured metadata in a lightweight manner (without cluttering the context window with Base64 strings).
โจ Features
๐ผ๏ธ Image Generation (
generate_image): Create images from detailed text prompts.๐๏ธ Image Editing and Variations (
edit_image): Transform, refine, or add elements to existing images on disk.๐พ Automatic Local Saving: Saves image files directly to the project directory requested by the agent (or in
./generated_images/).โก Lightweight & Efficient Response: Returns only the absolute file path and metadata (size, format, aspect ratio), preserving the caller LLM's context tokens.
๐ Aspect Ratio & Format Control: Supports multiple aspect ratios (
1:1,16:9,9:16,4:3,3:4,3:2,2:3,21:9) and file formats (png,webp,jpeg).๐ Model Flexibility: Defaults to
google/gemini-3.1-flash-image, with support for any multimodal model available on OpenRouter.
Related MCP server: openrouter-imgen-mcp
๐ Installation and Build
1. Prerequisites
Node.js 18 or higher
OpenRouter API Key
2. Install Dependencies and Build
# In the project root:
npm install
npm run buildโ๏ธ Configuration
You can configure the API key in one of three ways:
Environment Variable: Set
OPENROUTER_API_KEYin your environment..envFile: Create a.envfile in the root of the project:OPENROUTER_API_KEY=sk-or-v1-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx DEFAULT_IMAGE_MODEL=google/gemini-3.1-flash-image DEFAULT_OUTPUT_DIR=./generated_imagesCommand Line Argument: Pass
--api-key <your_key>in arguments when starting the server.
๐ ๏ธ Available Tools
1. generate_image
Generates a new image based on a text prompt.
Parameter | Type | Required | Description |
|
| Yes | Detailed description of the image to generate. |
|
| No | File path where the image will be saved (e.g., |
|
| No | Aspect ratio of the image ( |
|
| No | File format ( |
|
| No | Model on OpenRouter (Default: |
2. edit_image
Modifies an existing image provided by local file path.
Parameter | Type | Required | Description |
|
| Yes | Source image path (e.g., |
|
| Yes | Modification instructions or elements to add. |
|
| No | Destination path for the edited image. |
|
| No | Desired aspect ratio for the resulting image. |
|
| No | Output file format ( |
|
| No | Model on OpenRouter (Default: |
๐ How to Integrate with MCP Clients
Configuration in Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"genimg": {
"command": "node",
"args": [
"D:/MyProjs.Github/GenImgMCP/dist/index.js"
],
"env": {
"OPENROUTER_API_KEY": "sk-or-v1-your-key-here"
}
}
}
}Configuration in Antigravity / Cursor / MCP Config (mcp_config.json)
{
"mcpServers": {
"genimg": {
"command": "node",
"args": [
"D:/MyProjs.Github/GenImgMCP/dist/index.js"
],
"env": {
"OPENROUTER_API_KEY": "sk-or-v1-your-key-here"
}
}
}
}๐งช Testing the Server Locally
You can run the server directly in the terminal to verify startup:
node dist/index.jsThe server will start and wait for JSON-RPC messages on the stdio channel.
๐ License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables image generation via OpenRouter API, supporting models like Gemini 2.5 Flash Image Preview with options to save files locally.21Do What The F*ck You Want To Public
- AlicenseNot gradedqualityCmaintenanceGives AI assistants image generation and editing capabilities through OpenRouter, supporting multiple models, style presets, variations, and batch operations.322MIT
- AlicenseNot gradedqualityDmaintenanceEnables image and video generation from text, image editing, and text-to-video workflows using AI models via OpenRouter and fal.ai.MIT
- AlicenseAqualityAmaintenanceEnables coding agents to generate and edit images using Gemini and OpenAI image models, saving files directly into the project with configurable providers, models, and security restrictions.3MIT
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Generate images, video, and audio with Glif's media-generation agent
Generate images, GIFs, and PDFs from HTML, URLs, or templates โ from your AI agent.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/fabiojbg/GenImgMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server