qwen-image-mcp
Enables text-to-image generation using Alibaba Cloud's Qwen-Image models, supporting both synchronous and asynchronous modes with configurable parameters.
README
Qwen-Image MCP Server
An MCP Server for Alibaba Cloud DashScope (Bailian) Qwen-Image (千问文生图) models, supporting both synchronous and asynchronous image generation. Defaults to sync mode (generate_image_sync) for the simplest one-shot workflow.
Gallery
The following images were generated using the ian-xiaohei-illustrations Skills combined with this MCP Server (Qwen text-to-image):
<p align="center"> <img src="images/qwen-image-2026-07-20T08-32-04-750Z-1.png" width="45%" /> <img src="images/qwen-image-2026-07-20T08-32-04-841Z-1.png" width="45%" /> </p>
Features
Tools
| Tool | Description | Supported Models |
|---|---|---|
generate_image_sync |
Qwen text-to-image - Sync generation (one request, direct result, default mode) ✅ Recommended | qwen-image-2.0-pro, qwen-image-2.0, qwen-image-max |
generate_image_async |
Qwen text-to-image - Async generation (submit task, returns task_id, poll for result) | qwen-image-plus, qwen-image |
check_task_status |
Check async task status (use with generate_image_async) | - |
download_image |
Download generated images locally (call after task completes) | - |
Supported Models
| Model | Mode | Resolution | Features |
|---|---|---|---|
qwen-image-2.0-pro |
Sync | 512×512 ~ 2048×2048 | Best text rendering & realism |
qwen-image-2.0 |
Sync | Same as above | Balanced speed & quality |
qwen-image-max |
Sync | Fixed options | High realism, low AI artifacts |
qwen-image-plus |
Async | Fixed options | Diverse artistic styles |
qwen-image |
Async | Fixed options | Basic version |
Environment Variables
| Variable | Default | Description |
|---|---|---|
DASHSCOPE_API_KEY |
example-key |
Required. Alibaba Cloud DashScope API Key |
DASHSCOPE_BASE_URL |
https://dashscope.aliyuncs.com/api/v1 |
API base URL |
SYNC_MODEL |
qwen-image-2.0-pro |
Model for sync generation |
ASYNC_MODEL |
qwen-image-plus |
Model for async generation |
SAVE_DIR |
~/Desktop/qwen-images |
Image save directory. ⚠️ For Amazon Q Desktop: you must add this path in Settings → My computer → Local folders, otherwise the sandbox has no permission to read/write |
WORK_DIR |
process.cwd() |
Working directory |
Quick Start
1. Install Dependencies
npm install
2. Build
npm run build
3. Configure MCP Client
Add configuration in your MCP client (Claude Desktop, Kiro, etc.):
{
"mcpServers": {
"qwen-image": {
"command": "node",
"args": ["/path/to/qwen-image-mcp/build/index.js"],
"env": {
"DASHSCOPE_API_KEY": "sk-your-api-key",
"DASHSCOPE_BASE_URL": "https://your-workspace.cn-beijing.maas.aliyuncs.com/api/v1",
"SYNC_MODEL": "qwen-image-2.0-pro",
"SAVE_DIR": "/Users/yourname/Pictures/qwen-images"
}
}
}
}
Usage Examples
Sync Generation (Recommended)
Call generate_image_sync:
- prompt: "A ginger cat napping in the sunshine"
- size: "2048*2048"
- prompt_extend: true
Returns image URL directly and auto-downloads to local disk.
Async Generation
- Call
generate_image_asyncto gettask_id - Poll
check_task_statusevery 10 seconds - Once completed, call
download_imageto save images
API Reference
Sync Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | ✅ | Image prompt |
| negative_prompt | string | - | Negative prompt |
| size | string | - | Resolution, default 2048*2048 |
| n | number | - | Number of images (1-6), default 1 |
| seed | number | - | Random seed |
| prompt_extend | boolean | - | Smart rewriting, default true |
| watermark | boolean | - | Watermark, default false |
| model | string | - | Model name |
Async Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | ✅ | Image prompt |
| negative_prompt | string | - | Negative prompt |
| size | string | - | Resolution, default 1664*928 |
| seed | number | - | Random seed |
| prompt_extend | boolean | - | Smart rewriting, default true |
| watermark | boolean | - | Watermark, default false |
| model | string | - | Model name |
Debugging
npm run inspector
Notes
- Image URLs expire after 24 hours; download promptly
- qwen-image-2.0 series supports sync mode only
- qwen-image-plus / qwen-image supports async mode only
- Amazon Q Desktop users: Q Desktop runs MCP Servers in a sandboxed environment with no default filesystem access. You must configure
SAVE_DIRas an allowed path in Settings → My computer → Local folders before images can be saved
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。