Skip to main content
Glama

kairouter-mcp

MCP server exposing KaiRouter's video generation API — BytePlus Seedance family (Seedance 2.0, 2.0 Fast, 2.0 Mini, 1.5 Pro, 1.0 Pro, ...) and any other video model active on KaiRouter — as tools any MCP-compatible agent harness (Claude Code, Codex, Antigravity, ...) can call.

This is a standalone repo — it does not contain any of KaiRouter's backend source, only a thin client for its public/user-scoped HTTP API. Not yet published to npm — run it from a local build for now (see below).

Tools

Tool

Description

list_video_models

List currently active video models on KaiRouter, with pricing and live provider health. No API key required.

generate_video

Start an async video generation job (text-to-video or image-to-video). Returns a job id immediately — does not block until the video is ready. Spends real credits.

check_video_status

Poll a job by id. status is queued | processing | succeeded | failed; video_url is set once succeeded.

wait_for_video_job

Poll a job until it reaches a terminal status (succeeded/failed/cancelled/expired) or a timeout elapses, then return the final job.

list_video_jobs

List the caller's most recent jobs (up to 50), most recent first.

generate_video is async by design — BytePlus video generation can take tens of seconds to a few minutes. Either call generate_video once and poll check_video_status yourself every few seconds, or call wait_for_video_job right after to block until it's done (or times out).

Related MCP server: Seedance MCP

Setup

git clone https://github.com/X-OR-Cloud/kairouter-mcp.git
cd kairouter-mcp
npm install
npm run build

This produces dist/index.js. You'll need a KaiRouter API key — create one at https://kairouter.com/dashboard/api-keys.

Claude Code

claude mcp add kairouter -e KAIROUTER_API_KEY=sk-xor-your-key-here -- node /absolute/path/to/kairouter-mcp/dist/index.js

Or add directly to .mcp.json (project) / ~/.claude.json (user):

{
  "mcpServers": {
    "kairouter": {
      "command": "node",
      "args": ["/absolute/path/to/kairouter-mcp/dist/index.js"],
      "env": { "KAIROUTER_API_KEY": "sk-xor-your-key-here" }
    }
  }
}

Codex CLI

Add to ~/.codex/config.toml:

[mcp_servers.kairouter]
command = "node"
args = ["/absolute/path/to/kairouter-mcp/dist/index.js"]
env = { KAIROUTER_API_KEY = "sk-xor-your-key-here" }

Antigravity / other MCP-compatible harnesses

Most harnesses accept the same mcpServers JSON block shown above under Claude Code — check the harness's own MCP settings for the exact config file path/UI, since this varies and wasn't verified here for Antigravity specifically.

Configuration

Env var

Required

Default

Notes

KAIROUTER_API_KEY

For generate_video, check_video_status, list_video_jobs

From https://kairouter.com/dashboard/api-keys. Not needed for list_video_models, which is a public endpoint.

KAIROUTER_API_URL

No

https://kairouter.com

Override to point at a staging/local KaiRouter instance.

Development

npm run dev    # tsc --watch
npm start      # run the built server directly over stdio (for manual testing with an MCP client)

Available Tools

4 tools
check_video_statusCheck a KaiRouter video job's statusA

Poll the status of a video generation job started with generate_video. status is one of 'queued', 'processing', 'succeeded', 'failed'. Once status is 'succeeded', video_url has the finished video. Poll every few seconds — generation typically takes tens of seconds to a few minutes depending on model and resolution.

ParametersJSON Schema
NameRequiredDescriptionDefault
job_idYesThe job id returned by generate_video.

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses the status values, the success condition for video_url, and expected latency. It does not, however, describe behavior on failure (e.g., possible error fields), invalid job IDs, or whether the operation is read-only (implicit but not stated). This covers the basics but leaves some behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no redundancy. The purpose is stated first, followed by status semantics and practical polling advice. Every sentence earns its place; nothing is over-explained.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter polling tool with no output schema and no annotations, the description conveys the key response elements (status, video_url on success) and timing. It lacks details on failure responses, error handling, or what happens with an invalid job ID, making it adequate but not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description for job_id already states 'The job id returned by generate_video', and coverage is 100%. The description adds no extra parameter details beyond this; it only reinforces the generate_video link. Baseline 3 is appropriate since the schema carries the semantic weight.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'Poll' with the resource 'status of a video generation job', and immediately ties it to generate_video, making it distinct from siblings like list_video_jobs (lists all) and generate_video (creates). The action and scope are unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states the tool is for jobs started with generate_video and provides concrete polling guidance ('Poll every few seconds') with expected time ranges. However, it does not explicitly name alternatives or state when not to use it, though the context strongly implies it's for a single job's status.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_videoGenerate a video with KaiRouterA

Start an async video generation job on KaiRouter (e.g. BytePlus Seedance 2.0 / 2.0 Fast / 2.0 Mini / 1.5 Pro / 1.0 Pro — see list_video_models for the exact ids currently available). Returns immediately with a job id and status 'queued'; it does NOT wait for the video to finish. Call check_video_status with the returned id to poll until status is 'succeeded' (or 'failed'). Deducts real credits from the caller's KaiRouter account balance when the job is accepted.

