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

# Connect Mixpanel to Athena: service account, credentials, and setup

> Give Athena a Mixpanel service account to query events, funnels, retention, cohorts and profiles, export raw events, and maintain Lexicon and annotations.

Athena can answer product-analytics questions straight from your Mixpanel project: top events, segmentation and Insights reports, funnels, retention, cohorts and user profiles, JQL, raw event export, and the Lexicon data dictionary. It can also keep Mixpanel tidy by writing chart annotations and Lexicon descriptions, and by importing events.

Mixpanel connects through a built-in **MCP server** backed by a Mixpanel **service account**. Members do not sign in to Mixpanel themselves: every call runs as the service account, under the project role your Mixpanel administrator gave it.

> [!NOTE]
>
> Credentials are stored in a key-value **Secret** asset. Athena reads a Secret only for the member who created it, so each member who uses Mixpanel saves the service account credentials once in their own Secret. A Secret that was shared with you, even with edit rights, does not start the server.

## Step 1: Create a service account (Mixpanel admin)

You need the Owner or Admin role in Mixpanel to create a service account.

**1. Create the service account**

In Mixpanel, open **Organization Settings**, then **Service Accounts**, and add a service account. Grant it the project (or projects) Athena should reach.

**2. Choose a project role**

| Role | What Athena can do with it |
| - | - |
| **Analyst** | Every read, including raw event export, plus chart annotations |
| **Admin** | Everything above, plus Lexicon schema writes and event import |

Consumer is not enough: it cannot export data. Pick the lowest role that covers what you want Athena to do. Separate service accounts for projects that need different access keep permissions narrow.

**3. Copy the credentials**

Copy the service account **username** and **secret** right away; Mixpanel shows the secret only once. Then copy the numeric **Project ID** from **Project Settings** of the project you granted.

**4. Hand the values to your members**

Send the project ID, username and secret to the members who will use Mixpanel through a secure channel, or create one service account per member so each person's calls are attributable in Mixpanel.

If you set an expiry on the service account, Mixpanel refuses Athena's requests once it passes. Create a new service account and have members update their Secret.

## Step 2: Save the credentials in Olympus (each member)

**1. Open MCP Servers**

In the chat composer, open the overflow menu and choose **MCP Servers**. Under **Workspace MCP Servers**, turn on **Mixpanel** and expand it. You can also do this in the MCP servers section of an agent or toolkit asset you can edit.

**2. Create your Secret**

In **Credential Secret assets**, the **Mixpanel credentials** template is marked **Required**. Choose **Create Secret**. Olympus creates a key-value Secret you own, pre-filled with four keys, and opens it for editing:

```text theme={null}
MIXPANEL_PROJECT_ID=
MIXPANEL_SERVICE_ACCOUNT_USERNAME=
MIXPANEL_SERVICE_ACCOUNT_SECRET=
MIXPANEL_REGION=us
```

Paste the project ID, username and secret. Set `MIXPANEL_REGION` to `eu` or `in` if the project is hosted in the EU or India; leave `us` otherwise. To reuse a key-value Secret you already own, choose **Add Secret** instead.

**3. Check and apply**

Save the Secret. The card reads **Required credentials are available to your runtime**. If a key is empty, the card lists it under **Missing required keys** and the server does not start. Use **Test Setup** to see the Mixpanel tools, then **Apply to this chat**. To keep Mixpanel after a refresh, choose **Save as Toolkit**.

Connecting the MCP server passes the Secret values to it as environment variables without putting them in the chat. Separately, turning on **Allow Agent Access** on a Secret lets Athena read its values, so leave it off for this Secret. To limit which Mixpanel tools Athena may call, use **Tool access** in the server's settings.

## Step 3: Ask Athena

Ask in plain language, for example "What were the top events last week?", "Build the Sign Up to First Purchase funnel for October", "Which cohorts contain this user?", or "Export yesterday's Purchase events". Athena lists the available functions when it is unsure, then calls the one it needs with the dates, event names and filters from your request. Results appear in the chat as a Mixpanel tool card.

## What Athena can do

The server exposes three tools. Athena uses `list_functions` to discover the functions below, `call_function` for reads, and `call_write_function` for changes; a write sent through the read-only tool is refused.

| Area | Functions |
| - | - |
| Events | Event names, today's top events, event counts over time, top properties and property values, counts broken down by a property |
| Reports | Segmentation (counts, numeric buckets, sums, averages), saved Insights reports, saved funnels, retention, frequency |
| People | Cohorts and cohort members, user profiles, a profile's activity feed, JQL queries |
| Export | Raw event export for a date range, up to 10,000 events per call |
| Lexicon | List and read schemas; create or replace a schema (write) |
| Annotations | List and read annotations and tags; create, update or delete an annotation, create a tag (write) |
| Ingestion | Import events into the project (write) |

A few behaviors to know:

* Everyone who pastes the same service account acts as that account in Mixpanel. Mixpanel's API rate limits apply to the account as a whole; when a limit is hit, the tool returns an error marked retryable and Athena tells you. Raw export is limited by Mixpanel to 60 queries per hour, so Athena narrows the date range or filters instead of pulling an unbounded export.
* Requests go to Mixpanel's hosts for the region in `MIXPANEL_REGION`: `mixpanel.com`, `data.mixpanel.com` and `api.mixpanel.com` for `us`; `eu.mixpanel.com`, `data-eu.mixpanel.com` and `api-eu.mixpanel.com` for `eu`; `in.mixpanel.com`, `data-in.mixpanel.com` and `api-in.mixpanel.com` for `in`. Allow these if you restrict outbound traffic.
* Event import writes to your project. If your team only needs analysis, leave the service account at Analyst.
* Workspace owners can turn off MCP tools for the whole workspace, or limit them to certain roles, in **Tool Registry**.

## Troubleshooting

| What you see | What to do |
| - | - |
| Mixpanel is not listed under **Workspace MCP Servers** | Mixpanel is not enabled on your deployment. Ask your Athena administrator. |
| "A credential Secret is required before this server can start." | No Secret is linked for you. Create one with **Create Secret**. |
| **Missing required keys**, although a Secret is linked | The linked Secret belongs to someone else, or a key is empty. Create your own Secret and fill in every key. |
| Mixpanel returns 401 | The username or secret is wrong, the service account expired, or it was removed from the project. Ask your Mixpanel administrator for a new one and update your Secret. |
| Mixpanel returns 403 on a write | The service account's role is too low. Raise it to Admin in Mixpanel, or keep Athena read-only. |
| No data, or "project not found" | `MIXPANEL_PROJECT_ID` points at a project the account was not granted, or `MIXPANEL_REGION` does not match where the project is hosted. |

## Disconnecting

Turn off **Mixpanel** under **Workspace MCP Servers** in the chats, agents or toolkits that use it, and delete your Mixpanel Secret asset. To revoke access for everyone at once, delete the service account in Mixpanel.

## Related

* [MCP servers](https://resources.athenaintel.com/docs/developer-integrations/mcp.md): how Athena agents use MCP servers and which ones are built in.
* [All integrations](https://resources.athenaintel.com/docs/connect-your-data/all-integrations.md)


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