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

# Analytics MCP

> Connect an AI client or your own code to the iZap Analytics MCP server.

The **iZap Analytics MCP server** exposes analytics and assistant-management tools
over **Streamable HTTP** at `{origin}/mcp`. Connect Claude, ChatGPT, or your own
agent and call the tools directly — same business logic and auth as the REST API.

| Environment | MCP URL                           |
| ----------- | --------------------------------- |
| Production  | `https://api.izap.ai/mcp`         |
| Staging     | `https://api-staging.izap.ai/mcp` |

## Connect

Authentication is OAuth 2.0 (interactive clients bootstrap it automatically) or a
Bearer JWT for server-to-server code. Register it as a remote HTTP MCP server:

```json theme={null}
{
  "mcpServers": {
    "izap": {
      "type": "http",
      "url": "https://api.izap.ai/mcp",
      "headers": { "Authorization": "Bearer ${IZAP_TOKEN}" }
    }
  }
}
```

## Tool catalog

All tools accept an optional `business_id` (UUID); omit it to use your first
business.

| Tool                               | Purpose                                          |
| ---------------------------------- | ------------------------------------------------ |
| `list_connected_assistants`        | List the AI assistants on the account            |
| `get_today_message_stats`          | Chat / message / unique-people counts for a date |
| `get_today_assistant_ratio`        | AI-vs-human message ratio for a date             |
| `get_conversation_duration`        | Avg/min/max conversation duration for a date     |
| `search_today_messages`            | Keyword search over a date's messages            |
| `get_assistant_instructions`       | Read an assistant's prompt and instructions      |
| `create_ai_assistant`              | Create a new assistant                           |
| `update_ai_assistant_instructions` | Update an assistant's prompt/instructions        |

## Notes

* **Dates** are ISO-8601 strings (e.g. `2026-04-15`); **timezone** is an IANA name
  (e.g. `America/Sao_Paulo`).
* `search_today_messages` is rate-limited per user per day.
* Server errors surface as MCP tool errors (`isError: true`) with the message
  `Error <status>: <detail>`; a `401` means refresh the token.

<Card title="Build with the MCP in your code" icon="code" href="/en/api-reference/authentication">
  Get a token, then use the Python or TypeScript MCP SDK to call these tools from
  your own app or agent.
</Card>
