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

# MCP Server

> Connect Claude Code, Cursor, ChatGPT, and other AI tools to Milana through the Model Context Protocol.

Milana exposes a hosted **Model Context Protocol (MCP)** server so AI tools — Claude.ai, Cursor, Codex, and others — can search sessions, look up users, and kick off Milana queries directly.

## Server details

|               |                                |
| ------------- | ------------------------------ |
| **URL**       | `https://app.getmilana.ai/mcp` |
| **Transport** | Streamable HTTP                |

## Install

<Tabs>
  <Tab title="Claude Code">
    ```bash theme={null}
    claude mcp add --transport http milana https://app.getmilana.ai/mcp
    ```

    Then run `/mcp` inside Claude Code and follow the **Authenticate** prompt to sign in.
  </Tab>

  <Tab title="Cursor">
    Open **Cursor Settings → MCP & Integrations → Add new MCP server** and paste:

    ```json theme={null}
    {
      "mcpServers": {
        "milana": {
          "url": "https://app.getmilana.ai/mcp"
        }
      }
    }
    ```

    Cursor will prompt you to sign in the first time it calls a Milana tool.
  </Tab>

  <Tab title="ChatGPT">
    Go to [chatgpt.com/#settings/Connectors](https://chatgpt.com/#settings/Connectors) (requires login).

    You may have to ensure that **Developer Mode** is enabled in advanced settings.

    Click **Create App** and enter the URL:

    ```
    https://app.getmilana.ai/mcp
    ```

    Complete the OAuth flow to connect Milana.
  </Tab>

  <Tab title="Claude Desktop">
    Open **Settings → Connectors → Add custom connector** and enter:

    * **Name**: `Milana`
    * **URL**: `https://app.getmilana.ai/mcp`

    Claude Desktop will open a browser window to sign you in.

    <Note>Custom connectors are available on Claude Pro, Max, Team, and Enterprise plans.</Note>
  </Tab>

  <Tab title="Codex CLI">
    ```bash theme={null}
    codex mcp add milana --url https://app.getmilana.ai/mcp
    ```
  </Tab>

  <Tab title="VS Code">
    Open the **Command Palette → MCP: Add Server**, choose **HTTP**, and enter:

    ```
    https://app.getmilana.ai/mcp
    ```

    Or add this to your workspace's `.vscode/mcp.json`:

    ```json theme={null}
    {
      "servers": {
        "milana": {
          "type": "http",
          "url": "https://app.getmilana.ai/mcp"
        }
      }
    }
    ```
  </Tab>

  <Tab title="Other clients">
    For any MCP client that doesn't yet speak Streamable HTTP directly, use the [`mcp-remote`](https://www.npmjs.com/package/mcp-remote) adapter to bridge stdio to the hosted server:

    ```json theme={null}
    {
      "mcpServers": {
        "milana": {
          "command": "npx",
          "args": ["-y", "mcp-remote", "https://app.getmilana.ai/mcp"]
        }
      }
    }
    ```
  </Tab>
</Tabs>

## Available tools

| Tool                  | What it's for                                                      |
| --------------------- | ------------------------------------------------------------------ |
| `whoami`              | Returns the authenticated Milana user and active product.          |
| `list_products`       | Lists the Milana products you can access.                          |
| `search_sessions`     | Natural-language search for sessions, users, or moments.           |
| `get_sessions`        | Reads session transcripts to ground answers in real user behavior. |
| `get_users`           | Returns a user's recent session history and identity.              |
| `start_query`         | Kicks off a deeper Milana analysis across many sessions.           |
| `cancel_query`        | Cancels an active query that you own.                              |
| `get_query`           | Fetches the status and result of a running or completed query.     |
| `list_recent_queries` | Lists recent queries in the active product.                        |

## Selecting a product

If your account can access more than one Milana product, the agent uses the product you most recently opened in the dashboard by default. To switch, just ask — for example, *"use the Acme product"* — and the agent will call `list_products` to pick the right one.
