# The Blue Alliance

> The Blue Alliance is an open-source MCP server for sports data. MCP server giving AI assistants access to FIRST Robotics Competition team, event and match. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, self-hosted
- **Website:** https://www.thebluealliance.com
- **Repository:** https://github.com/withinfocus/tba-mcp-server
- **MCP Registry name:** io.github.withinfocus/tba
- **Categories:** [sports data](https://ai-powered.com/categories/sports-data)
- **Listing updated:** 2026-11-18

## About

The README says this server wraps The Blue Alliance API so MCP clients can query FRC data directly from a chat assistant. Teams can be looked up by key for profiles, participation history, awards and media, while events cover details, rankings, matches and elimination alliances. Match tools return scores, alliance composition and score breakdowns, and some years of data go back to 1992.

The server is distributed as an npm package and a Docker image, and it needs a Blue Alliance API key set through the TBA_API_KEY environment variable. Configuration examples are given for Claude Desktop-style MCP client setups. Responses are validated with Zod schemas.

It suits FRC scouts, mentors and volunteers who want an assistant to pull team and event statistics without navigating the website. Developers building FRC analysis tools can also use it as a reference for wiring the TBA API into MCP.

## Features

- **Team profiles and history:** Retrieves team details, events attended, matches, awards and media by team key.
- **Event rankings and matches:** Provides event details, participating teams, rankings, match results and elimination alliances.
- **Match score breakdowns:** Returns match scores, alliances and breakdowns, with robot tracking data where available.
- **Historical data queries:** Covers FRC data from 1992 through the current season.
- **District data access:** Includes tools for district rankings, events and teams.
- **Schema-validated responses:** Responses are checked against Zod schemas before being returned.

## Good for

- Asking an AI assistant for a team's season results and awards
- Comparing event rankings and OPRs across competitions
- Pulling historical match scores for scouting analysis
- Building FRC analytics tools on top of MCP clients

## Install

### Claude Code (Terminal)

```sh
claude mcp add tba --env TBA_API_KEY='<TBA_API_KEY>' -- npx -y @withinfocus/tba-mcp-server
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "tba": {
      "command": "npx",
      "args": [
        "-y",
        "@withinfocus/tba-mcp-server"
      ],
      "env": {
        "TBA_API_KEY": "<TBA_API_KEY>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "tba": {
      "command": "npx",
      "args": [
        "-y",
        "@withinfocus/tba-mcp-server"
      ],
      "env": {
        "TBA_API_KEY": "<TBA_API_KEY>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "tba": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@withinfocus/tba-mcp-server"
      ],
      "env": {
        "TBA_API_KEY": "<TBA_API_KEY>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "tba": {
      "command": "npx",
      "args": [
        "-y",
        "@withinfocus/tba-mcp-server"
      ],
      "env": {
        "TBA_API_KEY": "<TBA_API_KEY>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "tba": {
      "command": "npx",
      "args": [
        "-y",
        "@withinfocus/tba-mcp-server"
      ],
      "env": {
        "TBA_API_KEY": "<TBA_API_KEY>"
      }
    }
  }
}
```

## Tools

- `get_team`: Get detailed team profile by team key.
- `get_team_events`: Get a team's events in a given year.
- `get_team_matches`: Get a team's matches.
- `get_team_awards`: Get a team's awards for a year.
- `get_team_media`: Get a team's media.
- `get_event`: Get event details.
- `get_events`: List events.
- `get_event_teams`: Get teams participating in an event.
- `get_event_rankings`: Get event rankings.
- `get_event_matches`: Get matches for an event.
- `get_event_oprs`: Get event OPR analytics.
- `get_match`: Get detailed match information.
- `get_match_simple`: Get simplified match information.
- `get_match_zebra`: Get robot tracking data for a match, if available.
- `get_districts`: List districts.
- `get_district_rankings`: Get district rankings.
- `get_district_events`: Get district events.
- `get_district_teams`: Get district teams.
- `get_teams`: Get paginated team listings.
- `get_teams_by_year`: Get teams that competed in a given year.
- `get_status`: Get API status information.

## FAQ

### What do I need to run it?

A Blue Alliance API key, provided through the TBA_API_KEY environment variable. The server can run via npx or Docker.

### How many tools does it expose?

The README describes 35+ tools across team, event, match, district and utility categories.

### How far back does the data go?

The README says historical data is available from 1992 to the current year.

### Is The Blue Alliance free?

Yes. The Blue Alliance is open source, so you can use and self-host it for free.

### How do I add The Blue Alliance to Claude Code?

Run this command in your terminal: claude mcp add tba --env TBA_API_KEY='<TBA_API_KEY>' -- npx -y @withinfocus/tba-mcp-server

### What are the best alternatives to The Blue Alliance?

The closest alternatives to The Blue Alliance are Statbotics, LeagueApps MCP by usefulapi and Sports Events Results MCP.

## Where this comes from

- Description: written from the project's README, the project's website and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Statbotics](https://ai-powered.com/mcp/statbotics): Statbotics is an open-source MCP server for sports data.
- [LeagueApps MCP by usefulapi](https://ai-powered.com/mcp/leagueapps-mcp-by-usefulapi): LeagueApps MCP by usefulapi is a freemium MCP server for sports data.
- [Sports Events Results MCP](https://ai-powered.com/mcp/sports-events-results-mcp): Sports Events Results MCP is an MCP server for sports data.

---
Source: https://ai-powered.com/mcp/the-blue-alliance
