Mcp Drawthings

io.github.james-see由 GitHub 账号 james-see 发布v1.1.2更新于 Oct 24, 2026

MCP server for Draw Things - local AI image generation on Mac

已验证STDIO仅桌面媒体与设计AI 与机器学习

概览

AI 生成的概览

该 MCP 服务器让助手通过 Apple Silicon Mac 上的 Draw Things 应用在本地生成和转换图像。

可以做什么
  • 检查 Draw Things API 服务器是否可访问,并读取当前配置,包括已加载的模型和设置
  • 根据文本提示生成图像,可设置负面提示、尺寸、步数、引导系数、随机种子和输出路径
  • 使用文本提示转换已有图像,来源可以是文件路径或 base64 数据,并可调整去噪强度
  • 将结果保存到默认图片目录或自定义输出路径
适用场景
适合希望助手在 Mac 上用本地 Stable Diffusion 模型创作或改写图像、而不把提示词发送到云端图像服务的场景。适合已在使用 Draw Things 并想在 Claude Desktop、Cursor 等 MCP 客户端中直接生成图像的用户。
运行要求
Apple Silicon(M1 及以上)的 macOS、已安装并启用 API/HTTP 服务器的 Draw Things 应用(默认端口 7860),以及运行该 npm 包所需的 Node.js 18 或更高版本。可选环境变量 DRAWTHINGS_HOST、DRAWTHINGS_PORT 和 DRAWTHINGS_OUTPUT_DIR 用于修改主机、端口和输出目录。
安装前请注意
服务器会向磁盘写入图像文件,默认位于用户的图片文件夹,并接受自定义输出路径,请确认文件保存位置。它连接 Draw Things 应用提供的本地 HTTP 端点,该端点需启用并保持运行。生成过程占用较多算力,尺寸较大或步数较高时可能较慢。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Mcp Drawthings,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-drawthings

An MCP (Model Context Protocol) server for Draw Things - enabling LLMs to generate images locally on Mac using Stable Diffusion and other AI models.

Features

  • Text-to-Image Generation - Generate images from text prompts using the currently loaded model in Draw Things
  • Image-to-Image Transformation - Transform existing images using text prompts
  • Configuration Access - Query the current Draw Things settings and loaded model
  • Local Processing - All image generation runs locally on your Mac using Apple Silicon (M1/M2/M3/M4)

Prerequisites

  • macOS with Apple Silicon (M1/M2/M3/M4)
  • Draw Things app installed
  • Node.js 18 or later

Setup

1. Enable Draw Things API Server

  1. Open Draw Things
  2. Click the gear icon (⚙️) to open Settings
  3. Enable API Server / HTTP Server
  4. The server runs on port 7860 by default

Verify the server is running:

bash
curl http://localhost:7860

2. Configure Your MCP Client

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{  "mcpServers": {    "drawthings": {      "command": "npx",      "args": ["-y", "mcp-drawthings"]    }  }}
Cursor

Add to .cursor/mcp.json in your project or global config:

json
{  "mcpServers": {    "drawthings": {      "command": "npx",      "args": ["-y", "mcp-drawthings"]    }  }}

3. Restart Your MCP Client

Restart Claude Desktop or Cursor to load the new MCP server.

Available Tools

check_status

Check if the Draw Things API server is running and accessible.

get_config

Get the current Draw Things configuration including the loaded model and settings.

generate_image

Generate an image from a text prompt.

Parameters:

ParameterTypeRequiredDescription
promptstringYesText description of the image to generate
negative_promptstringNoElements to exclude from the generated image
widthnumberNoImage width in pixels (default: 512)
heightnumberNoImage height in pixels (default: 512)
stepsnumberNoNumber of inference steps (default: 20)
cfg_scalenumberNoGuidance scale (default: 7.5)
seednumberNoRandom seed for reproducibility (-1 for random)
output_pathstringNoCustom file path to save the image

Example:

Generate an image of a futuristic city at sunset with flying cars

transform_image

Transform an existing image using a text prompt (img2img).

Parameters:

ParameterTypeRequiredDescription
promptstringYesText description of the desired transformation
image_pathstringNo*Path to the source image file
image_base64stringNo*Base64-encoded source image
negative_promptstringNoElements to exclude
denoising_strengthnumberNoTransformation strength 0.0-1.0 (default: 0.75)
stepsnumberNoNumber of inference steps (default: 20)
cfg_scalenumberNoGuidance scale (default: 7.5)
seednumberNoRandom seed (-1 for random)
output_pathstringNoCustom file path to save the result

*Either image_path or image_base64 must be provided.

Configuration

Environment Variables

VariableDefaultDescription
DRAWTHINGS_HOSTlocalhostDraw Things API host
DRAWTHINGS_PORT7860Draw Things API port
DRAWTHINGS_OUTPUT_DIR~/Pictures/drawthings-mcpDirectory for generated images

Architecture

┌─────────────────┐     stdio      ┌──────────────────┐     HTTP      ┌─────────────┐│   MCP Client    │◄──────────────►│  mcp-drawthings  │◄────────────►│ Draw Things ││ (Claude/Cursor) │   JSON-RPC     │                  │  localhost    │    App      │└─────────────────┘                └──────────────────┘   :7860       └─────────────┘                                           │                                           ▼                                   ┌──────────────┐                                   │  File System │                                   │   (images)   │                                   └──────────────┘

Development

bash
# Clone the repositorygit clone https://github.com/james-see/mcp-drawthingscd mcp-drawthings
# Install dependenciesnpm install
# Buildnpm run build
# Run in development modenpm run dev

Troubleshooting

"Cannot connect to Draw Things API"

  1. Make sure Draw Things is running
  2. Check that the API Server is enabled in Draw Things settings
  3. Verify the server is accessible: curl http://localhost:7860
  4. Check if a different port is configured in Draw Things

Images not generating

  1. Make sure a model is loaded in Draw Things
  2. Check Draw Things for any error messages
  3. Try generating an image directly in Draw Things first

Permission errors saving images

Check that the output directory is writable. You can set a custom directory using the DRAWTHINGS_OUTPUT_DIR environment variable.

License

MIT

Related Projects

来源:README.md,提交 1c7b861

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.1.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分