OpenCode Integration with Luma MCP

📘 OverviewOpenCode MCP Overview →

The Luma Dream Machine has consistently been one of the most cost-effective video models in terms of "low cost / high quality / natural transitions." After connecting to the Luma MCP Server in OpenCode, you can generate short videos based on text or reference images, and you can also extend existing videos to maintain a consistent style.

Luma MCP is suitable for creating product demo shorts, banner animations, social media short videos, as well as two high-frequency scenarios: "driving animations with images" and "video extensions."

Obtain API Token

Before using the Luma MCP Server, you need to prepare an Ace Data Cloud API Token. OpenCode and Claude Code share a single set of tokens, and the acquisition process is the same:

  1. Open the Ace Data Cloud Console - Application List to obtain your API Token for future use.
  2. If you are not logged in or registered, you will be automatically redirected to the login page; after logging in or registering, you will be automatically returned to the current page.
  3. The first application will grant a free quota, allowing you to experience Luma MCP services for free.

One token can be used for all 11 MCP Servers provided by AceData Cloud, without needing to apply separately for Luma. The documentation and screenshots suggest displaying only a desensitized form, such as 3b78cc40dd3b43db806a4300...., and not posting the full token in public repositories, issues, screenshots, or chat logs.

Want to use Claude Desktop / Claude.ai web version for direct OAuth one-click authorization? Please see the Claude.ai / Desktop tutorial for Luma MCP.

Configure OpenCode

OpenCode describes all MCP Servers in a single opencode.json file, which can be placed in two locations; choose one based on the "scope" below. The field structure in both locations is identical, with the only difference being priority.

It is strongly recommended to first write the token to an environment variable:

export ACEDATACLOUD_API_KEY="replace with your real token"

Then reference it in opencode.json using the {env:ACEDATACLOUD_API_KEY} placeholder to avoid writing the real token into the file.

Global: Shared by All Projects

File location: ~/.config/opencode/opencode.json, suitable for "my own machine, configured once, usable by all projects."

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "luma": {
      "type": "remote",
      "url": "https://luma.mcp.acedata.cloud/mcp",
      "enabled": true,
      "oauth": false,
      "headers": { "Authorization": "Bearer {env:ACEDATACLOUD_API_KEY}" }
    }
  }
}

⚠️ "oauth": false cannot be omitted. AceData's MCP Server uses Bearer Token authentication and does not follow the OAuth process; OpenCode will automatically redirect 401 as an OAuth challenge, resulting in opencode mcp list showing SSE error: Non-200 status code (401). Explicitly declaring "oauth": false allows OpenCode to call directly with Authorization: Bearer ..., and opencode mcp debug luma will also echo OAuth explicitly disabled, indicating it is effective.

Project-Level: Effective Only for Current Project

File location: opencode.json in the current project root directory, which will override the global configuration. Suitable for team sharing, single repository customization, or temporarily enabling a specific MCP in a project.

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "luma": {
      "type": "remote",
      "url": "https://luma.mcp.acedata.cloud/mcp",
      "enabled": true,
      "oauth": false,
      "headers": { "Authorization": "Bearer {env:ACEDATACLOUD_API_KEY}" }
    }
  }
}

If the project-level opencode.json will be committed to Git, please ensure to use the {env:ACEDATACLOUD_API_KEY} placeholder instead of the real token to avoid leakage.

💡 If the .env in Shell is not explicitly exported, you need to use set -a && source .env && set +a to pass the variables to the OpenCode process; otherwise, opencode debug config will show "Authorization": "Bearer " (placeholder not resolved).

Actual Running Results

Below is the desensitized output after actual execution in an isolated temporary directory using OpenCode 1.15.13. The command uses the real AceData Cloud Token, and the token in the output has been replaced with 357265014ad145fc8ab2...., and the temporary configuration has been deleted.

$ opencode --version
1.15.13

$ opencode mcp list

┌  MCP Servers
│
●  ✓ luma connected
│      https://luma.mcp.acedata.cloud/mcp
│
└  1 server(s)

Seeing ✓ luma connected indicates that Luma MCP has been successfully integrated. If it shows or unauthorized, please check whether ACEDATACLOUD_API_KEY is set, whether the token is copied completely, and whether the Authorization prefix is Bearer (pay attention to case and spaces).

To debug the connection details of a specific MCP:

opencode mcp debug luma

After a successful handshake, OpenCode's INFO log will output service=mcp key=luma transport=StreamableHTTP connected and service=mcp key=luma toolCount=8 (tested with 8 tools), indicating that Luma MCP is ready to be called by the model.

🤖 Model Selection Testing Suggestions: To truly allow the model to actively call Luma MCP in OpenCode, please prioritize using OpenAI series models (such as acedatacloud/gpt-5-mini, acedatacloud/gpt-5). When the Claude series models on AceData are exposed through the OpenAI compatible interface, tool calls often return Improperly formed request (tested: acedatacloud/claude-haiku-4-5-20251001, acedatacloud/claude-sonnet-4-6 reported this error when mounting multiple MCPs). Claude models can be used normally when only doing dialogue without calling tools.

Typical Scenarios

After configuration is complete, you can directly call in the OpenCode session using natural language without switching to /mcp:

Text to Video

Generate a 5-second video: waves gently lapping on a golden beach, sunset, cinematic feel

Image to Video

Turn this product image into a video, slowly circling from left to right

Video Extension

Continue this video for another 10 seconds, maintaining the same style

Tool List

The table below lists the main tools (Luma MCP Server has exposed a total of 8 tools, which can be obtained through curl -X POST https://luma.mcp.acedata.cloud/mcp -H 'Authorization: Bearer <token>' -H 'Accept: application/json' -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' to get the complete list):

Tool Description
luma_generate_video Generate video from text
luma_generate_video_from_image Generate video from reference image
luma_extend_video Extend video