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
| Question | Tools called | Credits |
|---|---|---|
| Who led the league in points per game last season among players with at least 60 games? | get_leaders | 5 |
| Find Luka Doncic's id, then list his game log for last season. | search_players, get_player_games | 1 + 5 |
| How did Oklahoma City shoot by zone against expected points in last year's Finals? | list_games, get_shot_chart | 2 + 10 |
| Show every made layup in the restricted area from one playoff game, with the assist and the score. | get_plays | 10 |
| Which teams play back-to-backs and long trips in the next two weeks? | get_schedule, get_rest_and_travel | 2 + 5 |
| Who adds the most points per 48 minutes with the other nine players held fixed? | get_player_impact | 5 |
| What are the Elo ratings, the injury report and the standings for the Western Conference today? | get_ratings, get_injuries, get_standings | 2 + 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_movement | 5 + 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:
- `get_plays` and `get_shot_chart`. Play-by-play can be filtered by player, team, zone, period, made or missed, or clutch time (the last five minutes of the fourth quarter or overtime). The shot chart returns attempts, makes, percentage and expected points per shot by zone, and can include every located shot for drawing.
- `get_game`. One call returns both box scores and every book's line for a game. Team turnovers are counted in the team total, so it can exceed the sum of the players' turnovers.
- `get_player_impact`. An impact rating in points per 48 minutes over an average player, fitted on every stint of the last three seasons and refitted weekly.
- `get_season_projections`. Each team's chance at each seed, the play-in, the Finals and the title, from a simulation of the remaining schedule. It is our model and uses no betting-market input.
- Market tools.
get_odds,get_line_movement,get_market_odds(first half, first quarter and quarter totals),get_alt_lines(the full alternate spread and total ladders),get_player_props,get_prop_history,get_prop_movementandget_prop_probabilities. They return prices and implied and fair probabilities as information about the market. - `get_data_status`. One credit to find out how fresh each dataset is.
Ratings here are ours (Elo from every final game), not a ranking, and standings are computed from final games.
Credit costs
| Credits | Tools |
|---|---|
| 1 | list_teams, search_players, get_data_status |
| 2 | list_games, get_schedule, get_standings, get_injuries, get_ratings |
| 5 | get_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 |
| 10 | get_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 |
| 25 | get_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
- You need in-play data. Odds and props are pre-game only, and
starts_atis the schedule time rather than the actual tip. - You want a raw feed to resell. You may store the data, train models, backtest and build products that show your users what you derive. You may not redistribute the data, or odds as a raw feed, as a dataset or API of its own.
- You want a lot of history in bulk. Pulling a decade of play-by-play one call at a time is the expensive route. A Parquet data package delivers it in one download.
- You need college shot quality. College shots carry court locations but no expected points yet; that value is NBA and WNBA only.
- You need long prop history. Player prop lines start in 2023, and line coverage before July 2020 is a single final pregame line per book rather than opening and closing prices.
- You want a pick. The tools return prices and probabilities as data about the market. They do not recommend a wager, work out a stake or place anything.
- You only build in basketball. DunkAPI's own key has the same tools with paid plans from $19 a month, which is cheaper per credit than the cross-sport account.
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
- Get a free key: 1,000 credits a month, no card.
- Skip the API and download a data package if you want a full season in a file.
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.
Checked against the live API on 2026-12-06. Questions: hello@sportsdatahq.com.