Skip to main content
Glama

Draw Things MCP

by jaokuohsuan

绘制事物 MCP

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

先决条件

安装

# Install globally npm install -g draw-things-mcp-cursor # Or run directly npx draw-things-mcp-cursor

光标集成

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

快速设置:

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

CLI 使用

生成图像

echo '{"prompt": "your prompt here"}' | 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": "a happy smiling dog, professional photography", "negative_prompt": "ugly, deformed, blurry", "width": 360, "height": 360, "steps": 4 }' | npx draw-things-mcp-cursor

MCP 工具集成

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

{ 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) }

生成的图像将保存在images目录中,文件名格式为: <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 }

故障排除

如果您遇到问题:

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

执照

麻省理工学院

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

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

  1. 先决条件
    1. 安装
      1. 光标集成
        1. CLI 使用
          1. 生成图像
          2. 参数
          3. MCP 工具集成
        2. 响应格式
          1. 故障排除
            1. 执照

              Related MCP Servers

              • -
                security
                A
                license
                -
                quality
                An AI-powered development toolkit for Cursor providing intelligent coding assistance through advanced reasoning, UI screenshot analysis, and code review tools.
                Last updated -
                1,012
                240
                TypeScript
                MIT License
              • -
                security
                A
                license
                -
                quality
                A server that integrates Flux's advanced image generation and manipulation features into AI coding assistants, enabling seamless text-to-image and image control workflows in IDEs like Cursor and Windsurf.
                Last updated -
                4
                10
                Python
                MIT License
              • A
                security
                A
                license
                A
                quality
                An MCP server integration that enables Cursor AI to communicate with Figma, allowing users to read designs and modify them programmatically through natural language commands.
                Last updated -
                19
                2,514
                3,528
                JavaScript
                MIT License
                • Apple
                • Linux
              • -
                security
                F
                license
                -
                quality
                Enables Cursor AI to interact with Figma designs, allowing users to read design information and programmatically modify elements through natural language commands.
                Last updated -
                TypeScript

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/jaokuohsuan/draw-things-mcp-cursor'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server