BALLDONTLIE Sports MCP Server
Provides access to comprehensive sports data from 5 major leagues (NBA, NFL, MLB, EPL, NHL) including teams, players, games, statistics, standings, injuries, and betting odds through 67+ endpoints. Enables users to query sports information and analytics through natural language.
README
BALLDONTLIE Sports MCP Server
A Model Context Protocol (MCP) server that provides access to comprehensive sports data from the BALLDONTLIE API, including NBA, NFL, MLB, EPL, and NHL statistics, player information, game data, and more.
Features
- 67+ Sports Endpoints: Complete access to all BALLDONTLIE API endpoints
- 5 Major Sports: NBA, NFL, MLB, EPL, NHL
- Comprehensive Data: Teams, players, games, statistics, standings, injuries, and advanced analytics
- Authentication: Seamless API key forwarding to backend
- Pagination: Full support for cursor-based pagination
- Error Handling: Proper error forwarding and handling
- TypeScript: Full type safety and IntelliSense support
Installation
npm install @balldontlie/mcp-server
Quick Start
1. Get API Key
Sign up at BALLDONTLIE to get your free API key.
2. Configure MCP Client
Option A: Use Hosted Remote Server (Recommended)
Add to your MCP client configuration (e.g., Claude Desktop) to use the hosted server:
{
"mcpServers": {
"balldontlie-api": {
"url": "https://mcp.balldontlie.io/mcp",
"transport": "http",
"headers": {
"Authorization": "<YOUR_BALLDONTLIE_API_KEY>"
}
}
}
}
Replace <YOUR_BALLDONTLIE_API_KEY> with your actual API key from BALLDONTLIE.
Option B: Run from Source
Clone and run from source code:
git clone https://github.com/balldontlie-api/mcp-server.git
cd mcp-server
npm install
npm run build
npm start
Configure your MCP client to connect to the local server:
{
"mcpServers": {
"balldontlie-api": {
"url": "http://localhost:3000/mcp",
"transport": "http",
"headers": {
"Authorization": "<YOUR_BALLDONTLIE_API_KEY>"
}
}
}
}
3. Use in Your MCP Client
The server will automatically provide all available tools. You can ask your AI assistant things like:
- "Get the current NBA standings"
- "Show me LeBron James' season stats"
- "What are today's NFL games?"
- "Get Manchester United's recent EPL matches"
Environment Variables
| Variable | Default | Description |
|---|---|---|
PORT |
3000 |
Server port when running locally |
BACKEND_API_URL |
https://api.balldontlie.io |
BALLDONTLIE API base URL |
API_TIMEOUT |
30000 |
Request timeout in milliseconds |
LOG_LEVEL |
info |
Logging level (error, warn, info, debug) |
NODE_ENV |
development |
Environment (development, production, test) |
ENABLE_DEBUG |
false |
Enable debug logging |
ENABLE_TRACING |
false |
Enable DataDog APM tracing (requires DD_AGENT_HOST) |
DD_AGENT_HOST |
- | DataDog agent hostname for APM tracing |
DD_PROFILING_ENABLED |
false |
Enable DataDog profiling |
SERVICE_VERSION |
1.0.0 |
Service version for tracing |
Available Tools
NBA (16 tools)
| Tool | Description | Parameters |
|---|---|---|
nba_get_teams |
Get all NBA teams | division, conference |
nba_get_team_by_id |
Get specific NBA team | id (required) |
nba_get_players |
Get NBA players with filters | search, first_name, last_name, team_ids, player_ids, pagination |
nba_get_player_by_id |
Get specific NBA player | id (required) |
nba_get_active_players |
Get active NBA players | Same as nba_get_players |
nba_get_games |
Get NBA games | dates, seasons, team_ids, postseason, start_date, end_date, pagination |
nba_get_game_by_id |
Get specific NBA game | id (required) |
nba_get_stats |
Get NBA statistics | dates, seasons, team_ids, player_ids, game_ids, postseason, pagination |
nba_get_season_averages |
Get season averages | season (required), category (required), type (required), player_ids, season_type |
nba_get_advanced_stats |
Get advanced statistics | Same as nba_get_stats |
nba_get_box_scores |
Get box scores | dates, seasons, team_ids, game_ids, postseason, pagination |
nba_get_live_box_scores |
Get live box scores | Same as nba_get_box_scores |
nba_get_standings |
Get team standings | season, conference, division |
nba_get_leaders |
Get statistical leaders | season, stat_type, per_page |
nba_get_player_injuries |
Get player injuries | player_ids, team_ids, pagination |
nba_get_betting_odds |
Get betting odds | game_ids, dates, type, live, pagination |
NFL (14 tools)
| Tool | Description | Parameters |
|---|---|---|
nfl_get_teams |
Get all NFL teams | division, conference |
nfl_get_team_by_id |
Get specific NFL team | id (required) |
nfl_get_players |
Get NFL players | search, first_name, last_name, team_ids, player_ids, position, pagination |
nfl_get_player_by_id |
Get specific NFL player | id (required) |
nfl_get_active_players |
Get active NFL players | Same as nfl_get_players |
nfl_get_games |
Get NFL games | dates, seasons, team_ids, weeks, postseason, start_date, end_date, pagination |
nfl_get_game_by_id |
Get specific NFL game | id (required) |
nfl_get_stats |
Get NFL statistics | dates, seasons, team_ids, player_ids, game_ids, weeks, postseason, pagination |
nfl_get_season_stats |
Get season statistics | season, player_ids, team_ids, postseason, pagination |
nfl_get_standings |
Get team standings | season, conference, division |
nfl_get_player_injuries |
Get player injuries | player_ids, team_ids, pagination |
nfl_get_advanced_rushing_stats |
Get advanced rushing stats | season, week, player_ids, team_ids, position, pagination |
nfl_get_advanced_passing_stats |
Get advanced passing stats | Same as rushing |
nfl_get_advanced_receiving_stats |
Get advanced receiving stats | Same as rushing |
MLB (12 tools)
| Tool | Description | Parameters |
|---|---|---|
mlb_get_teams |
Get all MLB teams | division, league |
mlb_get_team_by_id |
Get specific MLB team | id (required) |
mlb_get_players |
Get MLB players | search, first_name, last_name, team_ids, player_ids, position, active, pagination |
mlb_get_player_by_id |
Get specific MLB player | id (required) |
mlb_get_active_players |
Get active MLB players | Same as mlb_get_players |
mlb_get_games |
Get MLB games | dates, seasons, team_ids, postseason, start_date, end_date, pagination |
mlb_get_game_by_id |
Get specific MLB game | id (required) |
mlb_get_stats |
Get MLB statistics | dates, seasons, team_ids, player_ids, game_ids, postseason, pagination |
mlb_get_season_stats |
Get season statistics | season, player_ids, team_ids, postseason, pagination |
mlb_get_team_season_stats |
Get team season stats | season, team_ids, postseason, pagination |
mlb_get_standings |
Get team standings | season, league, division |
mlb_get_player_injuries |
Get player injuries | player_ids, team_ids, pagination |
EPL (16 tools)
| Tool | Description | Parameters |
|---|---|---|
epl_get_teams |
Get all EPL teams | pagination |
epl_get_team_by_id |
Get specific EPL team | id (required) |
epl_get_team_players |
Get team players | id (required), pagination |
epl_get_team_season_stats |
Get team season stats | id (required), season, stat_types |
epl_get_team_stats_leaders |
Get team stat leaders | season, stat_type, per_page |
epl_get_standings |
Get EPL standings | season |
epl_get_players |
Get EPL players | search, team_ids, player_ids, position, pagination |
epl_get_player_by_id |
Get specific EPL player | id (required) |
epl_get_player_season_stats |
Get player season stats | id (required), season, stat_types |
epl_get_player_stats_leaders |
Get player stat leaders | season, stat_type, per_page |
epl_get_games |
Get EPL games | dates, seasons, team_ids, weeks, start_date, end_date, pagination |
epl_get_game_by_id |
Get specific EPL game | id (required) |
epl_get_game_lineups |
Get game lineups | id (required) |
epl_get_game_goals |
Get game goals | id (required) |
epl_get_game_team_stats |
Get game team stats | id (required) |
epl_get_game_player_stats |
Get game player stats | id (required) |
NHL (12 tools)
| Tool | Description | Parameters |
|---|---|---|
nhl_get_teams |
Get all NHL teams | conference, division, pagination |
nhl_get_team_by_id |
Get specific NHL team | id (required) |
nhl_get_team_season_stats |
Get team season stats | id (required), season |
nhl_get_team_stats_leaders |
Get team stat leaders | season, stat_type, per_page |
nhl_get_players |
Get NHL players | search, team_ids, player_ids, position, pagination |
nhl_get_player_by_id |
Get specific NHL player | id (required) |
nhl_get_player_season_stats |
Get player season stats | id (required), season |
nhl_get_player_stats_leaders |
Get player stat leaders | season, stat_type, per_page |
nhl_get_games |
Get NHL games | dates, seasons, team_ids, season_type, start_date, end_date, pagination |
nhl_get_game_by_id |
Get specific NHL game | id (required) |
nhl_get_standings |
Get NHL standings | season, conference, division |
nhl_get_box_scores |
Get NHL box scores | dates, seasons, team_ids, game_ids, season_type, pagination |
Authentication
The server forwards Authorization headers to the BALLDONTLIE API. Your MCP client should include the API key in requests:
Authorization: YOUR_API_KEY
Error Handling
The server provides detailed error information:
- Authentication Errors (401): Missing or invalid API key
- Authorization Errors (403): Insufficient tier access
- Validation Errors (400): Invalid parameters
- Rate Limiting (429): Request rate exceeded
- Server Errors (5xx): Backend API issues
Development
# Clone and install
git clone <repository>
cd mcp-server
npm install
# Build
npm run build
# Run in development
npm run dev
# Clean build
npm run clean
API Tiers
BALLDONTLIE offers different tiers with varying access levels:
- Free: Basic endpoints (teams, players, games)
- ALL-STAR ($9.99/mo): Includes stats, injuries, standings
- GOAT ($39.99/mo): Full access including advanced stats, box scores, betting odds
Support
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。