MCP server

NBA MCP Server for Claude, Cursor and ChatGPT

The NBA MCP server is a hosted, read-only connector at https://mcp.sportsdatahq.com/mcp/nba. It gives Claude, ChatGPT and Cursor 31 tools: play-by-play with every shot located, box scores, standings, injuries, ratings and odds. A free key brings 1,000 credits a month. Nothing to install.

What your agent can do with it

Basketball questions usually mix three kinds of data: who played and how they did, where the shots came from, and what the market thought beforehand. The NBA route puts all three behind one URL. It covers the NBA since 2003-04, the WNBA since 2006, Division I men's and women's college basketball, and Australia's NBL, and each tool takes a league argument that defaults to nba.

The part agents tend to like most is the shot data. Every shot in play-by-play carries its court location in feet (x runs 0 to 50 across the court, y runs from the basket, which sits at 25, 0), its zone, and an expected-points value from our own model fitted on every shot in the league's history. That makes questions like "who beat their shot quality" or "how did a team's midrange diet change after a trade" a single tool call instead of a spreadsheet project.

You can connect to either server. The SportsDataHQ route, https://mcp.sportsdatahq.com/mcp/nba, uses the cross-sport key and 1,000 free credits a month. DunkAPI's own server, https://mcp.dunkapi.com/mcp, uses a basketball-only key with 500 free credits a month. The tools and credit prices are identical.

Connect it to your client

You need one thing: a free SportsDataHQ key from app.sportsdatahq.com, with 1,000 credits a month across every sport. (DunkAPI's own server, https://mcp.dunkapi.com/mcp, takes a DunkAPI key instead and uses the same config shapes.) Claude and ChatGPT connectors sign you in with OAuth the first time a tool runs, so no key ever sits in a chat. Command-line and editor clients send the key in an x-api-key header instead. Connecting and listing tools cost nothing; only a data call spends credits.

Claude Code

claude mcp add --transport http sportsdatahq-nba https://mcp.sportsdatahq.com/mcp/nba --header "x-api-key: YOUR_API_KEY"

Run /mcp inside Claude Code to confirm the server shows as connected. If you leave the header off, /mcp walks you through an OAuth sign-in instead.

Claude.ai and Claude Desktop

Open Customize, then Connectors (older versions: Settings, Connectors), choose Add custom connector, name it sportsdatahq-nba and paste https://mcp.sportsdatahq.com/mcp/nba. Sign in the first time a tool runs and press Allow. On Team and Enterprise plans an owner adds it under Organization settings, Connectors, and members then press Connect. The local Claude Desktop config file starts programs rather than URLs, so it goes through the mcp-remote bridge:

{
  "mcpServers": {
    "sportsdatahq-nba": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.sportsdatahq.com/mcp/nba", "--header", "x-api-key:YOUR_API_KEY"]
    }
  }
}

Cursor

Paste this into ~/.cursor/mcp.json:

{
  "mcpServers": {
    "sportsdatahq-nba": {
      "url": "https://mcp.sportsdatahq.com/mcp/nba",
      "headers": { "x-api-key": "YOUR_API_KEY" }
    }
  }
}

VS Code

Add this to .vscode/mcp.json:

{
  "servers": {
    "sportsdatahq-nba": {
      "type": "http",
      "url": "https://mcp.sportsdatahq.com/mcp/nba",
      "headers": { "x-api-key": "YOUR_API_KEY" }
    }
  }
}

ChatGPT

ChatGPT adds outside MCP servers through developer mode, which OpenAI currently offers on workspace plans (Business, Enterprise and Edu) and which may need an admin to switch on. Create a custom MCP app or connector, paste https://mcp.sportsdatahq.com/mcp/nba and choose OAuth as the authentication. A sign-in page opens, you press Allow, and there is no key to copy. ChatGPT Plus does not have developer mode: call the REST API from your own machine with your key and paste the response in, as in the curl examples below.

Example questions and the tools they call

QuestionTools calledCredits
Who led the league in points per game last season among players with at least 60 games?get_leaders5
Find Luka Doncic's id, then list his game log for last season.search_players, get_player_games1 + 5
How did Oklahoma City shoot by zone against expected points in last year's Finals?list_games, get_shot_chart2 + 10
Show every made layup in the restricted area from one playoff game, with the assist and the score.get_plays10
Which teams play back-to-backs and long trips in the next two weeks?get_schedule, get_rest_and_travel2 + 5
Who adds the most points per 48 minutes with the other nine players held fixed?get_player_impact5
What are the Elo ratings, the injury report and the standings for the Western Conference today?get_ratings, get_injuries, get_standings2 + 2 + 2
How did the closing spread and total differ from the opening line at each sportsbook for last night's game?get_odds, get_line_movement5 + 10

