Qwen Image MCP Server
Click on "Deploy 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., "@Qwen Image MCP ServerGenerate a watercolor painting of a mountain lake at sunset"
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.
Qwen Image 3.0 MCP Server
基于阿里云百炼 DashScope API 的千问图像生成与编辑 MCP 服务,提供文生图(T2I)和图生图/图像编辑(I2I)能力。
功能
工具 | 功能 | 说明 |
| 文生图(T2I) | 根据文本提示词直接生成图像 |
| 图生图/图像编辑(I2I) | 基于 1-3 张参考图结合编辑指令进行精确编辑 |
模型选择
模型 | 特点 |
| 高质量,适合精细创作 |
| 兼顾质量与速度,适合快速生成 |
Related MCP server: Doubao Image/Video Generation MCP Server
前提条件
安装
uvx(无需安装,直接运行)
uvx qwen-image-mcppip
pip install qwen-image-mcp本地开发
git clone https://github.com/wchiway/qwen-image-mcp
cd qwen-image-mcp
uv sync配置
通过环境变量配置 API Key:
export DASHSCOPE_API_KEY="sk-xxxxxxxxxxxx"或创建 .env 文件:
# 必填:阿里云百炼 API Key
DASHSCOPE_API_KEY=sk-xxxxxxxxxxxx
# 可选:业务空间 ID(推荐,性能更优)
WORKSPACE_ID=
# 可选:地域(默认 cn-beijing)
REGION=cn-beijing使用方式
MCP 客户端配置(推荐)
在 Claude Code 的 settings.json 中添加:
{
"mcpServers": {
"qwen-image": {
"command": "uvx",
"args": ["qwen-image-mcp"],
"env": {
"DASHSCOPE_API_KEY": "sk-你的key",
"WORKSPACE_ID": "",
"REGION": "cn-beijing"
}
}
}
}uvx 直接运行
uvx qwen-image-mcp本地安装运行
qwen-image-mcp工具参考
generate_image — 文生图
参数 | 类型 | 必填 | 默认值 | 说明 |
| string | ✅ | — | 正向提示词,描述图像内容、风格和构图,支持中英文 |
| string | — |
| 模型名称 |
| string | — | 自动推荐 | 输出分辨率,格式 |
| integer | — | 1 | 生成数量(1-6) |
| boolean | — | true | 提示词智能改写 |
| string | — | direct | 改写方式: |
| string | — | — | 反向提示词 |
| integer | — | — | 随机种子(0-2147483647) |
| boolean | — | false | 是否添加水印 |
edit_image — 图生图/图像编辑
参数 | 类型 | 必填 | 默认值 | 说明 |
| string | ✅ | — | 编辑指令,描述期望的编辑效果,支持中英文 |
| string[] | ✅ | — | 参考图像列表(1-3 张),URL 或 Base64 |
| string | — |
| 模型名称 |
| string | — | 自动推荐 | 输出分辨率,格式 |
| integer | — | 1 | 生成数量(1-6) |
| boolean | — | true | 提示词智能改写 |
| string | — | direct | 仅支持 |
| string | — | — | 反向提示词 |
| integer | — | — | 随机种子(0-2147483647) |
| boolean | — | false | 是否添加水印 |
图像输入格式
公网 URL:
https://example.com/image.pngBase64 编码:
data:image/png;base64,iVBORw0KGgo...支持格式:JPG、JPEG、PNG、BMP、TIFF、WEBP、GIF
单张不超过 10MB,分辨率建议 384-2048 像素
环境变量
变量 | 必填 | 默认值 | 说明 |
| ✅ | — | 阿里云百炼 API Key |
| — | — | 业务空间 ID,不设则使用旧域名 |
| — |
| 地域: |
| — |
| API 请求超时(秒) |
| — |
| 日志级别: |
示例
文生图 — 生成一张风景照
prompt: "一幅秋日山间晨雾的风景摄影,暖金色阳光穿透薄雾,远山层叠,前景有金黄色的落叶松林"图生图 — 人物换装
images: ["https://example.com/portrait.jpg"]
prompt: "保留人物面部特征,将服装换为深蓝色商务西装,背景改为现代办公室"图生图 — 风格转换
images: ["https://example.com/photo.jpg"]
prompt: "将这张照片转换为宫崎骏动画风格,保持构图不变"响应格式
成功返回的图像 URL 有效期为 24 小时,请及时下载保存。
✅ 文生图完成
**图像 1**
- URL(24h 有效): https://dashscope-result-sz.oss-cn-shenzhen.aliyuncs.com/xxx.png
分辨率: 1024×1024
生成数量: 1
输入图片数: 0
request_id: 571ae02f-5c9d-436c-83c2-f221e6df0xxx技术栈
Python 3.10+
MCP Python SDK 2.0+
uv — 包管理与构建
许可证
MIT
Available Tools
2 toolsedit_imageA
图生图 / 图像编辑(I2I)— 基于 1-3 张参考图结合编辑指令进行精确编辑。
可传入图像 URL 或 Base64 编码,模型会根据文本指令对参考图进行编辑生成。 适用于: 换装、换背景、风格转换、人物保留编辑等场景。
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | 生成图像数量,1-6 张。 | |
| seed | No | 随机数种子(0-2147483647)。固定种子可使生成结果相对稳定。 | |
| size | No | 输出图像分辨率,格式为 "宽*高"(如 1024*1024)。不指定则由模型自动推荐。范围: 512*512 至 2048*2048。 | |
| model | No | 模型名称。qwen-image-3.0-pro 质量更高,qwen-image-3.0 兼顾质量与速度。 | qwen-image-3.0-pro |
| images | Yes | 参考图像列表(1-3 张)。每项为公网 URL 或 Base64 编码。格式: JPG/JPEG/PNG/BMP/TIFF/WEBP/GIF,单张不超过 10MB。 | |
| prompt | Yes | 编辑指令(正向提示词),描述期望的编辑效果、风格和构图。支持中英文。 | |
| watermark | No | 是否添加水印。 | |
| prompt_extend | No | 是否开启提示词智能改写(建议开启)。 | |
| negative_prompt | No | 反向提示词,描述不希望出现在画面中的内容。 | |
| prompt_extend_mode | No | 提示词改写方式。I2I 仅支持 direct,传入 agent 将被拒绝。 |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden for behavioral disclosure. It explains that images can be supplied as URL or Base64 and that the model generates an edited output based on the prompt. However, it does not mention any limitations, resource costs, or the return format—though the output schema may cover the latter.
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 two sentences followed by a short list of use cases, immediately front-loaded with the purpose. There is no redundant or extraneous wording.
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 the tool's complexity (10 parameters) and the presence of an output schema, the description covers the core functionality and typical use cases adequately. It does not explain output handling, but the output schema compensates, making the description sufficiently complete for an agent to select the tool.
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?
The input schema has 100% coverage with detailed descriptions for all 10 parameters, including seed, size, watermark, and prompt_extend_mode. The description only reiterates the reference image count (1-3) and text instructions, adding little beyond what the schema already provides.
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 identifies the tool as image-to-image editing (I2I) that uses 1-3 reference images combined with text instructions for precise editing. The mention of reference images distinguishes it from the sibling generate_image, which would not require them.
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?
The description lists concrete use cases (outfit change, background change, style transfer, person-preserving editing) that clarify when this tool is appropriate. It does not explicitly state exclusions or alternative tools, but the I2I definition implies text-to-image should use generate_image.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_imageA
文生图(T2I)— 根据文本提示词直接生成图像。
支持中英文提示词,模型会自动根据提示词推荐分辨率。 prompt_extend 默认开启,会对简单提示词进行智能改写以获得更好的效果。
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | 生成图像数量,1-6 张。 | |
| seed | No | 随机数种子(0-2147483647)。固定种子可使生成结果相对稳定。 | |
| size | No | 输出图像分辨率,格式为 "宽*高"(如 1024*1024)。不指定则由模型自动推荐。范围: 512*512 至 2048*2048。 | |
| model | No | 模型名称。qwen-image-3.0-pro 质量更高,qwen-image-3.0 兼顾质量与速度。 | qwen-image-3.0-pro |
| prompt | Yes | 正向提示词,描述期望生成的图像内容、风格和构图。支持中英文。 | |
| watermark | No | 是否添加水印。 | |
| prompt_extend | No | 是否开启提示词智能改写(建议开启)。 | |
| negative_prompt | No | 反向提示词,描述不希望出现在画面中的内容。 | |
| prompt_extend_mode | No | 提示词改写方式: direct=直接增强(默认,推荐), agent=智能体增强(更精细,仅 T2I)。 |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses prompt_extend is enabled by default and that the model auto-recommends resolution, which are useful behavioral traits. However, it doesn't mention costs, permissions, or side effects, leaving gaps.
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?
Two sentences, concise and front-loaded with the core purpose. No fluff.
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 the rich schema with 9 parameters and output schema, the description provides sufficient overview, covering the primary function and key defaults. It doesn't cover all parameters but the schema does. Sibling differentiation could enhance completeness but isn't essential.
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?
Schema coverage is 100%, so baseline is 3. The description adds context about prompt language support ('支持中英文提示词') and the auto-recommendation behavior relating to size, but most parameter details are already in the 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 prompts ('文生图(T2I)— 根据文本提示词直接生成图像'), using a specific verb and resource. It implicitly distinguishes from the sibling tool edit_image, which handles editing.
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?
No explicit when-to-use or alternatives are mentioned. The description implies usage for generating new images but doesn't exclude editing tasks or point to edit_image. Context about language support and auto-resolution is provided, but no comparative guidance.
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.
2 tool updates
v0.1.1- First observed
edit_image - First observed
generate_image
TDQS
Scored across 2 tools
The two tools have completely distinct purposes: generate_image creates images from text prompts, while edit_image modifies existing images using reference images and instructions. There is no overlap or ambiguity between them.
Both tools follow the exact same verb_noun pattern with clear, descriptive verbs: generate_image and edit_image. The naming is predictable and consistent.
Only two tools is on the thinner side, but they cover the two core capabilities of the Qwen image model (text-to-image and image-to-image editing). The server is narrowly scoped and each tool is essential, making the count reasonable for its purpose.
For the domain of image generation and editing, the server provides both fundamental operations. There are no obvious missing functions like image variation or upscaling, but the core workflows of generating from text and editing reference images are fully covered.
Maintenance
Related MCP Connectors
Create images and videos from prompts, with options for image mixing, reference images, and start/…
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Multi-model AI image and video generator. 14 models behind one OAuth-secured MCP endpoint.
Image, video, music and text generation across 100+ models through one endpoint.
Related MCP Servers
- AlicenseCqualityCmaintenanceEnables users to generate high-quality images using ModelScope's Qwen-Image model through natural language prompts. Supports async task processing with both image URL and base64 encoded data output options.12MIT
- AlicenseAqualityCmaintenanceEnables AI image generation using Doubao Seedream models and video generation using Doubao Seedance models through Volcano Engine's API, supporting text-to-image, image-to-image, text-to-video, and task status queries.334 npm3MIT
- AlicenseBqualityDmaintenanceEnables text-to-image generation through the ModelScope platform using the Qwen/Qwen-Image model. It supports customizable parameters such as negative prompts, resolution, and sampling steps within MCP-compatible clients.19 npm1MIT
- AlicenseAqualityAmaintenanceEnables image editing, remixing, and text-to-image generation using Qwen 2 models via RunAPI. Supports task polling and pricing checks.527 npmApache 2.0