L

Luma AI生成服务器

@bobtista/luma-ai-mcp-server
0 Stars 311 次浏览 bobtista 更新于 2026-08-23

使用Luma AI创建视频和图像,此MCP服务器处理来自Claude Desktop的Luma Dream Machine的所有API功能。

该服务暂未提供标准配置,请参考 README 手动接入

服务介绍

Luma AI MCP 服务器 🎥

Luma AI 的 Dream Machine API 的模型上下文协议服务器。

概述

此 MCP 服务器与 Luma AI 的 Dream Machine API(v1)集成,通过大型语言模型提供生成、管理和操作由 AI 生成的视频和图像的工具。它实现了模型上下文协议(MCP),以实现 AI 助手与 Luma 创意工具之间的无缝交互。

特性 ✨

  • 文本到视频生成
  • 带关键帧的高级视频生成
  • 图像到视频转换
  • 视频扩展和插值
  • 带参考图像的图像生成
  • 向视频添加音频
  • 视频放大
  • 信用管理
  • 生成跟踪和状态检查

工具 🛠️

  1. ping

    • Check if the Luma API is running
    • No parameters required
  2. create_generation

    • Creates a new video generation
    • Input:
      • prompt (string, required): Text description of the video to generate
      • model (string, optional): Model to use (default: "ray-2")
        • Available models: "ray-1-6", "ray-2", "ray-flash-2"
      • resolution (string, optional): Video resolution (choices: "540p", "720p", "1080p", "4k")
      • duration (string, optional): Video duration (only "5s" and "9s" are currently supported)
      • aspect_ratio (string, optional): Video aspect ratio (e.g., "16:9", "1:1", "9:16", "4:3", "3:4", "21:9", "9:21")
      • loop (boolean, optional): Whether to make the video loop
      • keyframes (object, optional): Start and end frames for advanced video generation:
        • frame0 and/or frame1 with either:
          • {"type": "image", "url": "image_url"} for image keyframes
          • {"type": "generation", "id": "generation_id"} for video keyframes
  3. get_generation

    • Gets the status of a generation
    • Input:
      • generation_id (string, required): ID of the generation to check
    • Output includes:
      • Generation ID
      • State (queued, dreaming, completed, failed)
      • Failure reason (if failed)
      • Video URL (if completed)
  4. list_generations

    • Lists all generations
    • Input:
      • limit (number, optional): Maximum number of generations to return (default: 10)
      • offset (number, optional): Number of generations to skip
  5. delete_generation

    • Deletes a generation
    • Input:
      • generation_id (string, required): ID of the generation to delete
  6. upscale_generation

    • Upscales a video generation to higher resolution
    • Input:
      • generation_id (string, required): ID of the generation to upscale
      • resolution (string, required): Target resolution for the upscaled video (one of "540p", "720p", "1080p", or "4k")
    • Note:
      • The generation must be in a completed state to be upscaled
      • The target resolution must be higher than the original generation's resolution
      • Each generation can only be upscaled once
  7. add_audio

    • Adds AI-generated audio to a video generation
    • Input:
      • generation_id (required): The ID of the generation to add audio to
      • prompt (required): The prompt for the audio generation
      • negative_prompt (optional): The negative prompt for the audio generation
      • callback_url (optional): URL to notify when the audio processing is complete
  8. generate_image

    • Generates an image from a text prompt with optional reference images
    • Input:
      • prompt (string, required): Text description of the image to generate
      • model (string, optional): Model to use for image generation (default: "photon-1")
        • Available models: "photon-1", "photon-flash-1"
      • aspect_ratio (string, optional): Image aspect ratio (same options as video)
      • image_ref (array, optional): Reference images to guide generation
        • Each ref: {"url": "image_url", "weight": optional_float}
      • style_ref (array, optional): Style reference images
        • Each ref: {"url": "image_url", "weight": optional_float}
      • character_ref (object, optional): Character reference images
        • Format: {"identity_name": {"images": ["url1", "url2", ...]}}
      • modify_image_ref (object, optional): Image to modify
        • Format: {"url": "image_url", "weight": optional_float}
  9. get_credits

    • Gets credit information for the current user
    • No parameters required
    • Returns available credit balance in USD cents
  10. get_camera_motions

    • Gets all supported camera motions
    • No parameters required
    • Returns: List of available camera motion strings

Claude Desktop 设置 🖥️

  1. Luma AI 获取您的 Luma API 密钥(注册或登录以获取您的 API 密钥)

  2. 将以下内容添加到您的 Claude Desktop 配置文件中:

    • 在 macOS 上:~/Library/Application Support/Claude/claude_desktop_config.json
    • 在 Windows 上:%APPDATA%\Claude\claude_desktop_config.json
    {
      "mcpServers": {
        "luma": {
          "command": "uv",
          "args": [
            "run",
            "--project",
            "/path/to/your/luma-ai-mcp-server",
            "-m",
            "luma_ai_mcp_server"
          ],
          "env": {
            "LUMA_API_KEY": "your-luma-api-key-here"
          }
        }
      }
    }
    

    替换:

    • /path/to/your/luma-ai-mcp-server 为您的服务器目录的实际路径
    • your-luma-api-key-here 为您的实际 Luma API 密钥
  3. 重启 Claude Desktop

  4. 完成!您现在可以在 Claude Desktop 对话中直接使用 Luma AI 工具。

快速故障排除 🛠️

如果您遇到问题:

  1. 检查您的 API 密钥是否正确
  2. 确保服务器路径正确
  3. 查看日志:tail -n 20 -f ~/Library/Logs/Claude/mcp*.log

高级视频生成类型 🎬

Luma API 支持通过关键帧进行多种类型的高级视频生成:

  1. 从图像开始:提供 frame0,设置 type: "image" 并提供一个图像 URL
  2. 以图像结束:提供 frame1,设置 type: "image" 并提供一个图像 URL
  3. 扩展视频:提供 frame0,设置 type: "generation" 并提供一个生成 ID
  4. 反向扩展视频:提供 frame1,设置 type: "generation" 并提供一个生成 ID
  5. 在视频之间插值:同时提供 frame0frame1,设置 type: "generation" 并提供生成 ID

API 限制和注意事项 📝

  • 持续时间:目前 API 仅支持 "5s" 或 "9s" 的持续时间
  • 分辨率:有效值为 "540p", "720p", "1080p", 和 "4k"
  • 模型
    • 视频生成:
      • "ray-2"(默认)- 最佳质量,但较慢
      • "ray-flash-2" - 生成速度更快
      • "ray-1-6" - 旧版模型
    • 图像生成:
      • "photon-1"(默认)- 最佳质量,但较慢
      • "photon-flash-1" - 生成速度更快
  • 生成类型:视频、图像及高级(带关键帧)
  • 纵横比:"1:1"(方形),"16:9"(横向),"9:16"(纵向),"4:3"(标准),"3:4"(标准纵向),"21:9"(超宽),"9:21"(超宽纵向)
  • 状态:"queued"(排队中),"dreaming"(处理中),"completed"(完成),"failed"(失败)
  • 放大
    • 只有当视频生成处于 "complete"(完成)状态时才能放大
    • 目标分辨率必须高于原始生成的分辨率
    • 每个生成只能放大一次
  • API 密钥:需要在环境变量中设置
  • API 版本:使用 Dream Machine API v1

许可证 📄

MIT

相关 MCP 服务