NBA MCP server to get nba stats and data
SaferSkills independently audited nba-stats-mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
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. v0.3.0: All 21 tools accept human names (not just IDs), return structured data + compact text, and default season to current. Optimized for both large and small LLM clients.
# 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-stats-mcp.git
cd nba-stats-mcp
uv syncMacOS: ~/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-stats-mcp/",
"run",
"nba-stats-mcp"
]
}
}
}All tools accept human names — no need to resolve IDs first. Every response includes structured data + compact text.
get_player_info(player) - Player bio and details (accepts name or ID)get_player_stats(player, stat_type) - Season, career, game log, hustle, defense, or advanced statsget_player_awards(player) - All awards and accoladesget_shooting_data(player, data_type) - Shot chart or shooting splitsget_team_roster(team) - Team roster (accepts team name or ID)get_team_advanced_stats(team) - Team efficiency metrics (ORtg, DRtg, pace)get_schedule(team) - Upcoming gamesget_standings() - League standings by conferenceget_scoreboard(date?) - Games for a date (defaults to today)find_game(team1, team2?, date?) - Find game_id by team matchupget_game_details(game_id) - Live game info with team statsget_box_score(game_id) - Full box score with player statsget_play_by_play(game_id) - Play-by-play with timestampsget_game_rotation(game_id) - Player rotation/substitution dataget_leaders(category, scope) - Current season, all-time, or hustle leadersget_season_awards(season?) - Season MVP and major awardscompare_players(player1, player2) - Side-by-side player comparisondaily_summary(date?) - All games + scores for a dateteam_overview(team) - Roster + record + upcoming scheduleresolve_player_id(query) - Fuzzy match player name to IDresolve_team_id(query) - Fuzzy match team name to IDThis 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, get_player_info, get_player_statsresolve_team_id, get_standings, get_team_rostergit clone https://github.com/labeveryday/nba-stats-mcp.git
cd nba-stats-mcp
uv syncpip install nba-stats-mcpgit clone https://github.com/labeveryday/nba-stats-mcp.git
cd nba-stats-mcp
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 (stdio, default)
nba-stats-mcp
# Or from source
uv run nba-stats-mcp
# or
python -m nba_mcp_server# Run as an HTTP server instead of stdio
nba-stats-mcp --transport streamable-http --host 127.0.0.1 --port 8000
# Also supports SSE transport
nba-stats-mcp --transport sse --port 8000npx @modelcontextprotocol/inspector
# In the Inspector UI, configure a stdio server:
# - Command: uv
# - Args: --directory /absolute/path/to/nba-stats-mcp 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:
The 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-mcpIn 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:
30)8)2)120)5)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=htmluv 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
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.