Draw Things MCP

Draw Things MCP

一个集成,允许 Cursor AI 通过 Draw Things API 使用自然语言提示生成图像。

图像与视频处理
访问服务器

Tools

generateImage

Generate an image based on a prompt

README

Draw Things MCP

使用模型上下文协议 (MCP) 为 Cursor 集成的 Draw Things API。

前提条件

  • Node.js >= 14.0.0
  • Draw Things API 运行在 http://127.0.0.1:7888

安装

# 全局安装
npm install -g draw-things-mcp-cursor

# 或者直接运行
npx draw-things-mcp-cursor

Cursor 集成

要在 Cursor 中设置此工具,请参阅 cursor-setup.md 中的详细指南。

快速设置:

  1. 创建或编辑 ~/.cursor/claude_desktop_config.json:
{
  "mcpServers": {
    "draw-things": {
      "command": "draw-things-mcp-cursor",
      "args": []
    }
  }
}
  1. 重启 Cursor
  2. 在 Cursor 中使用: generateImage({"prompt": "a cute cat"})

CLI 用法

生成图像

echo '{"prompt": "你的提示语"}' | npx draw-things-mcp-cursor

参数

  • prompt: 用于图像生成的文本提示语 (必需)
  • negative_prompt: 用于图像生成的负面提示语
  • width: 图像宽度 (默认: 360)
  • height: 图像高度 (默认: 360)
  • steps: 生成步骤数 (默认: 8)
  • model: 用于生成的模型 (默认: "flux_1_schnell_q5p.ckpt")
  • sampler: 采样方法 (默认: "DPM++ 2M AYS")

示例:

echo '{
  "prompt": "一只快乐微笑的狗,专业摄影",
  "negative_prompt": "丑陋,畸形,模糊",
  "width": 360,
  "height": 360,
  "steps": 4
}' | npx draw-things-mcp-cursor

MCP 工具集成

当在 Cursor 中用作 MCP 工具时,该工具将被注册为 generateImage,并具有以下参数:

{
  prompt: string;       // 必需 - 用于生成图像的提示语
  negative_prompt?: string;  // 可选 - 负面提示语
  width?: number;       // 可选 - 图像宽度 (默认: 360)
  height?: number;      // 可选 - 图像高度 (默认: 360)
  model?: string;       // 可选 - 模型名称
  steps?: number;       // 可选 - 步骤数 (默认: 8)
}

生成的图像将保存在 images 目录中,文件名格式为: <sanitized_prompt>_<timestamp>.png

响应格式

成功:

{
  "type": "success",
  "content": [{
    "type": "image",
    "data": "base64 编码的图像数据",
    "mimeType": "image/png"
  }],
  "metadata": {
    "parameters": { ... }
  }
}

错误:

{
  "type": "error",
  "error": "错误信息",
  "code": 500
}

故障排除

如果您遇到问题:

  • 确保 Draw Things API 正在 http://127.0.0.1:7888 运行
  • 如果与 Cursor 一起使用,请检查 ~/.cursor/logs 中的日志文件
  • 确保 src/index.js 具有执行权限:chmod +x src/index.js

许可证

MIT

推荐服务器

Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
@kazuph/mcp-fetch

@kazuph/mcp-fetch

用于获取网页内容和处理图像的模型上下文协议服务器。这使得 Claude Desktop(或任何 MCP 客户端)能够适当地获取网页内容和处理图像。

精选
本地
JavaScript
mermaid-mcp-server

mermaid-mcp-server

一个模型上下文协议 (MCP) 服务器,用于将 Mermaid 图表转换为 PNG 图像。

精选
JavaScript
mcp-pinterest

mcp-pinterest

用于图像搜索和信息检索的 Pinterest 模型上下文协议 (MCP) 服务器

精选
TypeScript
DeepSRT MCP Server

DeepSRT MCP Server

一个 MCP 服务器,通过与 DeepSRT 的 API 集成,使用户能够以多种语言和格式生成 YouTube 视频的摘要。 (Alternatively, a slightly more formal translation:) 一个 MCP 服务器,它与 DeepSRT 的 API 集成,使用户能够生成多种语言和格式的 YouTube 视频摘要。

官方
JavaScript
ScreenshotOne MCP Server

ScreenshotOne MCP Server

一个官方的 MCP 服务器实现,它允许 AI 助手通过 ScreenshotOne API 捕获网站截图,从而在对话期间提供来自网页的视觉上下文。

官方
TypeScript
Glif

Glif

通过 MCP 运行托管在 Glif.app 上的 AI 工作流程,包括基于 ComfyUI 的图像生成器、表情包生成器、自拍、链式 LLM 调用等等。

官方
TypeScript
WebPerfect MCP Server

WebPerfect MCP Server

一个智能的MCP服务器,具有全自动化的批处理流水线,可用于生成适用于网络的图像。功能包括降噪、自动色阶/曲线、JPEG伪影去除、4K调整大小、智能锐化(带阴影/高光增强)以及高级WebP转换。

本地
JavaScript
Stealth Browser MCP Server

Stealth Browser MCP Server

使用 Playwright 提供隐身浏览器功能,采用反检测技术,使 MCP 客户端能够浏览网站并截取屏幕截图,同时规避常见的机器人检测系统。

本地
TypeScript
Video Editor MCP Server

Video Editor MCP Server

使用自然语言命令进行视频编辑,由 FFmpeg 提供支持,支持剪辑、合并、格式转换等操作,并具有实时进度跟踪和错误处理功能。

本地
Python