grok-video-mcp
Click on "Install 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-video-mcpGenerate a video of a golden retriever running on a beach."
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-media-mcp
MCP server that gives AI agents xAI Grok media generation — images and video. Submit a prompt, get a real file back. Works with OpenCode, Claude Desktop, Cursor, VS Code, and any MCP client.
Companion to vision-mcp: one agent can generate a clip or image and verify it — a full media loop.
Why
Text-based agents can't generate media. grok-media-mcp exposes xAI's
grok-imagine-video and grok-imagine-image models as plain MCP tools so any
agent can produce real images and video clips from a prompt — no shell
scripts, no manual API calls, no hand-rolled polling loops.
Related MCP server: mcp-media-engine
Tools
Tool | What it does |
| Submit a generation → returns |
| Poll: |
| Download the finished clip to disk |
| Submit + poll + download in one call (agent-friendly) |
| Generate an image — synchronous, returns the saved file path (~10-30s, ~$0.06) |
Requirements
Node.js ≥ 18
An xAI API key — https://console.x.ai (or docs.x.ai)
Install
npx from GitHub (recommended)
npx -y github:pongsakornp/grok-media-mcpnpx clones the repo, installs deps, auto-builds via the
preparescript, and runs the server over stdio.
From source
git clone https://github.com/pongsakornp/grok-media-mcp.git
cd grok-media-mcp
npm install
npm run buildUsage
OpenCode (opencode.jsonc)
{
"mcp": {
"grok-media-mcp": {
"type": "local",
"command": ["npx", "-y", "github:pongsakornp/grok-media-mcp"],
"environment": {
"XAI_API_KEY": "xai-..."
},
"enabled": true
}
}
}Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"grok-media-mcp": {
"command": "npx",
"args": ["-y", "github:pongsakornp/grok-media-mcp"],
"env": {
"XAI_API_KEY": "xai-..."
}
}
}
}VS Code / Cursor (.vscode/mcp.json)
{
"servers": {
"grok-media-mcp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "github:pongsakornp/grok-media-mcp"],
"environment": {
"XAI_API_KEY": "xai-..."
}
}
}
}Keys live in the MCP config — no shell profile edits needed.
Configuration
Env var | Default | Description |
| — | required — xAI API key |
|
| Model ( |
|
| Image model ( |
|
| Where media is saved |
|
| Max wait for a generation |
|
| Initial poll interval |
|
| Max poll interval (×1.5 backoff) |
How it works
Video — xAI's video API is async:
POST /v1/videos/generations → { request_id }
GET /v1/videos/{request_id} → poll until status: "done"
GET video.url → mp4 bytesgenerate_and_wait encapsulates submit → poll (5s→30s backoff, progress
reported) → download → save, returning the file path.
Images — synchronous, one call:
POST /v1/images/generations → { data: [{ url, mime_type }], usage }
GET image.url → jpeg/png bytesgenerate_image encapsulates generate → download → save in one call.
(Verified live: 1248×832 output, ~30s, ~$0.06/image.)
Pricing: video roughly $0.005 per second ($0.04 for an 8s clip),
images **$0.06 each** — an order of magnitude cheaper than Google Veo Lite
($0.05–0.08/s).
Development
npm run build # TypeScript → dist/
npm test # 28 tests (vitest)
npm run typecheck # tsc --noEmitTest coverage: config parsing, video + image request/response mapping (mocked fetch), polling backoff/timeout/FAILED handling, and the full MCP stdio protocol.
License
MIT — see LICENSE.
Available Tools
4 toolsgenerate_and_waitGenerate video and waitA
Submit a Grok video generation, poll until complete (up to timeoutSeconds), and return the downloaded file path. The one-call convenience for agents.
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Text description of the video to generate | |
| duration | No | Duration in seconds (default 8) | |
| resolution | No | Resolution (grok-imagine-video-1.5 supports 1080p) | |
| aspectRatio | No | Aspect ratio (default 16:9) | |
| timeoutSeconds | No | Max wait in seconds (default 900) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations supplied, the description carries the burden of behavioral disclosure. It reveals that the tool polls and downloads a file, but it does not disclose what happens on timeout or generation failure, whether files are temporary or persistent, or if any cleanup is needed. This is partial transparency, not a contradiction.
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: a terse operational summary and a positioning sentence. It front-loads the core actions (submit, poll, return path) and avoids redundant detail. Every sentence earns its place.
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 tool has no output schema, so mentioning 'return the downloaded file path' is essential and done. Given the composite nature (generate + poll + download), the description covers the main workflow but omits failure behavior, timeout consequences, and any prerequisites. Still, for an agent, the essential contract is clear enough to invoke correctly in most cases.
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 schema already describes all parameters with 100% coverage. The description only references timeoutSeconds ('up to timeoutSeconds') without adding new meaning beyond what the schema states. It does not clarify parameter interactions or defaults beyond the schema. Baseline 3 is appropriate.
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 a specific verb-resource-action: 'Submit a Grok video generation, poll until complete, and return the downloaded file path.' This distinguishes it from siblings like generate_video (submit only) or get_generation (poll only), especially with the 'one-call convenience' framing.
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 says 'The one-call convenience for agents,' which implies using this tool instead of manually chaining generate_video and polling. It also mentions the timeoutSeconds bound. However, it does not explicitly name sibling tools or state when NOT to use this tool (e.g., when you don't want to wait).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_videoGenerate videoA
Submit a Grok video generation from a text prompt. Returns a requestId to poll with get_generation and download with get_video. Generation takes 1-5 minutes. ~$0.005/sec.
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Text description of the video to generate | |
| duration | No | Duration in seconds (default 8) | |
| resolution | No | Resolution (grok-imagine-video-1.5 supports 1080p) | |
| aspectRatio | No | Aspect ratio (default 16:9) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the transparency burden. It discloses that generation is asynchronous (returns a requestId), takes 1-5 minutes, and costs ~$0.005/sec. These are important behavioral traits beyond the schema. It does not cover failure handling or permissions, but the key operational facts are present.
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, front-loaded with the primary action, and every sentence adds value: the operation, the follow-up flow, and operational constraints (time and cost). There is no wasted wording.
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 the lack of output schema and annotations, the description covers the core workflow (submit, poll, download), timing, and cost. It could explicitly mention the synchronous alternative generate_and_wait, but overall it provides sufficient context for an agent to invoke the tool correctly and understand what to expect.
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 has 100% coverage with descriptions for all parameters, so the baseline is 3. The description adds no additional parameter-level detail beyond what the schema provides, but none is needed since the schema already explains prompt, duration, resolution, and aspect ratio.
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 'Submit' and identifies the resource 'Grok video generation', making the tool's function unmistakable. It distinguishes itself from siblings by stating it returns a requestId to poll with get_generation and download with get_video.
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 provides an explicit workflow: submit the prompt, then poll and download using the specified sibling tools. This clearly implies when to use this tool (to initiate generation). It does not mention generate_and_wait as a synchronous alternative, but the core usage context is well established.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_generationGet generation statusA
Poll the status of a Grok video generation by requestId. Returns PENDING, COMPLETED, or FAILED with progress when available.
| Name | Required | Description | Default |
|---|---|---|---|
| requestId | Yes | Request ID from generate_video |
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 does disclose the return values (PENDING, COMPLETED, FAILED) and progress availability, which is useful. However, it does not explicitly state that this is a read-only operation or mention error behaviors (e.g., unknown requestId), leaving some 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 two concise sentences, front-loaded with the primary action and resource, followed by the return behavior. Every word earns its place with no redundancy or 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?
For a simple polling tool with one parameter and no output schema, the description adequately covers the purpose, parameter, and return values. It could mention failure cases or authentication, but given the tool's simplicity, this is sufficiently complete.
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% and the 'requestId' parameter is well-described as 'Request ID from generate_video'. The description does not add any additional parameter semantics beyond what the schema already provides, so the baseline score of 3 is appropriate.
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 ('Poll') and resource ('Grok video generation') plus a unique identifier ('by requestId'). It clearly distinguishes from siblings like 'generate_video' and 'get_video' by focusing on status checking rather than creation or retrieval of the video.
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 implies a use-case (polling an asynchronous generation), but it does not explicitly mention alternatives or when not to use this tool. It lacks the explicit 'use X instead' guidance seen in high-quality examples, so this is adequate but not exemplary.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_videoGet videoA
Download a completed Grok video generation to disk. Returns the file path. Requires the generation to be COMPLETED.
| Name | Required | Description | Default |
|---|---|---|---|
| outDir | No | Optional output directory (default: ~/.grok-video-mcp/output) | |
| requestId | Yes | Request ID from generate_video |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the burden. It discloses the core behavior (download to disk, returns file path) and the completion requirement. However, it does not mention error behavior if called too early, file overwrite rules, or directory creation. For a simple download tool, this is acceptable but not rich.
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?
Three short, front-loaded sentences with no redundant phrases. Directly states the action, return value, and precondition.
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 simple download tool with only two parameters and no output schema, the description covers the essential purpose, return value, and prerequisite. It lacks some edge-case details but is sufficient for an agent to select and invoke correctly, especially with the schema providing param semantics.
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%, with both parameters documented (output directory with default, requestId from generate_video). The description adds no additional parameter details; the schema already provides semantic meaning.
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 a specific action ('Download a completed Grok video generation to disk') and identifies the resource. It distinguishes get_video from sibling tools: generate_video creates, get_generation likely fetches status, while get_video downloads the actual file.
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 states a clear precondition ('Requires the generation to be COMPLETED'), implying it should be used after generation finishes. However, it does not explicitly name alternatives or state when not to use it, so it's not as direct as a tool that says 'use generate_video to create, get_video to download'.
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
v0.1.0- First observed
generate_and_wait - First observed
generate_video - First observed
get_generation - First observed
get_video
TDQS
Scored across 4 tools
Each tool has a clear, distinct role: generate_video submits, get_generation polls status, get_video downloads, and generate_and_wait combines these steps. The purpose of each is unambiguous, even with the convenience wrapper.
Most tools follow a clear verb_noun pattern (generate_video, get_generation, get_video). generate_and_wait deviates with a compound verb phrase, but the style is still consistent and readable.
Four tools is ideal for a focused video generation service: submit, poll, download, and a convenience flow. Each tool earns its place without bloat.
The tool surface covers the full lifecycle of video generation: submit, check status, retrieve result, and a one-call convenience. No obvious gaps remain for the stated purpose.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for Grok Imagine AI video generation
MCP server for Hailuo (MiniMax) AI video generation
MCP server for OpenAI Sora AI video generation
MCP server for Kling AI video generation
Related MCP Servers
- AlicenseAqualityAmaintenanceUse XAI's latest api functionalities with Grok MCP. It supports image understanding and generation, live search, latest models and more.2251MIT
- AlicenseAqualityBmaintenanceMCP server for AI-powered image, audio, and video generation, enabling media creation directly from Claude, Cursor, and other MCP clients.1164MIT
- AlicenseAqualityBmaintenanceMCP server for generating, editing, and batch processing videos using xAI's Grok Imagine Video API, with support for text-to-video, image-to-video, and video editing via natural language prompts.4451MIT
- AlicenseNot gradedqualityDmaintenanceA single-file MCP server that enhances Claude Desktop with real-time web and X search, multi-tool agent, and image/video generation via xAI's Grok.MIT