imagegen

imagegen

Local-first MCP image generation server supporting OpenAI and Google Gemini models for generating and editing images, with an embedded interactive studio.

Category
Visit Server

README

imagegen

Local-first MCP image generation server with multi-model support and an embedded interactive studio.

Generate and edit AI images through OpenAI GPT Image and Google Gemini models via the Model Context Protocol (MCP). Includes a built-in studio UI for visual iteration directly inside the chat surface.

Works with any MCP-compatible client: Claude Desktop, Cursor, Windsurf, AnythingLLM, and other AI platforms.

Features

  • Multi-model support -- OpenAI GPT Image 1.5, GPT Image 1 Mini, Google Gemini 3.1 Flash, Gemini 3 Pro, Gemini 2.5 Flash
  • Image generation -- create images from detailed text prompts with configurable aspect ratios and quality profiles
  • Image editing -- modify existing images with natural language instructions and optional reference images
  • Embedded studio -- interactive MCP App for browsing assets, switching models, adjusting settings, and iterating visually
  • Local asset storage -- all generated and uploaded images are persisted locally with full history
  • Enterprise-ready -- configurable model access, concurrency limits, and provider API key management

Tools

Model-visible

These tools are exposed to the AI model:

Tool Description
imagegen_generate Generate a new image from a detailed text prompt
imagegen_edit Edit an existing image using instructions and optional reference images
imagegen_list_models List enabled image models and their capabilities

App-only

These tools are used internally by the embedded studio UI and are not visible to the AI model:

imagegen_list_assets, imagegen_read_asset_bytes, imagegen_create_upload, imagegen_append_upload_chunk, imagegen_finalize_upload

Quick start

Prerequisites: Node.js >= 24, pnpm

git clone https://github.com/CCimen/imagegen.git
cd imagegen
pnpm install
cp .env.example .env

Set at least one provider API key in .env:

OPENAI_API_KEY=sk-...
# and/or
GOOGLE_API_KEY=AI...

Start the server:

pnpm dev

The Streamable HTTP endpoint is available at:

http://127.0.0.1:3001/mcp

Configuration

Variable Default Description
OPENAI_API_KEY -- OpenAI API key (required for GPT Image models)
GOOGLE_API_KEY -- Google AI API key (required for Gemini Image models)
MCP_IMAGEGEN_DATA_DIR ~/.mcp-imagegen Local directory for generated assets
IMAGEGEN_ENABLED_MODELS gpt-image-1.5,gemini-3.1-flash-image-preview Comma-separated list of enabled model IDs
IMAGEGEN_DEFAULT_MODEL gpt-image-1.5 Model used when none is specified
IMAGEGEN_CONCURRENCY_LIMIT 2 Max concurrent image generation requests
IMAGEGEN_HTTP_HOST 127.0.0.1 Server bind address
IMAGEGEN_HTTP_PORT 3001 Server port

MCP client configuration

Add this to your MCP client configuration (e.g. claude_desktop_config.json):

{
  "mcpServers": {
    "imagegen": {
      "url": "http://127.0.0.1:3001/mcp"
    }
  }
}

Docker: If connecting from inside a container, use http://host.docker.internal:3001/mcp instead of 127.0.0.1.

Supported models

Model Provider Highlights
gpt-image-1.5 OpenAI State-of-the-art image generation and editing
gpt-image-1-mini OpenAI Cost-efficient variant with editing support
gemini-3.1-flash-image-preview Google Fast generation with thinking controls
gemini-3-pro-image-preview Google High-fidelity text rendering
gemini-2.5-flash-image Google Low-latency generation

Models are enabled via IMAGEGEN_ENABLED_MODELS in .env. The server fails fast on startup if no enabled models have valid API keys configured.

Development

pnpm dev          # build studio + start server in watch mode
pnpm test         # run all tests
pnpm test:e2e     # run end-to-end server tests
pnpm build        # production build
pnpm start        # start production server
pnpm check        # type-check all packages

License

AGPL-3.0-only

If you run a modified version of this server for users over a network, you must make the corresponding source available to those users, as required by the AGPL.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured