by zym9863
Generate images from text prompts using ModelScope Qwen-Image with format auto-detection and robust multilingual support
Generates images from text prompts using ModelScope's Qwen-Image model. Returns the generated images saved locally along with task status information.
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.
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.
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.
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
Provide Claude with access to relevant context and data
Example
Load project documentation, access knowledge bases, query databases
Get more accurate, context-aware responses
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
Share your MCP server with the developer community
We evaluated ModelScope Qwen-Image against two servers with overlapping tools; this profile had the clearer scope statement.
ModelScope Qwen-Image has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
I recommend ModelScope Qwen-Image for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
Useful MCP listing: ModelScope Qwen-Image is the kind of server we cite when onboarding engineers to host + tool permissions.
Strong directory entry: ModelScope Qwen-Image surfaces stars and publisher context so we could sanity-check maintenance before adopting.
We wired ModelScope Qwen-Image into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
According to our notes, ModelScope Qwen-Image benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
ModelScope Qwen-Image has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
ModelScope Qwen-Image reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
I recommend ModelScope Qwen-Image for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
showing 1-10 of 36
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.
uvxThe 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 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
You can register the server directly in an MCP-compatible client (e.g. Claude Desktop) without a prior manual install thanks to uvx.
{
"mcpServers": {
"modelscope-image": {
"command": "uvx",
"args": ["modelscope-image-mcp"],
"env": {
"MODELSCOPE_SDK_TOKEN": "your_token_here"
}
}
}
}
{
"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"
}
}
}
}
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" }
}
}
}
# 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"
}
}
{
"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"
}
}
Creates an image from a text prompt using the ModelScope async API.
Parameters:
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:
X-ModelScope-Async-Mode: true/v1/tasks/{task_id} every 5 seconds (max 120 attempts ~= 2 minutes)Planned enhancements (not yet implemented in server.py):
# 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
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
| 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 |
notification_options previously None causing AttributeErrorMIT License
PRs & issues welcome. Please describe reproduction steps for any failures.
This is an unofficial integration example. Use at your own risk; abide by ModelScope Terms of Service.
Prerequisites
Time Estimate
15-60 minutes depending on server complexity
Steps
Troubleshooting
✓ Do
✗ Don't
💡 Pro Tips
Architecture
Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.
Protocols
Compatibility
✓ 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.