ModelScope Image Generation MCP Server

ModelScope Image Generation MCP Server

Enables 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.

Category
Visit Server

README

ModelScope Image Generation MCP Server

一个用于魔搭社区(ModelScope)文生图服务的 MCP(Model Context Protocol)服务器,使用 Qwen/Qwen-Image 模型,支持在 Claude Desktop 等 MCP 客户端中使用。

功能特性

  • 🎨 使用魔搭社区的 Qwen/Qwen-Image 模型生成图片
  • 🔄 同步生图体验:调用工具后自动等待生成完成
  • ⚙️ 完整参数支持:正向/负向提示词、分辨率、种子、采样步数、引导系数等
  • 📦 支持 npx 一键安装和运行

安装

方式 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 build

Claude 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

  1. 访问 魔搭社区
  2. 登录账号
  3. 进入个人中心获取 API Token (MODELSCOPE_SDK_TOKEN)
  4. 将 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.json

macOS

~/Library/Application Support/Claude/claude_desktop_config.json

Linux

~/.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

相关链接

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured