# Claude Integration (MCP)

Connect Claude to Alhena so you can query your conversations, analytics, A/B experiments, and AI configuration directly in Claude — in plain English, without opening the dashboard.

Alhena exposes an MCP (Model Context Protocol) endpoint that Claude connects to as a custom connector. Once authorized, Claude can search conversations, pull performance metrics, inspect experiment results, review AI guidelines, and more.

{% hint style="info" %}
**Want to give Alhena's AI agents access to external tools?** This page covers using Claude to query Alhena. If you want to connect Alhena's own AI agents to external MCP servers, see [MCP Servers](/docs/integrations/custom-extensions/mcp-servers.md) instead.
{% endhint %}

## Prerequisites

* An active Alhena account
* A Claude account at [claude.ai](https://claude.ai) or [Claude Code](https://claude.ai/code) installed

## Regions

Use the MCP URL that matches the region where your Alhena account is hosted:

| Region | MCP URL                         |
| ------ | ------------------------------- |
| US     | `https://app.alhena.ai/api/mcp` |
| EU     | `https://eu.alhena.ai/api/mcp`  |

If you are unsure which region you are on, check the URL you use to log in to Alhena. If it starts with `eu.alhena.ai`, use the EU endpoint; otherwise use the US endpoint.

## Setup

{% tabs %}
{% tab title="Claude.ai" %}

#### Step 1: Add the custom connector

1. Go to [claude.ai/settings/connectors](https://claude.ai/settings/connectors)
2. Click **Add Custom Connector**
3. Fill in the details:
   * **Name:** Alhena (or your preferred name)
   * **MCP URL:** `https://app.alhena.ai/api/mcp` (US) or `https://eu.alhena.ai/api/mcp` (EU) — use the one matching your account's region
4. Click **Add**

#### Step 2: Authorize access

1. On the connector screen, scroll to the bottom and click **Connect**
2. An OAuth authorization screen will appear — click **Allow Access** to grant Claude permission to read your Alhena data

#### Step 3: Start using it

Open a new Claude chat and ask questions. Claude will automatically call Alhena when your question requires it.
{% endtab %}

{% tab title="Claude Code" %}

#### Step 1: Add the MCP server

Run this command in your terminal, using the URL for your account's region:

**US**

```bash
claude mcp add --transport http alhena https://app.alhena.ai/api/mcp
```

**EU**

```bash
claude mcp add --transport http alhena https://eu.alhena.ai/api/mcp
```

#### Step 2: Authorize access

Inside Claude Code, run:

```
/mcp
```

Claude Code will detect that Alhena requires OAuth and automatically open your browser to an authorization page. Click **Allow Access** to complete the flow. Tokens are stored securely and refreshed automatically.

#### Step 3: Start using it

Ask questions in your Claude Code session. Claude will call Alhena automatically when your question requires it.
{% endtab %}
{% endtabs %}

## What you can ask

### Conversations

* "Find conversations where customers complained about shipping"
* "Show me open escalated tickets from the past week"
* "Pull up conversation 48291"
* "Which conversations led to a purchase?"

### Performance metrics

* "How many AI vs human tickets did we have last month?"
* "What's our CSAT trend over the last 30 days?"
* "Show me ticket volume by day for the past two weeks"
* "How are we performing compared to the previous period?"

### A/B experiments

* "What experiments are currently running?"
* "Show me the results for experiment 12"
* "Is experiment 7 statistically significant?"

### AI configuration

* "What guidelines does my AI follow?"
* "Show me the guidelines for the answering agent"
* "Why did the AI give this answer in ticket 48291?"

### Conversation drivers

* "What are the top pages driving conversations this month?"
* "Which countries are our conversations coming from?"

## Troubleshooting

| Issue                                           | Solution                                                                                                                  |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| Connector fails to add (claude.ai)              | Double-check the MCP URL matches your region: `https://app.alhena.ai/api/mcp` (US) or `https://eu.alhena.ai/api/mcp` (EU) |
| MCP server fails to add (Claude Code)           | Ensure you have Claude Code installed and run the command exactly as shown, using the correct regional URL                |
| OAuth authorization fails                       | Make sure you are logged into the correct Alhena account in your browser before clicking Allow Access                     |
| Browser doesn't open during OAuth (Claude Code) | Claude Code will display the authorization URL — copy it and open it manually                                             |
| Claude doesn't use the connector                | Open a new chat — existing chats may not pick up newly added connectors                                                   |
| Need to re-authorize (Claude Code)              | Run `/mcp` and select "Clear authentication", then reconnect                                                              |
| No data returned                                | Confirm your Alhena account has data for the time period or resource you are asking about                                 |

## Related

* [Analytics](/docs/dashboard/analytics.md) — View performance data directly in the Alhena dashboard
* [A/B Testing](/docs/developer-reference/website-sdk/ab-testing.md) — Set up and manage experiments
* [MCP Servers](/docs/integrations/custom-extensions/mcp-servers.md) — Connect Alhena's AI agents to external MCP servers


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://alhena.gitbook.io/docs/features/claude-mcp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