ParametersJSON Schema
NameRequiredDescriptionDefault
modelYesKaiRouter model id, e.g. 'dreamina-seedance-2-0-260128'. Call list_video_models to see valid ids.
ratioNoAspect ratio, e.g. '16:9', '9:16', '1:1'. Default 16:9.
promptYesText prompt describing the video to generate.
durationNoOutput duration in seconds. Default 5.
image_urlNoReference image URL or data: URI, for image-to-video generation.
video_urlNoInput video URL, for video-to-video generation on models that support it.
resolutionNoOutput resolution. Default 720p.
with_audioNoGenerate with audio, on models with audio-based pricing (e.g. Seedance 1.5 Pro).
negative_promptNoThings to avoid in the output.
input_duration_secsNoDuration in seconds of the input video — required for accurate cost estimation on video-to-video.

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full disclosure burden and largely succeeds: it reveals the async return contract (job id + 'queued' status), the polling requirement, and — critically — the real financial consequence ('Deducts real credits from the caller's KaiRouter account balance when the job is accepted'). It misses minor items like rate limits, retry safety, or typical job duration, but the expensive-traits an agent needs to fear are covered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four sentences, roughly 85 words, each earning its place: what it does, what it returns, how to check results, and the cost warning. The structure is perfectly front-loaded — purpose first, operational warning last — with zero filler or repetition of schema details.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a high-complexity tool (async job, external service, real credits, no output schema, no annotations), the description covers the critical operational contract: launcher semantics, polling pattern, statuses, and billing side effects. Remaining gaps are real but minor — no idempotency/retry guidance (relevant when retries could double-charge) and no time-to-completion estimate to relay to users. Still well above the minimum viable bar.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline of 3 applies — and the schema genuinely earns it with rich per-field detail (defaults, examples, the data: URI hint on image_url, and the cost-estimation context on input_duration_secs). The tool description itself adds only marginal model-version context (e.g., 'BytePlus Seedance 2.0') that isn't already encoded in the schema. Correct baseline score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb-resource pairing ('Start an async video generation job on KaiRouter') and immediately demonstrates differentiation from siblings by naming them: 'see list_video_models' and 'Call check_video_status'. The async contract ('Returns immediately... does NOT wait') is stated up front. An agent could not confuse this with its siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit, condition-driven routing: use list_video_models when you need valid ids, use check_video_status with the returned id to poll. The polling workflow (poll until 'succeeded' or 'failed') is spelled out, leaving no ambiguity about when to invoke this tool vs. its siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_video_jobsList recent KaiRouter video jobsA

List the caller's most recent video generation jobs (up to 50), most recent first. Useful for recovering a job id that was lost, or reviewing recent generations.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the full burden. It discloses key behaviors: caller scoping, a 50-job limit, and recency ordering. While it does not explicitly state read-only, 'list' inherently implies no mutation, and the given details add useful context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with no redundancy. The first sentence front-loads the core action and scope; the second justifies use cases. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple, parameterless list tool, the description covers the essential aspects: what is listed, the limit, ordering, and practical use cases. It does not describe the response fields, but without an output schema, that is a minor gap and does not hinder correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters, so the baseline is 4. The description correctly focuses on what the tool does rather than parameters, as none exist. No additional parameter explanation is needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the specific verb 'List', a clear resource ('video generation jobs'), and a unique scope (caller's recent jobs, up to 50). It distinguishes itself from sibling tools like list_video_models and check_video_status by focusing on jobs, not models or status.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly gives use cases: 'recovering a job id that was lost, or reviewing recent generations.' It does not name alternatives or exclusions, but the context is clear enough for an agent to choose this tool when needing a job list.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_video_modelsList KaiRouter video modelsA

List the video generation models currently active on KaiRouter (BytePlus Seedance family and others), with id, pricing, and live provider health. Call this first to find a valid model id for generate_video — model availability changes over time, so don't assume a model id without checking here.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It discloses that model availability changes over time, which is a useful behavioral trait. However, it doesn't mention whether the tool is read-only, the response format, or any rate limits. Since the tool is clearly a listing operation, the read-only nature is implied but not explicit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core purpose, and includes a practical usage hint. Every sentence earns its place with no fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter listing tool, the description is complete: it states what is returned (id, pricing, health), why to call it (find valid model id), and the dynamic nature of the data. It doesn't describe the output schema, but no output schema is provided, so the description covers the essentials.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the description doesn't need to explain parameter semantics. The baseline for 0 params is 4, and the description appropriately focuses on what the tool returns rather than parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists video generation models on KaiRouter, specifies the model family (BytePlus Seedance), and mentions the included details (id, pricing, provider health). It distinguishes itself from siblings by explicitly positioning it as the first step before generate_video.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly instructs to call this tool first to find a valid model id for generate_video, and warns not to assume a model id without checking. This provides clear when-to-use guidance and implicitly differentiates from the sibling tools (list_video_jobs, check_video_status) which serve different purposes.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv0.1.0
    • First observedcheck_video_status
    • First observedgenerate_video
    • First observedlist_video_jobs
    • First observedlist_video_models

TDQS

A4.3/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clear, non-overlapping purpose: listing available models, listing past jobs, submitting a generation job, and polling its status. There is no ambiguity between them, and the descriptions reinforce distinct roles.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern (list_video_models, list_video_jobs, generate_video, check_video_status). The naming is predictable and maintains the same style across the set.

Tool Count5/5

With only 4 tools, the set is tightly scoped for its purpose—a video generation API router. Each tool is essential for the core workflow (discover models, generate, check status, review history) without unnecessary extras.

Completeness4/5

The toolset covers the primary lifecycle: listing models, creating a job, polling status, and retrieving past jobs. The only minor gap is the lack of cancellation or deletion options, but these are not critical for the core use case and can be worked around.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers