RunwayML + Luma AI MCP 服务器
该 MCP 服务器提供与 RunwayML 和 Luma AI API 交互的工具,用于执行视频和图像生成任务。
特征
根据文本提示生成视频(RunwayML 或 Luma AI)。
从图像生成视频(RunwayML 或 Luma AI)。
根据文本提示生成图像(Luma AI)。
管理 Luma AI 生成(列出、获取、删除)。
向 Luma AI 代添加音频。
升级 Luma AI 世代。
生成之前使用 OpenRouter LLM 增强提示。
先决条件
Node.js(建议使用 v18 LTS 或更高版本)
npm(通常包含在 Node.js 中)
API 密钥:
RunwayML API 秘密
Luma AI API密钥
OpenRouter API 密钥(用于
enhance_prompt工具)
安装
**克隆或下载:**获取服务器代码。
**导航到目录:**在服务器的根目录(
runwayml-mcp-server)中打开一个终端。安装依赖项:
npm install
配置
**创建
.env文件:**在服务器的根目录中,创建一个名为.env的文件。**添加 API 密钥:**将您的 API 密钥添加到
.env文件:RUNWAYML_API_SECRET=your_runwayml_api_secret_here LUMAAI_API_KEY=your_luma_api_key_here OPENROUTER_API_KEY=your_openrouter_api_key_here将占位符值替换为您的实际键。
运行服务器
**构建服务器:**编译 TypeScript 代码:
npm run build启动服务器:
npm start您应该会在终端的错误输出(stderr)中看到类似
RunwayML MCP server running on stdio消息。
MCP 客户端设置(例如 Claude 桌面应用程序、Cline)
配置您的 MCP 客户端以连接到此服务器。具体步骤取决于客户端,但通常需要提供以下信息:
**名称:**描述性名称(例如,
runway-luma-server)命令:
node**参数:**已编译服务器索引文件的完整路径(例如,
/path/to/your/runwayml-mcp-server/build/server-index.jsto/your/runwayml-mcp-server/build/server-index.js)环境变量:
RUNWAYML_API_SECRET:您的 RunwayML API 密钥LUMAAI_API_KEY:您的 Luma AI API 密钥OPENROUTER_API_KEY:您的 OpenRouter API 密钥
示例配置(概念):
(请记住将
可用工具
generate_text_to_video:从文本生成视频。provider:(可选)runwayml(默认)或lumaai。promptText:(必需)文本提示。runway_model:(可选)跑道模型(例如“gen-2”)。runway_resolution:(可选)跑道分辨率(1280:768或768:1280)。runway_watermark:(可选)布尔值,默认为false。luma_model:(可选)亮度模型(ray-flash-2、ray-2(默认)、ray-1-6)。luma_aspect_ratio:(可选)亮度宽高比(例如,16:9(默认值)、1:1)。luma_loop:(可选)布尔值。duration:(可选)视频持续时间(以秒为单位)(数字)。seed:(可选)生成种子(数字)。
generate_image_to_video:从图像生成视频。provider:(可选)runwayml(默认)或lumaai。promptImage:(必需)输入图像的 URL,或者对于 Runway,为数组[{uri: "url", position: "first" | "last"}]。promptText:(可选)伴随图像的文本提示。runway_model:(可选)跑道模型(gen3a_turbo(默认))。runway_duration:(可选)跑道持续时间(5(默认)或10)。runway_ratio:(可选)跑道分辨率(1280:768或768:1280)。runway_watermark:(可选)布尔值,默认为false。luma_model:(可选)亮度模型(ray-flash-2、ray-2(默认)、ray-1-6)。luma_aspect_ratio:(可选)亮度宽高比(例如,16:9(默认值))。luma_loop:(可选)布尔值。seed:(可选)生成种子(数字)。
enhance_prompt:使用 OpenRouter 优化提示。original_prompt:(必需)需要增强的提示。model:(可选)OpenRouter 模型名称(默认为像anthropic/claude-3.5-sonnet这样的能力模型)。instructions:(可选)增强功能的具体说明。
luma_generate_image:使用 Luma AI 生成图像。prompt:(必需)文本提示。aspect_ratio:(可选)亮度宽高比(16:9(默认))。model:(可选)亮度图像模型(photon-1(默认)、photon-flash-1)。image_ref:(可选)图像引用对象数组({url: string, weight?: number})。最多 4 个。style_ref:(可选)样式参考对象数组({url: string, weight?: number})。最多 1 个。character_ref:(可选)字符引用对象({ identity0: { images: [url1, ...] } })。modify_image_ref:(可选)修改图像参考对象({url: string, weight?: number})。
luma_list_generations:列出之前的 Luma AI 代。limit:(可选)结果数量(默认 10)。offset:(可选)分页偏移量(默认为 0)。
luma_get_generation:获取特定 Luma AI 生成的详细信息。generation_id:(必需)该代的 UUID。
luma_delete_generation:删除特定的 Luma AI 生成。generation_id:(必需)该代的 UUID。
luma_get_camera_motions:列出 Luma AI 提示支持的摄像头运动。(无参数)。luma_add_audio:将音频添加到 Luma 生成。generation_id:(必需)该代的 UUID。prompt:(必需)提示音频。negative_prompt:(可选)音频的负面提示。
luma_upscale:提升 Luma 生成。generation_id:(必需)该代的 UUID。resolution:(可选)目标分辨率(1080p(默认)或4k)。
(注意:对于涉及生成的工具(
示例工作流程
以下是如何组合服务器工具用于常见用例的示例:
1. 音乐视频片段(赛博朋克黑色)
**目标:**为歌词“霓虹河流经铬城”制作一段 5 秒的赛博朋克黑色视频片段。
步骤:
生成基础图像(亮度):
{ "tool_name": "luma_generate_image", "arguments": { "prompt": "Overhead shot of a dark, rainy cyberpunk city street at night. Bright neon signs reflect on wet pavement, resembling rivers of light flowing between towering chrome skyscrapers. Film noir aesthetic, photorealistic.", "aspect_ratio": "16:9" } }(等待图片生成完成,获取图片URL)
动画图像(亮度):
{ "tool_name": "generate_image_to_video", "arguments": { "provider": "lumaai", "promptImage": "{IMAGE_URL_FROM_STEP_1}", "promptText": "Slow pan left across the rainy cyberpunk cityscape, neon lights flickering subtly.", "luma_aspect_ratio": "16:9", "duration": 5 } }(等待视频生成完成)
2. 产品广告概念(悬浮耳塞)
**目标:**制作一段 5 秒的视频,展示一款漂浮在简约环境中的未来派耳塞。
步骤:
使用产品参考生成场景(Luma):
{ "tool_name": "luma_generate_image", "arguments": { "prompt": "A single, sleek futuristic wireless earbud floats weightlessly in the center of a bright, minimalist white room with soft, diffused ambient light. Zero gravity effect.", "aspect_ratio": "1:1", "image_ref": [{ "url": "{PRODUCT_IMAGE_URL}", "weight": 0.8 }] } }(等待图片生成完成,获取图片URL)
动画场景(Luma):
{ "tool_name": "generate_image_to_video", "arguments": { "provider": "lumaai", "promptImage": "{IMAGE_URL_FROM_STEP_1}", "promptText": "The earbud slowly rotates and drifts gently in zero gravity.", "luma_aspect_ratio": "1:1", "duration": 5 } }(等待视频生成完成)
3.图像动画(RunwayML Gen3a)
**目标:**使用 RunwayML 的 Gen3a 模型为现有图像制作动画。
步骤:
**(可选)生成基础图像(Luma):**如果您没有图像,请使用
luma_generate_image。动画图像(RunwayML):
{ "tool_name": "generate_image_to_video", "arguments": { "provider": "runwayml", "promptImage": "{YOUR_IMAGE_URL}", "promptText": "Subtle zoom in, cinematic lighting.", "runway_model": "gen3a_turbo", "runway_duration": "5", "runway_ratio": "1280:768" // Or "768:1280" } }(等待视频生成完成)
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
提供与 RunwayML 和 Luma AI API 交互的工具,用于视频和图像生成,包括文本转视频、图像转视频、提示增强和生成管理。
Related MCP Servers
- -security-license-qualityA server that provides Luma AI's video generation API as the Model Context Protocol (MCP)Last updated -3
- -security-license-qualityGives AI-powered coding tools like Cursor, Windsurf, and Cline access to Figma design files, enabling more accurate code generation directly from Figma designs.Last updated -63,839MIT License
- Asecurity-licenseAqualityCreate videos and images using Luma AI, this MCP server handles all API functionality for Luma Dream Machine from Claude Desktop.Last updated -103
- Asecurity-licenseAqualityEnables AI tools to interact with browsers for enhanced frontend development, providing context to LLMs through tools like API call analysis, screenshots, element selection, and documentation ingestion.Last updated -82410MIT License