Skip to main content

文本到图像生成API客户端和服务

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.1.0.tar.gz (23.6 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.1.0-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for clipmcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 76b56c13af1ffe55c26701563969255b0f81bc26c6bb9d2da867c949e47185f8
MD5 54e0469e5a01f2d92d254405ef61fd83
BLAKE2b-256 47f2e5160c6fc7c96a97db270e787fe4b3e733b9b8e5e2e72507c55abf63e45c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: clipmcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.0 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38b7266a07c5fd0a61e835ceee28ae57cdc64a6c0b1813c794f78169d9390801
MD5 24ab7ea7b655c25a1ec409f27ebb14e4
BLAKE2b-256 0cb7d3fa61a7bee22da35d71d6c7ff70bd8fc678a9f620ddde81e5a61adf5065

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