Grok MCP Integration Guide

Grok MCP provides two types of operations. The chat tool can handle questions and message histories; the video tools can generate videos from text or reference images and retrieve the generation results.

Connect to the hosted service

Select remote MCP (Streamable HTTP) in the client and enter https://grok.mcp.acedata.cloud/mcp as the server address. After selecting OAuth, follow the browser prompts to log in to 零壹AI and authorize access.

Client How to connect
Claude / Claude Desktop Add a custom connector under “Customize → Connectors”, paste the server address, and log in.
Claude Code Run claude mcp add --transport http --scope user grok https://grok.mcp.acedata.cloud/mcp, open /mcp in the session, select the server, and complete authorization.
Codex CLI Run codex mcp add grok --url https://grok.mcp.acedata.cloud/mcp, then run codex mcp login grok.
Cursor Create a new HTTP server in the MCP settings, enter the address, and log in when prompted during connection.
VS Code Run MCP: Add Server from the command palette, select HTTP and enter the address, then use MCP: List Servers to check the status.

If using an application API Key, select the application used for Grok on the application management page, check that the allowed APIs cover the chat, video generation, or task query endpoints you intend to use, and confirm the balance. Set the request header to Authorization: Bearer <application API Key> in the client's private credential settings. Applications and API Keys

Use an application key with Gemini CLI and OpenCode

First, set the environment variable ACEDATACLOUD_API_TOKEN to the application API Key in the terminal where you launch the client. The following commands use macOS or Linux shell quoting and save the variable reference.

Client How to connect
Gemini CLI Run gemini mcp add --scope user --transport http grok https://grok.mcp.acedata.cloud/mcp --header 'Authorization: Bearer ${ACEDATACLOUD_API_TOKEN}', then check with gemini mcp list.
OpenCode 2.x Run opencode mcp add grok --global --url https://grok.mcp.acedata.cloud/mcp --header 'Authorization=Bearer {env:ACEDATACLOUD_API_TOKEN}', then run opencode reload and opencode mcp list.

For OpenCode 1.x, you can add a service named grok to the mcp object in your personal opencode.json, set type to remote, url to the address above, oauth to false, and headers.Authorization to Bearer {env:ACEDATACLOUD_API_TOKEN}. OpenCode 1.x configuration

Connect locally via stdio

Install uv, open the local MCP configuration in Claude Desktop's developer settings, and merge the following entry into the user configuration. Replace the placeholder with the application API Key, save, and restart the client. Other clients that support stdio can also run the uvx mcp-grok command and pass the key to the process as an environment variable.

{
  "mcpServers": {
    "grok": {
      "command": "uvx",
      "args": [
        "mcp-grok"
      ],
      "env": {
        "ACEDATACLOUD_API_TOKEN": "YOUR_API_KEY"
      }
    }
  }
}

The local process still calls the 零壹AI API. Store the key in your personal client configuration or credential manager. mcp-grok package

Verify the connection and available tools

Open the client's tool list, find Grok, and first ask the assistant to call grok_list_models and list the chat and video models separately. This query can check whether the client has loaded the tools without submitting a service request.

Purpose Tool Usage
Chat grok_chat_completions Pass messages containing role and content. The tool returns the complete response at once; omit stream or set it to false.
Generate video from text or images grok_text_to_video, grok_image_to_video Text-to-video requires a prompt; image-to-video requires an image_url and can include a motion description.
Query video tasks grok_get_task, grok_get_tasks_batch Query using the task_id returned upon submission, or query multiple IDs at once.
Select models and write prompts grok_list_models, grok_list_actions, grok_get_prompt_guide Check the inputs supported by each model, then select the video tool and parameters.

Usage examples

If the goal is to write a storyboard, enter “Use grok_chat_completions to write three storyboard descriptions for a street after the rain” to the assistant, and read the text directly from the chat result.

If the goal is to generate a video, enter “Use Grok to turn my reference image into a video where the camera slowly moves forward.” Use an accessible image URL as image_url, and have the assistant select a model that supports image-to-video generation. If the response contains a pending task_id, use grok_get_task to query the same task and retrieve the video URL when it succeeds; if it fails, check the task's error information.

Before making an actual call, you can check current pricing and availability on the service page. Grok service · Chat API · Video generation API · Task query API