Kling 4.0 MCP and CLI: Connect Kling to Claude and ChatGPT
Connect Kling 4.0 to Claude, ChatGPT, Claude Code or Cursor with its official MCP server, or generate videos from the command line with Kling’s CLI.
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.
👁 123 reads
Kling 4.0 has supported an official MCP server and command-line interface (CLI) since launch. For now, these are the only ways to automate video generation with Kling 4.0 - there is no standard API yet. You can connect the MCP server to Claude, ChatGPT, Cursor or Claude Code as a remote connector, signing in with your Kling account. Install the CLI with a single npm command. I checked the server address, its authentication configuration and the CLI package instructions. Here’s a step-by-step guide, along with what I couldn’t verify without an account.
Key facts (checked 15 October 2026)
- MCP server:
https://kling.ai/mcp- sign in with your Kling account via OAuth, using dynamic client registration. - CLI:
npm i -g @klingai/cli-global(Node.js 18+); run it with theklingcommand. - Models:
kling-video-v4_0andkling-video-v4_0_flash. - Usage draws on the credits in your Kling plan; you don’t need a separate API account.
What are Kling’s MCP server and CLI?
MCP (Model Context Protocol) is a standard that lets an AI assistant call external tools. Kling provides its own MCP server. Once connected, Claude or ChatGPT can access tools such as “create a video from text,” “check a task” and “show credit balance,” then call them when you ask it to make a video. The CLI lets you use the same server from a terminal. The package description calls it a “thin MCP client”; its commands map one-to-one to the server’s tools.
In its 15 October release note, Kling says: “MCP and CLI now support Kling 4.0, including Omni Reference and video generation with keyframes”.
What I checked
| Item | Result on 15 October 2026 |
|---|---|
Server kling.ai/mcp |
Returns 401 without a token, so sign-in is required |
| Server OAuth metadata | Authorization server: kling.ai/auth; scopes: create and read generations, and read credit balance |
| Authentication | Authorization code with PKCE (S256), plus dynamic client registration - required for remote connectors in Claude and ChatGPT |
| CLI package | @klingai/cli-global 0.2.1, dated 28 September 2026; Node.js 18+; Chinese accounts use @klingai/cli-cn |
| Models in the CLI instructions | kling-video-v4_0 (3-30 seconds, 720p/1080p), kling-video-v4_0_flash (3-20 seconds, 720p) |
I didn’t sign in to a Kling account through MCP, so I couldn’t see the full list of tools available after sign-in. In the web interface’s video generator, I checked the rate: 15 credits per second at 1080p and 10 at 720p. I didn’t check whether MCP uses the same rates. For a breakdown of how many seconds each plan includes, see Kling 4.0 pricing.
Connect Kling to Claude and claude.ai
- Open Settings and go to Connectors.
- Choose Add custom connector.
- Name it Kling and enter
https://kling.ai/mcpas the URL. Leave the client ID fields empty - the server registers the client automatically. - Click Connect. A Kling sign-in window will open; sign in and approve the three scopes (create generations, read generations and read credits).
- In a new conversation, enable the Kling connector and try this translated example of the original Polish test prompt: “Check my Kling credit balance, then make a 10-second clip in Kling 4.0 Flash, 16:9: a cat wearing a hat walks across a piano keyboard.”
Adding custom connectors depends on your Claude plan. If you don’t see the option, check your plan settings or use Claude Code instead.
Connect Kling to Claude Code or Cursor
In Claude Code, add the server with a single terminal command:
claude mcp add --transport http kling https://kling.ai/mcp
Then, in a Claude Code session, enter /mcp, select the kling server and sign in through your browser. In Cursor, add an entry with the server URL to your MCP configuration file:
{
"mcpServers": {
"kling": { "url": "https://kling.ai/mcp" }
}
}
Connect Kling to ChatGPT
- In ChatGPT settings, enable Developer mode for apps and connectors. It’s available on select paid plans.
- Create a new connector, enter
https://kling.ai/mcpand choose OAuth authentication. - Sign in with your Kling account and approve the scopes.
- Add the Kling connector to a conversation and describe the video you want to create.
Kling CLI: installation and first commands
- Install Node.js 18 or later.
- Install the CLI:
npm i -g @klingai/cli-global - Sign in:
kling login(a browser window will open). The CLI stores your login data in~/.kling/. - Check which models and settings are available to your account:
kling who_am_i - Check your balance:
kling account
Examples from the official package instructions (Windows, macOS and Linux):
# Text-to-video, 10 seconds; wait up to 300 seconds for the result
kling text_to_video --model kling-video-v4_0 "drone shot flying over a snowy mountain peak" --duration 10 --aspectRatio 16:9 --poll 300
# First and last frames
kling image_to_video --model kling-video-v4_0 --image ./first.jpg --tailImage ./last.jpg "slow camera push-in" --duration 6 --poll 300
# Keyframes: start, middle and end (up to 10 images total)
kling image_to_video --model kling-video-v4_0 --input first_image=./first.jpg --input keyframe_1=./middle.jpg --input tail_image=./last.jpg --poll 300
# Flash: first frame only
kling image_to_video --model kling-video-v4_0_flash --image ./first.jpg --poll 300
# Omni Reference: an image plus a video with camera movement
kling omni_ref_video --model kling-video-v4_0 --image ./ref.jpg --video ./clip.mp4 "follow the reference camera movement" --poll 300
The CLI prints results as JSON. The video URL is in the works[].url field; the version without a watermark, if your plan allows it, is in works[].url_without_watermark.
Kling CLI commands
| Command | What it does |
|---|---|
who_am_i |
Shows your account, available models and their settings |
text_to_video, image_to_video |
Creates video from text, images or frames |
omni_ref_video |
Combines images, videos and elements in a new clip |
query_tasks |
Shows task status and result URLs |
file_upload |
Uploads a file and returns a public URL |
element_create, element_list |
Creates and lists reusable characters and objects |
motion_control |
Transfers motion from a recording to a character |
account |
Shows your plan and credit balance |
text_to_image, image_to_image |
Creates images (Kling Image 3.0) |
What to watch out for
- Credits are deducted automatically. An agent may submit several videos at once. To start, ask it to check your balance and estimate the cost before submitting a task.
- Omni Reference V4 also counts the length of the input video - according to the CLI instructions. A 20-second reference video increases the generation cost.
- Choose either reference audio or new audio, not both. In Omni Reference,
enable_audioandkeepOriginalSoundcannot be enabled at the same time. - Use the global-region account package. Accounts in China use
@klingai/cli-cn.
What Kling MCP and CLI change
Until now, automating Kling required API packages costing at least 700 USD or third-party intermediaries. MCP and the CLI use credits from a regular plan (Kling 4.0 is included starting with the Pro plan, priced at 32.56 USD per month), so an individual can ask an agent to generate a series of clips without an API agreement. The limitation: this still uses your account and browser for sign-in, not a key for a production server. For more on where Kling 4.0 is and isn’t available, see Kling 4.0 API. For a complete guide to the new version, see the Kling 4.0 hub.
Sources
- Kling AI: Kling 4.0 release note, “Kling 4.0 Now Available via MCP / CLI” section
- npm: @klingai/cli-global 0.2.1 package instructions
- Kling AI: MCP server metadata (checked 15 October 2026)
- Kling AI: OAuth authorization server metadata (checked 15 October 2026)
- Model Context Protocol: documentation
- Kling AI on YouTube: official Kling 4.0 videos (28 September-15 October 2026)
More on this from QUANTSLANT
guides·AI Tool Inventory: Build One for Your Business in an HourCreate a practical inventory of the AI tools your business uses, who owns them and what data they handle, with a 10-field template and a 60-minute plan.

