# AI assistants (MCP)

The SportsAPI MCP server gives AI assistants the API as tools. Remote server (Streamable HTTP): https://mcp.sportsapi.app. Every plan, Free included.

Authentication: clients that take a header (Claude Code, Cursor, VS Code) send your MCP key (`mk_live_…`, made on the dashboard; it works only on the MCP server) or your API key as `Authorization: Bearer`. Connectors with sign-in (Claude web and desktop, ChatGPT) use OAuth: sign in on sportsapi.app and press Allow, and the connection gets its own MCP key, listed under Connections on the dashboard, where you can revoke it. Widget keys are refused. An MCP key on REST or WebSocket gets `403 mcp_key`.

Claude Code:

```bash
$ claude mcp add --transport http sportsapi https://mcp.sportsapi.app \
    --header "Authorization: Bearer mk_live_…"

# Or without a key: add it without --header, then run /mcp
# in Claude Code and sign in with your SportsAPI account.
```

Cursor:

```json
// ~/.cursor/mcp.json
{
  "mcpServers": {
    "sportsapi": {
      "url": "https://mcp.sportsapi.app",
      "headers": { "Authorization": "Bearer mk_live_…" }
    }
  }
}
```

VS Code:

```json
// .vscode/mcp.json
{
  "servers": {
    "sportsapi": {
      "type": "http",
      "url": "https://mcp.sportsapi.app",
      "headers": { "Authorization": "Bearer mk_live_…" }
    }
  }
}
```

Claude (web & desktop):

```bash
Settings → Connectors → Add custom connector
  Name: SportsAPI
  URL:  https://mcp.sportsapi.app
Connect → sign in on sportsapi.app → Allow.
```

ChatGPT:

```bash
Settings → Apps & Connectors → Create (developer mode)
  Name: SportsAPI
  MCP server URL: https://mcp.sportsapi.app
  Authentication: OAuth
Then sign in on sportsapi.app → Allow.
```

| Tool | What it does | Cost |
| --- | --- | --- |
| `list_sports` | Every sport with its kind, live count and the endpoint groups you can use for it. | free |
| `list_endpoints` | A sport’s endpoints your plan includes, by group, with parameter signatures; one group for full parameter detail. | free |
| `call_endpoint` | Call any listed endpoint by its op (e.g. leagues.standings) with its parameters. | 1 request |
| `search` | Find teams, players, leagues, managers, referees, races, fixtures or venues by name → SportsAPI ids. | 1 request |
| `live_fixtures` | Fixtures in play now: every sport, one sport or one league. | 1 request |
| `fixtures_by_date` | Fixtures on a UTC day: one league, one sport (paged) or one country of a sport. | 1 request |
| `fixture` | One fixture, optionally with lineups, statistics, events, h2h, form, best players, streaks or odds (one request per part). | 1 request |
| `standings` | A league’s table, the newest season unless one is given; total, home or away. | 1 request |
| `team` | A team’s profile, optionally with its squad and recent or upcoming fixtures (one request per part). | 1 request |
| `player` | A player’s profile and season statistics, his newest league season unless one is given. | 1 request |
| `leaders` | A league season’s player leaderboards (goals, assists, rating, …), the newest season by default. | 1 request |
| `race_results` | Motorsport and cycling: a race’s classification, or a series’ latest finished race. | 1 request |

Each data call counts as one API request against the plan’s quota and rate, and the plan’s endpoints apply. Discovery tools cost no quota. Answers are compacted (no nulls, no image URLs, long lists cut with a `_cut` note).

---

Base URL: https://api.sportsapi.app. Send your API key as `Authorization: Bearer <key>` on every /v2 request; keys are created in the dashboard (https://sportsapi.app/dashboard).
HTML: https://sportsapi.app/docs/mcp · All docs: https://sportsapi.app/markdown/en/docs.md
