Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .cursor-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,16 @@
"source": "third_party/lmty",
"description": "Read tracked competitors, competitive intelligence reports, change logs, evidence, social mentions, and market feeds for your products, and browse LMTY's public Markets, event timelines, and company, product, and person profiles."
},
{
"name": "kling-ai",
"source": "third_party/kling-ai",
"description": "Generate and edit images with Kling Image 4.0, create videos with Kling 4.0 and Kling 4.0 Flash, and reuse Elements through Kling MCP."
},
{
"name": "kling-ai-cn",
"source": "third_party/kling-ai-cn",
"description": "Generate and edit images with Kling Image 4.0, create videos with Kling 4.0 and Kling 4.0 Flash, and reuse Elements through the China-region Kling MCP."
},
{
"name": "sabre-developer-hub",
"source": "third_party/sabre-developer-hub",
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ Official Cursor plugins for popular developer tools, frameworks, and SaaS produc
| `createos` | [CreateOS](third_party/createos/) | Cursor | Integrations | Deploy and manage projects, environments, deployments, domains, logs, cron jobs, security scans, templates, and sandboxes on NodeOps CreateOS. |
| `fiscal-ai` | [Fiscal.ai](third_party/fiscal-ai/) | Cursor | Integrations | Pull source-linked financials, filings, ratios, prices, segments, KPIs, ownership, fund letters, and news from Fiscal.ai. |
| `lmty` | [LMTY](third_party/lmty/) | Cursor | Integrations | Read tracked competitors, competitive intelligence reports, change logs, evidence, social mentions, and market feeds for your products, and browse LMTY's public Markets, event timelines, and company, product, and person profiles. |
| `kling-ai` | [Kling AI Plugin](third_party/kling-ai/) | KLING AI | Integrations | Generate and edit images with Kling Image 4.0, create videos with Kling 4.0 and Kling 4.0 Flash, and reuse Elements through Kling MCP. |
| `kling-ai-cn` | [Kling AI China Plugin](third_party/kling-ai-cn/) | KLING AI | Integrations | Generate and edit images with Kling Image 4.0, create videos with Kling 4.0 and Kling 4.0 Flash, and reuse Elements through the China-region Kling MCP. |
| `sabre-developer-hub` | [Sabre Developer Hub](third_party/sabre-developer-hub/) | Cursor | Integrations | Search and read Sabre Developer Hub documentation, OpenAPI specs, and Sabre-published agent skills for travel APIs, SDKs, and product collections. |
Author values match each plugin’s `plugin.json` `author.name` (Cursor lists `plugins@cursor.com` in the manifest).

Expand Down
33 changes: 33 additions & 0 deletions third_party/kling-ai-cn/.cursor-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "kling-ai-cn",
"$schema": "https://cursor.com/schemas/cursor-plugin/plugin.json",
"description": "Generate and edit images with Kling Image 4.0, create videos with Kling 4.0 (including HDR) and Kling 4.0 Flash, and reuse Elements through Kling MCP.",
"version": "1.4.2",
"author": {
"name": "KLING AI"
},
"homepage": "https://klingai.com",
"repository": "https://github.com/klingai-tech/cursor-plugin",
"license": "MIT",
"keywords": [
"kling",
"kling-ai",
"image-generation",
"video-generation",
"mcp",
"oauth"
],
"logo": "assets/kling-logo.png",
"rules": "rules",
"skills": "skills",
"mcpServers": "mcp.json",
"tags": [
"media",
"creative",
"ai-generation",
"video",
"image",
"mcp",
"oauth"
]
}
6 changes: 6 additions & 0 deletions third_party/kling-ai-cn/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
.env
.env.*
outputs/
assets/generated/
.DS_Store
21 changes: 21 additions & 0 deletions third_party/kling-ai-cn/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 KLING AI Pte Ltd

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
11 changes: 11 additions & 0 deletions third_party/kling-ai-cn/PRIVACY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Privacy

The plugin sends prompts, reference media, task identifiers, account queries,
and generation requests to the Kling AI China remote MCP at
`https://klingai.com/mcp/plugin` only when Cursor invokes its tools.

Cursor manages OAuth for the remote MCP connection. The packages do not request,
store, or log API keys, OAuth tokens, cookies, authorization headers, or local
credential files. They do not include a local MCP server or localhost monitor.

