Skip to main content

Video processing MCP server

Project description

VideoMCP

VideoMCP是一个图像生成服务的MCP(Model Control Protocol)集成,用于在Cursor中直接生成AI图像。

功能

  • 支持文本到图像的生成 (使用liblibai API)
  • MCP协议集成,支持Cursor直接调用

安装

  1. 克隆本仓库:

    git clone https://github.com/your-username/VideoMCP.git
    cd VideoMCP
    
  2. 安装依赖:

    pip install -e .
    
  3. 配置MCP:

    • 复制mcp.example.json~/.cursor/mcp.json
    • 或添加videomcp部分到现有的~/.cursor/mcp.json文件

使用方式

启动服务

python -m videomcp.server

通过Cursor使用

  1. 确保Cursor已启动并已加载MCP配置
  2. 使用Cursor中的VideoMCP API生成图像:
# 示例代码
await videomcp_generate_image(
    prompt="一只可爱的猫",
    negative_prompt="模糊,变形",
    width=768,
    height=768
)

MCP协议支持情况

支持的方法:

  • test_connection: 测试API连接
  • ping: 心跳检测
  • generate_image: 生成图像

服务器日志

  • 主日志: ~/videomcp_debug.log
  • 错误日志: ~/videomcp_error.log
  • 标准错误: ~/videomcp_stderr.log

故障排查

如果遇到问题,请查看日志文件并确保:

  1. API密钥正确配置
  2. Python路径正确设置
  3. 下载目录存在且可写

API凭证

您需要从liblibai获取API密钥。

开发说明

MCP集成完成情况

MCP协议集成已完成并经过测试,主要改进包括:

  1. 协议兼容性:

    • 完善了Content-Length机制
    • 确保所有响应都符合JSON-RPC 2.0规范
    • 增强了错误处理
  2. 稳定性改进:

    • 标准输出重定向,防止调试信息干扰协议通信
    • 完善的日志记录系统
    • 中文和特殊字符的正确处理
  3. 认证机制:

    • 完善了API认证参数生成
    • 错误处理和重试机制
  4. 调试工具:

    • 提供了专门的调试日志
    • 支持查看JSON序列化过程
    • 协议测试工具

已解决问题

  • JSON-RPC消息序列化和中文编码问题
  • API认证参数生成规范化
  • MCP协议消息格式符合标准

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clipmcp-0.2.0.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clipmcp-0.2.0-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file clipmcp-0.2.0.tar.gz.

File metadata

  • Download URL: clipmcp-0.2.0.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for clipmcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 952da3c94783e7450fee73a36668c2a34c22a3d23358bb706ac14533761dda0a
MD5 03cfd979a15b399ccbfa62d33c572a75
BLAKE2b-256 6e11d7a1cf537c5e69c9fdf55b60b4e61f007fef80d46d7140ff18907f6251de

See more details on using hashes here.

File details

Details for the file clipmcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: clipmcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for clipmcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fec8b992fb6f777ec1820f89ba4fda927f0ab4c361bbcca8121411fca93e1ac
MD5 054846384356e5e262521ac64ae5d0e6
BLAKE2b-256 58c15bfc8f315d36728ce381ae4b8f0b23bac95b1a4cf02fdf15f0e6c8c1d891

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page