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
Open Draw Things
Click the gear icon (⚙️) to open Settings
Enable API Server / HTTP Server
The server runs on port 7860 by default
Verify the server is running:
2. Configure Your MCP Client
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
Cursor
Add to .cursor/mcp.json in your project or global config:
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:
Parameter | Type | Required | Description |
| string | Yes | Text description of the image to generate |
| string | No | Elements to exclude from the generated image |
| number | No | Image width in pixels (default: 512) |
| number | No | Image height in pixels (default: 512) |
| number | No | Number of inference steps (default: 20) |
| number | No | Guidance scale (default: 7.5) |
| number | No | Random seed for reproducibility (-1 for random) |
| string | No | Custom file path to save the image |
Example:
transform_image
Transform an existing image using a text prompt (img2img).
Parameters:
Parameter | Type | Required | Description |
| string | Yes | Text description of the desired transformation |
| string | No* | Path to the source image file |
| string | No* | Base64-encoded source image |
| string | No | Elements to exclude |
| number | No | Transformation strength 0.0-1.0 (default: 0.75) |
| number | No | Number of inference steps (default: 20) |
| number | No | Guidance scale (default: 7.5) |
| number | No | Random seed (-1 for random) |
| string | No | Custom file path to save the result |
*Either image_path or image_base64 must be provided.
Configuration
Environment Variables
Variable | Default | Description |
|
| Draw Things API host |
|
| Draw Things API port |
|
| Directory for generated images |
Architecture
Development
Troubleshooting
"Cannot connect to Draw Things API"
Make sure Draw Things is running
Check that the API Server is enabled in Draw Things settings
Verify the server is accessible:
curl http://localhost:7860Check if a different port is configured in Draw Things
Images not generating
Make sure a model is loaded in Draw Things
Check Draw Things for any error messages
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
Draw Things - The AI image generation app for Mac/iOS
Model Context Protocol - The protocol specification
@modelcontextprotocol/sdk - TypeScript SDK for MCP