Updated October 18, 2026 · Last checked October 18, 2026 against the Kling MCP & CLI Guide, the Kling MCP page FAQ, the @klingai/cli-global README (v0.2.3), the klingai-tech/skills repository and the Kling 4.0 release notes
Short answer: To use Kling MCP, add the remote server https://kling.ai/mcp to your AI assistant (Cursor, Claude or another MCP client) and sign in with your Kling account; no API key is needed. To use the Kling CLI instead, run npm i -g @klingai/cli-global, then kling login. Both draw on the same credits as the Kling web app, both support Kling 4.0 with Omni Reference and keyframes, and Kling says to install one or the other in a given assistant, not both.
| Kling MCP | Kling CLI | |
|---|---|---|
| What it is | Remote MCP server for AI assistants | Terminal tool; also installable as an agent skill |
| Setup | Add https://kling.ai/mcp, then Connect and sign in | npm i -g @klingai/cli-global or npx skills add klingai-tech/skills |
| Sign-in | OAuth with your Kling account | kling login opens browser OAuth |
| API key | Not required | Not required |
| Tools / commands | 18 tools | 21 commands in the guide’s table |
| Requirements | An MCP client that supports remote servers | Node.js 18+ on macOS, Linux or Windows |
| Kling 4.0 | Supported, including Omni Reference and keyframes | Supported; model names such as kling-video-v4_0 |
What are Kling MCP and Kling CLI?
The Kling MCP & CLI Guide describes Kling MCP as a protocol adapter that lets general-purpose AI assistants such as Cursor and Claude call Kling’s image and video generation directly. Once it is configured and authorized, you ask in plain language, for example “Turn this image into a 5-second cinematic camera-movement video”, and the result comes back inside the assistant.
The Kling CLI is a command-line tool that exposes the same generation features as terminal commands. The guide lists three uses: generating videos in bulk from the terminal, scripts or CI pipelines; plugging Kling into your own toolchain, such as ComfyUI nodes, Makefiles and shell pipelines; and installing it through an AI assistant so you can still work in natural language. The CLI README calls it a thin MCP client: each command maps one-to-one to a backend MCP tool, and the CLI handles argument translation, login, polling and file upload.
Before building terminal commands or an agent workflow, review the Kling 4.0 overview and write down the creative inputs your automation will need to preserve.
Both now run Kling 4.0. The Kling 4.0 release notes say MCP and CLI support Kling 4.0, including Omni Reference and video generation with keyframes, for uses such as marketing assets, short-form video at scale, storyboard previsualization and character consistency.
Should I use Kling MCP or the CLI?
Kling’s guide compares three ways of working:
| Dimension | MCP | CLI (via AI assistant) | CLI (direct terminal use) |
|---|---|---|---|
| Natural language support | ✓ | ✓ | – |
| Multi-step workflows in a single conversation | ✓ | ✓ | – |
| Easy setup (single URL) | ✓ | ✓ | – |
| Works without an AI assistant | – | – | ✓ |
Two rules from Kling’s pages decide most cases. First, the guide warns: “For a given AI assistant, install either MCP or CLI, but not both. If both are installed, the assistant may choose between them unpredictably.” Second, the FAQ on the Kling MCP page says the CLI “works in terminals and across a wide range of AI agents, offering better compatibility and stability”, and recommends installing the CLI for the best experience. The guide adds that for platforms like OpenClaw and Hermes, the CLI is the preferred option.
In practice: pick MCP if you live in Claude or Cursor chat and want a one-URL setup; pick the CLI if you script jobs, run CI, or use an agent platform such as OpenClaw or Hermes.
How do I set up Kling MCP in Cursor?
These are the steps in Kling’s guide, quoted exactly:
- In Cursor, go to Settings → Tools & MCPs → Add Custom MCP.
- Add klingai:
"klingai": {"url": "https://kling.ai/mcp"}
- Click Connect, sign in with your Kling account and start prompting from Cursor.
The snippet is the server entry only. Kling’s guide does not show the surrounding file, so place it where Cursor’s own MCP settings ask for server entries. Sign-in is OAuth, so nothing secret goes in the config.
Kling also publishes a quick-start option for any assistant that can install MCP servers itself. Paste this instruction into the assistant:
Please help me setup a new custom MCP server via the following endpoint, and complete the authorization process, https://kling.ai/mcp
How do I set up Kling MCP in Claude and Claude Code?
Claude desktop or claude.ai, per the guide: go to Customize → Connectors, choose Add custom connector and use the same entry:
"klingai": {"url": "https://kling.ai/mcp"}
Then click Add → Connect, sign in with your Kling account and start prompting. Kling’s fashion-video tutorial notes that for Team or Enterprise Claude accounts, connector availability may depend on your organization’s settings.
Claude Code, per Kling’s Claude Code tutorial: to make Kling available across your projects, run
claude mcp add --transport http klingai --scope user https://kling.ai/mcp
Use --scope project to share the connection through the current project. Without a scope, Claude Code uses its default local scope. Then start Claude Code, run /mcp, and complete the Kling sign-in.
Kling’s tutorials suggest one safe first prompt after any setup: “Confirm that Kling MCP is connected. Show me the Kling image and video tools currently available. Do not generate anything yet.” It costs nothing and shows you what your connection actually exposes.
How do I install the Kling CLI?
The CLI needs Node.js 18 or later and runs on macOS, Linux and Windows. Kling’s guide gives two routes. As an agent skill (the klingai-tech/skills repository):
npx skills add klingai-tech/skills
Or as a global npm package, exactly as the guide writes it:
npm i -g @klingai/cli-global --registry=https://registry.npmjs.org
Accounts are split by region. The @klingai/cli-global README says both packages install the same kling command, and to use @klingai/cli-cn instead if your account belongs to the China site. The skill’s own notes warn that installing the wrong region’s package makes login fail repeatedly, so check which site your account is on first.
To upgrade:
npm i -g @klingai/cli-global@latest
kling --version
On October 18, 2026, both npm packages were at version 0.2.3.
How do I log in, and do I need an API key?
No API key. The Kling MCP page FAQ says: “Simply add the Kling MCP server to your client, or install the CLI and sign in with your Kling account using OAuth. No API keys are required.” For the CLI, kling login opens browser OAuth. The README says credentials are saved under ~/.kling/ and that the CLI never prints tokens or secrets; the guide says the token is stored locally in .credentials. kling logout revokes and clears local login state.
One account limit matters for teams: MCP and CLI currently use only paid credits from your Personal workspace. Team workspace benefits are not available yet, and Kling says switching between Personal and Team workspaces will come in a future release.
Which tools and commands does Kling expose?
The guide lists 18 MCP tools. CLI commands use the same names, with no aliases.
| Group | MCP tools / CLI commands | What they do (from Kling’s descriptions) |
|---|---|---|
| Discovery | who_am_i | Your identity plus the available models and parameter specs; call it first |
| Video | text_to_video, image_to_video, omni_ref_video | Return a generation_id; poll query_tasks for status and results |
| Image | text_to_image, image_to_image | Same task flow as video |
| Motion | motion_control, motion_library_list | Animate a subject image from a Motion Library motionId or a reference video |
| Elements | element_create, element_list, element_get, element_update, element_delete | Reusable characters or objects from images or a video |
| Tasks and files | query_tasks, file_upload | Status and final asset URL; one-time upload ticket |
| Account | query_membership_and_credits (CLI: account), logout | Subscription status and available credits; log out or switch accounts |
| Support | feedback | Report task problems |
The CLI adds client-side commands: kling --help, kling <command> --help, login and tool_list, which lists the tools the backend server currently advertises. Useful flags from the README: --model <name> (required for generation), --poll [N] (wait up to N seconds; bare --poll means 60) and --quiet for one-line JSON. Output is JSON on stdout, and exit codes are 0 for success, 1 for failure and 130 for user cancellation.
How do I make a Kling 4.0 video from the CLI?
Start by asking the server what your account can use. The README says models, required arguments, defaults and allowed values are declared by the server, and that you should run who_am_i for the authoritative spec:
kling login
kling who_am_i
Text-to-video with Kling 4.0, from the README:
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 in the middle of the clip use named slots:
kling image_to_video --model kling-video-v4_0 \
--input first_image=./first.jpg --input keyframe_1=./middle.jpg \
--input tail_image=./last.jpg --prompt "" --poll 300
The README’s current declaration for standard Kling 4.0 allows 3–30 seconds and 720p/1080p (subject to account access), with first_image, tail_image and keyframe_1..10 sharing a combined limit of 10 images. Flash (kling-video-v4_0_flash) allows 3–20 seconds at 720p and is first-frame only, so --tailImage is rejected. Omni-Ref with Kling 4.0 accepts up to 10 images, 5 videos and 7 Elements (up to 3 video Elements), 15 references combined, and is billed per second including input video duration.
If you submit without --poll, check later with kling query_tasks <generationId> --poll. Results arrive in works[].url, and watermark-free URLs, when available, in works[].urlWithoutWatermark. Download promptly: generated file URLs stay valid for 24 hours.
What are the credit and rate limits?
| Limit | What Kling’s docs say |
|---|---|
| Credit pricing | Same pricing and consumption rules as Kling’s own platforms; credits depend on model, duration and resolution |
| Off-peak free generation | Not available through AI assistants |
| Which credits | Paid credits from your Personal workspace only; Team workspace not supported yet |
| Bonus credits | Cannot currently be used with MCP or CLI |
| Rate limit | 5 QPS |
| Concurrency | Non-subscribers: one concurrent video task. Subscribers: no task limits |
| Result URLs | Valid for 24 hours |
| Cancel a submitted job | Not possible once submitted |
| Generation time | Comparable to the web app; depends on queue and subscription tier |
| Asset storage | Synced to your Kling web asset library |
Kling’s guide does not publish per-model credit prices for MCP or CLI. The credits a job used come back with the job: the skill’s reference says the submit response can include a creditsConsumed field, and kling account shows your membership and available credits.
Will chaining jobs also mass-produce failed clips?
Yes, a chain can multiply clips you don’t want, because every submitted job is billed and none can be recalled. Jobs that fail outright are a different case: Kling’s Credits Policy says credits are refunded when a generation fails. Kling’s documents give the rules and a working method.
What the docs say about cost:
- Each generation submission consumes credits, and the submit response can report how many (the kling-cli skill’s billing rules). MCP and CLI follow the same credit rules as Kling’s own platforms (guide FAQ).
- Kling’s Credits Policy: credits are deducted immediately upon generation, and if the generation fails, the corresponding credits are refunded.
- Generation tasks cannot be canceled once submitted (guide FAQ).
- Unknown parameters or invalid values are rejected before billing (CLI README), so a malformed job in a chain fails for free.
- The skill tells agents not to rewrite a prompt and resubmit after a failure without asking you first, and to get your approval before any retry.
feedbackreports a stuck task, billing anomaly or unexpected result, but the skill says it does not retry, refund or repair the original task.- Non-subscribers can run only one video task at a time; subscribers have no task limits.
What Kling recommends: its MCP batch workflow article says to ask the agent to “show me the plan before generating any media”, to “start with a few videos before generating the full set”, and, when the same problem shows up in several results, to update the shared instruction rather than rewriting every prompt. Its Claude Code tutorial adds: check an existing task before submitting a duplicate request.
Not documented: any refund for a job that completes but looks wrong. The refund line in the Credits Policy covers failed generations only, and Kling’s MCP pages add nothing for unwanted results, so budget every completed clip as spent.
A practical guard for scripts: run who_am_i, submit two or three test jobs, review them, then loop over the approved list only, with a fixed list length rather than an open-ended retry loop.
What has not been published
- MCP endpoint for China-site accounts: Kling’s blog gives https://kling.ai/mcp for international accounts; the MCP pages checked do not list a separate endpoint. The CLI handles the region through the @klingai/cli-cn package.
- Codex config snippet: Codex is listed as supported, but Kling publishes no Codex-specific MCP config. Use the quick-start prompt or the CLI.
- Per-model credit prices for MCP/CLI: Not listed; Kling says pricing matches its own platforms.
- Refunds for completed but unwanted results: Not documented. Failed generations are refunded under the Credits Policy.
- Job cancellation: not supported.
Which should you choose: MCP, CLI or a browser?
| If you… | Use |
|---|---|
| Chat with Claude or Cursor and want one-URL setup | Kling MCP |
| Script batches, run CI, or use OpenClaw or Hermes | Kling CLI |
| Use Claude Code across many projects | MCP with --scope user, or the CLI skill — not both |
| Have a China-site Kling account | @klingai/cli-cn |
| Want no installs, keys or terminals | A browser generator such as kling4.tv |
Kling MCP and CLI are built for people who already work with AI agents or scripts. If you only want to type a prompt and get a clip, a browser is faster. On kling4.tv text-to-video there is nothing to install: the generator lists 7 models and opens on “Kling 4.0 Lite” at 720p, 4 seconds and 40 credits, and the exact model and credits are shown in the generator before you submit. kling4.tv uses its own account and credits, with free credits on sign-up, enough for one video; plans are on the pricing page.
What do people ask about Kling MCP and CLI?
What is the Kling MCP server URL?
The endpoint is https://kling.ai/mcp. Kling’s blog gives it for international accounts on kling.ai.
Do I need an API key for Kling MCP or CLI?
No. You sign in with your Kling account through OAuth, and Kling says no API keys are required.
Should I install both MCP and the CLI?
No. Kling’s guide says to install one or the other in a given assistant, because the assistant may switch between them unpredictably.
Which AI assistants work with Kling MCP?
Kling lists Codex, Claude, Cursor, Openclaw and Workbuddy, among others. Setup steps are published for Cursor, Claude and Claude Code.
Does Kling MCP support Kling 4.0?
Yes. The Kling 4.0 release notes say MCP and CLI support Kling 4.0, including Omni Reference and keyframes.
How are credits charged through MCP and CLI?
They use the same credit pricing and rules as Kling’s own platforms, based on model, duration and resolution. Off-peak free generation and bonus credits are not available through them.
What are the rate limits?
The rate limit is 5 QPS. Non-subscribers can run one video task at a time, while subscribers have no task limits.
Can I cancel a Kling MCP job?
No. Generation tasks cannot be canceled once submitted, so review the plan before you send it.
How long do result links last?
Generated file URLs stay valid for 24 hours. Download the files you want to keep, and find them later in your Kling web asset library.
Do failed MCP or CLI jobs still cost credits?
Kling’s Credits Policy says credits for a failed generation are refunded, and MCP and CLI follow the same credit rules. A job that completes but looks wrong is a finished generation, so test a small set before you scale a chain.
Where do these facts come from?
- Kling MCP & CLI Guide — setup steps, config snippets, tools, commands and FAQ. Checked October 18, 2026.
- Kling MCP page FAQ — CLI recommendation, supported agents, OAuth, billing, features, storage. Checked October 18, 2026.
- @klingai/cli-global README (v0.2.3) and @klingai/cli-cn — install, commands, flags, Kling 4.0 examples and limits. Checked October 18, 2026.
- klingai-tech/skills — skill install, region packages, billing and retry rules. Checked October 18, 2026.
- Kling 4.0 release notes — MCP/CLI support for Kling 4.0. Checked October 18, 2026.
- Kling Credits Policy — deduction on generation, refund on failed generation. Checked October 18, 2026.
- Kling blog: MCP batch workflow and Claude Code tutorial — endpoint note, Claude Code command, test-first batching. Checked October 18, 2026.
Related: Kling 4.0 vs Seedance 2.5 · Seedance 2.5 overview · Kling 4.0 vs Kling 3.0 · Plans and credits
Try Kling AI Today
No terminal or connector needed: open the generator, check the model and cost line, and make a first clip with free credits on sign-up, enough for one video. Start on kling4.tv.
