mcpField
B
balldontlie

balldontlie

Remote
github.com/balldontlie-apiGames & Entertainment12Updated 4w ago
Repository

About balldontlie

balldontlie is a remote MCP server for AI clients that need sports data and analytics from the BALLDONTLIE API. It generates tools from public OpenAPI specifications and requires an API key on every MCP request.

Key features

  1. 01Generates tools from OpenAPI specifications
  2. 02Covers APIs for multiple sports and leagues
  3. 03API-key authentication
  4. 04Sensitive account tools disabled by default
  5. 05Health-status endpoint

Use cases

  1. 01Query data from the BALLDONTLIE sports API
  2. 02Let AI clients invoke API operations
  3. 03Check service health and deployed revision

MCP support

The server exposes BALLDONTLIE API operations as MCP tools, with tool catalogs and input definitions derived from public OpenAPI specifications. Every MCP request requires a BALLDONTLIE API key; some sensitive Account tools are disabled by default.

Configuration

Remote servers need no local install. Pick your client, then copy the config or install in one click.

Endpointhttps://mcp.balldontlie.io/mcp
Copy install command
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.

All endpoints
Streamable HTTPhttps://mcp.balldontlie.io/mcpAuth required

Tools

Details

From the project 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.
  5. Run npm test and npm run build.

Generated src/tools/*.ts, src/schemas/*.ts, and registry files are checked in and must not be edited manually. Runtime does not parse YAML and has no production YAML-parser dependency.

Configuration

VariableDefaultPurpose
PORT3000HTTP port
BACKEND_API_URLhttps://api.balldontlie.ioBALLDONTLIE API base URL
API_TIMEOUT30000Upstream timeout in milliseconds
ENABLE_DEBUGfalseLogs only method, query-free path, and query-field count
ENABLE_SENSITIVE_ACCOUNT_TOOLSfalseEnables sensitive Account tools only when exactly true
TRUST_PROXY_HOPS1 in production, 0 otherwiseValidated trusted proxy hop count; only 0 or 1 is accepted
ENABLE_TRACINGfalseEnables Datadog tracing when an agent host is configured

Authorization values, query values, request bodies, raw upstream errors, API-key responses, and hosted billing-session URLs are excluded from server logs and tracing tags.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.