Video processing MCP server
Project description
VideoMCP
VideoMCP是一个图像生成服务的MCP(Model Control Protocol)集成,用于在Cursor中直接生成AI图像。
功能
- 支持文本到图像的生成 (使用liblibai API)
- MCP协议集成,支持Cursor直接调用
安装
-
克隆本仓库:
git clone https://github.com/your-username/VideoMCP.git cd VideoMCP
-
安装依赖:
pip install -e .
-
配置MCP:
- 复制
mcp.example.json到~/.cursor/mcp.json - 或添加
videomcp部分到现有的~/.cursor/mcp.json文件
- 复制
使用方式
启动服务
python -m videomcp.server
通过Cursor使用
- 确保Cursor已启动并已加载MCP配置
- 使用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
故障排查
如果遇到问题,请查看日志文件并确保:
- API密钥正确配置
- Python路径正确设置
- 下载目录存在且可写
API凭证
您需要从liblibai获取API密钥。
开发说明
MCP集成完成情况
MCP协议集成已完成并经过测试,主要改进包括:
-
协议兼容性:
- 完善了Content-Length机制
- 确保所有响应都符合JSON-RPC 2.0规范
- 增强了错误处理
-
稳定性改进:
- 标准输出重定向,防止调试信息干扰协议通信
- 完善的日志记录系统
- 中文和特殊字符的正确处理
-
认证机制:
- 完善了API认证参数生成
- 错误处理和重试机制
-
调试工具:
- 提供了专门的调试日志
- 支持查看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.1.tar.gz
(25.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
clipmcp-0.2.1-py3-none-any.whl
(27.2 kB
view details)
File details
Details for the file clipmcp-0.2.1.tar.gz.
File metadata
- Download URL: clipmcp-0.2.1.tar.gz
- Upload date:
- Size: 25.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f68692dffb4770f91fff204946d1ed028f3d656b3fd9d6cadb399d9f51955e7
|
|
| MD5 |
f9d17a3e0802fcd526b6b14be31a51f6
|
|
| BLAKE2b-256 |
1606a4111d3c1fcd0c4599c5bb09cf8f739047af1964da60a0a0d8b635157f53
|
File details
Details for the file clipmcp-0.2.1-py3-none-any.whl.
File metadata
- Download URL: clipmcp-0.2.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4de2292b3e6759cdf9eac439e6bf124ea238bfd782914d150a3b3b0a103d0f65
|
|
| MD5 |
e4ec2efbe76c30a0b379f8a144c7801f
|
|
| BLAKE2b-256 |
1c34ce700fdeb47b160b27eaa0d6cd107b79a683528aa5fdca8153c443ac994b
|