MCP server for accessing NBA statistics and data via direct API calls
Project description
NBA MCP Server
Access NBA statistics via the Model Context Protocol (MCP).
This package runs an MCP server with 21 consolidated tools — live scores, box scores, standings, player/team stats, play-by-play, shot charts, and more. All tools accept human names (not just IDs), return structured data + compact text, and default season to current.
Supports stdio, streamable HTTP, and SSE transports. No API key required.
Quick Start
With uvx (Recommended - No Install Required)
Add to your MCP client config (e.g., Claude Desktop):
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"nba-stats": {
"command": "uvx",
"args": ["nba-stats-mcp"]
}
}
}
Restart your client and start asking!
With pip
pip install nba-stats-mcp
Then configure your MCP client:
{
"mcpServers": {
"nba-stats": {
"command": "nba-stats-mcp"
}
}
}
Response Format (v3.0)
All tools return JSON (encoded in the MCP TextContent.text field). Each response includes:
text— compact 1-3 line summary (clean, no IDs or URLs)data— structured dict with all values (primary output for programmatic use)entities— extracted IDs + asset URLs for UI rendering
Example:
{
"tool_name": "get_player_stats",
"arguments": {"player": "LeBron James", "stat_type": "season"},
"text": "LeBron James 2025-26: 25.3 PPG, 7.1 RPG, 7.8 APG (51.2% FG)",
"data": {
"player_id": 2544, "name": "LeBron James", "season": "2025-26",
"pts": 25.3, "reb": 7.1, "ast": 7.8, "fg_pct": 0.512
},
"entities": {
"players": [{"player_id": "2544", "headshot_url": "https://cdn.nba.com/headshots/nba/latest/1040x760/2544.png"}]
}
}
What You Can Ask
- "Show me today's NBA games"
- "What are LeBron James' stats this season?"
- "Compare LeBron and Curry"
- "Give me a team overview for the Lakers"
- "Who are the top 10 scorers this season?"
- "Show me all-time assists leaders"
- "When do the Celtics play next?"
Features
21 consolidated tools (optimized for LLM clients):
- All tools accept names —
get_player_stats(player="LeBron James")works - Structured
datafield for programmatic access - 3 new composite tools:
compare_players,daily_summary,team_overview - Live game scores and play-by-play
- Player stats (season, career, game log, hustle, defense, advanced)
- Team rosters and advanced metrics
- League standings and leaders (current season, all-time, hustle)
- Shot charts and shooting analytics
Full Documentation & Tool Reference
Requirements
- Python 3.10+
- An MCP-compatible client
License
MIT License - See LICENSE for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nba_stats_mcp-0.3.0.tar.gz.
File metadata
- Download URL: nba_stats_mcp-0.3.0.tar.gz
- Upload date:
- Size: 139.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9024db40bc48c45ff99faaffa6b7fca54c490d0b7f41bd274df546fda74d50d7
|
|
| MD5 |
61e6f2950f698c19d4648a2dea4c642d
|
|
| BLAKE2b-256 |
864cd8d3c81847da654adbf72d2e14e3fb1e3f4465e571efd819e7f17b5cf6b3
|
File details
Details for the file nba_stats_mcp-0.3.0-py3-none-any.whl.
File metadata
- Download URL: nba_stats_mcp-0.3.0-py3-none-any.whl
- Upload date:
- Size: 23.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20e841be8e12df890c8efc0777d25a2e5ef465b59af5b072ffe43c3db4b0aaa7
|
|
| MD5 |
fad3043288c39372520305b57866314e
|
|
| BLAKE2b-256 |
2b951d3654608b7543a9183566676a8b61958187a7ebed717cf7d9c401c41278
|