Agents with a few calls to spend usually start cheap. list_teams and search_players cost 1 credit and return the ids every other tool wants, so a good agent resolves names first and spends the 10-credit calls only once it knows exactly which game or player it needs.

Tool count and highlights

The NBA route lists 31 tools. The ones worth knowing about:

Ratings here are ours (Elo from every final game), not a ranking, and standings are computed from final games.

Credit costs

CreditsTools
1list_teams, search_players, get_data_status
2list_games, get_schedule, get_standings, get_injuries, get_ratings
5get_game, get_player, get_player_games, get_leaders, get_team_stats, get_odds, get_game_probabilities, get_line_at_time, get_rest_and_travel, get_season_projections, get_player_impact
10get_plays, get_shot_chart, get_line_movement, get_player_props, get_prop_history, get_prop_movement, get_market_odds, get_alt_lines, get_prop_probabilities
25get_prop_backtest, get_prop_projections (paid plans only)

Two prices scale with what you ask for. get_odds costs 5 credits a game and 10 for a whole day. get_player_props costs 10 credits for a game that has not started and 20 once it has been played. A free account's 1,000 credits cover roughly 500 standings calls or 100 play-by-play pulls.

Verified examples you can run now

Export your key as KEY first. Each of these was run against the live API on December 6, 2026 and returned HTTP 200.

Points leaders last season (5 credits):

curl -s -X POST https://api.sportsdatahq.com/v1/nba/get_leaders \
  -H "x-api-key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{"stat": "pts", "season": 2026, "limit": 3}'
{
  "data": {
    "stat": "pts",
    "season": 2026,
    "leaders": [
      {
        "player_id": "3945274",
        "name": "Luka Doncic",
        "team": "LAL",
        "games": 64,
        "value": 33.5
      },
      {
        "player_id": "4278073",
        "name": "Shai Gilgeous-Alexander",
        "team": "OKC",
        "games": 68,
        "value": 31.1
      }
    ]
  }
}

Restricted-area shots from one playoff game, with court location and expected points (10 credits):

curl -s -X POST https://api.sportsdatahq.com/v1/nba/get_plays \
  -H "x-api-key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{"game_id": "401873203", "shots_only": true, "zone": "restricted_area", "limit": 2}'

Standings for the same season (2 credits):

curl -s -X POST https://api.sportsdatahq.com/v1/nba/get_standings \
  -H "x-api-key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{"season": 2026}'

And the tool list your MCP client sees on the NBA route, which costs nothing:

curl -s -X POST https://mcp.sportsdatahq.com/mcp/nba \
  -H "x-api-key: $KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

When not to use this

Source and related pages

The public nba-mcp-server repository has the setup notes and a first-call example. Full tool arguments are on the DunkAPI docs and the DunkAPI MCP page. For other sports, see the free sports data MCP server, the NFL, NHL and soccer guides, and the free skills for NBA game previews, shot quality and line movement.

Try it

FAQ

How many tools does the NBA MCP server have?

The NBA route on the SportsDataHQ server lists 31 tools, and DunkAPI's own server lists the same 31. They cover games, box scores, play-by-play, shot charts, standings, injuries, ratings, odds, player props and season projections.

Which leagues does it cover besides the NBA?

Every tool takes a league argument: nba (the default), wnba, ncaam and ncaaw for men's and women's Division I college basketball, and nbl for Australia's NBL. Some tools, such as expected points per shot, are NBA and WNBA only.

How far back does the NBA data go?

Games, box scores and play-by-play with shot locations start in 2003-04. Sportsbook lines by book start in 2013-14, and player prop lines by book start in 2023. Seasons are named by the year they end, so 2026 means 2025-26.

Should I use the SportsDataHQ server or DunkAPI's?

Both give you the same NBA tools and credit prices. The SportsDataHQ key works across nine sports with 1,000 free credits a month. DunkAPI's key is basketball only, with 500 free credits a month and paid plans from $19, so it is cheaper if basketball is all you build.

Get a free key

Checked against the live API on 2026-12-06. Questions: hello@sportsdatahq.com.