NBA MCP Server
Provides live access to NBA data including player lookup, career stats, team rosters, league standings, stat leaders, daily scoreboards, and game box scores.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@NBA MCP ServerShow me the box score for last night's Warriors game."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
NBA MCP Server
A Model Context Protocol server that gives any MCP-compatible LLM client (Claude Desktop, Cursor, VS Code, a custom LangGraph agent) live access to NBA stats, standings, rosters, scores and box scores.
"Compare LeBron James and Kevin Durant's playoff scoring."
"Who led the league in assists in 2023-24?"
"What was the final score and top scorers of game 0042300405?"The LLM answers these by calling tools on this server — no hard-coded data, no scraping in the prompt.
Why this project exists
Most "LLM + API" demos wire one API to one chatbot with glue code. MCP replaces the glue with a protocol: write the server once, and every compatible client can use it. This repo is a small, production-shaped example of that — caching, error handling, a clean data/protocol split, tests, and two transports (stdio + HTTP).
Related MCP server: nba-stats-mcp
Tools
Tool | What it does |
| Resolve a player name → |
| Resolve a team name / city / abbreviation → |
| All 30 teams with ids |
| Career + playoff averages + season-by-season |
| Standings by conference for a season |
| Roster with position, age, experience |
| Per-game leaders (points/rebounds/assists/…) |
| Games and scores for a date (defaults to today) |
| Final score + top 5 scorers per side |
Every tool returns {"ok": true, "data": ...} or {"ok": false, "error": "..."} so
the model can recover from a bad name instead of hallucinating.
Resources
URI | Contents |
| The 30 teams with ids (JSON) |
| What each stat field means (Markdown) |
Prompts
Prompt | Arguments |
|
|
|
|
Both walk the model through calling the tools and grounding every claim in the returned numbers.
Architecture
MCP client (Claude Desktop / Cursor / LangGraph agent)
│ JSON-RPC over stdio or streamable HTTP
▼
server.py ── tool schemas (docstrings + type hints), thin error wrapping
▼
nba_client.py ── normalizes nba_api's 80-column rows into small LLM-friendly dicts
▼
cache.py ── TTL disk cache (scores 5 min, season stats 6 h, rosters 30 d)
▼
nba_api ──► stats.nba.comnba_client.py has no MCP dependency on purpose — the same layer will feed the RAG
pipeline and agents in the companion project.
Install
git clone https://github.com/SergioCastro02/nba-mcp-server
cd nba-mcp-server
python -m venv .venv && . .venv/Scripts/activate # or source .venv/bin/activate
pip install -e ".[dev]"Run
nba-mcp-server # stdio (for Claude Desktop / Cursor)
nba-mcp-server --http # streamable HTTP on http://localhost:8000/mcp
nba-mcp-server --http --host 0.0.0.0 # bind all interfaces (containers)GET /healthz returns {"status": "ok"} for load balancers and container probes.
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"nba": {
"command": "nba-mcp-server"
}
}
}(Use the absolute path to the .venv binary if it isn't on your PATH.)
MCP Inspector
npx @modelcontextprotocol/inspector nba-mcp-serverEnd-to-end demo
Launches the server as a subprocess and drives it over stdio, exactly like a real client would — resolves names to ids, compares two players' playoff stats, pulls season leaders and a box score:
python examples/mcp_client_demo.pyDeploy to AWS
Terraform stack for ECS Fargate + ALB + CloudWatch in infra/.
Development
ruff check .
pytestRoadmap
resourcesfor static reference data (nba://teams,nba://glossary)prompts(scouting_report,compare_players)IaC to deploy the HTTP transport to AWS ECS Fargate — see
infra/Wire continuous deployment (OIDC + push job) and stand up a public demo URL
Publish to PyPI
This server is the tool layer for a larger project: a multi-agent NBA analysis platform (LangGraph orchestration + RAG over news/recaps + AWS Bedrock).
Data source & limits
Data comes from stats.nba.com via nba_api.
It is unofficial and rate-limited; the disk cache absorbs most repeat calls.
Not affiliated with the NBA.
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityDmaintenanceA Model Context Protocol server that enables LLMs to retrieve NBA data including player stats, team information, game logs, and league standings through the nba_api library.101
- AlicenseBqualityDmaintenanceProvides comprehensive NBA statistics via Model Context Protocol, enabling queries for player stats, game scores, team info, and advanced analytics through natural language.2110MIT
- AlicenseAqualityCmaintenanceExposes the StatsPlus API as tools for MCP-compatible clients, enabling users to query player/team statistics, contracts, ratings, and game history via natural language.154MIT
- AlicenseAqualityCmaintenanceMCP server for NBA live data and stats, providing read-only tools to query live scores, box scores, player info, standings, and more from NBA.com.15151MIT
Related MCP Connectors
Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Hosted MCP endpoint with realistic fake data for prototyping agents. 12 tools, no setup.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SergioCastro02/nba-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server