ModelScope Qwen-Image▌
by zym9863
Generate images from text prompts using ModelScope Qwen-Image with format auto-detection and robust multilingual support
Integrates with ModelScope's Qwen-Image model to generate images from text prompts, returning base64-encoded results with automatic format detection and error handling for multilingual content creation.
Both formats append explainx.ai attribution and the canonical URL for this MCP server listing.
best for
- / Content creators needing AI-generated images
- / Developers building image generation workflows
- / AI assistants requiring visual content creation
capabilities
- / Generate images from text prompts
- / Handle asynchronous image processing tasks
- / Save generated images to local files
- / Monitor task status with automatic polling
- / Support multilingual text prompts
what it does
Generates images from text prompts using ModelScope's Qwen-Image model. Returns the generated images saved locally along with task status information.
about
ModelScope Qwen-Image is a community-built MCP server published by zym9863 that provides AI assistants with tools and capabilities via the Model Context Protocol. Generate images from text prompts using ModelScope Qwen-Image with format auto-detection and robust multilingual support It is categorized under ai ml.
how to install
You can install ModelScope Qwen-Image in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
license
MIT
ModelScope Qwen-Image is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
readme
ModelScope Image MCP Server
English | 中文
An MCP (Model Context Protocol) server for generating images via the ModelScope image generation API. This server provides seamless integration with AI assistants, enabling them to create images through natural language prompts with robust async processing and local file management.
IMPORTANT: Earlier drafts of this README mentioned features like returning base64 data, negative prompts, and additional parameters. The current released code (see
src/modelscope_image_mcp/server.py) implements a focused minimal feature set: one toolgenerate_imagethat submits an async task and saves the resulting image locally. Planned / upcoming features are listed in the roadmap below.
Current Features
- Asynchronous image generation using ModelScope async task API
- Periodic task status polling (every 5 seconds, up to 2 minutes)
- Saves the first generated image to a local file
- Returns task status and image URL to the MCP client
- Robust error handling + timeout messaging
- Simple one-command start with
uvx
Environment Variable
The server reads your credential from:
MODELSCOPE_SDK_TOKEN
If it is missing, the server will raise an error. Obtain a token from: https://modelscope.cn/my/myaccesstoken
Set on Windows (cmd):
set MODELSCOPE_SDK_TOKEN=your_token_here
PowerShell:
$env:MODELSCOPE_SDK_TOKEN="your_token_here"
Unix/macOS bash/zsh:
export MODELSCOPE_SDK_TOKEN=your_token_here
Installation & MCP Client Configuration
You can register the server directly in an MCP-compatible client (e.g. Claude Desktop) without a prior manual install thanks to uvx.
Option 1: PyPI (Recommended once published)
{
"mcpServers": {
"modelscope-image": {
"command": "uvx",
"args": ["modelscope-image-mcp"],
"env": {
"MODELSCOPE_SDK_TOKEN": "your_token_here"
}
}
}
}
Option 2: Direct from GitHub
{
"mcpServers": {
"modelscope-image": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/zym9863/modelscope-image-mcp.git",
"modelscope-image-mcp"
],
"env": {
"MODELSCOPE_SDK_TOKEN": "your_token_here"
}
}
}
}
Option 3: Local Development Checkout
git clone https://github.com/zym9863/modelscope-image-mcp.git
cd modelscope-image-mcp
uv sync
Then configure MCP client entry using:
{
"mcpServers": {
"modelscope-image": {
"command": "uvx",
"args": ["--from", ".", "modelscope-image-mcp"],
"env": { "MODELSCOPE_SDK_TOKEN": "your_token_here" }
}
}
}
Quick Local Smoke Test
# Run directly (local checkout)
uvx --from . modelscope-image-mcp
When running successfully you should see log lines showing task submission and polling.
## Usage Examples
### Basic Image Generation
```jsonc
{
"name": "generate_image",
"arguments": {
"prompt": "A serene mountain landscape at sunset"
}
}
Advanced Configuration
{
"name": "generate_image",
"arguments": {
"prompt": "A futuristic city with flying cars, cyberpunk style",
"model": "Qwen/Qwen-Image",
"size": "1024x1024",
"output_filename": "cyberpunk_city.png",
"output_dir": "./generated_images"
}
}
Creative Prompts
- Art Style: "in the style of Van Gogh", "watercolor painting", "digital art"
- Composition: "close-up portrait", "wide-angle landscape", "bird's eye view"
- Lighting: "dramatic lighting", "golden hour", "studio lighting"
- Mood: "mysterious atmosphere", "vibrant colors", "minimalist design"
Best Practices
- Be Specific: Detailed prompts produce better results than vague ones
- Use References: Mention specific art styles, artists, or time periods
- Experiment: Try variations of your prompt to find the best result
- Organize Outputs: Use descriptive filenames and organized directories
- Check Status: Monitor the async task status for long-running generations
generate_image
Creates an image from a text prompt using the ModelScope async API.
Parameters:
- prompt (string, required): The text description of the desired image
- model (string, optional, default: Qwen/Qwen-Image): Model name passed to API
- size (string, optional, default: 1024x1024): Image resolution size, Qwen-Image supports: [64x64,1664x1664]
- output_filename (string, optional, default: result_image.jpg): Local filename to save the first output image
- output_dir (string, optional, default: ./outputs): Directory path where the image will be saved
Sample invocation (conceptual JSON sent by MCP client):
{
"name": "generate_image",
"arguments": {
"prompt": "A golden cat playing in a garden",
"size": "1024x1024",
"output_filename": "cat.jpg",
"output_dir": "./my_images"
}
}
Sample textual response payload (returned to the client):
图片生成成功!
提示词: A golden cat playing in a garden
模型: Qwen/Qwen-Image
保存路径: /path/to/my_images/cat.jpg
输出目录: /path/to/my_images
文件名: cat.jpg
图片URL: https://.../generated_image.jpg
Notes:
- Only the first image URL is used (if multiple are ever returned)
- If the task fails or times out you receive a descriptive message
- No base64 data is currently returned (roadmap item)
Internal Flow
- Submit async generation request with header
X-ModelScope-Async-Mode: true - Poll task endpoint
/v1/tasks/{task_id}every 5 seconds (max 120 attempts ~= 2 minutes) - On SUCCEED download first image and save via Pillow (PIL)
- Return textual metadata to MCP client
- Provide clear error / timeout messages otherwise
Roadmap
Planned enhancements (not yet implemented in server.py):
- Optional base64 return data
- Negative prompt & guidance parameters
- Adjustable polling interval & timeout via arguments
- Multiple image outputs selection
- Streaming progress notifications
Development
# Install all (including dev) dependencies
uv sync --dev
# Run server module directly
uv run python -m modelscope_image_mcp.server
# Or via uvx using local source
uvx --from . modelscope-image-mcp
# Run with environment variable
MODELSCOPE_SDK_TOKEN=your_token_here uv run python -m modelscope_image_mcp.server
# Format code (if ruff is configured)
uv run ruff format .
# Lint code (if ruff is configured)
uv run ruff check . --fix
Project Structure
modelscope-image-mcp/
├── src/modelscope_image_mcp/
│ ├── __init__.py
│ └── server.py # Main MCP server implementation
├── pyproject.toml # Project configuration and dependencies
├── uv.lock # Lock file for reproducible builds
├── README.md # This file
└── README-zh.md # Chinese documentation
Troubleshooting
| Symptom | Possible Cause | Action |
|---|---|---|
| ValueError: 需要设置 MODELSCOPE_SDK_TOKEN 环境变量 | Token missing | Export / set environment variable then restart |
| 图片生成超时 | Slow model processing | Re-run; later we will expose longer timeout argument |
| 网络相关 httpx.TimeoutException | Connectivity issues | Check network / retry |
| PIL cannot identify image file | Invalid image data received | Try a different prompt or model |
| Permission denied when saving | Output directory permissions | Check write permissions or change output_dir |
| No such file or directory | Output directory doesn't exist | Server will create it automatically, or specify existing path |
Changelog
1.0.1
- Added size parameter support for customizable image resolution
- Improved image generation with Qwen-Image model resolution range [64x64,1664x1664]
- Enhanced documentation with size parameter usage examples
1.0.0
- Major update with improved async handling and output directory support
- Added configurable output directory parameter
- Enhanced error handling and logging
- Updated dependencies to use httpx for better async support
- Fixed notification_options bug from initial release
0.1.0
- Initial minimal implementation with async polling & local image save
- Fixed bug:
notification_optionspreviously None causing AttributeError
License
MIT License
Contributing
PRs & issues welcome. Please describe reproduction steps for any failures.
Disclaimer
This is an unofficial integration example. Use at your own risk; abide by ModelScope Terms of Service.
FAQ
- What is the ModelScope Qwen-Image MCP server?
- ModelScope Qwen-Image is a Model Context Protocol (MCP) server profile on explainx.ai. MCP lets AI hosts (e.g. Claude Desktop, Cursor) call tools and resources through a standard interface; this page summarizes categories, install hints, and community ratings.
- How do MCP servers relate to agent skills?
- Skills are reusable instruction packages (often SKILL.md); MCP servers expose live capabilities. Teams frequently combine both—skills for workflows, MCP for APIs and data. See explainx.ai/skills and explainx.ai/mcp-servers for parallel directories.
- How are reviews shown for ModelScope Qwen-Image?
- This profile displays 36 aggregated ratings (sample rows for discoverability plus signed-in user reviews). Average score is about 4.7 out of 5—verify behavior in your own environment before production use.
Use Cases▌
Extended AI Capabilities
Add new capabilities to Claude beyond text generation
Example
Access external data sources, execute code, interact with tools and services
Transform Claude from chatbot to action-taking agent
Context Enhancement
Provide Claude with access to relevant context and data
Example
Load project documentation, access knowledge bases, query databases
Get more accurate, context-aware responses
Workflow Automation
Automate multi-step workflows combining AI and external tools
Example
Research → Summarize → Create document → Send notification
Complete complex tasks end-to-end without manual steps
Implementation Guide▌
Prerequisites
- ›Claude Desktop 0.7.0+ or Cursor IDE with MCP support
- ›Basic understanding of MCP architecture and capabilities
- ›Access credentials for integrated services (if required)
- ›Willingness to experiment and iterate on configuration
Time Estimate
15-60 minutes depending on server complexity
Installation Steps
- 1.Install MCP server: npm install -g [package-name] or via GitHub
- 2.Add server configuration to ~/.claude/mcp.json
- 3.Provide required credentials and configuration
- 4.Restart Claude Desktop to load new server
- 5.Test basic functionality with simple prompts
- 6.Explore capabilities and experiment with use cases
- 7.Document successful patterns for reuse
Troubleshooting
- ⚠MCP server not loading: Check config syntax, verify installation
- ⚠Connection errors: Check network, firewall, credentials
- ⚠Feature not working: Read server docs, check required parameters
- ⚠Performance issues: Monitor resource usage, check for network latency
- ⚠Conflicts with other servers: Check port assignments, namespace collisions
Best Practices▌
✓ Do
- +Read server documentation thoroughly before setup
- +Start with simple use cases to validate functionality
- +Test in non-production environment first
- +Monitor resource usage and performance
- +Keep servers updated for bug fixes and new features
- +Document configuration for team members
- +Use environment variables for sensitive configuration
✗ Don't
- −Don't grant overly permissive access to MCP servers
- −Don't skip reading security considerations in docs
- −Don't expose sensitive data without proper controls
- −Don't run untrusted MCP servers without code review
- −Don't ignore error messages—investigate root cause
💡 Pro Tips
- ★Combine multiple MCP servers for powerful workflows
- ★Create custom MCP servers for your specific needs
- ★Share successful configurations with team
- ★Use MCP inspector for debugging
- ★Join MCP community for tips and troubleshooting
Technical Details▌
Architecture
Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.
Protocols
- Model Context Protocol (MCP)
- JSON-RPC 2.0
- stdio or HTTP transport
Compatibility
- Claude Desktop
- Cursor IDE
- Custom MCP clients
When to Use This▌
✓ Use When
Use when you need Claude to access external data, execute actions, or integrate with tools. Best for extending AI capabilities beyond conversation.
✗ Avoid When
Avoid when native integrations exist (use official APIs directly), for real-time critical systems, or when security/compliance requires zero external dependencies.
Integration▌
- →Tool composition: Chain multiple MCP tools in workflows
- →Context augmentation: Provide AI with relevant external data
- →Action delegation: Let AI execute tasks on external systems
- →Bidirectional sync: Keep AI context and external systems in sync
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
List & Promote Your MCP Server
Share your MCP server with the developer community
Ratings
4.7★★★★★36 reviews- ★★★★★Shikha Mishra· Dec 28, 2024
We evaluated ModelScope Qwen-Image against two servers with overlapping tools; this profile had the clearer scope statement.
- ★★★★★James Kim· Dec 24, 2024
ModelScope Qwen-Image has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
- ★★★★★Sofia Malhotra· Dec 12, 2024
I recommend ModelScope Qwen-Image for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
- ★★★★★Yash Thakker· Nov 19, 2024
Useful MCP listing: ModelScope Qwen-Image is the kind of server we cite when onboarding engineers to host + tool permissions.
- ★★★★★Zaid Nasser· Nov 15, 2024
Strong directory entry: ModelScope Qwen-Image surfaces stars and publisher context so we could sanity-check maintenance before adopting.
- ★★★★★Alexander Diallo· Nov 11, 2024
We wired ModelScope Qwen-Image into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
- ★★★★★Diya Abebe· Nov 3, 2024
According to our notes, ModelScope Qwen-Image benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
- ★★★★★Nikhil Huang· Oct 22, 2024
ModelScope Qwen-Image has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
- ★★★★★Dhruvi Jain· Oct 10, 2024
ModelScope Qwen-Image reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
- ★★★★★James Mensah· Oct 6, 2024
I recommend ModelScope Qwen-Image for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
showing 1-10 of 36