Hailuo MCP integration guide
Hailuo MCP can generate videos from text descriptions or animate a reference image. Once connected, the assistant can submit generation requests, record task IDs, and provide video URLs when the tasks are complete.
¶ Connect to the Hosted Service
In your client, select remote MCP (Streamable HTTP) and enter https://hailuo.mcp.acedata.cloud/mcp as the server URL. Select OAuth, then follow the browser prompts to sign in to AI 聚合 and authorize access.
| Client | How to connect |
|---|---|
| Claude / Claude Desktop | Under “Customize → Connectors”, add a custom connector, paste the server URL, and sign in. |
| Claude Code | Run claude mcp add --transport http --scope user hailuo https://hailuo.mcp.acedata.cloud/mcp, then open /mcp within the session, select the server, and complete authorization. |
| Codex CLI | Run codex mcp add hailuo --url https://hailuo.mcp.acedata.cloud/mcp, then run codex mcp login hailuo. |
| Cursor | Add a new HTTP server in the MCP settings, enter the URL, and follow the prompts to sign in when connecting. |
| VS Code | Run MCP: Add Server from the command palette, select HTTP and enter the URL, then use MCP: List Servers to check the status. |
If using an application API key, select a general-purpose application or one with permissions for Hailuo video generation and task queries on the application management page, and check the allowed APIs and balance. In the client's private credential settings, set the request header to Authorization: Bearer <应用 API Key>. Applications and API Keys
¶ Use an Application Key with Gemini CLI and OpenCode
First, set the environment variable ACEDATACLOUD_API_TOKEN to the application API key in the terminal where you launch the client. The following commands use macOS or Linux shell quoting and save a reference to the variable.
| Client | How to connect |
|---|---|
| Gemini CLI | Run gemini mcp add --scope user --transport http hailuo https://hailuo.mcp.acedata.cloud/mcp --header 'Authorization: Bearer ${ACEDATACLOUD_API_TOKEN}', then check using gemini mcp list. |
| OpenCode 2.x | Run opencode mcp add hailuo --global --url https://hailuo.mcp.acedata.cloud/mcp --header 'Authorization=Bearer {env:ACEDATACLOUD_API_TOKEN}', then run opencode reload and opencode mcp list. |
For OpenCode 1.x, add a service named hailuo to the mcp object in your personal opencode.json. Set type to remote, url to the address above, oauth to false, and headers.Authorization to Bearer {env:ACEDATACLOUD_API_TOKEN}. OpenCode 1.x configuration
¶ Connect locally via stdio
Install uv, open the local MCP configuration in Claude Desktop's developer settings, and merge the following entries into the user configuration. Replace the placeholder with your application's API key, save, and restart the client. Other clients that support stdio can also run the uvx mcp-hailuo command and pass the key to the process as an environment variable.
{
"mcpServers": {
"hailuo": {
"command": "uvx",
"args": [
"mcp-hailuo"
],
"env": {
"ACEDATACLOUD_API_TOKEN": "YOUR_API_KEY"
}
}
}
}
The local process still calls the AI 聚合 API. Store the key in your personal client configuration or a credential manager. mcp-hailuo package
¶ Verify the connection and available tools
Open the client's tool list and find Hailuo. First, ask the assistant to call hailuo_list_models and list which models support text-to-video generation and which require a first-frame image. This query checks whether the client has loaded the tools without submitting a generation request.
| Purpose | Tool | Usage |
|---|---|---|
| Select models and operations | hailuo_list_models, hailuo_list_actions |
View available models, operations, and input requirements. |
| Generate from text | hailuo_generate_video |
Pass prompt. The text example can use the default model. |
| Animate a reference image | hailuo_generate_video_from_image |
Pass an accessible first_image_url and a prompt describing the motion. |
| Query videos | hailuo_get_task, hailuo_get_tasks_batch |
Use task_id or task_ids, respectively. |
¶ Example invocation
In the client, enter the following prompt for the assistant: “Use Hailuo to generate a video of a street after the rain, with a fixed camera and puddles reflecting illuminated streetlights. Submit the request only once, record the task ID, and give me the video link when it is complete.”
After receiving task_id, ask the assistant to query the same task using hailuo_get_task. If it is still processing, keep the ID and continue querying. If it fails or is canceled, first read the reason returned. When using a reference image, provide its accessible URL to the image-to-video tool and describe how the camera or subject should move in the prompt.
Before making a request, check the service page for current pricing and availability. Hailuo service · Video generation API · Task query API

