BA

balldontlie-api/mcp

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

12 stars 8 forks Качество 58 Тренд 16MIT

The official mcp-server for BALLDONTLIE

Обзор

A Model Context Protocol (MCP) server that provides access to comprehensive sports data from the BALLDONTLIE API, including NBA, WNBA, NFL, MLB, EPL, NHL, NCAAF, NCAAB, MMA, CS2, League of Legends, Dota 2, FIFA World Cup 2026, La Liga, Serie A, UEFA Champions League, Bundesliga, and Ligue 1 statistics, player information, game data, and more. - : Complete access to all BALLDONTLIE API endpoints - : NBA, WNBA, NFL, MLB, EPL, NHL, NCAAF, NCAAB, MMA, CS2, League of Legends, Dota 2, FIFA World Cup 2026, La Liga, Serie A, UEFA Champions League, Bundesliga, Ligue 1 - : Teams, players, games, statistics, standings, injuries, betting odds, and advanced analytics - : Seamless API key forwarding to backend - : Full support for cursor-based pagination - : Proper error forwarding and handling - : Full type safety and IntelliSense support Sign up at BALLDONTLIE to get your free API key. Add to your MCP client configuration (e.g.

README

Показан фрагмент оригинального README. Открыть оригинал.

BALLDONTLIE MCP Server

Remote Model Context Protocol server for the BALLDONTLIE sports API. The tool catalog is generated from the vendored public OpenAPI specifications so endpoint methods, paths, parameters, and constraints stay aligned with the API source.

The current generated surface contains 529 tools from 27 specifications: Account, ATP, Bundesliga, college baseball, Counter-Strike, Dota 2, EPL, F1, FIFA World Cup, La Liga, Ligue 1, League of Legends, MLB, MLS, MMA, NBA, NCAAB, NCAAF, NCAAW, NFL, NHL, PGA, Serie A, UCL, Valorant, WNBA, and WTA. /health reports the authoritative runtime count and deployed revision.

Authentication

Every MCP request requires a BALLDONTLIE API key:

Authorization: Bearer YOUR_API_KEY

Initialization, tool listing, authenticated documentation, and API operations that are public outside the MCP validate the supplied key before proceeding. Other tool calls forward only the Authorization header to the corresponding authenticated BALLDONTLIE endpoint.

Public service metadata is limited to /health and /.well-known/mcp-config. /api/docs requires a valid API key.

Sensitive Account tools

The complete Account API surface is registered, but the following tools are disabled by default:

  • account_signup
  • account_rotate_api_key
  • account_change_subscription
  • account_cancel_subscription
  • account_create_checkout
  • account_get_billing_portal

They can create credentials, change billing state, or return sensitive hosted billing-session URLs. A deployment must set ENABLE_SENSITIVE_ACCOUNT_TOOLS=true exactly to enable them. Enabling the flag means those values may intentionally enter the authenticated caller’s MCP transcript. Other spellings, casing, or whitespace fail closed.

account_get_me remains available but always omits the api_key response field.

MCP request example

curl https://mcp.balldontlie.io/mcp \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "nba_get_teams",
      "arguments": {}
    }
  }'

Use tools/list to retrieve the current catalog, input schemas, and MCP read-only/destructive annotations.

Development

npm ci
npm run check:openapi
npm test
npm run build

The tests independently compare every generated operation and input against all vendored specifications. They also cover legacy tool-name compatibility, exact array query serialization, path/body dispatch, credential-safe errors and logs, API-key validation limits, and Account safety controls. Tests never call a live Account mutation.

Updating from the API source

  1. Copy balldontlie-2/marketing/public/openapi.yml to openapi.yml.
  2. Copy every balldontlie-2/marketing/public/openapi/*.yml file into openapi/.
  3. Update scripts/openapi-source.json to the source API commit.
  4. Run npm run generate:openapi.
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →