Kling — Claude Code MCP server: what it does, how to install
Connects Kling AI video generation and lip-sync directly to your AI agent. It handles rendering tasks, checks queue status, and downloads assets to the workspace.
claude mcp add --env KLING_ACCESS_KEY=<KLING_ACCESS_KEY> --env KLING_SECRET_KEY=<KLING_SECRET_KEY> --env KLING_REQUEST_TIMEOUT_MS=<KLING_REQUEST_TIMEOUT_MS> --env MCP_WORKSPACE_PATH=<MCP_WORKSPACE_PATH> --env KLING_DOWNLOAD_ROOT=<KLING_DOWNLOAD_ROOT> --transport stdio kling -- npx -y @mindstone/mcp-server-klingWhat Kling does
This package gives your host 10 tools targeting the Kling API. You can generate videos from text prompts or animate still frames. It also stretches clips by 4 to 5 seconds per request. A dedicated tool synchronizes lip movement to speech. Quota checks run through the same interface.
Running this requires Node.js 20+ and API keys: KLING_ACCESS_KEY and KLING_SECRET_KEY. Input media files must live inside MCP_WORKSPACE_PATH. For safety, the server refuses file access to directories like ~/.ssh or /etc. Generated asset URLs expire after 30 days.
What it helps with
- produce AI videos from text prompts or still frames
- extend existing Kling video clips by 4 to 5 seconds
- add lip-synced speech to characters using text or audio
- save generated media files before the 30-day URL expiration
Example prompts for the agent
- Generate a video of a wooden boat drifting across a foggy lake using Kling.
- Check the status of my Kling video generation task.
- Extend the previous Kling clip and verify the remaining account balance.
How to install Kling
Platform CLI
claude mcp add --env KLING_ACCESS_KEY=<KLING_ACCESS_KEY> --env KLING_SECRET_KEY=<KLING_SECRET_KEY> --env KLING_REQUEST_TIMEOUT_MS=<KLING_REQUEST_TIMEOUT_MS> --env MCP_WORKSPACE_PATH=<MCP_WORKSPACE_PATH> --env KLING_DOWNLOAD_ROOT=<KLING_DOWNLOAD_ROOT> --transport stdio kling -- npx -y @mindstone/mcp-server-klingReplace <…> with your own values
Platform CLI
codex mcp add kling --env KLING_ACCESS_KEY=<KLING_ACCESS_KEY> --env KLING_SECRET_KEY=<KLING_SECRET_KEY> --env KLING_REQUEST_TIMEOUT_MS=<KLING_REQUEST_TIMEOUT_MS> --env MCP_WORKSPACE_PATH=<MCP_WORKSPACE_PATH> --env KLING_DOWNLOAD_ROOT=<KLING_DOWNLOAD_ROOT> -- npx -y @mindstone/mcp-server-klingReplace <…> with your own values
Config file
{
"mcpServers": {
"kling": {
"command": "npx",
"args": [
"-y",
"@mindstone/mcp-server-kling"
],
"env": {
"KLING_ACCESS_KEY": "<KLING_ACCESS_KEY>",
"KLING_SECRET_KEY": "<KLING_SECRET_KEY>",
"KLING_REQUEST_TIMEOUT_MS": "<KLING_REQUEST_TIMEOUT_MS>",
"MCP_WORKSPACE_PATH": "<MCP_WORKSPACE_PATH>",
"KLING_DOWNLOAD_ROOT": "<KLING_DOWNLOAD_ROOT>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"kling": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@mindstone/mcp-server-kling"
],
"env": {
"KLING_ACCESS_KEY": "<KLING_ACCESS_KEY>",
"KLING_SECRET_KEY": "<KLING_SECRET_KEY>",
"KLING_REQUEST_TIMEOUT_MS": "<KLING_REQUEST_TIMEOUT_MS>",
"MCP_WORKSPACE_PATH": "<MCP_WORKSPACE_PATH>",
"KLING_DOWNLOAD_ROOT": "<KLING_DOWNLOAD_ROOT>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e KLING_ACCESS_KEY=<KLING_ACCESS_KEY> -e KLING_SECRET_KEY=<KLING_SECRET_KEY> -e KLING_REQUEST_TIMEOUT_MS=<KLING_REQUEST_TIMEOUT_MS> -e MCP_WORKSPACE_PATH=<MCP_WORKSPACE_PATH> -e KLING_DOWNLOAD_ROOT=<KLING_DOWNLOAD_ROOT> kling npx -y @mindstone/mcp-server-klingReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Kling
How to install Kling in Claude Code?
Run this terminal command: claude mcp add mcp-server-kling -e KLING_ACCESS_KEY=<KLING_ACCESS_KEY> -e KLING_SECRET_KEY=<KLING_SECRET_KEY> -- npx -y @mindstone/mcp-server-kling.
What does the Kling MCP server do?
It connects your model to the Kling API for video and image workflows. The agent can trigger renders, track progress, and download output files to your workspace.
Where are downloaded media files saved?
Files are placed into a kling-downloads directory within your defined workspace. The server blocks any attempts to write outside that root to protect sensitive locations.