Skip to main content

animatool-mcp

[!WARNING] 暂不支持 Cherry Studio
Cherry Studio 的 MCP 客户端未正确处理 ImageContent 类型,会将 base64 图片数据作为纯文本字符串返回,而非渲染为图片。请使用正确实现 MCP 规范的客户端。

一个独立的 MCP Server + Python 客户端:通过标准 ComfyUI Server API(/prompt、/history/<id>、/view?...)在本地或云端 ComfyUI 上执行 Anima 工作流,并把生成图片以 base64 形式返回给 Cursor/Claude 等 MCP 客户端原生显示。

重要:本项目不需要安装到 ComfyUI/custom_nodes/。但你仍然需要一台可访问的 ComfyUI Server(本机或云端),并且云端已经把模型权重放到 models/ 下(按文件名加载)。


安装

方式一:使用 uvx (推荐)

无需手动安装 Python 包,直接在 Cursor 配置中使用 uvx 运行(需安装 uv):

{
  "mcpServers": {
    "animatool": {
      "command": "uvx",
      "args": ["--from", "comfyui-animatool", "animatool-mcp"],
      "env": {
        "COMFYUI_URL": "http://127.0.0.1:8188"
      }
    }
  }
}

方式二:使用 pip

pip install comfyui-animatool

Cursor 配置(MCP)

如果你使用 pip 安装,请在 .cursor/mcp.json 中配置:

{
  "mcpServers": {
    "animatool": {
      "command": "animatool-mcp",
      "env": {
        "COMFYUI_URL": "http://127.0.0.1:8188"
      }
    }
  }
}

然后重启 Cursor,确保 MCP 状态为 Running。


云端/远程 ComfyUI(推荐做法)

COMFYUI_URL 该填什么?

  • 本机默认:http://127.0.0.1:8188
  • 带路径前缀的反代:例如 https://example.com/comfy/(注意建议以 / 结尾,避免丢路径前缀)

1) 最佳实践:用隧道/VPN 让 ComfyUI 变成“内网可达”

ComfyUI 默认几乎没有鉴权能力,把它直接暴露到公网非常危险。建议使用:

  • Tailscale / ZeroTier / Cloudflare Tunnel / 自建 VPN
  • 或者反向代理 + HTTPS + 鉴权(Bearer / Basic / 自定义 Header)

2) 配置鉴权(可选)

本项目支持“有些云端需要、有些不需要”的混合场景。你可以在 .cursor/mcp.json 里通过 env 注入:

Bearer Token

{
  "mcpServers": {
    "animatool": {
      "command": "animatool-mcp",
      "env": {
        "COMFYUI_URL": "https://your-host.example.com:8188",
        "ANIMATOOL_BEARER_TOKEN": "YOUR_TOKEN"
      }
    }
  }
}

Basic Auth

{
  "mcpServers": {
    "animatool": {
      "command": "animatool-mcp",
      "env": {
        "COMFYUI_URL": "https://your-host.example.com:8188",
        "ANIMATOOL_BASIC_USER": "user",
        "ANIMATOOL_BASIC_PASS": "pass"
      }
    }
  }
}

自定义 Header(通用,推荐)

{
  "mcpServers": {
    "animatool": {
      "command": "animatool-mcp",
      "env": {
        "COMFYUI_URL": "https://your-host.example.com:8188",
        "ANIMATOOL_HEADERS_JSON": "{\"X-API-Key\":\"xxx\",\"CF-Access-Client-Id\":\"...\",\"CF-Access-Client-Secret\":\"...\"}"
      }
    }
  }
}

Windows/JSON 转义提示:ANIMATOOL_HEADERS_JSON 本身是一个 JSON 字符串,所以内部的双引号需要转义(如上所示)。

3) 自签名证书/SSL 校验

如果你的云端是自签名证书,可以临时关闭校验(不推荐长期使用):

{
  "mcpServers": {
    "animatool": {
      "command": "animatool-mcp",
      "env": {
        "COMFYUI_URL": "https://your-host.example.com:8188",
        "ANIMATOOL_SSL_VERIFY": "false"
      }
    }
  }
}

CLI(可选)

用于本地自测(不依赖 MCP 客户端):

animatool-generate --comfyui-url http://127.0.0.1:8188 --json-file payload.json

环境变量速查

环境变量 说明 默认值
COMFYUI_URL ComfyUI Server base URL http://127.0.0.1:8188
ANIMATOOL_TIMEOUT 请求超时秒 600
ANIMATOOL_POLL_INTERVAL 轮询间隔秒 1
ANIMATOOL_SSL_VERIFY SSL 校验 true
ANIMATOOL_BEARER_TOKEN Bearer Token (空)
ANIMATOOL_BASIC_USER / ANIMATOOL_BASIC_PASS Basic Auth (空)
ANIMATOOL_HEADERS_JSON 自定义 Header JSON (空)
ANIMATOOL_DOWNLOAD_IMAGES 是否保存图片到本地 false
ANIMATOOL_OUTPUT_DIR 本地保存目录 ./animatool_outputs
COMFYUI_MODELS_DIR models 目录(用于本机预检查) (空)
ANIMATOOL_CHECK_MODELS 是否启用预检查 true

常见问题

Q: 报错连接不上 /prompt?

  • 检查 COMFYUI_URL 是否可达(云端建议先在浏览器访问 COMFYUI_URL/system_stats)
  • 如果有鉴权,请确认 /prompt、/history、/view 都在同一套鉴权规则下
    • 常见坑:反代只给 /prompt 放行了,但 /view 被 401/403 拦住,会导致“生成成功但取图失败”

Q: 报错找不到模型?

本工具提交的是一个包含 UNETLoader/CLIPLoader/VAELoader 的工作流模板,加载的是云端磁盘上的文件名。请确认云端 models/ 下至少存在:

  • models/diffusion_models/anima-preview.safetensors
  • models/text_encoders/qwen_3_06b_base.safetensors
  • models/vae/qwen_image_vae.safetensors

Metadata

Release files for comfyui-animatool 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for comfyui-animatool 0.2.0
File Size Uploaded Provenance Actions
comfyui_animatool-0.2.0.tar.gz 28.5 kB Without provenance Details for comfyui_animatool-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for comfyui-animatool 0.2.0
File Interpreter ABI Platform Actions
comfyui_animatool-0.2.0-py3-none-any.whl Python 3 none any Details for comfyui_animatool-0.2.0-py3-none-any.whl

Total release size: 60.4 kB

Release files / comfyui_animatool-0.2.0.tar.gz

Download URL comfyui_animatool-0.2.0.tar.gz
Size 28.5 kB
Tags Source
SHA-256 checksum
How to use checksums
446c305ee12e3b33a8a550e71ab8a33be67d4abf3f14111b677e8ae35384dae3
BLAKE2b-256 checksum
How to use checksums
bc74704280dbd6d78a7a6b2dd37f9734d4fa45f1126ed5113fd1815c860b1989
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / comfyui_animatool-0.2.0-py3-none-any.whl

Download URL comfyui_animatool-0.2.0-py3-none-any.whl
Size 31.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d70ef792e9b2b47a15cce92b669539247635b0619ec6fce37536d68d1d8df70
BLAKE2b-256 checksum
How to use checksums
655ce398ff8113be10d038e6745f6f7d6ce10587349fcda564c2944f0b78f6cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for comfyui-animatool 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page