grok-imagine-mcp
v0.2.3RunAPI MCP server for Grok Imagine: create tasks, poll status, check pricing.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
login
Authenticate RunAPI by opening a browser PKCE login flow and saving the API key to ~/.config/runapi/config.json.
| Parameter | Type | Description |
|---|---|---|
force | boolean | Re-run browser login when the current credential comes from the local config file. |
edit_image
Create a Grok Imagine task on RunAPI (edit image). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
aspect_ratio | string | Declared type: string. |
callback_url | string | Webhook URL for terminal Task delivery. Declared type: string. |
enable_safety_checker | boolean | Enable content safety checks. Declared type: boolean. |
mask_indices | Not accepted by this model. | |
model | string | RunAPI model slug for this model line. |
poll_interval_ms | integer | |
prompt | string | Optional image editing instruction. Declared type: string. |
source_image_url | string | Public source image URL. Declared type: string. |
source_image_urls | array | Declared type: array. |
source_task_id | Not accepted by this model. | |
timeout_ms | integer | |
wait | boolean | Poll until the task reaches a terminal status. |
extend_video
Create a Grok Imagine task on RunAPI (extend video). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
extension_duration_seconds * | integer | Extension duration in seconds. Declared type: integer. Known values: 6, 10. |
prompt * | string | Video continuation prompt. Declared type: string. |
source_task_id * | string | Completed prior Grok Imagine video Task ID. Declared type: string. |
start_seconds * | integer | Source video position in seconds where extension begins. Declared type: integer. |
callback_url | string | Webhook URL for terminal Task delivery. Declared type: string. |
poll_interval_ms | integer | |
timeout_ms | integer | |
wait | boolean | Poll until the task reaches a terminal status. |
image_to_video
Create a Grok Imagine task on RunAPI (image to video). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
aspect_ratio | string | Output aspect ratio. Declared type: string. Known values: "2:3", "3:2", "1:1", "16:9", "9:16", "auto". |
callback_url | string | Webhook URL for terminal Task delivery. Declared type: string. |
duration_seconds | integer | Output duration in seconds. Declared type: integer. |
enable_safety_checker | boolean | Enable content safety checks. Declared type: boolean. |
index | integer | Zero-based source image index; used only with source_task_id. Declared type: integer. |
model | string | RunAPI model slug for this model line. |
motion_style | string | Video motion style; spicy requires source_task_id. Declared type: string. |
output_resolution | string | Output resolution. Declared type: string. Known values: "480p", "720p", "1080p". |
poll_interval_ms | integer | |
prompt | string | Optional video generation prompt. Declared type: string. |
reference_image_urls | array | Not accepted by this model. Declared type: array. |
source_image_url | string | Public source image URL; provide this or source_task_id, but not both. Declared type: string. |
source_task_id | string | Prior Grok Imagine text-to-image Task ID; provide this or source_image_url, but not both. Declared type: string. |
timeout_ms | integer | |
wait | boolean | Poll until the task reaches a terminal status. |
segment_map
Create a Grok Imagine task on RunAPI (segment map). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
callback_url | string | Webhook URL for terminal Task delivery. Declared type: string. |
image_url | string | Public image URL that the service can fetch. Declared type: string. |
model | string | RunAPI model slug for this model line. |
poll_interval_ms | integer | |
source_task_id | string | Completed Image 2.0 text-to-image Task ID owned by the same account. Compatibility input; use image_url instead. Declared type: string. |
timeout_ms | integer | |
wait | boolean | Poll until the task reaches a terminal status. |
text_to_image
Create a Grok Imagine task on RunAPI (text to image). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | Image generation prompt. Declared type: string. |
aspect_ratio | string | Output aspect ratio. Declared type: string. Known values: "1:1", "2:3", "3:2", "16:9", "9:16". |
callback_url | string | Webhook URL for terminal Task delivery. Declared type: string. |
enable_pro | boolean | Not accepted by this model. Declared type: boolean. |
enable_safety_checker | boolean | Not accepted by this model. Declared type: boolean. |
model | string | RunAPI model slug for this model line. |
poll_interval_ms | integer | |
timeout_ms | integer | |
wait | boolean | Poll until the task reaches a terminal status. |
text_to_video
Create a Grok Imagine task on RunAPI (text to video). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | Video generation prompt. Declared type: string. |
aspect_ratio | string | Output aspect ratio. Declared type: string. Known values: "2:3", "3:2", "1:1", "16:9", "9:16", "auto". |
callback_url | string | Webhook URL for terminal Task delivery. Declared type: string. |
duration_seconds | integer | Output duration in seconds. Declared type: integer. |
enable_safety_checker | boolean | Enable content safety checks. Declared type: boolean. |
model | string | RunAPI model slug for this model line. |
motion_style | string | Video motion style. Declared type: string. |
output_resolution | string | Output resolution. Declared type: string. Known values: "480p", "720p", "1080p". |
poll_interval_ms | integer | |
reference_image_urls | array | Not accepted by this model. Declared type: array. |
timeout_ms | integer | |
wait | boolean | Poll until the task reaches a terminal status. |
upscale_image
Create a Grok Imagine task on RunAPI (upscale image). Returns a task id, status, and output URLs.
| Parameter | Type | Description |
|---|---|---|
source_task_id * | string | Completed prior Grok Imagine video Task ID. Declared type: string. |
callback_url | string | Webhook URL for terminal Task delivery. Declared type: string. |
poll_interval_ms | integer | |
timeout_ms | integer | |
wait | boolean | Poll until the task reaches a terminal status. |
get_task
Fetch the current status and latest result payload for a grok-imagine task.
| Parameter | Type | Description |
|---|---|---|
action * | string | Asynchronous endpoint the task was created on. |
task_id * | string | Task id returned when the task was created. |
check_pricing
Look up RunAPI pricing for the grok-imagine model line.
| Parameter | Type | Description |
|---|---|---|
action | string | Endpoint name. Defaults to the endpoint that offers the model. |
model | string | Model slug. Defaults to the line's primary model. |