MCP server for Draw Things - local AI image generation on Mac
An MCP (Model Context Protocol) server for Draw Things - enabling LLMs to generate images locally on Mac using Stable Diffusion and other AI models.
Verify the server is running:
curl http://localhost:7860Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"drawthings": {
"command": "npx",
"args": ["-y", "mcp-drawthings"]
}
}
}Add to .cursor/mcp.json in your project or global config:
{
"mcpServers": {
"drawthings": {
"command": "npx",
"args": ["-y", "mcp-drawthings"]
}
}
}Restart Claude Desktop or Cursor to load the new MCP server.
check_statusCheck if the Draw Things API server is running and accessible.
get_configGet the current Draw Things configuration including the loaded model and settings.
generate_imageGenerate an image from a text prompt.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Text description of the image to generate |
negative_prompt | string | No | Elements to exclude from the generated image |
width | number | No | Image width in pixels (default: 512) |
height | number | No | Image height in pixels (default: 512) |
steps | number | No | Number of inference steps (default: 20) |
cfg_scale | number | No | Guidance scale (default: 7.5) |
seed | number | No | Random seed for reproducibility (-1 for random) |
output_path | string | No | Custom file path to save the image |
Example:
Generate an image of a futuristic city at sunset with flying cars
transform_imageTransform an existing image using a text prompt (img2img).
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Text description of the desired transformation |
image_path | string | No* | Path to the source image file |
image_base64 | string | No* | Base64-encoded source image |
negative_prompt | string | No | Elements to exclude |
denoising_strength | number | No | Transformation strength 0.0-1.0 (default: 0.75) |
steps | number | No | Number of inference steps (default: 20) |
cfg_scale | number | No | Guidance scale (default: 7.5) |
seed | number | No | Random seed (-1 for random) |
output_path | string | No | Custom file path to save the result |
*Either image_path or image_base64 must be provided.
| Variable | Default | Description |
|---|---|---|
DRAWTHINGS_HOST | localhost | Draw Things API host |
DRAWTHINGS_PORT | 7860 | Draw Things API port |
DRAWTHINGS_OUTPUT_DIR | ~/Pictures/drawthings-mcp | Directory for generated images |
┌─────────────────┐ stdio ┌──────────────────┐ HTTP ┌─────────────┐
│ MCP Client │◄──────────────►│ mcp-drawthings │◄────────────►│ Draw Things │
│ (Claude/Cursor) │ JSON-RPC │ │ localhost │ App │
└─────────────────┘ └──────────────────┘ :7860 └─────────────┘
│
▼
┌──────────────┐
│ File System │
│ (images) │
└──────────────┘# Clone the repository
git clone https://github.com/james-see/mcp-drawthings
cd mcp-drawthings
# Install dependencies
npm install
# Build
npm run build
# Run in development mode
npm run devcurl http://localhost:7860Check that the output directory is writable. You can set a custom directory using the DRAWTHINGS_OUTPUT_DIR environment variable.
MIT