agent-link
v0.1.2Connect your own AI agent (Claude Code, Codex, Cursor…) to KinoViz Studio over MCP — the agent builds animations live in your browser tab.
Bring your own AI agent to KinoViz Studio. Claude Code, Codex, Cursor or any other MCP client can build and edit animations directly in your open Studio tab, while you watch every change live and keep editing by hand afterwards. Agent Link is included in the Pro and Studio plans (and the Pro trial). The package runs locally. It talks only to your agent (over stdio) and to your own Studio tab (over a local WebSocket). Your agent's model and its costs stay with your agent; KinoViz does not run an AI model for you here.
Summary extracted from the README.
@kinoviz/agent-link
Bring your own AI agent to KinoViz Studio. Claude Code, Codex, Cursor or any other MCP client can build and edit animations directly in your open Studio tab, while you watch every change live and keep editing by hand afterwards.
Agent Link is included in the Pro and Studio plans (and the Pro trial).
your agent ──MCP (stdio)──▶ @kinoviz/agent-link (on your machine) ──ws://127.0.0.1:7801──▶ KinoViz Studio tab
The package runs locally. It talks only to your agent (over stdio) and to your own Studio tab (over a local WebSocket). Your agent's model and its costs stay with your agent; KinoViz does not run an AI model for you here.
Requirements
- Node.js 18 or newer (
node -v). - A KinoViz account on Pro or Studio, signed in at kinoviz.com/studio in a desktop browser (Chrome, Edge, Arc or Firefox recommended).
- An MCP-capable agent: Claude Code, Codex CLI, Cursor, …
Install
Claude Code
claude mcp add kinoviz -- npx -y @kinoviz/agent-link --studio-url https://kinoviz.com/studio
Codex CLI (~/.codex/config.toml)
[mcp_servers.kinoviz]
command = "npx"
args = ["-y", "@kinoviz/agent-link", "--studio-url", "https://kinoviz.com/studio"]
startup_timeout_sec = 60
tool_timeout_sec = 180
Cursor (~/.cursor/mcp.json or .cursor/mcp.json in a project)
{
"mcpServers": {
"kinoviz": {
"command": "npx",
"args": ["-y", "@kinoviz/agent-link", "--studio-url", "https://kinoviz.com/studio"]
}
}
}
Restart the agent (or reload its MCP servers) after adding the server.
Connect your agent
-
Open kinoviz.com/studio, open or create a project, and click Connect agent. Studio shows a 6-digit pairing code.
-
Optional but strongly recommended: fill in Agent brief (style family, aspect ratio, duration, colors, fonts, exact copy, and upload the images to use). Agents produce much better work with a brief.
-
In your agent, ask for an animation and give it the code, for example:
Use the kinoviz tools to build the animation from my brief. Pairing code: 482913
The server also ships an MCP prompt named build that walks the agent through the whole workflow (in Claude Code it appears as
/mcp__kinoviz__build, with the code as its argument). -
Keep the Studio tab in the foreground while the agent works. Studio shows an "Agent is editing" banner with live activity; you can pause or disconnect at any time.
The agent's workflow: kinoviz_status → kinoviz_pair → kinoviz_get_brief (or kinoviz_start_freeform if you decline a brief) → kinoviz_get_guide → build → kinoviz_render_frames self-check → kinoviz_finish → preview, save, and a short report back to you. Export from Studio as usual when you are happy.
Tool sets
| Mode | What the agent gets | When to use |
|---|---|---|
lean (default) |
Session tools (kinoviz_*) + applyFullProject, addElement, modifyElement, removeElement, duplicateElement, groupElements, alignElements, setElementMask, applyEntrancePreset, applyExitPreset, applyEmphasisPreset, addBackgroundKeyframe, setProjectState, getKinoSkill |
Typography, product, social, lower-third and UI pieces |
full |
Everything in lean + applyBooleanOp, applyEffector, applyGooeyGroup, applySoftCellGroup, applyPhysics, addCameraKeyframe, addComponentInstance, modifyComponentInstance |
Boolean shapes, arrays/effectors, physics, camera moves, components |
Switch with --tools full. Session tools in both modes: kinoviz_status, kinoviz_pair, kinoviz_get_brief, kinoviz_start_freeform, kinoviz_get_guide, kinoviz_list_projects, kinoviz_create_project, kinoviz_open_project, kinoviz_set_canvas_ratio, kinoviz_get_snapshot, kinoviz_import_image (bring in images your agent made, by absolute path), kinoviz_render_frames, kinoviz_finish, kinoviz_preview, kinoviz_save.
Not available over MCP: AI image generation (your agent can create images with its own tools and import them), the asset library search, and the in-app plan/stance cards.
Options
| Flag | Env | Default | |
|---|---|---|---|
--studio-url <url> |
KINO_STUDIO_URL |
https://kinoviz.com/studio |
Studio address used in connection hints |
--port <n> |
KINO_LINK_PORT |
7801 |
Local relay port; Studio must use the same port |
--tools lean|full |
KINO_LINK_TOOLS |
lean |
Tool set (see above) |
--allow-origin <origin> |
KINO_LINK_ALLOW_ORIGINS (comma-separated) |
— | Also accept this origin (repeatable; http://host:* = any port) |
--help, --version |
Security
- The relay listens on
127.0.0.1only and accepts connections only fromhttps://kinoviz.com,https://pre.test.kinoviz.com,http://localhost:*andhttp://127.0.0.1:*(plus any--allow-originyou add). - Until the agent pairs with the code shown in your Studio tab, every editing tool is refused. Codes are issued per signed-in Pro account; five wrong codes lock the session until you reopen Connect agent.
- The agent can only change the project open in your tab, through the same editing engine you use. Saving and exporting follow your account's normal rules.
kinoviz_import_imagereads only the file paths your agent passes (images up to 10 MB).
FAQ
The agent says Studio is not connected. Make sure Studio is open and signed in, click Connect agent, and check that the dialog and the server use the same port. If your browser asks whether kinoviz.com may access apps or services on this device, allow it; that is the local link. Some browsers, notably Safari, may block connections from a web page to local addresses.
"Port 7801 is already in use". Another agent session is already running Agent Link. Close it, or start this one with --port 7802 and pick the same port in Studio.
"The Studio tab is in the background". Browsers pause rendering in hidden tabs. Bring the tab to the front; queued operations continue for up to 60 seconds.
"Not paired". Read the 6-digit code from Connect agent again. A new code (for example after reopening the dialog or using another tab) requires pairing again.
A tool "is not enabled in this session". It belongs to the full tool set. Restart the server with --tools full.
"Studio runs KinoViz x.y.z; this agent link was built for …". Update the package: npx -y @kinoviz/agent-link@latest (re-add it in your agent if you pinned a version).
My agent times out on long operations. Rendering and big scene builds can take a minute or more. Raise your agent's MCP tool timeout to at least 180 seconds (for Codex: tool_timeout_sec).
Do I need the brief? No, but without one results are usually generic. If you skip it, the agent asks you to confirm and then calls kinoviz_start_freeform.
The agent asked for a font and got the default one. Only fonts in KinoViz's font list can be used (the guide ends with "Fonts available"). An unknown fontFamily is not applied and the tool result's warnings names the closest available families; letterSpacing is in 1/100 em (10 = 0.1em), not px.
License
The CLI implementation is MIT-licensed. The embedded KinoViz guides, knowledge base, style guidance, and tool schemas are KinoViz copyrighted content licensed only for use with KinoViz. See LICENSE for the exact scope and terms. Third-party components retain their own licenses. These terms apply starting with 0.1.1; the previously published 0.1.0 remains under its original MIT license.
Development
This package lives in the KinoViz repo at tools/agent-link and never imports the app's source at runtime. Everything it needs from the app is snapshotted at build time into src/generated/ (committed):
| File | Source |
|---|---|
tools.json |
src/lib/ai/tools/{canvas,aesthetic,simulation,knowledge,assets}: name, description, execution, JSON input schema |
guide-create.md |
buildSystemPrompt('create', …) from src/lib/ai/AgentPrompts.ts |
kino-skill.json |
every getKinoSkill section |
manifest.json |
{ protocol, appVersion, toolSchemaHash, tools, minPackageVersion }, hashed with the same functions as GET /api/agent-link/manifest (src/lib/agent-link/tool-manifest.ts) |
cd tools/agent-link
npm install
npm run gen # regenerate src/generated from the app source (runs scripts/agent-link/gen-snapshot.mts)
npm run gen:check # fail if the committed snapshot drifted from the app source
npm run build # tsup → dist/cli.js (single ESM file, node ≥18, only node built-ins external)
npm test # builds, then vitest (fake Studio page over real WebSockets + in-memory MCP client)
npm run smoke # stdio smoke test against dist/cli.js (no browser needed)
npm run typecheck
Regenerate (npm run gen) and rebuild whenever canvas tool schemas, AgentPrompts.ts, kino-skill.ts or the AgentBrief enums change; npm test includes the drift check.
Local dev against pnpm dev
# 1. app: pnpm dev (repo root) → http://localhost:3000
# 2. use the local build instead of the published npm package:
claude mcp add kinoviz-dev -- node /abs/path/kinoviz/tools/agent-link/dist/cli.js --studio-url http://localhost:3000/studio --tools full
# 3. open http://localhost:3000/studio?agentLink=1 — local tabs connect without a pairing code
Dev scripts in dev/ (run from this directory with ./node_modules/.bin/tsx, after npm run build; they start dist/cli.js with --studio-url http://localhost:3000/studio --tools full, overridable via KINO_STUDIO_URL / KINO_LINK_PORT / KINO_LINK_TOOLS):
dev/headless-studio.mjs: headless Chrome signed in to the test account at/studio?agentLink=1(run withnode).dev/smoke-e2e.mts: status → freeform → create project → applyFullProject → frames → preview → save.dev/import-probe.mts <abs image path>:kinoviz_import_imageround trip.dev/render-preview.mts <projectId>: read-only frame dump → mp4 + contact sheet.dev/compare.mts <projectId>: export vs editor frames at the same times.dev/m3d-probe.mjs: model3daddElementprobe (no relay).probes/: one-off research probes from the 2026-10-26 friction study (historical; some target the removed spike server).
Source layout: src/cli.ts (entry, flags/env) · src/config.ts (argument parsing) · src/server.ts (MCP server, pairing/brief state machine, finish, prompt) · src/relay.ts (WebSocket relay, origin whitelist, hello checks) · src/tools.ts (session tools, lean/full catalog) · src/slim.ts (result slimming) · src/guide.ts (guide build + stable pagination) · src/style-families.ts · src/brief.ts (AgentBrief snapshot + check times) · src/kino-skill.ts · src/catalog-rules.ts · src/manifest-hash.ts. Protocol and API contract: docs/agent-link/2026-10-26-phase1-contracts.md.