提供Luma AI视频生成API的Model Context Protocol (MCP)服务器
</div>Luma MCP Server提供了Luma AI的视频生成功能作为MCP服务器。它支持从文本或图像生成视频,以及扩展和插值现有视频的功能。
src/
├── types/ - 类型定义
│ ├── schemas.ts - 输入模式
│ └── types.ts - 公共类型定义
├── services/ - 业务逻辑
├── handlers/ - 请求处理器
│ └── tool-handlers.ts
├── clients/ - 外部API客户端
│ └── luma-client.ts
├── utils/ - 工具
│ └── error-handler.ts
├── config/ - 配置
│ └── server-config.ts
└── index.ts - 入口点
npm install @sunwood-ai-labs/luma-mcp-server
获取Luma API密钥
设置环境变量
export LUMA_API_KEY=your_api_key_here
根据文本提示生成视频。
{
name: 'generate_video',
arguments: {
prompt: "一个戴着墨镜的泰迪熊在弹电吉他并跳舞",
loop: true, // 可选
callback_url: "https://your-callback-url.com" // 可选
}
}
以图片作为起始帧生成视频。
{
name: 'generate_video_from_image',
arguments: {
prompt: "低角度拍摄一只威猛的老虎在雪地里漫步",
image_url: "https://your-image-url.com/start-frame.jpg",
loop: true, // 可选
callback_url: "https://your-callback-url.com" // 可选
}
}
扩展现有的视频。
{
name: 'extend_video',
arguments: {
prompt: "继续舞蹈序列",
source_generation_id: "existing-video-generation-id",
loop: true, // 可选
callback_url: "https://your-callback-url.com" // 可选
}
}
在两个视频之间进行平滑过渡。
{
name: 'interpolate_videos',
arguments: {
prompt: "创建视频之间的平滑过渡",
start_generation_id: "first-video-generation-id",
end_generation_id: "second-video-generation-id",
callback_url: "https://your-callback-url.com" // 可选
}
}
类型定义 (types/):
schemas.ts: 使用Zod进行输入验证模式types.ts: 公共类型定义和接口处理器 (handlers/):
tool-handlers.ts: 处理MCP工具请求客户端 (clients/):
luma-client.ts: 负责与Luma AI API通信工具 (utils/):
error-handler.ts: 统一错误处理配置 (config/):
server-config.ts: 统一管理服务器配置git checkout -b feature/amazing-feature)git commit -m '✨ feat: 添加精彩功能')git push origin feature/amazing-feature)MIT License - 详情请参阅 LICENSE 文件。