Grok Imagine Video MCP Server
This MCP server lets you generate, edit, and extend videos via xAI's Grok Imagine Video API, plus manage files and run batch jobs.
Generate videos – Text-to-Video (T2V), Image-to-Video (I2V), and Reference-to-Video (R2V) with configurable duration (1–15s), aspect ratio (16:9, 9:16, etc.), resolution (480p/720p/1080p), and output path.
Edit existing videos – Provide a prompt and a source video (URL, local path, or file ID) to modify content; output matches original duration (max 8.7s source).
Extend videos – Append a continuation segment (2–10s, default 6s) to an existing video.
Upload files – Upload images/videos to the xAI Files API and get reusable file IDs for subsequent calls.
Batch processing CLI – Run multiple generation/edit/extend jobs from a JSON config with concurrency, polling, retry policies, and cost estimation.
Model selection – Supports
grok-imagine-video(all features) andgrok-imagine-video-1.5(T2V/I2V with 1080p, R2V with preset voices, no edit/extend).Audio automatically included – Generated MP4s always have an AAC audio track (sound effects/ambience/score); for 1.5 R2V you can also select preset voices via
reference_audios.Preset voices – In R2V with
grok-imagine-video-1.5, up to 3 reference audios can be used and referenced in the prompt as<AUDIO_0>etc.Flexible input sources – Images/videos can be provided as public URLs, local paths (auto-uploaded as base64 or via Files API), or pre-uploaded file IDs.
Asynchronous handling – Polls job status and downloads result videos automatically, with configurable intervals and attempts.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Grok Imagine Video MCP Servergenerate a 5-second video of a sunset over the ocean"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Grok Imagine Video MCP Server
xAI の Grok Imagine Video API 用 MCP (Model Context Protocol) サーバー。テキストプロンプトからの動画生成、画像からの動画生成(Image-to-Video)、既存動画の編集をサポートします。
クイックスタート (npx)
最も簡単な方法は npx を使用することです:
# APIキーを設定
export XAI_API_KEY="xai-your-api-key"
# サーバーを実行
npx grok-imagine-video-mcp-serverRelated MCP server: Aetherwave Studio
機能
動画生成(Text-to-Video): テキストプロンプトから新規動画を生成
動画生成(Image-to-Video): 画像を入力として動画を生成(プロンプト省略可)
動画生成(Reference-to-Video / R2V): 参照画像をスタイル/コンテンツ参照として動画を生成(
grok-imagine-video-1.5ではプリセットボイスreference_audiosも指定可)動画編集: 既存動画をプロンプトで編集
動画延長(Extension): 既存動画の続きを生成して延長
バッチ処理: CLIで複数動画を一括処理
多様なアスペクト比をサポート(16:9, 4:3, 1:1, 9:16 など)
解像度: 480p, 720p, 1080p(1080p は
grok-imagine-video-1.5限定)動画長: 1〜15秒(デフォルト8秒。編集時は元動画と同じ長さ、延長は2〜10秒)
音声つき(効果音・環境音・BGM が自動生成される。話者の声のみ 1.5 の
reference_audiosで選択可、それ以外はプロンプトで指示する)非同期処理対応(ポーリングによる結果取得、進捗・コスト表示)
grok-imagine-video 1.5 対応: Reference-to-Video(プリセットボイス含む)、動画延長、構造化エラー/進捗、実コスト(
cost_in_usd_ticks)表示に対応しています。
プロンプトの書き方は docs/prompt-templates.md を参照してください。
サポートモデル
モード |
|
|
Text-to-Video | ✅ | ✅ |
Image-to-Video | ✅ | ✅ |
Reference-to-Video | ✅ | ✅ |
R2V のプリセットボイス( | ❌ | ✅ |
編集 | ✅ | ❌ |
延長 | ✅ | ❌ |
1080p | ❌ | ✅ |
モデルと機能の対応について(2026-08-30 実機検証済み):
grok-imagine-video-1.5は Text-to-Video に続き Reference-to-Video も受け付けるようになりました(プリセットボイスreference_audiosを含む)。一方 編集・延長は引き続きVideo editing is not supported for this model./Video extension is not supported for this model.を返します。全モードを使えるのは基本モデルgrok-imagine-videoのみで、これがデフォルトです。なお 1080p が使えるのは T2V/I2V のみで、R2V の出力は 720p 上限です。1080p について: 1080p は
grok-imagine-video-1.5でのみ利用できます。公式ドキュメントは「1.5 の Image-to-Video 限定」と書いていますが、実測では 1.5 の Text-to-Video でも 1080p が通ります(出力実寸 1920x1088)。基本モデルで1080pを指定すると1080p video resolution is not available for this model.が返ります。これはアカウントの権限や Grok のサブスク(SuperGrok 等)とは無関係です。なお xAI の API 課金は消費者向け Grok サブスクとは別系統(前払いクレジット/請求)で、サブスク加入で API 機能が解放されることはありません。
音声
出力される MP4 には常に AAC 音声トラックが含まれます。効果音・環境音・BGM はプロンプトのシーン内容から自動生成されます。話者の声だけは grok-imagine-video-1.5 の R2V で reference_audios(プリセットボイス、最大3件。プロンプト中で <AUDIO_0> … と参照)として選択できますが、効果音・BGM を制御する API パラメータはありません。狙った音にしたい場合はプロンプト本文で指示します(テンプレート集参照)。音声が不要なら ffmpeg -i in.mp4 -c copy -an out.mp4 で除去してください。
必要条件
Node.js 18.0.0 以上
xAI API キー(console.x.ai から取得)
インストール
方法1: npx(推奨)
npx grok-imagine-video-mcp-server方法2: グローバルインストール
npm install -g grok-imagine-video-mcp-server
grok-imagine-video-mcp-server設定
環境変数
変数 | 必須 | 説明 |
| Yes | xAI API キー |
| No |
|
| No | 動画のデフォルト出力ディレクトリ |
| No | ポーリング間隔(ミリ秒、デフォルト: 5000) |
| No | 最大ポーリング回数(デフォルト: 120) |
Claude Desktop 設定
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"grok-imagine-video": {
"command": "npx",
"args": ["-y", "grok-imagine-video-mcp-server"],
"env": {
"XAI_API_KEY": "xai-your-api-key-here"
}
}
}
}ツール
generate_video
テキストプロンプトまたは画像から動画を生成します。
パラメータ | 型 | 必須 | 説明 |
| string | 条件付き | 生成する動画の説明テキスト。T2V/R2V では必須、I2V(画像指定時)では省略可 |
| string | No | 出力ファイルパス(デフォルト: generated_video.mp4) |
| string | No | モデル(デフォルト: grok-imagine-video) |
| number | No | 動画長(1-15秒、デフォルト: 8) |
| string | No | アスペクト比(デフォルト: 16:9) |
| string | No | 解像度(480p/720p/1080p、デフォルト: 720p) |
| string | No | Image-to-Video用の入力画像URL |
| string | No | ローカル画像ファイルパス(base64 data URLとして送信。10MB超はFiles API経由で自動アップロード) |
| string | No | xAI Files API の File ID(Image-to-Video用) |
| array | No | Reference-to-Video用の参照画像(各要素は |
| array | No | R2V用のプリセットボイス(最大3件、各要素は |
注意:
image_url/image_path/image_file_idはいずれか1つのみ指定できます。また、画像(I2V)とreference_images/reference_audios(R2V)も同時指定できません。reference_audiosは単独指定(音声のみの R2V)も可能です。
edit_video
既存動画を編集します。
パラメータ | 型 | 必須 | 説明 |
| string | Yes | 編集内容の説明 |
| string | No* | 編集する動画のURL(公開アクセス可能、最大8.7秒) |
| string | No* | ローカル動画ファイルパス(.mp4、Files API 経由で自動アップロード) |
| string | No* | xAI Files API の File ID(*いずれか1つを指定) |
| string | No | 出力ファイルパス(デフォルト: edited_video.mp4) |
| string | No | モデル(デフォルト: grok-imagine-video) |
注意: 編集後の動画は元動画と同じ長さになります。
durationパラメータは編集時には指定できません。
extend_video
既存動画の続きを生成して延長します(grok-imagine-video 1.5)。
パラメータ | 型 | 必須 | 説明 |
| string | Yes | 続きで何が起こるかの説明 |
| string | No* | 延長する動画のURL(公開アクセス可能 or base64 data URL、.mp4) |
| string | No* | ローカル動画ファイルパス(.mp4、Files API 経由で自動アップロード) |
| string | No* | xAI Files API の File ID(*いずれか1つを指定) |
| string | No | 出力ファイルパス(デフォルト: extended_video.mp4) |
| string | No | モデル(デフォルト: grok-imagine-video) |
| number | No | 延長セグメントの長さ(2-10秒、デフォルト: 6) |
upload_file
ローカルの画像・動画ファイルを xAI Files API にアップロードし、file_id を取得します。ファイルは非公開のまま保存され、image_file_id / reference_images[].file_id / video_file_id として再利用できます(同じファイルを何度も送り直す必要がありません)。
パラメータ | 型 | 必須 | 説明 |
| string | Yes | アップロードするファイルのパス(画像: jpg/jpeg/png/gif/webp/bmp/tiff、動画: mp4、最大 48MB) |
バッチ処理 CLI
コマンド書式
grok-imagine-video-batch <config.json> [options]または npx 経由:
npx grok-imagine-video-batch <config.json> [options]基本的な使用例
# 設定ファイルでバッチ実行
npx grok-imagine-video-batch batch.json
# コスト見積もりのみ(実行しない)
npx grok-imagine-video-batch batch.json --estimate-only
# 出力先とフォーマットを指定
npx grok-imagine-video-batch batch.json --output-dir ./videos --format json
# ポーリング設定をカスタマイズ
npx grok-imagine-video-batch batch.json --poll-interval 10000 --max-poll-attempts 60
# 高並列実行(タイムアウト延長)
npx grok-imagine-video-batch batch.json --max-concurrent 5 --timeout 1800000
# ヘルプ表示
npx grok-imagine-video-batch --help
# バージョン表示
npx grok-imagine-video-batch --versionCLI オプション一覧
オプション | 短縮形 | 引数 | 説明 | デフォルト |
| - |
| 出力ディレクトリを上書き | 設定ファイルから |
| - |
| 出力フォーマット |
|
| - |
| タイムアウト(ミリ秒、最小1000) |
|
| - |
| 最大同時実行数(1-10) |
|
| - |
| ポーリング間隔(ミリ秒、最小1000) |
|
| - |
| 最大ポーリング回数 |
|
| - | - | コスト見積もりのみ(実行しない) | - |
| - | - | 任意の出力パスを許可(CI/CD用) | - |
|
| - | ヘルプメッセージ表示 | - |
|
| - | バージョン表示 | - |
終了コード
コード | 意味 |
| 成功(全ジョブ完了) |
| エラー(失敗またはキャンセルあり) |
バッチ設定ファイル
{
"jobs": [
{
"prompt": "猫がボールで遊んでいる",
"output_path": "cat_video.mp4",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p"
},
{
"prompt": "キャラクターが歩いているアニメーション",
"image_url": "https://example.com/character.jpg",
"output_path": "walking.mp4",
"duration": 10
},
{
"prompt": "ボールを大きくして",
"video_url": "https://example.com/video.mp4",
"output_path": "edited.mp4"
}
],
"output_dir": "./output",
"max_concurrent": 2,
"poll_interval": 5000,
"max_poll_attempts": 120,
"default_model": "grok-imagine-video",
"default_duration": 5,
"retry_policy": {
"max_retries": 2,
"retry_delay_ms": 1000
}
}ジョブ定義スキーマ
各ジョブは3種類のうち1つを指定します:
1. Text-to-Video(テキストから動画生成)
{
"prompt": "生成したい動画の説明",
"output_path": "output.mp4",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "720p",
"model": "grok-imagine-video"
}フィールド | 型 | 必須 | 説明 |
| string | Yes | 動画の説明テキスト |
| string | No | 出力ファイル名 |
| number | No | 動画長(1-15秒) |
| string | No | アスペクト比 |
| string | No | 解像度(720p/480p) |
| string | No | モデル名 |
2. Image-to-Video(画像から動画生成)
URL指定の場合:
{
"prompt": "画像をアニメーション化する説明",
"image_url": "https://example.com/image.jpg",
"output_path": "animated.mp4",
"duration": 5
}ローカルファイルの場合(base64 data URL):
{
"prompt": "画像をアニメーション化する説明",
"image_path": "./images/character.jpg",
"output_path": "animated.mp4",
"duration": 5
}フィールド | 型 | 必須 | 説明 |
| string | Yes | アニメーションの説明 |
| string | No* | 入力画像のURL(公開アクセス可能) |
| string | No* | ローカル画像ファイルパス(base64 data URLとして送信。10MB超はFiles API経由で自動アップロード) |
| string | No* | xAI Files API の File ID |
| string | No | 出力ファイル名 |
| number | No | 動画長(1-15秒) |
*
image_url/image_path/image_file_idのいずれか1つを指定(同時指定不可)
3. Reference-to-Video(参照画像から動画生成 / R2V)
{
"prompt": "アニメ風に歩くキャラクター",
"reference_images": [
{ "url": "https://example.com/style.jpg" },
{ "path": "./images/character.png" }
],
"output_path": "r2v.mp4",
"duration": 8
}フィールド | 型 | 必須 | 説明 |
| string | Yes | 動画の説明 |
| array | 条件付き | 参照画像(各要素は |
| array | 条件付き | プリセットボイス(最大3件、各要素は |
| string | No | 出力ファイル名 |
| number | No | 動画長(1-15秒) |
参照音声(プリセットボイス)を使う例:
{
"model": "grok-imagine-video-1.5",
"prompt": "<IMAGE_0> の人物が <AUDIO_0> の声で商品を紹介する",
"reference_images": [{ "path": "./images/person.png" }],
"reference_audios": [{ "voice_id": "eve" }],
"output_path": "r2v_voice.mp4",
"duration": 8
}画像(I2V)と
reference_images/reference_audios(R2V)は同時指定できません。reference_audios(プリセットボイス、最大3件)はgrok-imagine-video-1.5限定です。
4. Video Edit(動画編集)
{
"prompt": "編集内容の説明",
"video_url": "https://example.com/video.mp4",
"output_path": "edited.mp4"
}フィールド | 型 | 必須 | 説明 |
| string | Yes | 編集内容の説明 |
| string | No* | 編集する動画のURL(最大8.7秒) |
| string | No* | ローカル動画ファイルパス(.mp4、Files API 経由で自動アップロード) |
| string | No* | xAI Files API の File ID(*いずれか1つを指定) |
| string | No | 出力ファイル名 |
5. Video Extension(動画延長)
{
"operation": "extend",
"prompt": "カメラが引いて街並みが見える",
"video_url": "https://example.com/video.mp4",
"output_path": "extended.mp4",
"duration": 6
}フィールド | 型 | 必須 | 説明 |
| string | Yes |
|
| string | Yes | 続きで何が起こるかの説明 |
| string | No* | 延長する動画のURL |
| string | No* | ローカル動画ファイルパス(.mp4、Files API 経由で自動アップロード) |
| string | No* | xAI Files API の File ID(*いずれか1つを指定) |
| string | No | 出力ファイル名 |
| number | No | 延長セグメントの長さ(2-10秒、デフォルト6) |
video_url/video_path/video_file_idを持つジョブは既定で編集(edit)として扱われます。延長したい場合は"operation": "extend"を明示してください。
グローバル設定
フィールド | 型 | 説明 | デフォルト |
| string | 出力ディレクトリ |
|
| number | 最大同時実行数(1-10) |
|
| number | ポーリング間隔(ms) |
|
| number | 最大ポーリング回数 |
|
| string | デフォルトモデル |
|
| number | デフォルト動画長 |
|
| string | デフォルトアスペクト比 |
|
| string | デフォルト解像度 |
|
リトライポリシー
{
"retry_policy": {
"max_retries": 2,
"retry_delay_ms": 1000,
"retry_on_errors": ["rate_limit", "429", "500", "502", "503"]
}
}フィールド | 型 | 説明 | デフォルト |
| number | 最大リトライ回数 |
|
| number | リトライ間隔(ms) |
|
| string[] | リトライ対象エラー(エラーメッセージへの部分一致) |
|
service_unavailable と internal_error は xAI が「リトライすべき」と定義しているエラーコードです。
invalid_argument / permission_denied / failed_precondition はリクエスト内容の問題なのでリトライしません。
設定例は examples/ ディレクトリを参照してください:
batch-simple.json- 基本的な動画生成batch-image-to-video.json- 画像からの動画生成(URL指定)batch-local-images.json- ローカル画像からの動画生成batch-reference-to-video.json- 参照画像からの動画生成(R2V)batch-reference-voice.json- 参照画像+プリセットボイス/音声のみの R2V(grok-imagine-video-1.5)batch-with-edits.json- 動画編集チェーンbatch-extend.json- 動画延長(Extension)batch-social-media.json- SNS向けフォーマット
サポートされているアスペクト比
アスペクト比 | 用途例 |
| 横長ワイドスクリーン、YouTube(デフォルト) |
| 標準的な横長 |
| 正方形、Instagram |
| 縦長、TikTok、Reels、Stories |
| 縦長 |
| 写真比率 |
サポートされている解像度
解像度 | 説明 |
| フルHD画質( |
| HD画質(デフォルト) |
| 標準画質 |
動画長の制限
操作 | 最小 | 最大 | デフォルト |
生成(Text/Image/Reference-to-Video) | 1秒 | 15秒 | 8秒 |
編集 | - | 8.7秒 | 元動画と同じ |
延長(Extension) | 2秒 | 10秒 | 6秒 |
料金
動画 1 秒あたりの単価(USD)。1秒ジョブの usage.cost_in_usd_ticks から実測(2026-07-31)。
モデル | 480p | 720p | 1080p |
| $0.05 | $0.07 | 非対応 |
| $0.08 | $0.14 | $0.25 |
実課金額はジョブごとに
usage.cost_in_usd_ticksとして返り、結果表示に含まれますバッチ CLI の
--estimate-onlyはこの表で事前見積もりを出します(編集は 720p 単価で概算)参照画像・参照音声・入力画像・入力動画にも課金されるため、R2V の実額は上表の単価をやや上回ります(実測例: 1.5 / 480p / 1秒 / 参照画像1枚 + ボイス1件 = $0.09)
非同期処理について
Video APIは非同期で動作します:
リクエスト送信: 動画生成/編集リクエストを送信
request_id 取得: APIから
request_idが返されるポーリング: 定期的に結果を確認(デフォルト: 5秒間隔)
結果取得: 完了後、動画URLを取得してダウンロード
POST /v1/videos/generations → { request_id: "abc123" }
↓
GET /v1/videos/abc123 → { status: "pending" } → 待機
↓
GET /v1/videos/abc123 → { status: "completed", url: "..." } → ダウンロードstatus は pending / done(旧 completed) / failed / expired のいずれかです。
failed と expired は終端としてポーリングを打ち切り、エラーを返します(expired はリクエストの保持期限切れで、再送信が必要)。
使用例
# テキストから動画生成
「猫がボールで遊んでいる」の5秒動画を16:9で生成して
# 画像から動画生成
この画像のキャラクターを歩かせる動画を作って
# 動画編集
この動画の背景を夜に変更してAPI リファレンス
機能 | エンドポイント |
動画生成(T2V/I2V/R2V) |
|
動画編集 |
|
動画延長 |
|
結果取得 |
|
ドキュメント: docs.x.ai
開発
git clone https://github.com/ex-takashima/grok-imagine-video-mcp-server.git
cd grok-imagine-video-mcp-server
npm install
npm run build
npm start開発用コマンド
# ビルド
npm run build
# ウォッチモード
npm run dev
# バッチCLI実行
npm run batch -- examples/batch-simple.json --estimate-onlyトラブルシューティング
ポーリングがタイムアウトする
動画生成には時間がかかる場合があります。以下を試してください:
# ポーリング回数を増やす
npx grok-imagine-video-batch batch.json --max-poll-attempts 200
# タイムアウトを延長
npx grok-imagine-video-batch batch.json --timeout 1200000Rate Limit エラー
並列数を減らすか、リトライ設定を調整してください:
{
"max_concurrent": 1,
"retry_policy": {
"max_retries": 3,
"retry_delay_ms": 5000,
"retry_on_errors": ["rate_limit", "429"]
}
}関連プロジェクト
grok-imagine-image-mcp-server - 画像生成用MCP Server
ライセンス
MIT
作者
Junji Takashima takajyun00@gmail.com
Available Tools
4 toolsedit_videoA
Edit an existing video using xAI Grok Imagine Video API. Provide a source video URL along with a prompt describing the desired changes. The maximum supported video length is 8.7 seconds. The edited video will have the same duration as the original.
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model to use (default: grok-imagine-video). grok-imagine-video-1.5 does not support editing and returns "Video editing is not supported for this model.". | |
| prompt | Yes | Description of the desired edits to make to the video | |
| video_url | No | URL of the source video to edit (must be publicly accessible, max 8.7 seconds). Provide exactly one of video_url, video_path, or video_file_id. | |
| video_path | No | Local video file path (.mp4). Uploaded to the xAI Files API automatically. Provide exactly one of video_url, video_path, or video_file_id. | |
| output_path | No | Output file path (default: edited_video.mp4) | |
| video_file_id | No | File ID of the source video from the xAI Files API. Provide exactly one of video_url, video_path, or video_file_id. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses the 8.7-second maximum length and the fact that the edited video has the same duration as the original, which are useful behavioral details. However, it omits the model parameter caveat (grok-imagine-video-1.5 does not support editing) and does not describe error handling or processing behavior, leaving significant gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences long, each adding value: it states the purpose, gives a usage instruction, and lists key constraints. It is front-loaded with the core action and contains no fluff or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 6 parameters, no annotations, and no output schema, the description covers the essential behavior (editing existing video), key constraints (8.7s max, same duration), and offers a usage hint. However, it does not mention the model caveat or the exclusive-or relationship between video_url, video_path, and video_file_id, though these are present in the schema. It is fairly complete but not exhaustive.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description does not add much beyond the schema; it mentions providing a 'source video URL along with a prompt,' but the schema already documents all parameters and their constraints, including the mutually exclusive video source fields and the 8.7-second limit. The description adds no new parameter semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the function: 'Edit an existing video' using the xAI Grok Imagine Video API. It also specifies key constraints (max 8.7 seconds, same output duration) that distinguish it from sibling tools like generate_video and extend_video, which create or extend videos rather than edit them.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description establishes a clear context: it is for editing an existing video. This implicitly differentiates it from siblings that generate, extend, or upload videos. However, it does not explicitly state when not to use this tool or name alternative tools, so it lacks explicit exclusion criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
extend_videoA
Extend an existing video by generating continuation content using xAI Grok Imagine Video API. Provide a source video URL and a prompt describing what should happen next. The extension segment duration is 1-10 seconds (default 6).
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model to use (default: grok-imagine-video). grok-imagine-video-1.5 does not support extension and returns "Video extension is not supported for this model.". | |
| prompt | Yes | Description of what should happen next in the video | |
| duration | No | Duration of the extension segment in seconds (1-10, default: 6) | |
| video_url | No | URL of the source video to extend (public URL or base64 data URL, .mp4). Provide exactly one of video_url, video_path, or video_file_id. | |
| video_path | No | Local video file path (.mp4). Uploaded to the xAI Files API automatically. Provide exactly one of video_url, video_path, or video_file_id. | |
| output_path | No | Output file path (default: extended_video.mp4) | |
| video_file_id | No | File ID of the source video from the xAI Files API. Provide exactly one of video_url, video_path, or video_file_id. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must carry behavioral disclosure. It explains the core action and duration range but omits details like authentication, rate limits, side effects (e.g., file uploads for video_path), and failure modes. The model compatibility caveat is only in the schema, not the description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the purpose, and contains no filler. It is appropriately sized for the tool's complexity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the basic workflow but does not mention the three mutually exclusive source options (video_url, video_path, video_file_id) or the output_path. It also omits that model grok-imagine-video-1.5 does not support extension. While the schema fills many gaps, the description alone would leave users uncertain about the full input flexibility.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the description needs to add limited extra meaning. It mentions source URL and prompt, but the schema already describes each parameter fully. The 'default 6' is also already in the schema, so the description adds no novel semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Extend') and resource ('an existing video'), clearly distinguishing it from siblings like generate_video and edit_video. It also names the underlying API, adding specificity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It provides clear context: use for extending an existing video with a prompt. It does not explicitly contrast with generate_video or edit_video, but the context is unambiguous. No exclusions are stated, so not a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_videoA
Generate a new video using xAI Grok Imagine Video API (grok-imagine-video). Supports text-to-video (T2V), image-to-video (I2V), and reference-to-video (R2V). Supports aspect ratios: 16:9, 4:3, 1:1, 9:16, 3:4, 3:2, 2:3. Video duration: 1-15 seconds (default 8). Resolution: 480p, 720p, or 1080p (1080p only with model grok-imagine-video-1.5). The output MP4 always contains an auto-generated audio track (sound effects, ambience, score) driven by the prompt; there is no audio parameter. For image-to-video, provide image_url, image_path, or image_file_id. For reference-to-video, provide reference_images.
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model to use (default: grok-imagine-video) | |
| prompt | No | Text prompt describing the video. Required for text-to-video and reference-to-video; optional for image-to-video (image alone drives generation). | |
| duration | No | Video duration in seconds (1-15, default: 8) | |
| image_url | No | Source image URL for image-to-video generation (optional) | |
| image_path | No | Local image file path for image-to-video generation. Sent as a base64 data URL; files over 10 MB are uploaded via the xAI Files API automatically (max 48 MB). Cannot be used together with image_url or image_file_id. | |
| resolution | No | Resolution of the generated video (default: 720p). 1080p is only available with model grok-imagine-video-1.5 (text-to-video and image-to-video). | |
| output_path | No | Output file path (default: generated_video.mp4) | |
| aspect_ratio | No | Aspect ratio (default: 16:9) | |
| image_file_id | No | File ID from the xAI Files API for image-to-video generation. Cannot be used together with image_url or image_path. | |
| reference_images | No | Reference images for reference-to-video (R2V) generation, used as style/content references. Cannot be combined with image_url/image_path/image_file_id. Requires model grok-imagine-video; grok-imagine-video-1.5 rejects R2V. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and does so thoroughly. It discloses that the output MP4 always includes an auto-generated audio track with no audio parameter, explains resolution restrictions (1080p only with certain model), mentions automatic file upload for large image_path, and clarifies incompatibilities between input methods. This is substantial behavioral context beyond the schema.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single dense paragraph but every sentence contributes necessary details (modes, aspect ratios, duration, resolution, audio behavior, input requirements). It is front-loaded with the primary purpose. While it could be broken into bullets, the length is justified given the tool's complexity, and there is no fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 10 parameters and no output schema, the description covers most behavioral aspects: modes, constraints, and input options. The main gap is that it does not explicitly state the return value or side effects (e.g., returns the output file path, uploads to Files API). Despite this, it provides enough context for an agent to invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, giving a baseline of 3. The description adds value by clarifying parameter interdependencies (e.g., prompt required for T2V/R2V, optional for I2V), model-specific restrictions (1080p, R2V availability), and the behavior of image_path (base64 upload path). This enriches the schema without being redundant.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Generate a new video using xAI Grok Imagine Video API,' which clearly states the action (generate) and resource (new video), and distinguishes this from sibling tools like edit_video and extend_video since it creates a new video. It further lists supported modes (T2V, I2V, R2V), providing a precise scope.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to use each mode (e.g., 'For image-to-video, provide image_url, image_path, or image_file_id') and states model-specific constraints, but it does not explicitly compare against sibling tools or provide 'when not to use' guidance. The context is clear and actionable, but lacks explicit exclusions or alternative tool references.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
upload_fileA
Upload a local image or video file to the xAI Files API and get a file_id. The file stays private; the returned file_id can be used as input for generate_video (image_file_id, reference_images[].file_id), edit_video, and extend_video (video_file_id). Useful for reusing the same asset across multiple calls without re-uploading. Supported: images (jpg/jpeg/png/gif/webp/bmp/tiff) and videos (mp4), max 48 MB.
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Local path of the image or video file to upload |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full transparency burden. It discloses that the file stays private, returns a file_id, and supports specific formats/size limits. While it doesn't discuss persistence or side effects, the information provided is sufficient for safe use of a basic upload operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and front-loaded: the first sentence gives the core purpose, followed by useful context on privacy, reuse, and constraints. Every sentence adds necessary information with no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with a single parameter, no output schema, and no annotations, the description fully covers purpose, return value, privacy, supported formats, size limit, and downstream usage. It is complete and self-sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already covers file_path with a clear description (100% coverage). The description adds value by specifying allowed file types and the 48 MB limit, which gives the agent practical constraints beyond the raw schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Upload a local image or video file'), the target resource ('xAI Files API'), and the primary output ('get a file_id'). It also distinguishes itself from sibling tools (generate_video, edit_video, extend_video) by positioning the file_id as reusable input for those tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to use it ('reusing the same asset across multiple calls without re-uploading') and specifies constraints (supported formats, max size). It does not explicitly state when not to use it or mention alternative methods, but the context is clear enough for a simple upload tool.
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.
4 tool updates
v1.8.0- First observed
edit_video - First observed
extend_video - First observed
generate_video - First observed
upload_file
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: generate creates new videos, edit modifies existing ones, extend continues them, and upload_file handles file ingestion. No overlap or ambiguity.
All tool names follow a consistent verb_noun pattern in snake_case (generate_video, edit_video, extend_video, upload_file). The pattern is uniform and predictable.
With 4 tools, the server is well-scoped for video generation. Each tool serves a necessary core function without redundancy or bloat.
The tool set covers the full video lifecycle: generate, edit, extend, and upload. There are no obvious missing operations for the stated domain.
Maintenance
Related MCP Connectors
MCP server for Grok Imagine AI video generation
MCP server for Google Veo AI video generation
MCP server for Kling AI video generation
MCP server for Hailuo (MiniMax) AI video generation
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server for generating and editing images using xAI's Grok image model, supporting text prompts, batch generation, local files, and optional proxy configurations.219 npm29MIT
- AlicenseAqualityBmaintenanceOne MCP server for music, image, video, and audio generation across Suno, Grok Imagine, Seedance, Kling, Hailuo, Wan, VEO, Ideogram, and GPT Image 2. Generate, edit, upscale, reframe, and master through one API key and one credit pool.1692 npm6MIT
- AlicenseAqualityCmaintenanceMCP server for Google Veo 3.1 video generation. Supports text/video/image-based generation, extension, and interpolation with cost estimation and batch processing.411 npm1MIT
- AlicenseAqualityAmaintenanceAn MCP server for Grok (xAI) that enables chat, reasoning, vision, and video generation using the AceDataCloud API.81MIT