OpenCode Integration with Luma MCP
📘 Overview:OpenCode MCP Overview →
Luma Dream Machine has always been one of the most cost-effective video models in terms of “low cost / high image quality / natural transitions.” After connecting the Luma MCP Server in OpenCode, you can have it generate short videos based on text or reference images, and you can also directly extend existing videos while maintaining stylistic consistency.
Luma MCP is suitable for product demo short clips, Banner animations, social media short videos, as well as two high-frequency scenarios: “driving animation with images” and “video extension.”
¶ Get API Token
Before using the Luma MCP Server, you need to prepare an Ace Data Cloud API Token. OpenCode and Claude Code share the same Token, and the acquisition process is the same:
- Open Ace Data Cloud Console - Applications to obtain your API Token and keep it for later use.
- If you are not logged in or registered yet, you will automatically be redirected to the login page; after logging in or registering, you will automatically return to the current page.
- A free quota will be provided when you apply for the first time, so you can try the Luma MCP service for free first.

One Token can be used with all MCP Servers provided by Ace Data Cloud, so there is no need to apply separately for Luma. In documents and screenshots, it is recommended to display only a redacted form, such as YOUR_ACEDATACLOUD_API_KEY, and do not paste the complete Token into public repositories, Issues, screenshots, or chat records.
Want to use Claude Desktop / Claude.ai web version for one-click OAuth authorization directly? Please see the Luma MCP Claude.ai / Desktop Tutorial.
¶ Configure OpenCode
OpenCode uses an opencode.json file to describe all MCP Servers. The file can be placed in two locations; choose one according to the “scope” below. The field structure of the two locations is exactly the same, with the only difference being their priority.
It is strongly recommended to write the Token into an environment variable first:
export ACEDATACLOUD_API_KEY="Replace with your actual Token"
Then use {env:ACEDATACLOUD_API_KEY} as a placeholder reference in opencode.json to avoid writing the actual Token into the file.
¶ Global: Shared by All Projects
File location: ~/.config/opencode/opencode.json, suitable for “my own machine, configure it once, and use it for 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": falsecannot be omitted. AceData’s MCP Server uses Bearer Token authentication and does not use the OAuth flow; OpenCode will automatically treat 401 as an OAuth challenge and redirect by default, causingopencode mcp listto showSSE error: Non-200 status code (401). Explicitly declaring"oauth": falseallows OpenCode to call directly withAuthorization: Bearer ...;opencode mcp debug lumawill also echoOAuth explicitly disabled, indicating that it has taken effect.
¶ Project-Level: Effective Only for the Current Project
File location: opencode.json under the root directory of the current project, which will override the global configuration. Suitable for team sharing, single-repository customization, or temporarily enabling an MCP only in a certain 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, make sure to use the {env:ACEDATACLOUD_API_KEY} placeholder instead of the actual Token to avoid leakage.
💡 If
.envin the Shell does not have an explicitexport, you need to useset -a && source .env && set +ato pass the variable to the OpenCode process; otherwise,opencode debug configwill show"Authorization": "Bearer "(the placeholder was not resolved).
¶ Verify Connection
After configuration, run:
opencode mcp list
opencode mcp debug luma
Seeing luma connected means the handshake was successful. If it fails, check whether ACEDATACLOUD_API_KEY has been exported, whether oauth is false, and whether Authorization contains the Bearer prefix. Model and tool Schemas will continue to change, so select a model that supports native tool calling from the current directory.
¶ Typical Scenarios
After configuration is complete, you can directly use natural language in the OpenCode session to make calls without first switching to /mcp:
Text-to-Video
Generate a 5-second video: waves gently lapping against a golden beach, sunset, cinematic feel
Image-to-Video
Turn this product image into a video, slowly circling around it from left to right
Video Extension
Extend this video, add another 10 seconds, and maintain the same style
¶ Tool List
The table below lists the main tools; you can obtain the current complete list 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"}':
| Tool | Description |
|---|---|
| luma_generate_video | Text-to-video |
| luma_generate_video_from_image | Generate video using a reference image |
| luma_extend_video | Video extension |
