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.2.tar.gz (26.0 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.2-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: clipmcp-0.2.2.tar.gz
  • Upload date:
  • Size: 26.0 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.2.tar.gz
Algorithm Hash digest
SHA256 004182b33b571faa46006c6dc896b420a971f9efce92745200f9ed54cb19d228
MD5 25d0b575777b31e36db1c84c461024b5
BLAKE2b-256 a0345864b82f3d6467143dd268e317e960648ed75bb0016b90ec46deebd2ef73

See more details on using hashes here.

File details

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

File metadata

  • Download URL: clipmcp-0.2.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6f0fa8ca436e1c3ea7d5d9f9f6b19e557e1bde4e2e1f9a0bd670341c0113a86c
MD5 b9e927f55762da25a994289e0e690334
BLAKE2b-256 17543df60d2abc60339e6ad536e144af4f53608eb31793134ab5ca5015084796

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