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. 1. Install the server: 2. Add to your Claude Desktop config file: MacOS: ~/Library/Application Support/Claude/claudedesktopconfig.json Windows: %APPDATA%/Claude/claude
Add this skill
npx mdskills install labeveryday/nba-mcp-serverComprehensive NBA stats server with 30 tools, excellent docs, and clear setup for Claude Desktop
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.
# 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
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"
]
}
}
}
get_server_info - Server version + runtime settings (timeouts, retries, cache, concurrency)resolve_team_id - Resolve team name/city/nickname โ team_idresolve_player_id - Resolve player name โ player_id (official stats endpoint)find_game_id - Find game_id by date + matchup filterssearch_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%, PIEget_all_teams - All 30 NBA teamsget_team_roster - Team rosterget_team_advanced_stats - Team efficiency metricsget_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 patternsget_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 awardsget_shot_chart - Shot locations with X/Y coordinatesget_shooting_splits - Shooting % by zone and distanceThis MCP server also returns public NBA CDN asset URLs (no API key) alongside IDs in several tool responses, so UI clients can render visuals.
https://cdn.nba.com/headshots/nba/latest/1040x760/{playerId}.pnghttps://cdn.nba.com/headshots/nba/latest/260x190/{playerId}.pnghttps://cdn.nba.com/logos/nba/{teamId}/global/L/logo.svgTools that include these URLs:
resolve_player_id, search_players, get_player_inforesolve_team_id, get_all_teams, get_standingsgit clone https://github.com/labeveryday/nba_mcp_server.git
cd nba_mcp_server
uv sync
pip install nba-stats-mcp
git 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_server
# or Test with MCP Inspector
# (Inspector launches a stdio server command; it is NOT the python module name.)
npx @modelcontextprotocol/inspector
# In the Inspector UI, configure a stdio server:
# - Command: uv
# - Args: --directory /absolute/path/to/nba_mcp_server run nba-stats-mcp
# (or Command: python, Args: -m nba_mcp_server)
All tools return a single JSON object (encoded as the MCP TextContent.text string). The top-level schema is:
tool_name: tool that ranarguments: arguments passedtext: human-readable summary (kept for debugging and display)entities: machine-friendly IDs + asset URLs extracted from the resultThe server includes public CDN URLs (no API key required) in entities:
headshot_url: https://cdn.nba.com/headshots/nba/latest/1040x760/{playerId}.pngthumbnail_url: https://cdn.nba.com/headshots/nba/latest/260x190/{playerId}.pngteam_logo_url: https://cdn.nba.com/logos/nba/{teamId}/global/L/logo.svgControl logging verbosity with the NBA_MCP_LOG_LEVEL environment variable (default: WARNING):
export NBA_MCP_LOG_LEVEL=INFO # For debugging
nba-stats-mcp
In Claude Desktop config:
{
"mcpServers": {
"nba-stats": {
"command": "uvx",
"args": ["nba-stats-mcp"],
"env": {
"NBA_MCP_LOG_LEVEL": "INFO"
}
}
}
}
You can tune request behavior (helpful when agents do parallel tool calls) via env vars:
NBA_MCP_HTTP_TIMEOUT_SECONDS: Per-request timeout (default: 30)NBA_MCP_MAX_CONCURRENCY: Max concurrent outbound NBA API requests (default: 8)NBA_MCP_RETRIES: Retries for transient failures (429 / 5xx / network) (default: 2)NBA_MCP_CACHE_TTL_SECONDS: Cache TTL for stats endpoints (default: 120)NBA_MCP_LIVE_CACHE_TTL_SECONDS: Cache TTL for live endpoints (default: 5)NBA_MCP_TLS_VERIFY: TLS verification enabled (default: 1). If you see PermissionError reading CA bundles (common in sandboxed/macOS privacy contexts), set to 0.Example Claude Desktop config:
{
"mcpServers": {
"nba-stats": {
"command": "uvx",
"args": ["nba-stats-mcp"],
"env": {
"NBA_MCP_LOG_LEVEL": "INFO",
"NBA_MCP_MAX_CONCURRENCY": "8",
"NBA_MCP_CACHE_TTL_SECONDS": "120",
"NBA_MCP_LIVE_CACHE_TTL_SECONDS": "5",
"NBA_MCP_RETRIES": "2",
"NBA_MCP_HTTP_TIMEOUT_SECONDS": "30"
}
}
}
}
This server uses official NBA APIs:
uv sync --all-extras
uv run pytest
uv run pytest --cov=nba_mcp_server --cov-report=html
uv run ruff check src/
uv run ruff format src/
Static security analysis:
uv sync --all-extras
uv run bandit -c pyproject.toml -r src/
This project uses Hatchling for builds. Recommended release steps:
# 1) Ensure clean env + tests
uv sync --all-extras
uv run pytest
uv run ruff check src/ tests/
uv run bandit -c pyproject.toml -r src/
# 2) Build distributions
uv run python -m build
# 3) Upload
uv run twine upload dist/*
Tip: for TestPyPI uploads, use twine upload --repository testpypi dist/*.
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
Install via CLI
npx mdskills install labeveryday/nba-mcp-serverNBA MCP Server is a free, open-source AI agent skill. 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. 1. Install the server: 2. Add to your Claude Desktop config file: MacOS: ~/Library/Application Support/Claude/claudedesktopconfig.json Windows: %APPDATA%/Claude/claude
Install NBA MCP Server with a single command:
npx mdskills install labeveryday/nba-mcp-serverThis downloads the skill files into your project and your AI agent picks them up automatically.
NBA MCP Server works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Gemini Cli, Amp, Roo Code, Goose. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.