Skip to main content
Glama
viktor-haag

scuffed-painter

by viktor-haag

Scuffed Painter

一个使用 Pillow 将绘图命令渲染为栅格图像的 MCP(Model Context Protocol)服务器。它暴露两个工具:

  • draw_image — 渲染命令并将结果作为内联 PNG 图像返回。

  • draw_image_to_file — 渲染命令并将结果保存到文件。

支持五种形状,每种形状都是一个 JSON 对象,通过其 "shape" 字段区分:

shape

参数

line

startendcolorwidth

rect

box(左、上、右、下)、filloutlinewidth

circle

centerradiusfilloutlinewidth

ellipse

box(x0, y0, x1, y1)、filloutlinewidth

triangle

points(恰好三个顶点)、filloutlinewidth

命令按列表顺序在固定大小的白色画布上执行;后面的命令会覆盖先前的命令。颜色可以是 CSS 颜色名称或十六进制颜色代码。

安装

pip install .

这将提供 scuffed-painter 控制台脚本,它通过 stdio 启动 MCP 服务器(默认方式)。python -m scuffed_painter 是等效的替代方式。同样的命令还可以通过 HTTP(MCP Streamable HTTP 传输)运行服务器:

scuffed-painter                              # stdio transport (default)
scuffed-painter --transport http             # HTTP on 127.0.0.1:8000
scuffed-painter --transport http --host H --port P

--host--port 仅适用于 HTTP 传输;默认值为 127.0.0.18000。如有必要,可以使用 --enable-cors 启用 CORS。

Related MCP server: openai-imagegen-mcp

MCP 主机配置

stdio

将服务器添加到 MCP 主机的 stdio 服务器配置中:

{
  "mcpServers": {
    "scuffed-painter": {
      "command": "scuffed-painter"
    }
  }
}

注意:在 PATH 受限的主机上,或在 virtualenv 中运行时,请改用已安装的 scuffed-painter 脚本的绝对路径(例如 which scuffed-painter 报告的路径)。

Streamable HTTP

自行启动服务器,然后将 MCP 主机指向该端点(路径为 /mcp):

scuffed-painter --transport http --host 127.0.0.1 --port 8000
{
  "mcpServers": {
    "scuffed-painter": {
      "type": "streamable-http",
      "url": "http://127.0.0.1:8000/mcp"
    }
  }
}

(调整键名以匹配 MCP 主机的配置格式。)

注意:使用 draw_image_to_file 时,output_path 指的是服务器运行所在的机器。通过 stdio 时,该机器与 MCP 客户端位于同一主机;当通过 HTTP 访问服务器时,该机器则是服务器所在的主机。

示例工具调用

{
  "width": 200,
  "height": 200,
  "commands": [
    {"shape": "circle", "center": [100, 80], "radius": 50, "fill": "gold", "outline": "orange", "width": 3},
    {"shape": "triangle", "points": [[50, 170], [150, 170], [100, 70]], "fill": "darkgreen"},
    {"shape": "line", "start": [20, 185], "end": [180, 185], "color": "black", "width": 2}
  ]
}

开发

仓库布局:

scuffed_painter/          the package
  server.py             server, tools, command models, rendering
  __init__.py           re-exports mcp, defines __version__
  __main__.py           python -m scuffed_painter support
  py.typed              typing marker
tests/                  pytest suite (in-process fastmcp.Client)

安装并运行测试:

pip install -e ".[dev]"
python -m pytest
Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Generate images, GIFs, and PDFs from HTML, URLs, or templates — from your AI agent.

  • Create diagrams in chat, rendered as live interactive draw.io diagrams. 10,000+ searchable shapes.

  • Generate logos, social posts, app screenshots, comic panels & visual-novel assets from prompts.

View all MCP Connectors

Latest Blog Posts

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/viktor-haag/scuffed-painter'

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