# Connect the MultitaskAI MCP server to xAI API

The xAI API lets Grok call remote MCP servers. Add an mcp tool with the MultitaskAI URL, a server label and your key in an Authorization header.

## Endpoint

```text
https://mcp.multitaskai.com
```

## Steps

1. Create an API key in your MultitaskAI account.
2. Add an mcp tool to your request with the endpoint as server_url and multitaskai as server_label.
3. Add your key in an Authorization header on the tool, as below.
4. Send the request and check that Grok calls the MultitaskAI tools.

```shell
curl https://api.x.ai/v1/responses \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -d '{
  "model": "grok-4.7",
  "input": [
    {
      "role": "user",
      "content": "List my MultitaskAI tools."
    }
  ],
  "tools": [
    {
      "type": "mcp",
      "server_url": "https://mcp.multitaskai.com",
      "server_label": "multitaskai",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  ]
}'
```

## Authentication

xAI API sends your MultitaskAI API key in the Authorization header. Create a key in your account and use it in place of YOUR_API_KEY. Keep the key out of files you share or commit.

```text
Authorization: Bearer YOUR_API_KEY
```

## Good to know

- It works through the OpenAI compatible Responses API and the xAI native SDK, where headers is extra_headers and allowed_tools is allowed_tool_names.
- require_approval and connector_id are not supported.
- Only Streamable HTTP and SSE servers work.

## Official documentation

The [xAI MCP documentation](https://docs.x.ai/developers/tools/remote-mcp) covers xAI API's own settings in detail. See the [overview](/docs.md) for the endpoint and authentication, and [pricing](/pricing/) for the daily free requests.
