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

# MCP Server

> Query Datadash analytics and manage cohorts from Claude Code, the Claude app, Codex, Cursor, VS Code, Gemini CLI or any MCP client.

Datadash runs a [Model Context Protocol](https://modelcontextprotocol.io) server alongside the REST API. Connect it to an AI assistant and you can ask questions in plain English — "which wallets are up the most on election markets this month?" — and the assistant composes the queries, runs them and reads the rows for you.

```
https://api.datadash.xyz/mcp
```

It uses the Streamable HTTP transport and authenticates with the same `X-Api-Key` header as the REST API.

The [Datadash AI plugin](https://github.com/datadash-xyz/mcp-skills-plugin) bundles this server with skills, such as wallet analysis and smart money, that teach the assistant which tables answer which question and how to read the numbers. Where your tool supports it, installing the plugin is the quickest setup.

> [!NOTE]
>
> The **MCP** option in this site's page menu connects an assistant to *these docs*, for searching them. The server on this page connects it to Datadash's *data*.

## Setup

**1. Create an API key**

Follow [API Keys](https://docs.datadash.xyz/api-keys.md) to create one.

The assistant acts with that key's full access, including creating, changing and deleting your cohorts. Create a key just for your MCP client, so you can revoke it without affecting anything else.

**2. Pick your AI tool**

Each tab has the exact setup. Replace `<your-api-key-here>` with the key from step 1.

> [tab] Claude Code
>
> Install the Datadash AI plugin from inside Claude Code (v2.1.275 or later):
>
> ```
> /plugin install datadash --marketplace datadash-xyz/mcp-skills-plugin
> ```
>
> Confirm the marketplace, choose a scope, then enter your Datadash API key when prompted.
>
> To add only the server, without the plugin's skills, register it directly. `--scope user` makes it available in every project:
>
> ```bash theme={null}
> claude mcp add --scope user --transport http datadash https://api.datadash.xyz/mcp --header "X-Api-Key: <your-api-key-here>"
> ```
>
> Start a new session and open the MCP menu. **datadash** should be listed as connected:
>
> ```bash theme={null}
> claude /mcp
> ```

> [tab] Claude app
>
> Install the Datadash AI plugin in Claude on the web or desktop:
>
> 1. Open **Customize**, then **Plugins**.
> 2. Select **Add marketplace** and enter `datadash-xyz/mcp-skills-plugin`.
> 3. Install **Datadash** from it.
> 4. Open the plugin's **Connectors** tab and connect Datadash.

> [tab] Codex
>
> Install the Datadash AI plugin. Set your key in the environment Codex runs in, then add the marketplace:
>
> ```bash theme={null}
> export DATADASH_API_KEY=<your-api-key-here>
> codex plugin marketplace add datadash-xyz/mcp-skills-plugin
> ```
>
> Then run `/plugins` inside Codex, select **Datadash** and install it.
>
> To add only the server, without the plugin's skills: `codex mcp add` can't set a custom header, so add the server to `~/.codex/config.toml` directly:
>
> ```toml ~/.codex/config.toml theme={null}
> [mcp_servers.datadash]
> url = "https://api.datadash.xyz/mcp"
> http_headers = { "X-Api-Key" = "<your-api-key-here>" }
> ```
>
> To keep the key out of the file, use `env_http_headers = { "X-Api-Key" = "DATADASH_API_KEY" }` instead and export `DATADASH_API_KEY` in your shell.
>
> Check that **datadash** is listed as enabled:
>
> ```bash theme={null}
> codex mcp list
> ```

> [tab] Cursor
>
> Add the server to `~/.cursor/mcp.json`, or `.cursor/mcp.json` to limit it to one project:
>
> ```json mcp.json theme={null}
> {
>   "mcpServers": {
>     "datadash": {
>       "url": "https://api.datadash.xyz/mcp",
>       "headers": {
>         "X-Api-Key": "<your-api-key-here>"
>       }
>     }
>   }
> }
> ```
>
> Open **Cursor Settings** and find **datadash** in the MCP section. A green dot means it's connected.

> [tab] VS Code
>
> Add the server to `.vscode/mcp.json` in your workspace. The `inputs` entry has VS Code prompt for the key once and store it, so it never sits in the file:
>
> ```json .vscode/mcp.json theme={null}
> {
>   "inputs": [
>     {
>       "type": "promptString",
>       "id": "datadash-api-key",
>       "description": "Datadash API key",
>       "password": true
>     }
>   ],
>   "servers": {
>     "datadash": {
>       "type": "http",
>       "url": "https://api.datadash.xyz/mcp",
>       "headers": {
>         "X-Api-Key": "${input:datadash-api-key}"
>       }
>     }
>   }
> }
> ```
>
> Select **Start** above the `datadash` entry and enter your key when prompted. The tools are then available in Chat's agent mode.

> [tab] Gemini CLI
>
> Install the Datadash AI plugin as a Gemini CLI extension:
>
> ```bash theme={null}
> gemini extensions install https://github.com/datadash-xyz/mcp-skills-plugin
> ```
>
> Enter your Datadash API key when prompted. It is stored as `DATADASH_API_KEY`.

> [tab] Other
>
> Any client that speaks Streamable HTTP and can send a custom header will work. Point it at `https://api.datadash.xyz/mcp` and send your key as `X-Api-Key`.
>
> The server is stateless: every request is authenticated on its own, and no session carries over between them.

**3. You're set**

Datadash is connected. Start a new chat and ask about the data. The prompts below are a good place to start.

## What you can ask

Once connected, just ask. A few starting points:

* *"Who are the top 10 wallets by realized PnL in crypto markets?"*
* *"What is smart money positioned on in the biggest active politics markets?"*
* *"Show me the open positions of 0xAb8D...90F1, largest first."*
* *"Build a cohort of wallets with over \$100k in volume and a win rate above 60%, then tell me what they're holding."*

The assistant works out the table, fields and filters itself. You don't need to know the request shape. When it creates or reports on a cohort, it links you to that cohort in the dashboard.

## Tools

The server exposes a small, fixed set of tools. Rather than one tool per endpoint, a single `query_table` takes the table as an argument, and `get_schema` describes every table in one call.

| Tool | What it does |
| - | - |
| `get_schema` | Every table, its fields, which are filterable and sortable, and a worked request example. Called once, before anything else. |
| `query_table` | Run a query against one table: the same filter, `orderBy` and `page` body the REST endpoint takes. |
| `query_lookup` | Find IDs by name — for example, the market IDs matching "presidential election" — to use in a `query_table` filter. |
| `list_cohorts` | List your cohorts and their build status. |
| `get_cohort` | Read a cohort's status, size and criteria. Can wait for a build to finish. |
| `list_cohort_wallets` | Page through the wallet addresses in a cohort. |
| `create_cohort` | Save a wallet segment defined by criteria over the tables. |
| `update_cohort` | Rename a cohort or replace its criteria, which rebuilds it. |
| `create_static_cohort` | Save a fixed list of wallet addresses as a cohort. |
| `update_static_cohort` | Rename a static cohort or replace its wallet list. |
| `delete_cohort` | Delete a cohort permanently. |

The schema is also published as the resource `datadashxyz://schema`, for clients that can load resources into context without spending a tool call.

## Things worth knowing

> [accordion] It's the REST API underneath
>
> A tool call runs through the same validation, filtering and authentication as the equivalent REST request. The [filter grammar](https://docs.datadash.xyz/filters.md), page limits and error messages are identical, so anything you can do over MCP you can reproduce with `curl`. That makes it a quick way to prototype a query before you write code.

> [accordion] Results are paged
>
> The assistant picks a `page.limit` for each query. When a result fills the page, the tool says so, and the assistant can either narrow the filter or read on with `page.offset`. If an answer looks suspiciously round, ask whether it saw every row.

> [accordion] Cohorts build in the background
>
> A criteria cohort's membership is computed asynchronously after it's created or changed. The assistant waits for the build to finish (up to two minutes) before reading its wallets. A static cohort is ready as soon as it's saved. See [Cohorts](https://docs.datadash.xyz/cohorts.md) for how criteria work.

> [accordion] Names resolve to IDs
>
> Markets, events and similar entities are filtered by ID, not name. The assistant finds the IDs with `query_lookup` first. When a name matches several candidates, it should pick the right ones or ask you. If an answer covers the wrong market, name the market more precisely.

## Next steps

> [card] [API Keys](https://docs.datadash.xyz/api-keys.md)
>
> Create a dedicated key for your MCP client.

> [card] [Cohorts](https://docs.datadash.xyz/cohorts.md)
>
> How cohort criteria are defined and built.


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