Skip to content
trending

AI Tools

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.

By 6 min read

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 the kling command.
  • Models: kling-video-v4_0 and kling-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

  1. Open Settings and go to Connectors.
  2. Choose Add custom connector.
  3. Name it Kling and enter https://kling.ai/mcp as the URL. Leave the client ID fields empty - the server registers the client automatically.
  4. Click Connect. A Kling sign-in window will open; sign in and approve the three scopes (create generations, read generations and read credits).
  5. 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.

Dealat Kinetyra
Synthesia Starter - 12 Months
$79 instead of $216 -63%
See the deal →

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

  1. In ChatGPT settings, enable Developer mode for apps and connectors. It’s available on select paid plans.
  2. Create a new connector, enter https://kling.ai/mcp and choose OAuth authentication.
  3. Sign in with your Kling account and approve the scopes.
  4. Add the Kling connector to a conversation and describe the video you want to create.

Kling CLI: installation and first commands

  1. Install Node.js 18 or later.
  2. Install the CLI: npm i -g @klingai/cli-global
  3. Sign in: kling login (a browser window will open). The CLI stores your login data in ~/.kling/.
  4. Check which models and settings are available to your account: kling who_am_i
  5. 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)
Official Kling AI example (source: Kling AI’s YouTube channel, “Keep Your Character Consistent with Elements in Kling MCP”, 2 September 2026). This guide predates the 4.0 launch and shows how to keep a character consistent with Elements in Kling MCP. It demonstrates an MCP agent workflow, not the quality of model 4.0. This is a manufacturer video, not my test.

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_audio and keepOriginalSound cannot 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.

// read next

More on this from QUANTSLANT

Piotr Olszewski

Editor and publisher · Quantslant

I edit and publish Quantslant. AI tools help with research, drafts and translation; choosing topics, running the tests, checking facts and the decision to publish are mine, and so is the responsibility for what appears here.

read nextAI Tool Inventory: Build One for Your Business in an HourguidesAI 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.

Most read

  1. 1Best AI Video Generator Apps for Your Phone (2026)
  2. 2Claude Opus 5.5 Motion Graphics: 60s Showreel from One Prompt
  3. 3Wan 2.2 on RTX 4090: timings, VRAM and four test clips
// site map

This page in other languages4

Quantslant in numbers 1,423posts in archive22news from the last 7 days18video models in the observatory
🎬 AI Video Benchmarks: Higgsfield DoP vs OpenAI Sora • Higgsfield vs Runway Gen-3 • AI Video Credit Calculator
× ‹ enlarge ›