ModelScope Image Generation 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., "@ModelScope Image Generation MCP Servergenerate a cinematic 1024x1024 image of a futuristic city 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.
ModelScope Image Generation MCP Server
一个用于魔搭社区(ModelScope)文生图服务的 MCP(Model Context Protocol)服务器,使用 Qwen/Qwen-Image 模型,支持在 Claude Desktop 等 MCP 客户端中使用。
功能特性
🎨 使用魔搭社区的 Qwen/Qwen-Image 模型生成图片
🔄 同步生图体验:调用工具后自动等待生成完成
⚙️ 完整参数支持:正向/负向提示词、分辨率、种子、采样步数、引导系数等
📦 支持 npx 一键安装和运行
Related MCP server: Zhipu Text-to-Image MCP Server
安装
方式 1: 使用 npx(推荐)
无需安装,直接在 Claude Desktop 配置中使用:
{
"mcpServers": {
"modelscope-image": {
"command": "npx",
"args": ["-y", "mcp-modelscope-image"],
"env": {
"MODELSCOPE_API_KEY": "your-api-key-here"
}
}
}
}方式 2: 全局安装
npm install -g mcp-modelscope-image配置示例:
{
"mcpServers": {
"modelscope-image": {
"command": "mcp-modelscope-image",
"env": {
"MODELSCOPE_API_KEY": "your-api-key-here"
}
}
}
}方式 3: 本地开发
# 克隆或下载项目
cd mcp-local-modelscope-image
# 安装依赖
npm install
# 构建项目
npm run buildClaude Desktop 配置:
{
"mcpServers": {
"modelscope-image": {
"command": "node",
"args": ["E:\\workspace\\jasion\\jq-mcp\\mcp-local-modelscope-image\\dist\\index.js"],
"env": {
"MODELSCOPE_API_KEY": "your-api-key-here"
}
}
}
}获取 API Key
访问 魔搭社区
登录账号
进入个人中心获取 API Token (MODELSCOPE_SDK_TOKEN)
将 Token 配置为环境变量
MODELSCOPE_API_KEY
使用示例
在 Claude Desktop 中,你可以直接使用自然语言调用生图功能:
基础用法
请生成一张图片:一只金色的猫咪在阳光下玩耍高级用法(指定详细参数)
生成图片:
- 提示词:A mysterious girl walking down the corridor, cinematic lighting, highly detailed
- 负向提示词:lowres, bad anatomy, text, watermark
- 分辨率:1024x1024
- 采样步数:30
- 引导系数:7.5
- 随机种子:12345支持的参数
本服务使用 Qwen/Qwen-Image 模型,支持以下参数:
prompt (必需): 正向提示词(建议使用英文)
最大长度:2000 字符
negative_prompt (可选): 负向提示词
最大长度:2000 字符
size (可选): 图片分辨率
范围:[64x64, 1664x1664]
默认:1024x1024
seed (可选): 随机种子,用于可重复生成
范围:[0, 2^31-1]
steps (可选): 采样步数
范围:[1, 100]
guidance (可选): 提示词引导系数
范围:[1.5, 20]
image_url (可选): 待编辑图片的 URL(用于图片编辑模式)
要求:公网可访问
配置文件位置
Windows
%APPDATA%\Claude\claude_desktop_config.jsonmacOS
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux
~/.config/Claude/claude_desktop_config.json开发
# 安装依赖
npm install
# 开发模式(监听文件变化)
npm run watch
# 构建
npm run build故障排除
提示 API Key 未设置
确保在 Claude Desktop 配置文件中正确设置了 MODELSCOPE_API_KEY 环境变量。
生成失败
检查模型 ID 是否正确
检查提示词长度是否超过 2000 字符
检查参数值是否在允许范围内
查看 Claude Desktop 的开发者工具控制台获取详细错误信息
npx 命令找不到
确保已安装 Node.js 18 或更高版本。
许可证
MIT
相关链接
Available Tools
1 toolgenerate_imageC
Generate an image using ModelScope image generation models. The tool will wait until the image is generated and return the image URL.
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model to use for image generation. Available options: 'Qwen/Qwen-Image' (default), 'Tongyi-MAI/Z-Image-Turbo' | Qwen/Qwen-Image |
| prompt | Yes | Positive prompt for image generation (English recommended). Max length: 2000 characters | |
| negative_prompt | No | Negative prompt to specify what to avoid in the image. Max length: 2000 characters | |
| size | No | Image resolution size (e.g., '1024x1024'). Range for Qwen-Image: [64x64, 1664x1664]. Default: 1024x1024 | |
| seed | No | Random seed for reproducibility. Range: [0, 2^31-1] | |
| steps | No | Number of sampling steps. Range: [1, 100] | |
| guidance | No | Guidance scale for prompt adherence. Range: [1.5, 20] | |
| image_url | No | URL of the image to edit (only for image editing mode). Must be publicly accessible |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that the tool 'will wait until the image is generated and return the image URL,' which adds some behavioral context about synchronous operation and output format. However, it lacks critical information about rate limits, authentication requirements, error handling, or whether the operation is read-only or mutative.
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 efficiently structured in two sentences that directly convey the core functionality and behavioral characteristic (synchronous waiting). There's no wasted verbiage, though it could potentially be more front-loaded with key constraints.
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?
For an image generation tool with 8 parameters and no output schema, the description provides basic operational context but lacks important details about authentication, rate limits, error conditions, and the format/structure of returned data. The 100% schema coverage helps, but the description alone doesn't provide complete guidance for effective tool invocation.
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% description coverage, providing detailed documentation for all 8 parameters including ranges, defaults, and constraints. The description adds no additional parameter semantics beyond what's already in the schema, so it meets the baseline score of 3 for high schema coverage.
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 action ('generate an image') and the resource ('using ModelScope image generation models'), making the purpose immediately understandable. However, with no sibling tools mentioned, it cannot demonstrate differentiation from alternatives, so it doesn't reach the highest score.
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 provides no guidance on when to use this tool versus alternatives, nor does it mention any prerequisites or contextual constraints. It simply states what the tool does without offering usage context.
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.
1 tool update
- First observed
generate_image
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap in purpose. The tool 'generate_image' has a clear, singular function that cannot be confused with any other tool.
Since there is only one tool, it inherently follows a consistent naming pattern. The tool name 'generate_image' uses a verb_noun format, which is clear and appropriate for its function.
A single tool is too few for a server focused on image generation, as it lacks essential operations like listing models, managing generation parameters, or handling image variations. This minimal scope limits functionality and agent workflows.
The tool surface is severely incomplete for image generation; it only provides generation without supporting model selection, parameter tuning, or post-processing. This creates significant gaps that will hinder agent tasks requiring more control or information.
Maintenance
Related MCP Connectors
MCP server for Qwen Image 3 AI image generation
Generate AI images and videos from any compatible MCP client.
Generate AI images, video, music, and sound effects, and upscale them, from any MCP client.
Generate images with any major model — one API key, one prepaid balance, one MCP.
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
- AlicenseNot gradedqualityDmaintenanceEnables text-to-image generation using Zhipu AI's CogView-4 API. Supports generating images from text prompts with configurable size and quality parameters through MCP-compatible clients like Claude Desktop and Cline.21MIT
- AlicenseDqualityDmaintenanceIntegrates Jimeng AI image and video generation services through MCP protocol, enabling users to generate high-quality images and videos from text prompts with support for image mixing, reference images, and multiple AI models.3753MIT
- AlicenseBqualityDmaintenanceEnables AI image generation via MCP protocol, supporting dozens of models, customizable parameters, and multiple resolutions.318ISC