imagegen
Local-first MCP image generation server supporting OpenAI and Google Gemini models for generating and editing images, with an embedded interactive studio.
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/mcpinstead of127.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 |
Fast generation with thinking controls | |
gemini-3-pro-image-preview |
High-fidelity text rendering | |
gemini-2.5-flash-image |
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
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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。