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

# Data MCP: local scaffold

> Run a read-only MCP server that fetches sports, affiliates, market definitions, events, and open main lines with your TheRundown API key.

The data MCP scaffold lets an AI assistant fetch TheRundown Product API data through five read-only tools. Run it locally with Node.js 22+ and your own API key. Your plan's data delay, coverage, entitlements, and data-point billing still apply.

<Info>
  This is a source example, not a hosted data MCP service or a published npm package. The existing [documentation MCP](/mcp) at `https://docs.therundown.io/mcp` searches documentation only.
</Info>

## Install from source

Download the [versioned source bundle](https://therundown.io/downloads/therundown-data-mcp-0.1.2.zip), extract it locally, and install the locked dependencies. The archive includes the server, dependency lockfile, design, and offline tests; no GitHub repository access is required:

```bash theme={null}
cd /absolute/path/to/therundown-data-mcp-0.1.2
npm ci --ignore-scripts
npm test
```

The server uses the official MCP SDK over stdio. It exposes no listening HTTP port. Keep the process environment and local client configuration private.

To check the download before extracting it, download its [SHA-256 checksum](https://therundown.io/downloads/therundown-data-mcp-0.1.2.sha256) into the same directory and run `sha256sum -c therundown-data-mcp-0.1.2.sha256` (Linux) or `shasum -a 256 -c therundown-data-mcp-0.1.2.sha256` (macOS). The archive also contains `SOURCE.json` with the source revision and individual file hashes.

## Connect an MCP client

Replace both paths below with the absolute Node.js 22+ executable and extracted `server.mjs`. An absolute Node path also works when a desktop app does not inherit your terminal's Node version. Keep real keys in private local configuration or the client's supported secret/environment mechanism.

### Claude Desktop

Use this entry in `claude_desktop_config.json`, then restart Claude Desktop. This source ZIP is not a `.mcpb` desktop extension. See the [official local-server configuration guide](https://modelcontextprotocol.io/docs/develop/connect-local-servers).

```json theme={null}
{
  "mcpServers": {
    "therundown-data": {
      "command": "/absolute/path/to/node",
      "args": ["/absolute/path/to/therundown-data-mcp-0.1.2/server.mjs"],
      "env": {
        "THERUNDOWN_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
```

### Cursor

Add this entry to the global `~/.cursor/mcp.json`. Make `THERUNDOWN_API_KEY` available in the environment that launches Cursor, then reload its MCP servers. The environment reference keeps the key value out of the JSON. See [Cursor's MCP instructions](https://cursor.com/docs/mcp).

```json theme={null}
{
  "mcpServers": {
    "therundown-data": {
      "type": "stdio",
      "command": "/absolute/path/to/node",
      "args": ["/absolute/path/to/therundown-data-mcp-0.1.2/server.mjs"],
      "env": {
        "THERUNDOWN_API_KEY": "${env:THERUNDOWN_API_KEY}"
      }
    }
  }
}
```

The server reads `THERUNDOWN_API_KEY` from its environment and sends it to the Product API in `X-TheRundown-Key`. Tool arguments never accept credentials, arbitrary URLs, or custom headers. Never commit a client configuration containing a real key.

## Tools

| Tool              | Input                                                        | Result                                                                                               |
| ----------------- | ------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------- |
| `list_sports`     | None                                                         | Canonical sport IDs and names.                                                                       |
| `list_affiliates` | None                                                         | Currently published source IDs, names, and API integration status. Retired affiliate 27 is excluded. |
| `list_markets`    | Optional `sport_id`, `live`, `page`, `limit`                 | Market definitions, period IDs, and `live_variant_id`.                                               |
| `list_events`     | `sport_id`, `date`; optional filters, offset, and pagination | Event IDs, teams, score, date, and available market IDs.                                             |
| `get_main_lines`  | `event_id`; optional filters and pagination                  | Open main-line prices with participant, affiliate, line value, and `updated_at`.                     |

Both event tools default to `market_ids: [1, 2, 3]` and `affiliate_ids: [19, 23]` (DraftKings and FanDuel). They always request `main_line=true&hide_closed=true&include=all_periods`. Pass live IDs `41,42,43` explicitly for in-play moneyline, spread, and total. Discover other markets instead of guessing IDs.

The scaffold accepts at most 12 market IDs and 10 affiliate IDs per call. Pages contain at most 200 items; the default is 50. Pagination is local: another page fetches another full filtered API response, incurs its normal usage, and may reflect a newer snapshot. Reduce upstream market/book filters to reduce billing; lowering the page size only reduces the tool output.

## First conversation

```text theme={null}
Use TheRundown to list current sports and affiliates. Find MLB (sport 3).
For today's UTC date, list events with market_ids [1,2,3]
and affiliate_ids [19,23]. Select an event ID from that response and
call get_main_lines with the same filters.
Show the source URL, each book's line value and price updated_at,
and the returned usage headers. Explain empty results without inventing odds.
```

Results carry `source_url`, `retrieved_at`, `usage`, and `data`. `retrieved_at` is the HTTP retrieval time, not the freshness of an individual price. Use the price's `updated_at` and your key's delay entitlement. A sport or affiliate catalog entry does not guarantee an open offer for a particular event.

## Verify a real request

After setting `THERUNDOWN_API_KEY` privately in your environment, run:

```bash theme={null}
npm run smoke
```

This opt-in check makes metered requests. Ordinary `npm test` is offline. By default, the smoke check uses MLB, DraftKings/FanDuel, and pre-match markets `1,2,3`, so it does not request live access on a Free key. Free covers pre-match odds from three listed books with a five-minute delay; it excludes live odds, props/alternates, and history. Check [current entitlements](/rate-limits) for your key.

With an eligible key, explicitly include live markets `41,42,43`:

```bash theme={null}
THERUNDOWN_SMOKE_LIVE=1 npm run smoke
```

Require `status: "ok"`, `tools: 5`, and positive `events` and `main_lines` counts. The script verifies the exact five tool names before making data requests, selects an event whose summary reports a requested market ID, spaces its two Product API calls by one second for Free-plan compatibility, and reports its UTC check time, sport/date/affiliate/market scope, selected event ID, source URLs, and usage. An empty result is inconclusive and exits with status 2; set `THERUNDOWN_SMOKE_DATE=YYYY-MM-DD` to select a known active date. The script has a 60-second deadline. A positive response is a snapshot check, not a latency or all-source coverage benchmark.

## Limits and next steps

The scaffold allows one in-flight API call, uses a 15-second timeout and a 4 MiB upstream response limit, rejects redirects, and never retries automatically. On `429`, follow the returned `retry_after` and [usage headers](/rate-limits). API errors are sanitized before reaching the assistant.

It provides REST snapshots. Streaming, bet placement, account changes, hosted OAuth, package publication, and directory listings are outside this example. Read the [design and release criteria](/data-mcp-design) before operating a shared service.

For a pasteable API integration brief, see [Build with AI](https://therundown.io/build-with-ai). For the underlying contracts, use the [OpenAPI specification](https://docs.therundown.io/openapi.yaml), [authentication guide](/authentication), and [market reference](/reference/markets).
