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

# MCP Server

> Connect AI clients like Claude and ChatGPT to Dakota Platform data via the Model Context Protocol.

The Dakota Platform MCP server exposes platform data (customers, accounts, transactions) to AI clients like Claude Desktop, Claude Code, and ChatGPT via the [Model Context Protocol](https://modelcontextprotocol.io/docs).

<Note>
  The server is **read-only** today. Future versions will support orchestration commands (creating transactions, managing accounts).
</Note>

## Using ChatGPT? Install the Dakota app

<Card title="Dakota Platform on the ChatGPT App Store" href="https://chatgpt.com/apps/dakota-platform/asdk_app_69499c05441c8191bb997b5e9999e1bf">
  <img src="https://mintcdn.com/dakota-49818541/hnhwRadiostcwm5E/images/chatgpt.svg?fit=max&auto=format&n=hnhwRadiostcwm5E&q=85&s=9e7504aedc1a681fd0d2afef07dc2e5e" alt="ChatGPT" className="block dark:hidden h-6 w-6 mb-2" width="24" height="24" data-path="images/chatgpt.svg" />

  <img src="https://mintcdn.com/dakota-49818541/hnhwRadiostcwm5E/images/chatgpt-white.svg?fit=max&auto=format&n=hnhwRadiostcwm5E&q=85&s=ef9ca97f3c44246a81a9da0c9fdbc1e7" alt="ChatGPT" className="hidden dark:block h-6 w-6 mb-2" width="24" height="24" data-path="images/chatgpt-white.svg" />

  One-click install, sign in with Google, and start asking ChatGPT about your customers, accounts, and transactions. No configuration required.
</Card>

For everything else (Claude Desktop, Claude Code, Cursor, custom MCP clients), keep reading.

## Hosted endpoint

| Environment | URL                                   |
| ----------- | ------------------------------------- |
| Production  | `https://mcp.platform.dakota.xyz/mcp` |

HTTPS-only. You need to authenticate — pick one of the two methods below.

## Authentication

The server supports two methods. Most users want **OAuth (Google login)** — it's a one-click sign-in with no tokens to copy around. Use the API-key fallback only if OAuth doesn't work for your client.

### Option 1 — Google OAuth (recommended)

Add the server with no extra configuration:

<Tabs>
  <Tab title="Claude Code">
    ```bash theme={null}
    claude mcp add --transport http dakota-platform https://mcp.platform.dakota.xyz/mcp
    ```

    In a fresh Claude Code session, run `/mcp` → pick `dakota-platform` → **Authenticate**. A browser tab opens, you sign in with Google, and you're done. Verify with `claude mcp list`.
  </Tab>

  <Tab title="Claude Desktop">
    Edit `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):

    ```json theme={null}
    {
      "mcpServers": {
        "dakota-platform": {
          "url": "https://mcp.platform.dakota.xyz/mcp"
        }
      }
    }
    ```

    Restart Claude Desktop. The first time you call a Dakota tool, it'll open a browser for you to sign in with Google.
  </Tab>

  <Tab title="Other MCP clients">
    Point your client at `https://mcp.platform.dakota.xyz/mcp` with no static auth header. The server speaks **Streamable HTTP** (HTTP + SSE) on a single endpoint:

    * `POST /mcp` — client messages
    * `GET /mcp` — SSE stream
    * Required header: `Accept: application/json, text/event-stream`
    * Session via `Mcp-Session-Id` header

    The client's first request will get a 401 with `WWW-Authenticate: Bearer realm="mcp"`, which kicks off the OAuth flow per the MCP spec.
  </Tab>
</Tabs>

Sign in with **any Google account** that's been invited to your Dakota organization. The session lasts a week; you'll only re-sign in if you're idle for that long or revoke access from the dashboard.

### Option 2 — API key (fallback)

Use this if OAuth doesn't work in your client (some older or custom integrations), or if you need a long-lived, headless credential (e.g. for a server-side agent).

**1. Create a key.** Go to [https://platform.dakota.xyz](https://platform.dakota.xyz) → **API keys** → create a new one. Copy it the moment it's shown — the dashboard won't display it again.

<Warning>
  The key carries the same permissions as your user account. Store it in a password manager, never in plain text or git. Revoke it from the dashboard if it leaks.
</Warning>

**2. Register the server with the key as a static `Authorization` header.** The `apikey:` prefix tells the MCP server to forward the key to the Platform API as `X-API-Key`:

<Tabs>
  <Tab title="Claude Code">
    ```bash theme={null}
    claude mcp add --transport http dakota-platform \
      https://mcp.platform.dakota.xyz/mcp \
      --header "Authorization: Bearer apikey:YOUR_PLATFORM_API_KEY"
    ```
  </Tab>

  <Tab title="Claude Desktop">
    ```json theme={null}
    {
      "mcpServers": {
        "dakota-platform": {
          "url": "https://mcp.platform.dakota.xyz/mcp",
          "headers": {
            "Authorization": "Bearer apikey:YOUR_PLATFORM_API_KEY"
          }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Other MCP clients">
    Send `Authorization: Bearer apikey:YOUR_PLATFORM_API_KEY` on every request to the MCP endpoint. No browser flow is involved.
  </Tab>
</Tabs>

### Smoke-test it

Ask your agent: *"List the first 3 customers from Dakota."* If you see real data, you're done. If you see "Authentication failed" or "Access denied", double-check that you signed in with the right account (OAuth) or that the header includes the `apikey:` prefix (API key).

## Available tools

### Customers

| Tool             | Description                                                                 |
| ---------------- | --------------------------------------------------------------------------- |
| `list_customers` | List customers with filtering by name, type, KYB status, and creation date  |
| `get_customer`   | Get detailed customer information including KYB links and provider statuses |

### Orchestration accounts

| Tool                    | Description                                   |
| ----------------------- | --------------------------------------------- |
| `list_onramp_accounts`  | List onramp accounts (bank transfer → crypto) |
| `get_onramp_account`    | Get onramp account details                    |
| `list_offramp_accounts` | List offramp accounts (crypto → fiat)         |
| `get_offramp_account`   | Get offramp account details                   |
| `list_swap_accounts`    | List swap accounts (crypto → crypto)          |
| `get_swap_account`      | Get swap account details                      |

### Transactions

| Tool                        | Description                                                                |
| --------------------------- | -------------------------------------------------------------------------- |
| `list_auto_transactions`    | List auto transactions with filtering by account, status, type, date range |
| `get_auto_transaction`      | Get auto transaction details including receipt and blockchain info         |
| `list_one_off_transactions` | List one-off offramp transactions (single-use crypto → fiat)               |
| `get_one_off_transaction`   | Get one-off transaction details                                            |

## Example prompts

Once connected, you can ask your AI agent things like:

* *"List the 10 most recent customers that completed KYB this month."*
* *"Show me all failed auto transactions for customer `cust_xxx` in the past 7 days."*
* *"What's the total volume across all onramp accounts for `cust_xxx`?"*
* *"Get details for offramp account `acct_xxx` and summarize its recent activity."*

The agent picks the right tool, calls the MCP server, and synthesizes a response from the structured data.

## Security notes

* All connections are HTTPS-only. The server validates `Origin` headers to prevent DNS-rebinding attacks.
* The server is **read-only** — no mutations are possible today.
* Treat API keys as credentials — revoke from the dashboard if leaked.
* Never paste session tokens, API keys, or customer PII into prompts.

## Reference

* **MCP protocol**: [modelcontextprotocol.io/docs](https://modelcontextprotocol.io/docs)
