Get the FREE Ultimate OpenClaw Setup Guide →

balldontlie

An MCP Server implementation that integrates the Balldontlie API, to provide information about players, teams and games for the NBA, NFL and MLB

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio mikechao-balldontlie-mcp npx -y balldontlie-mcp \
  --env BALLDONTLIE_API_KEY="YOUR API KEY HERE"

How to use

This MCP server integrates the Balldontlie API to provide data about players, teams, and games across NBA, NFL, and MLB. It exposes a set of tools you can query through your preferred LLMs or automation workflows to retrieve teams, players, games, and specific game details. The available tools are get_teams, get_players, get_games, and get_game. For example, you can fetch all NBA teams, search for players by name, or obtain game schedules for a given date range. The server can be invoked via npx balldontlie-mcp (often with an API key provided as an environment variable) and returns structured results you can feed into your prompts or applications. You can also use prompts like schedule_generator to generate interactive schedules for Claude Desktop. Overall, it enables building conversational or analytic flows that reference current data from the Balldontlie API within your Claude or other LLM-based assistants.

How to install

Prerequisites:

  • Node.js and npm installed on your machine to use npx with the MCP package.
  • An Balldontlie API key (free tier acceptable).

Installation steps:

  1. Ensure Node.js is installed. Verify with: node -v npm -v

  2. Install and run the MCP server via npx (no local installation required):

npx -y balldontlie-mcp
  1. If you need to specify the API key via environment variable, set it in your shell before launching or include it in the mcp_config as shown in the example:
export BALLDONTLIE_API_KEY=your-api-key-here
npx -y balldontlie-mcp
  1. Alternatively, install via Smithery as described in the README to integrate with Claude Desktop:
npx -y @smithery/cli install balldontlie-mcp --client claude
  1. For Claude Desktop usage, configure claude_desktop_config.json as shown in the README (balldontlie with command npx and args [-y, balldontlie-mcp]).

Additional notes

Tips and caveats:

  • Ensure the BALLDONTLIE_API_KEY (note the potential misspelling in docs) or BALLOY key is set as an environment variable where required. The example uses BALLDONTLIE_API_KEY in the config; double-check which env var name your deployment expects.
  • The MCP exposes four main tools: get_teams, get_players, get_games, and get_game. Use the inputs described in the README to filter results by league (NBA, NFL, MLB) and to paginate with cursor where applicable.
  • If you run into rate limits from Balldontlie, consider caching results or batching requests where possible.
  • The schedule_generator prompt can help you generate an interactive schedule for Claude Desktop via Claude’s integration; keep in mind this requires Claude Desktop context and proper prompt formatting.
  • This MCP server is described as MIT licensed; you may modify and redistribute per the license terms.
  • If you need to switch to a different deployment (e.g., Docker, Python uv, etc.), you can adapt the mcp_config accordingly but this README uses the Node/npx path by default.

Related MCP Servers

Sponsor this space

Reach thousands of developers