This server implements the Model Context Protocol (MCP) to integrate Draw Things API with Cursor, allowing you to generate AI images directly from the Cursor environment. It provides a bridge between Cursor's interface and Draw Things' image generation capabilities.
You can install the MCP server globally or run it directly:
# Install globally
npm install -g draw-things-mcp-cursor
# Or run directly
npx draw-things-mcp-cursor
To integrate with Cursor:
~/.cursor/claude_desktop_config.json
:{
"mcpServers": {
"draw-things": {
"command": "draw-things-mcp-cursor",
"args": []
}
}
}
generateImage({"prompt": "a cute cat"})
You can generate images directly from the command line:
echo '{"prompt": "your prompt here"}' | npx draw-things-mcp-cursor
echo '{
"prompt": "a happy smiling dog, professional photography",
"negative_prompt": "ugly, deformed, blurry",
"width": 360,
"height": 360,
"steps": 4
}' | npx draw-things-mcp-cursor
When used as an MCP tool in Cursor, it's registered as generateImage
with these parameters:
{
prompt: string; // Required - The prompt to generate the image from
negative_prompt?: string; // Optional - The negative prompt
width?: number; // Optional - Image width (default: 360)
height?: number; // Optional - Image height (default: 360)
model?: string; // Optional - Model name
steps?: number; // Optional - Number of steps (default: 8)
}
Generated images are saved in the images directory with filenames in this format:
<sanitized_prompt>_<timestamp>.png
{
"type": "success",
"content": [{
"type": "image",
"data": "base64 encoded image data",
"mimeType": "image/png"
}],
"metadata": {
"parameters": { ... }
}
}
{
"type": "error",
"error": "error message",
"code": 500
}
If you encounter issues:
chmod +x src/index.js
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.