image-gen-mcp
Allows generating images using OpenAI's DALL-E models (DALL-E 2 and DALL-E 3) by providing a prompt and optional parameters.
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., "@image-gen-mcpGenerate a picture of a cyberpunk cat in a neon city"
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.
Image Gen MCP Server — 文生图能力代理 🎨
让 LLM 通过 MCP 调用 AI 模型生成图片。只需一个 API Key,即可让任何 AI 客户端拥有图片生成能力。
每个部署者自行选择图片生成提供商和默认模型,只需在部署时配置环境变量即可。
功能
工具 | 说明 |
| 根据文字描述生成图片。传入 prompt + 可选参数,返回图片 URL |
| 查看当前提供商和推荐使用的模型列表 |
Related MCP server: MCP OpenAI Image Generation Server
支持的图片生成提供商
提供商 |
| 特点 |
硅基流动 |
| 国内直接访问,免费额度,推荐中文用户 |
OpenAI |
| DALL-E 3,需国际网络 |
自定义接口 |
| 任何 OpenAI 兼容接口(中转 API) |
一键运行(无需手动安装)
项目支持 uvx / pip 两种方式一键运行,无需手动克隆仓库。
方式 | 命令 | 前提条件 |
uvx 🏆 |
| 安装 uv(自动安装 Python 依赖) |
pip |
| 安装 Python 3.10+ |
# uvx 运行(默认 stdio 模式,适用于本地 Reasonix 接入)
uvx --from git+https://github.com/DoctorPan/image-gen-mcp image-gen-mcp
# uvx 运行(SSE 模式,用于远程部署)
uvx --from git+https://github.com/DoctorPan/image-gen-mcp image-gen-mcp --transport sse --port 8000
# 需要先设置环境变量
set IMAGE_API_KEY=你的硅基流动APIKey
set IMAGE_PROVIDER=siliconflow注意:uvx 会自动从 GitHub 拉取代码并安装 Python 依赖,首次运行可能需要几十秒。
在 Reasonix 中配置(推荐)
方式一:通过 uvx 一键运行(推荐)
无需克隆仓库、无需手动安装依赖,Reasonix 自动通过 uvx 拉取运行:
{
"mcpServers": {
"image-gen-mcp": {
"command": "uvx",
"args": ["--from", "git+https://github.com/DoctorPan/image-gen-mcp", "image-gen-mcp"],
"env": {
"IMAGE_API_KEY": "你的硅基流动 API Key",
"IMAGE_PROVIDER": "siliconflow",
"DEFAULT_IMAGE_MODEL": "black-forest-labs/FLUX.1-dev"
}
}
}
}方式二:本地 Python 直接运行(已克隆项目)
{
"mcpServers": {
"image-gen-mcp": {
"command": "python",
"args": ["C:\\path\\to\\image-gen-mcp\\server.py"],
"env": {
"IMAGE_API_KEY": "你的硅基流动 API Key",
"IMAGE_PROVIDER": "siliconflow",
"DEFAULT_IMAGE_MODEL": "black-forest-labs/FLUX.1-dev"
}
}
}
}方式三:远程 SSE URL(部署到魔搭后)
{
"mcpServers": {
"image-gen-mcp": {
"url": "https://mcp.api-inference.modelscope.net/xxxxx/mcp"
}
}
}快速开始(本地开发)
# 1. 进入项目目录
cd image-gen-mcp
# 2. 安装依赖
pip install -r requirements.txt
# 3. 复制配置模板
copy .env.example .env
# 4. 编辑 .env,填入你的配置
# IMAGE_API_KEY=sk-xxx
# IMAGE_PROVIDER=siliconflow
# 5. 启动(默认 stdio 模式)
python server.py
# 或者本地测试 SSE 模式
python server.py --transport sse --port 8000如何使用
示例:生成一张图片
generate_image(
prompt="一只穿着西装的猫,坐在办公室的老板椅上,夕阳从窗外照进来,赛博朋克风格",
model="black-forest-labs/FLUX.1-dev",
size="1024x1024"
)选择不同的提供商
在 generate_image 的 model 参数中传入不同的模型名称:
提供商 | 推荐模型 | 尺寸支持 |
硅基流动 |
| 1024x1024、768x1344、864x1152、1344x768、1152x864 |
硅基流动 |
| 同上 |
OpenAI |
| 1024x1024、1792x1024、1024x1792 |
OpenAI |
| 256x256、512x512、1024x1024 |
部署到魔搭 Hosted(SSE 模式)🚀
魔搭社区提供 Hosted MCP 服务,可以将你的 MCP 服务器部署在魔搭云端,生成 SSE URL 供远程调用。
部署步骤
第 1 步:将代码推送到 GitHub
cd image-gen-mcp
git init
git add .
git commit -m "初始提交"
git remote add origin https://github.com/DoctorPan/image-gen-mcp.git
git push -u origin main第 2 步:在魔搭提交 MCP 服务
进入 MCP 广场 → 点击 提交 MCP 服务
填写以下信息:
字段 | 内容 |
服务名称 |
|
中文名称 | 文生图能力代理 |
描述 | 让 LLM 通过 MCP 调用 AI 模型生成图片。支持硅基流动、OpenAI 等多个提供商。 |
源代码地址 |
|
启动命令 |
|
传输方式 | SSE |
第 3 步:部署 Hosted 服务
审核通过后,在 MCP 管理页面找到 image-gen-mcp,点击部署,选择 Hosted 部署类型,配置环境变量:
变量 | 必填 | 值 |
| ✅ | 你的图片生成 API Key |
| ❌ |
|
| ❌ |
|
部署成功后,魔搭会生成 SSE URL。
环境变量速查
环境变量 | 作用 | 示例值 |
| ⭐ 你的 API Key(必填) |
|
| 选择提供商 |
|
| 自定义 API 地址 |
|
| 调用的默认模型 |
|
| 默认图片尺寸 |
|
| 传输模式 |
|
| SSE 监听地址 |
|
| SSE 监听端口 |
|
命令行参数
python server.py --help
# 输出:
usage: server.py [-h] [--transport {stdio,sse}] [--host HOST] [--port PORT]
Image Gen MCP Server — 文生图能力代理
options:
-h, --help show this help message and exit
--transport {stdio,sse}
传输模式: stdio (默认) / sse (远程部署)
--host HOST SSE 监听地址 (默认 0.0.0.0)
--port PORT SSE 监听端口 (默认 8000)项目结构
image-gen-mcp/
├── pyproject.toml # Python 项目配置,支持 uvx 一键运行
├── server.py # MCP 服务器主代码
├── requirements.txt # Python 依赖
├── .env.example # 环境变量模板
├── .gitignore
└── README.md许可证
MIT
Available Tools
2 toolsgenerate_imageA
根据文字描述生成一张或多张图片。
向图片生成模型发送文字描述(prompt),模型会生成对应的图片并返回图片 URL。 支持多个提供商,默认使用硅基流动(免费额度)。
model 参数不传时使用默认模型。不同提供商默认模型不同:
siliconflow: black-forest-labs/FLUX.1-dev(高质量开源模型)
openai: dall-e-3
custom: 由部署者自定
你也可以传入自己熟悉的任意模型名称(只要在你的提供商平台可用)。
size 参数控制图片尺寸:
siliconflow 推荐: 1024x1024(默认)
openai DALL-E 3: 1024x1024 / 1792x1024 / 1024x1792
适用于:
根据描述生成插图、海报、概念图
为文章、演示生成配图
创意设计、头脑风暴视觉化
生成社交媒体图片
注意:生成的图片 URL 通常有有效期(数小时到数天),请及时保存。
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | ||
| size | No | ||
| model | No | ||
| prompt | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. Discloses multi-provider support, default model behavior, size constraints, and URL expiration. Does not mention rate limits or authorization, but covers main behavioral traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with bullet points and sections. Information is valuable but slightly lengthy; some repetition could be trimmed. Good front-loading of purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given output schema exists, return values need no explanation. Covers generation behavior, provider options, parameter defaults, and URL expiry. Could explicitly mention sibling tool for model list, but overall very complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Despite 0% schema coverage signal, description explains 'model' (defaults per provider, custom) and 'size' (recommended dimensions) in detail. 'n' is implied but not explicitly explained; 'prompt' is clarified as text description. Adds significant meaning beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool generates images from text descriptions, using verb 'generate' and resource 'image(s)'. It distinguishes itself from the sibling tool 'list_image_models' by being about generation, not listing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides specific use cases (illustrations, posters, etc.), default models per provider, and size recommendations. Lacks explicit 'when not to use' or direct alternatives, but the sibling tool context helps.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_image_modelsB
列出当前提供商推荐使用的图片生成模型列表及使用说明。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description must fully cover behavioral traits. It only states the tool lists models and instructions, with no mention of auth, rate limits, or read-only nature.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single clear sentence, front-loaded with the action and resource. No redundancy, though it could be expanded slightly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given zero parameters and an output schema, the description is adequate but could specify the source of the data (e.g., provider-specific) or the format of usage instructions.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are zero parameters, so the schema provides no information. The description adds meaning by indicating the output includes model list and usage instructions, but it is minimal.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists image generation models and usage instructions recommended by the current provider. It distinguishes from sibling generate_image by focusing on listing rather than generation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied but not explicit. It is reasonable to use this before generate_image, but no explicit when-to-use or alternative guidance is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v1.0.0- First observed
generate_image - First observed
list_image_models
TDQS
The two tools have completely distinct purposes: one lists available image models, the other generates images. No overlap or confusion possible.
Both tools use a consistent verb_noun pattern in snake_case: 'list_image_models' and 'generate_image', making them predictable and easy to understand.
With only 2 tools, the server feels under-scoped for its stated support of multiple providers and model selection. While minimal, it may be acceptable for a focused image generation task, but lacks coverage for related operations.
The server covers basic listing and generation, but lacks tools for retrieving generated images (URLs expire), managing providers, or handling model customization beyond the generate call. Minor gaps exist that could limit agent autonomy.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Generate images with any major model — one API key, one prepaid balance, one MCP.
Multi-model AI image and video generator. 14 models behind one OAuth-secured MCP endpoint.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides tools for generating and editing images using OpenAI's gpt-image-1 model via an MCP interface, enabling AI assistants to create and modify images based on text prompts.15Apache 2.0
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to generate and edit images through OpenAI's DALL-E models via MCP tools. Supports text-to-image generation and image-to-image editing with configurable parameters for size, quality, and style.-
- AlicenseNot gradedqualityCmaintenanceExposes multiple image generation backends as independent MCP tools for generating images with configurable models and parameters.MIT
- AlicenseNot gradedqualityCmaintenanceProvides multimodal vision MCP tools for image analysis, OCR, object detection, text-to-image generation, and image similarity, integrating OpenAI, Qwen, and Gemini.321MIT
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/Doctor-Pan-code/image-gen-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server