Kling 4.0 MCP and CLI: Connect Claude and ChatGPT
Kling 4.0 is officially live with remote MCP and CLI support for Claude, Cursor, and ChatGPT. Here is how to configure the server, run commands, and manage your credits.

Update (9 Nov 2026): Claude Fable 5.2 and Mythos 5.2 are out - prices, access and benchmarks are in my Claude Fable 5.2 guide.
👁 113 reads
You can connect Kling 4.0 to Claude, Claude Code, Cursor, and ChatGPT right now using an official remote Model Context Protocol (MCP) server or the command-line interface. While the traditional developer API is not yet released, this setup allows your AI assistants to trigger video renders directly. In this guide, we break down the exact setup for the Kling 4.0 MCP and CLI for Claude and ChatGPT, along with installation steps and credit spending rules.
On October 15, 2026, Kuaishou made Kling 4.0 available to everyone on the web interface, while also shipping native terminal and agent tooling. For broader context on this generation engine, take a look at our Kling 4 hub. A major benefit for English speakers is that English (including American, British, and Indian accents) is explicitly included in the official list of 9 supported languages for speech synthesis and on-screen text generation, alongside Chinese, Japanese, Korean, Spanish, Portuguese, German, French, and Hindi.
Kling 4.0 MCP and CLI for Claude and ChatGPT: Setup and Endpoints
Unlike standard developer platforms where you wait for approved access keys, Kling uses an authenticated remote MCP server. It handles authentication using OAuth with PKCE (S256) and dynamic client registration. This means compatible assistants can initiate an authorization flow without you manually pasting secret tokens into config files.
- MCP Server URL:
https://kling.ai/mcp - OAuth Authorization Server:
https://kling.ai/auth - OAuth Scopes:
generation.create,generation.read,account.credit.read
I checked the MCP endpoint personally on October 15, 2026. Without an active OAuth bearer token, sending a GET or POST request directly to https://kling.ai/mcp immediately returns an HTTP 401 Unauthorized status. This confirms that the server is active, enforces strict permission checks, and exposes OAuth metadata for automated client registration.
To connect the service inside Claude Code, you only need to run a single setup command in your terminal:
claude mcp add --transport http kling https://kling.ai/mcp
In standard Claude, Cursor, or ChatGPT developer mode, add a custom remote connector using HTTP transport pointing to https://kling.ai/mcp. Your client will launch a browser window redirecting to kling.ai/auth, where you approve access using your active Kling user credentials.
Installing and Using the Official CLI
Kuaishou also published an official command-line package to npm named @klingai/cli-global (version 0.2.1, requiring Node.js 18 or higher). This CLI acts as a thin MCP client where local terminal commands map one-to-one to MCP server tools.
To install the tool globally on your system, execute:
npm i -g @klingai/cli-global
Once installed, the CLI binary is called kling. All session tokens and credentials will be saved locally inside your ~/.kling/ directory. Here are the core management commands to get your environment ready:
# Log in via your browser
kling login
# Check user profile and active scopes
kling who_am_i
# Check your remaining balance
kling account
# Log out and clear session tokens
kling logout
Video Generation Commands: Text, Keyframes, and Omni-Ref
The CLI exposes two model identifiers: kling-video-v4_0 (supporting 3 to 30 seconds, 720p or 1080p, subject to your account tier) and kling-video-v4_0_flash (supporting 3 to 20 seconds at 720p, first frame only). You can track status directly by passing the --poll flag.
To trigger a standard text-to-video generation:
kling text_to_video --model kling-video-v4_0 "drone shot flying over a snowy mountain peak" --duration 10 --aspectRatio 16:9 --poll 300
For image-to-video, Kling 4 allows multi-keyframe control. You can specify a starting frame, an ending frame, and intermediate keyframes up to a combined maximum of 10 images:
kling image_to_video --model kling-video-v4_0 --input first_image="start.png",keyframe_1="mid.png",tail_image="end.png" --duration 10 --poll 300
When working with character consistency or complex scene directions, use Omni Reference video workflows:
kling omni_ref_video --model kling-video-v4_0 --prompt "character running through a neon corridor" --poll 300
For more architectural details on how reference elements work, read our guide to Kling 4.0 Omni Reference.
Comparing MCP and CLI Features
Here is an overview of how the primary endpoints and CLI models behave across tasks:
| Model Name | Durations | Supported Capabilities |
|---|---|---|
| kling-video-v4_0 | 3-30 seconds | Text, 10 keyframes, Omni-Ref, 720p/1080p |
| kling-video-v4_0_flash | 3-20 seconds | Text, first frame only, Omni-Ref, 720p |
Critical Operational Rules and Credit Consumption
Before letting an autonomous agent execute tasks on your behalf, you need to understand how billing and generation flags operate behind the scenes. Kling displays all subscription prices in USD without VAT information. For an in-depth breakdown of plan structures, check our overview of Kling 4.0 pricing and plans.
- No Separate API Contract: CLI and MCP operations draw directly from your personal Kling subscription balance. In the web creator I checked 15 credits per second at 1080p and 10 at 720p; I have not verified whether MCP bills the same way.
- Agent Spending Risks: Because an autonomous AI model in Cursor or Claude Code can call tools iteratively, a looping script can exhaust your plan balance rapidly without additional approval prompts. Always monitor jobs via
kling query_tasksor check your remaining balance viakling account. - Omni-Ref Duration Billing: For
omni_ref_video, Kling bills generation credits per second by including the length of your input reference video along with the requested generation length. - Audio Flag Exclusivity: When configuring audio parameters,
enable_audioandkeepOriginalSoundcannot both be set to true simultaneously. Doing so results in a validation error.
If you are exploring traditional endpoint integrations, understand that the developer API on kling.ai/dev still displays “Kling 4.0 API Coming Soon” and current developer token packages do not support the 4.0 architecture. You can learn more in our detailed analysis of where the Kling 4.0 API works.
Frequently Asked Questions
Does the Kling 4.0 MCP server require a separate developer API key?
No, it does not use traditional developer API keys. The server uses OAuth with dynamic client registration, drawing credits directly from your standard Kling web account plan.
Can Kling 4 generate speech and text in English?
Yes, English is officially supported for both generated speech and on-screen text. Kling 4.0 supports American, British, and Indian accents across single-prompt video generations.
What happens if I make a direct request to https://kling.ai/mcp without authentication?
The endpoint will immediately return an HTTP 401 Unauthorized error. You must authenticate using the OAuth authorization server located at kling.ai/auth before tools can run.
How many keyframe images can I pass to image-to-video in the CLI?
You can supply up to 10 keyframe images combined across your generation command. This includes the first image, intermediate keyframes, and the final tail image.
Sources
- Kling 4.0 Official Release Note
- Kling AI Membership Plans
- Kling Developer Platform
- npm: @klingai/cli-global Package
- Kling AI Official Announcement on X
- Kling AI on YouTube: official Kling 4.0 videos (28.09-15.10.2026)
As of 15 October 2026. Kling changes plans and availability often - check kling.ai before buying.


