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

# MCP Quickstart

> Connect an AI agent to Whistle's remote MCP server — a bearer-authenticated HTTP Model Context Protocol endpoint with 20 tools covering leagues, games, officials, payments, and webhooks.

Whistle hosts a remote [Model Context Protocol](https://modelcontextprotocol.io) server at:

```
https://whistle.huddleup-sports.com/api/mcp
```

* **Transport:** streamable HTTP (the standard MCP HTTP transport). This is not SSE-only and not a stdio server — connect with any MCP client that supports HTTP transports.
* **Auth:** the same partner API key as the REST API, sent as `Authorization: Bearer whk_…`. Unauthenticated requests get `401 {"error":"unauthorized"}`.
* **Tools:** 20 tools mirroring the REST API's 20 resource operations (`whistle_list_leagues`, `whistle_create_games`, `whistle_assign_official`, …) — everything except the `GET /api/v1` index, which has no tool. Tool results are the REST response's `data` payload; REST errors surface as tool errors with the same `error` code.
* **Scoping:** the server forwards **your** bearer token to the REST API, so every tool call runs as you — the same [source scope](/developers/authentication#what-your-key-can-access) and attribution as direct REST calls.

## Connect from Claude Code

Use an environment variable — don't paste the key into the command history:

```bash theme={null}
claude mcp add --transport http whistle \
  https://whistle.huddleup-sports.com/api/mcp \
  --header "Authorization: Bearer $WHISTLE_API_KEY"
```

Then ask Claude to `list Whistle leagues` to verify the connection with a read-only tool.

## Connect from a generic MCP client

Any MCP client configuration that supports HTTP servers with custom headers works. For clients using the common JSON config shape:

```json theme={null}
{
  "mcpServers": {
    "whistle": {
      "type": "http",
      "url": "https://whistle.huddleup-sports.com/api/mcp",
      "headers": {
        "Authorization": "Bearer ${WHISTLE_API_KEY}"
      }
    }
  }
}
```

<Note>
  Check your client's documentation for how it interpolates environment variables into headers — the goal is that the literal key never lands in a config file you might commit.
</Note>

## The 20 tools

| Read (safe)                       | Write (confirm first)          |
| --------------------------------- | ------------------------------ |
| `whistle_list_leagues`            | `whistle_create_league`        |
| `whistle_get_league`              | `whistle_update_league`        |
| `whistle_list_games`              | `whistle_create_games`         |
| `whistle_get_game`                | `whistle_update_game`          |
| `whistle_list_officials`          | `whistle_cancel_game` ⚠️       |
| `whistle_list_assignments`        | `whistle_add_official`         |
| `whistle_list_payments`           | `whistle_remove_official` ⚠️   |
| `whistle_list_webhooks`           | `whistle_assign_official`      |
| `whistle_list_webhook_deliveries` | `whistle_unassign_position` ⚠️ |
|                                   | `whistle_register_webhook`     |
|                                   | `whistle_delete_webhook` ⚠️    |

Tools marked ⚠️ are destructive — agents should summarize and get human confirmation before calling them. See [Errors & agent safety](/developers/errors-and-agent-safety) for the full rules, and [Task recipes](/developers/recipes) for end-to-end flows (each recipe notes its MCP tool equivalents).

<Warning>
  One schema quirk to know: **`whistle_create_games`** accepts `startsAt`, `sport`, `location`, `payDollars`, `label`, `externalId` per game. Unlike the REST endpoint, the MCP tool schema does not take `latitude`/`longitude`.
</Warning>
