> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acedata.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Grok MCP integration guide

> grok MCP server integration

Grok MCP provides two types of tools. Conversation tools handle questions and message history; video tools generate videos from text or reference images and retrieve generation results.

## Connect to the hosted service

In your client, select remote MCP (Streamable HTTP) and enter `https://grok.mcp.acedata.cloud/mcp` as the server address. Select OAuth, then follow the browser prompts to sign in to Ace Data Cloud and authorize access.

| Client | How to connect |
| - | - |
| Claude / Claude Desktop | Under “Customize → Connectors,” add a custom connector, paste the server address, and sign in. |
| Claude Code | Run `claude mcp add --transport http --scope user grok https://grok.mcp.acedata.cloud/mcp`, then 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 follow the prompts to sign in when connecting. |
| 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 its allowed APIs include the conversation, video generation, or task query endpoints you intend to use, and confirm the balance. In the client's private credential settings, set the request header to `Authorization: Bearer &lt;应用 API Key>`. [Applications and API Keys](https://platform.acedata.cloud/console/applications)

### Using 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 a reference to the variable.

| 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 use `gemini mcp list` to check. |
| 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, 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](https://opencode.ai/v1/docs/mcp-servers/)

## Connect locally via stdio

Install uv, open the local MCP configuration in Claude Desktop's developer settings, and merge the following entries into your user configuration. Replace the placeholder with your 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.

```json theme={null}
{
  "mcpServers": {
    "grok": {
      "command": "uvx",
      "args": [
        "mcp-grok"
      ],
      "env": {
        "ACEDATACLOUD_API_TOKEN": "YOUR_API_KEY"
      }
    }
  }
}
```

The local process still calls the Ace Data Cloud API. Store the key in your personal client configuration or a credential manager. [mcp-grok installation package](https://pypi.org/project/mcp-grok/)

## Verify the connection and available tools

Open the client's tool list and find Grok. First, ask the assistant to call `grok_list_models` to list the chat and video models separately. This query checks whether the client has loaded the tools without submitting a production 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 an image | `grok_text_to_video`, `grok_image_to_video` | Text-to-video requires `prompt`; image-to-video requires `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. You can also query multiple IDs at once. |
| Choose a model and write prompts | `grok_list_models`, `grok_list_actions`, `grok_get_prompt_guide` | Check the inputs supported by each model, then choose a video tool and its parameters. |

## Usage examples

To write a storyboard, enter: “Use `grok_chat_completions` to write three storyboard descriptions of a street after the rain.” Read the text directly from the chat response.

To generate a video, enter: “Use Grok to turn my reference image into a video with the camera slowly moving forward.” Provide an accessible image URL as `image_url` and ask the assistant to choose a model that supports image-to-video. If the response contains a pending `task_id`, use `grok_get_task` to query the same task and retrieve the video URL once it succeeds. If it fails, check the task's error message.

Before making a request, check the service pages for current pricing and availability. [Grok service](https://platform.acedata.cloud/services/grok) · [Chat API](https://platform.acedata.cloud/documents/grok-chat-completions) · [Video generation API](https://platform.acedata.cloud/documents/grok-videos) · [Task query API](https://platform.acedata.cloud/documents/grok-tasks)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.