Access comprehensive NBA statistics via Model Context Protocol
A Model Context Protocol (MCP) server that provides access to live and historical NBA data including player stats, game scores, team information, and advanced analytics.
- Install the server:
# Using uvx (recommended - no install required)
uvx nba-stats-mcp
# Or using pip
pip install nba-stats-mcp
# Or from source
git clone https://github.com/labeveryday/nba_mcp_server.git
cd nba_mcp_server
uv sync- Add to your Claude Desktop config file:
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"]
}
}
}Or if you installed from source:
{
"mcpServers": {
"nba-stats": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/nba_mcp_server/",
"run",
"nba-stats-mcp"
]
}
}
}- Restart Claude Desktop
- "Show me today's NBA games"
- "What are LeBron James' stats this season?"
- "Get the box score for Lakers vs Warriors"
- "Who are the top 10 scorers this season?"
- "Show me all-time assists leaders"
- "When do the Celtics play next?"
- "Get Stephen Curry's shot chart"
- "Who are the league leaders in deflections?"
- "Show me Giannis' career awards"
search_players- Find players by nameget_player_info- Player bio and detailsget_player_season_stats- Current/historical season statsget_player_career_stats- Career totals and averagesget_player_game_log- Game-by-game performanceget_player_awards- All awards and accoladesget_player_hustle_stats- Deflections, charges, loose balls, box outsget_player_defense_stats- Opponent FG% when defendedget_player_advanced_stats- TS%, ORtg, DRtg, USG%, PIE
get_all_teams- All 30 NBA teamsget_team_roster- Team rosterget_team_advanced_stats- Team efficiency metrics
get_todays_scoreboard- Today's games with live scoresget_scoreboard_by_date- Games for specific dateget_game_details- Detailed game info with live statsget_box_score- Full box score with player statsget_play_by_play- Complete play-by-play dataget_game_rotation- Player substitution patterns
get_standings- Current NBA standingsget_league_leaders- Statistical leaders (PTS, AST, REB, etc.)get_all_time_leaders- All-time career leadersget_league_hustle_leaders- League leaders in hustle statsget_schedule- Team schedule (up to 90 days ahead)get_season_awards- Season MVP and major awards
get_shot_chart- Shot locations with X/Y coordinatesget_shooting_splits- Shooting % by zone and distance
git clone https://github.com/labeveryday/nba_mcp_server.git
cd nba_mcp_server
uv syncpip install nba-stats-mcpgit clone https://github.com/labeveryday/nba_mcp_server.git
cd nba_mcp_server
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e .from mcp import stdio_client, StdioServerParameters
from strands.tools.mcp import MCPClient
mcp_client = MCPClient(lambda: stdio_client(
StdioServerParameters(
command="uvx",
args=["nba-stats-mcp"]
)
))# If installed via pip/uvx
nba-stats-mcp
# Or from source
uv run nba-stats-mcp
# or
python -m nba_mcp_serverControl logging verbosity with the NBA_MCP_LOG_LEVEL environment variable (default: WARNING):
export NBA_MCP_LOG_LEVEL=INFO # For debugging
nba-stats-mcpIn Claude Desktop config:
{
"mcpServers": {
"nba-stats": {
"command": "uvx",
"args": ["nba-stats-mcp"],
"env": {
"NBA_MCP_LOG_LEVEL": "INFO"
}
}
}
}This server uses official NBA APIs:
- Live Data API - Real-time scores and game data
- Stats API - Player stats, team info, historical data
- Schedule API - Full season schedule including future games
uv sync --all-extras
uv run pytest
uv run pytest --cov=nba_mcp_server --cov-report=htmluv run ruff check src/
uv run ruff format src/- Python 3.10+
- mcp >= 1.0.0
- httpx >= 0.27.0
MIT License - see LICENSE file for details.
Contributions welcome! Please submit a Pull Request.
This project was created by Du'An Lightfoot, a developer passionate about AI agents, cloud infrastructure, and teaching in public.
Learn more and connect:
- π Website: duanlightfoot.com
- πΊ YouTube: @LabEveryday
- π GitHub: @labeveryday