> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acedata.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Kling MCP Integration Guide

> kling MCP server integration

Kling MCP provides text-to-video, first-and-last-frame generation, video extension, motion transfer, and lip sync. Before creating, you can query the current combinations using the model and action lists.

## Connect to the Hosted Service

In a client that supports remote MCP, add a **Streamable HTTP** server at `https://kling.mcp.acedata.cloud/mcp`. When using OAuth, choose to sign in to Ace Data Cloud and confirm authorization in your browser.

| Client | How to connect |
| - | - |
| Claude / Claude Desktop | Add a custom connector under “Customize → Connectors”, enter the hosted URL, and sign in. |
| Claude Code | Run `claude mcp add --transport http --scope user kling https://kling.mcp.acedata.cloud/mcp`, open `/mcp` in the session, select the server, and complete authorization. |
| Cursor | Create an HTTP server in MCP settings, enter the hosted URL, and sign in as prompted when connecting. |
| VS Code | Run **MCP: Add Server** from the command palette, select HTTP and enter the hosted URL, then use **MCP: List Servers** to check the status. |

In Codex CLI, you can run the following commands, then enter `/mcp` in the session to view the server.

```bash theme={null}
codex mcp add kling --url https://kling.mcp.acedata.cloud/mcp
codex mcp login kling
```

To use fixed credentials, add the request header `Authorization: Bearer <application API Key>` in the client's private settings, and confirm that the application is authorized to call the selected API. You can create or copy a key in the console under “Applications → General Applications → Key Management”. [Applications Console](https://platform.acedata.cloud/console/applications)

### Use an Application Key in Gemini CLI and OpenCode

First, save the application API Key as the client environment variable `ACEDATACLOUD_API_TOKEN`. The following commands use macOS or Linux shell quoting.

| Client | How to connect |
| - | - |
| Gemini CLI | Run `gemini mcp add --scope user --transport http kling https://kling.mcp.acedata.cloud/mcp --header 'Authorization: Bearer ${ACEDATACLOUD_API_TOKEN}'`, and check with `gemini mcp list`. |
| OpenCode 2.x | Run `opencode mcp add kling --global --url https://kling.mcp.acedata.cloud/mcp --header 'Authorization=Bearer {env:ACEDATACLOUD_API_TOKEN}'`, then run `opencode reload` and `opencode mcp list`. |

For OpenCode 1.x, in the `mcp` object of your personal `opencode.json`, set `type: "remote"`, the hosted URL, and `oauth: false` for this service, and set the `Authorization` request header to `Bearer {env:ACEDATACLOUD_API_TOKEN}`. [OpenCode 1.x Configuration](https://opencode.ai/v1/docs/mcp-servers/)

## Local stdio Integration

After installing [uv](https://docs.astral.sh/uv/getting-started/installation/), local clients can start the MCP process using standard input and output, and Kling requests are sent to Ace Data Cloud by that process.

Claude Desktop users can open the local MCP configuration from developer settings, merge the server entry below, replace the placeholder with the application API Key in plain text in their personal configuration, and then restart the client. Clients that support private environment variables can also inject `ACEDATACLOUD_API_TOKEN` from a credential manager.

```json theme={null}
{
  "mcpServers": {
    "kling": {
      "command": "uvx",
      "args": [
        "mcp-kling"
      ],
      "env": {
        "ACEDATACLOUD_API_TOKEN": "YOUR_API_KEY"
      }
    }
  }
}
```

[mcp-kling Package](https://pypi.org/project/mcp-kling/)

## Initial Verification

After connecting, say to the assistant: “Please call only `kling_list_models` and `kling_list_actions`, and list the models and actions that currently support video generation from a first frame.”

## Tools and Usage Examples

| Operation | Tools and parameters |
| - | - |
| Generate, extend | `kling_generate_video` generates video from text, `kling_generate_video_from_image` accepts a first frame and an optional last frame, and `kling_extend_video` extends an existing video. |
| Motion, storyboards, and reference assets | `kling_generate_motion` applies reference motion to a character image, `kling_generate_storyboard` generates a storyboard, and `kling_generate_with_assets` uses existing platform assets. |
| Lip sync and portraits | `kling_lip_sync` aligns video lip movements, and `kling_talking_photo` makes a person in a photo speak. |
| Query results | `kling_get_task` accepts a single `task_id`, and `kling_get_tasks_batch` queries multiple tasks. |
| Turbo and e-commerce creation | `kling_generate_turbo_video` generates Turbo videos, `kling_goods_studio` creates product assets, and `kling_video_commerce` is used for e-commerce videos. See the client tool parameters for each tool's request structure. |

For example: “Use this bicycle photo as the first frame, keep the frame shape fixed, and make the woods behind it move slowly backward.” Pass an accessible image URL as `start_image_url` to `kling_generate_video_from_image`. If a `task_id` is returned, save it, call `kling_get_task` as prompted by the service, and read the task's video link once it is complete.

For parameter and result formats, see the API documentation. [Video Generation](https://platform.acedata.cloud/documents/kling-videos), [Motion Transfer](https://platform.acedata.cloud/documents/kling-motion), [Task Query](https://platform.acedata.cloud/documents/kling-tasks).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.