Kling AI's privacy policy and terms apply to data processed by the service.
133 changes: 133 additions & 0 deletions third_party/kling-ai-cn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# 可灵 AI Cursor 插件

This marketplace lists the upstream `cn` branch separately as `kling-ai-cn` so it can be installed alongside the Global listing.

在 Cursor 的 Agent 对话中生成图片和视频、复用主体、查询任务进度。
这是 `cn` 分支的**国内版**,版本 **1.4.2**。使用国际站账号请前往
[`main` 分支](https://github.com/klingai-tech/cursor-plugin/tree/main)。

## 快速开始

### 1. 安装插件

打开 Cursor 桌面端,在 **Agent** 对话中粘贴这段话。

> 请从 https://github.com/klingai-tech/cursor-plugin 的 `cn` 分支安装可灵 AI Cursor 插件。
> 参照 Cursor 的本地插件安装说明,安装后引导我重载 Cursor、连接可灵国内站账号,
> 并检查连接和可用灵感值。先不要发起生成任务。

[可灵 MCP & CLI 官方指南(国内)](https://klingai.com/app/mcp/guide) ·
[Cursor 本地插件安装说明](https://cursor.com/docs/plugins#test-plugins-locally)

#### 手动安装

macOS 或 Linux 用户可在终端运行以下命令。

```bash
git clone --branch cn --single-branch https://github.com/klingai-tech/cursor-plugin.git
cd cursor-plugin
mkdir -p ~/.cursor/plugins/local/kling-ai
cp -R .cursor-plugin assets rules skills mcp.json README.md ~/.cursor/plugins/local/kling-ai/
```

<details>
<summary>Windows PowerShell</summary>

```powershell
git clone --branch cn --single-branch https://github.com/klingai-tech/cursor-plugin.git
Set-Location cursor-plugin
$pluginDir = Join-Path $HOME '.cursor/plugins/local/kling-ai'
New-Item -ItemType Directory -Force -Path $pluginDir | Out-Null
Copy-Item -Recurse -Force -Path .cursor-plugin, assets, rules, skills, mcp.json, README.md -Destination $pluginDir
```

</details>

如果已经克隆过仓库,更新本地 `cn` 分支,在仓库根目录执行复制步骤即可。
如果旧版的本地插件目录里还有 `commands/kling-ai.md`,请在重载前移除该旧文件。

[Cursor Directory 页面](https://cursor.directory/plugins/kling-ai)会分别添加 Rule 或 MCP。
要安装包含 `/kling-ai` Skill 的完整插件,请使用上面的本地安装步骤。

### 2. 授权可灵账号

1. 重启 Cursor,或在命令面板运行 **Developer: Reload Window**。
2. 打开 **Customize → Plugins**,确认 **Kling AI** 已加载。在 **Customize** 中找到已启用的
`kling-ai` MCP 服务,点击 **Connect**。
3. 在浏览器登录可灵国内站账号并授权 Cursor。返回 Cursor,新建一个 Agent 对话。
插件自带[国内站 MCP 配置](mcp.json),地址为 `https://klingai.com/mcp/plugin`,由 Cursor 完成 OAuth 授权。

### 3. 在 Agent 对话中试用

输入 `/kling-ai`,选中 Skill 后发送提示词。

- **检查连接** · 帮我检查可灵账号是否已连接,以及还有多少可用灵感值。先不发起生成。
- **文生图** · 生成一张 4:5 的香水商品海报,玻璃瓶身、暖色棚拍光。先展示生成设置,等我确认后再提交。
- **图生视频** · 用我附上的商品图做首帧,生成一段 5 秒视频。商品保持不动,镜头缓慢推近。

有参考图或视频时,把素材附在对话里,并说明它是首帧、风格参考还是主体素材。
生成会消耗灵感值,请先核对设置再确认提交。提交后可以在结果卡片查看进度,也可以凭任务编号查询已有任务。

更多示例见[中文提示词](skills/kling-ai/references/prompt-examples.md#推荐提示词)和
[英文提示词](skills/kling-ai/references/prompt-examples.md#suggested-prompts)。

## 常见问题

- **找不到插件或 Skill** · 确认本地插件目录内有 `.cursor-plugin/plugin.json`,重载 Cursor 后新建 Agent 对话。
企业版可请管理员确认 **Allow Local Plugin Imports** 已开启。
- **连接失败或账号不对** · 在 Cursor 中仅保留一个启用的可灵 MCP 条目,再重新连接插件的 `kling-ai` 服务。
从国际版切换时,先断开旧连接,再用国内站账号授权。
- **任务还在运行或结果卡片未显示** · 如果已有任务编号,请让 Cursor 查询原任务。其他问题见[故障排查](skills/kling-ai/references/troubleshooting.md)。

## 功能

- 文生图、参考图编辑和连续组图。未指定模型时,如果当前账号支持且符合需求,优先使用可灵图片 4.0,再考虑账号可用的默认模型。
- [可灵图片 4.0](https://kling.ai/quickstart/kling-image-4-user-guide)支持原生 8K 和连续组图模式,单次最多生成 10 张连贯图片。
- 可灵 4.0 支持文生视频、首尾帧与中间关键帧,以及使用图片、视频、音频和主体的全能参考。支持 3–30 秒,默认 720p。可用 1080p 或 4K 的账号可在文生视频、图生视频和全能参考中开启 HDR 输出。
- 可灵 4.0 Flash 支持文生视频、单首帧图生视频,以及使用图片、视频和主体的全能参考。支持 3–20 秒、720p。
- 两款视频模型的全能参考均支持智能分镜。同步生成声音和保留原视频音频最多启用一项。实际可用模型、参数、素材上限和计费信息以当前账号为准。
- 支持素材上传、主体管理、动作库、灵感值查询和任务查询。生成前确认计费设置,每次确认对应一次提交,结果卡片可用时自动刷新。

## 插件组件

| 组件 | 路径 | 用途 |
| --- | --- | --- |
| 清单 | `.cursor-plugin/plugin.json` | 声明插件及组件入口 |
| MCP | `mcp.json` | 国内站远程 OAuth MCP |
| Rule | `rules/kling-ai.mdc` | 请求路由和单次提交规则 |
| 核心 Skill | `skills/kling-ai/` | `/kling-ai` 入口、授权、账号、素材、主体和任务查询 |
| 图片 Skill | `skills/kling-ai-generate-image/` | 图片生成、提示词和质量检查 |
| 视频 Skill | `skills/kling-ai-generate-video/` | 视频、动作控制、时长和镜头规划 |

## 生成流程

1. 生成前调用 `who_am_i`,使用服务返回的模型、参数、枚举值和输入定义。
2. 使用远程上传工具上传本地素材。同一目标复用一个 UUIDv7 `taskTraceId`。
3. 展示最终生成设置和当前服务要求的计费信息。用户已经授权这些设置时可直接继续,否则先取得明确确认。
4. 提交前在同一连接检查当前灵感值。余额不可用或不足时暂停。
5. 每次确认最多调用一次生成工具。提交结果不明确时,禁止自动重试。
6. Cursor 显示结果卡片时,由卡片自动刷新。卡片未显示时,按服务允许的间隔查询,直到任务结束、取消或对话无法继续。单次状态查询只查一次。
7. 任务成功并返回所需类型、数量的可用结果后,才报告完成。结果不足时报告实际数量。

灵感值不足时,请在国内站用同一账号补充,然后回到原 Cursor 对话继续。
Cursor 会先检查已有任务编号,并且只在可以安全提交时复核余额、按原设置提交。

## 开发验证

```bash
npm run check
npm test
for skill in skills/*; do
python3 "${CODEX_HOME:-$HOME/.codex}/skills/.system/skill-creator/scripts/quick_validate.py" "$skill"
done
```

## 官方资料

- [Cursor 插件文档](https://cursor.com/docs/plugins)
- [Cursor 插件参考](https://cursor.com/docs/reference/plugins)
- [Cursor MCP 文档](https://cursor.com/docs/mcp)

## 许可证

MIT。可灵 AI 及相关商标归各自权利人所有。
Binary file added third_party/kling-ai-cn/assets/kling-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions third_party/kling-ai-cn/mcp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"mcpServers": {
"kling-ai": {
"type": "http",
"url": "https://klingai.com/mcp/plugin"
}
}
}
14 changes: 14 additions & 0 deletions third_party/kling-ai-cn/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "kling-ai-cursor-plugin",
"version": "1.4.2",
"private": true,
"type": "module",
"description": "Generate and edit images with Kling Image 4.0, create videos with Kling 4.0 (including HDR) and Kling 4.0 Flash, and reuse Elements through Kling MCP.",
"scripts": {
"check": "node scripts/verify-plugin.mjs",
"test": "node --test tests/*.test.mjs"
},
"engines": {
"node": ">=20"
}
}
27 changes: 27 additions & 0 deletions third_party/kling-ai-cn/rules/kling-ai.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
description: Use Kling AI for prompts, storyboards, image, video, motion, asset, account, and task requests
globs:
alwaysApply: false
---

For Kling requests, use `$kling-ai` and route creative work to
`$kling-ai-generate-image` or `$kling-ai-generate-video`. Use only the
configured `kling-ai` China MCP at `https://klingai.com/mcp/plugin`.
For prompt-only or storyboard-only requests, deliver the text without MCP calls.
During generation preparation, discover live model capabilities across relevant
tools and follow the dedicated Skill's model preferences. For video, include
`omni_ref_video` when available. Confirm final billable settings before generation
unless the same unsubmitted intent and unchanged settings are already explicitly
authorized. Submit each confirmed intent at most once.

Check current credits on the same connection immediately before submitting. If
the balance is unavailable or insufficient, pause and follow the core Skill's
recovery workflow. When the user asks to resume and the original submission
has a task number, check that task first.

Let a mounted generation MCP App refresh its own task. If no App is mounted
and a `generationId` is known, query at the provider-permitted interval until
terminal, cancelled, or the turn cannot continue. Report completion only after
terminal success with usable primary media. Query once for an explicit standalone
status request with a known task ID. Never switch regions or start or depend on
a local Kling MCP server.
77 changes: 77 additions & 0 deletions third_party/kling-ai-cn/scripts/verify-plugin.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/usr/bin/env node

import { existsSync, readFileSync } from "node:fs";
import { dirname, join, resolve } from "node:path";
import { fileURLToPath } from "node:url";

const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const SERVER_KEY = "kling-ai";
const ENDPOINT = "https://klingai.com/mcp/plugin";

function readJson(path) {
return JSON.parse(readFileSync(path, "utf8"));
}

export function verifyPlugin() {
const failures = [];
const check = (condition, message) => {
if (!condition) failures.push(message);
};

const packageJson = readJson(join(repoRoot, "package.json"));
const manifest = readJson(join(repoRoot, ".cursor-plugin/plugin.json"));
const mcp = readJson(join(repoRoot, "mcp.json"));
const servers = mcp.mcpServers ?? {};

check(manifest.name === "kling-ai", "manifest name must be kling-ai");
check(manifest.version === packageJson.version, "manifest and package versions must match");
check(manifest.homepage === "https://klingai.com", "homepage must use the China Kling site");
check(
manifest.repository === "https://github.com/klingai-tech/cursor-plugin",
"manifest repository must match this repository"
);
check(
manifest.rules === "rules" &&
manifest.skills === "skills" &&
manifest.mcpServers === "mcp.json",
"manifest must reference native Cursor components"
);
check(!Object.hasOwn(manifest, "commands"), "the core Skill provides the /kling-ai entrypoint");
check(JSON.stringify(Object.keys(servers)) === JSON.stringify([SERVER_KEY]), `plugin must register only ${SERVER_KEY}`);
check(servers[SERVER_KEY]?.type === "http", "MCP transport must be http");
check(servers[SERVER_KEY]?.url === ENDPOINT, `MCP endpoint must be ${ENDPOINT}`);

for (const path of [
"assets/kling-logo.png",
"rules/kling-ai.mdc",
"skills/kling-ai/SKILL.md",
"skills/kling-ai-generate-image/SKILL.md",
"skills/kling-ai-generate-video/SKILL.md"
]) {
check(existsSync(join(repoRoot, path)), `${path} is missing`);
}

for (const forbidden of [
".cursor-plugin/marketplace.json",
"commands/kling-ai.md",
"kling-ai",
"plugin.json",
"ui",
"server",
"mcp-app",
"scripts/kling-monitor.mjs"
]) {
check(!existsSync(join(repoRoot, forbidden)), `single China plugin must not bundle ${forbidden}`);
}

if (failures.length > 0) {
throw new Error(`Cursor plugin verification failed:\n- ${failures.join("\n- ")}`);
}

return { name: manifest.name, endpoint: ENDPOINT, version: manifest.version };
}

if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
const result = verifyPlugin();
console.log(`Verified ${result.name} ${result.version} at ${result.endpoint}.`);
}
Loading