TOBYCAI/image-mcp

image-mcp

本地 Pillow 图片处理 MCP:12 工具(信息/缩放/裁剪/转换/压缩/旋转/翻转/缩略图/水印/特效/占位/叠加),离线零成本,经 dsh-mcp-client 接入 DSH。Local Pillow image MCP with 12 tools for DeepSeek Harness, offline & free. | Platforms: macOS/Windows/Linux (Python+Pillow)

Uncategorizeddeepseek-harnessdshimage-processing

image-mcp

中文 | English

A local, Pillow-based image-processing MCP server (offline, no API key). Via MCP it exposes a set of image tools to DeepSeek Harness (or any stdio-MCP client): info / resize / crop / convert / compress / rotate / flip / thumbnail / watermark / effects / placeholder / overlay — 12 tools, model-visible as mcp__images__*.

Features

  • Offline & zero-cost: local Pillow processing only, no online API or key required.
  • 12 image tools: info / resize / crop / convert / compress / rotate / flip / thumbnail / watermark / effects / placeholder / overlay.
  • Standard protocol: JSON-RPC 2.0, newline-delimited stdio MCP; all logs go to stderr (stdout is reserved for the protocol).
  • Easy wiring: one config entry via @deepseek-ai/dsh-mcp-client in a DSH profile.

Install & wire in (DSH)

pip install -r requirements.txt   # or: pip install Pillow

In a DSH profile patch (e.g. cordis.patch.yml):

- id: mcp-images
  name: '@deepseek-ai/dsh-mcp-client'
  config:
    serverName: images
    transport: stdio
    command: python3
    args: ['<PATH-TO>/image_mcp.py']

Restart DSH and the agent can call the mcp__images__* tools.

Run standalone (no DSH)

echo '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | python3 image_mcp.py
# returns the schema of the 12 tools

Tools

ToolDescription
infoimage format / dimensions / mode / size
resizescale by width/height or ratio (contain / cover / fill / stretch)
cropcrop a rectangle region
convertconvert format (PNG/JPEG/WEBP/GIF/BMP/TIFF)
compressre-encode with a quality setting
rotaterotate (optionally expand canvas)
flipmirror horizontally / vertically
thumbnailthumbnail with longest side at most size
watermarktext watermark (position/color/opacity/size)
effectsgreyscale / sepia / invert / blur / sharpen / contrast / brightness
placeholdersolid-color placeholder (optionally with text)
overlaycomposite one image over another (with alpha)

Protocol

  • Transport: stdio, one JSON object per line.
  • Version: JSON-RPC 2.0, Protocol 2025-03-26.
  • SERVER_NAME=dsh-image-mcp, SERVER_VERSION=0.1.0.

Supported platforms

  • Supported platforms: macOS / Windows / Linux (Python 3 + Pillow, cross-platform).
  • Windows note: use python instead of python3 in the MCP config; use absolute or backslash paths in args.

License

MIT © TOBYCAI