A Model Context Protocol (MCP) server that provides access to The Blue Alliance API for FIRST Robotics Competition data. This server enables AI assistants and other MCP clients to retrieve comprehensive FRC team, event, and match information.
- Team Information: Get detailed team profiles, participation history, awards, and media
- Event Data: Access event details, rankings, matches, and elimination alliances
- Match Results: Retrieve match data with scores, alliances, and breakdowns
- Historical Data: Query data from 1992 to the current year
- Node.js 22
- The Blue Alliance API key (register at thebluealliance.com/account)
npm install -g @withinfocus/tba-mcp-server
git clone https://github.com/withinfocus/tba-mcp-server.git
cd tba-mcp-server
npm ci
npm run build
Set your The Blue Alliance API key as an environment variable:
export TBA_API_KEY=your_api_key_here
Or create a .env
file:
TBA_API_KEY=your_api_key_here
Open up your application configuration, e.g. for Claude Desktop:
{
"mcpServers": {
"tba": {
"command": "npx",
"args": ["-y", "@withinfocus/tba-mcp-server"],
"env": {
"TBA_API_KEY": "your_api_key_here"
}
}
}
}
This MCP server provides many tools for accessing The Blue Alliance API. All tools validate input parameters and return structured, type-safe data.
-
get_team
- Get detailed team information- Parameters:
team_key
(string, format: frcXXXX) - Returns: Complete team profile including location, website, rookie year, motto
- Example:
get_team(team_key="frc86")
- Parameters:
-
get_team_simple
- Get simplified team information- Parameters:
team_key
(string, format: frcXXXX) - Returns: Basic team data (number, name, city, state, country)
- Parameters:
-
get_team_years_participated
- Get years a team has participated in competition- Parameters:
team_key
(string) - Returns: Array of years (numbers)
- Parameters:
-
get_team_districts
- Get district history for a team- Parameters:
team_key
(string) - Returns: Array of district objects with abbreviation, display name, key, year
- Parameters:
-
get_team_robots
- Get robot names for a team by year- Parameters:
team_key
(string) - Returns: Array of robot objects with year, name, key
- Parameters:
-
get_team_history
- Get comprehensive historical data for a team- Parameters:
team_key
(string) - Returns: Awards, events, matches, and robots across all years
- Parameters:
-
get_team_events
- Get events a team participated in for a specific year- Parameters:
team_key
(string),year
(number, 1992-current+1) - Returns: Array of detailed event objects
- Parameters:
-
get_team_events_simple
- Get simplified events for a team in a year- Parameters:
team_key
(string),year
(number) - Returns: Array of basic event data
- Parameters:
-
get_team_events_keys
- Get event keys for a team in a year- Parameters:
team_key
(string),year
(number) - Returns: Array of event key strings
- Parameters:
-
get_team_events_all
- Get all events a team has participated in across all years- Parameters:
team_key
(string) - Returns: Array of detailed event objects
- Parameters:
-
get_team_event_status
- Get team's rank and status at a specific event- Parameters:
team_key
(string),event_key
(string) - Returns: Qualification ranking, alliance info, playoff status
- Parameters:
-
get_team_event_statuses
- Get team's status at all events in a year- Parameters:
team_key
(string),year
(number) - Returns: Object mapping event keys to status objects
- Parameters:
-
get_team_matches
- Get detailed matches for a team in a year- Parameters:
team_key
(string),year
(number) - Returns: Array of complete match objects with scores, alliances, breakdowns
- Parameters:
-
get_team_matches_simple
- Get simplified matches for a team in a year- Parameters:
team_key
(string),year
(number) - Returns: Array of basic match data
- Parameters:
-
get_team_matches_keys
- Get match keys for a team in a year- Parameters:
team_key
(string),year
(number) - Returns: Array of match key strings
- Parameters:
-
get_team_event_matches
- Get detailed matches for a team at a specific event- Parameters:
team_key
(string),event_key
(string) - Returns: Array of complete match objects
- Parameters:
-
get_team_event_matches_simple
- Get simplified matches for a team at an event- Parameters:
team_key
(string),event_key
(string) - Returns: Array of basic match data
- Parameters:
-
get_team_event_matches_keys
- Get match keys for a team at an event- Parameters:
team_key
(string),event_key
(string) - Returns: Array of match key strings
- Parameters:
-
get_team_awards
- Get awards won by a team in a specific year- Parameters:
team_key
(string),year
(number) - Returns: Array of award objects with name, type, event, recipients
- Parameters:
-
get_team_awards_all
- Get all awards won by a team across all years- Parameters:
team_key
(string) - Returns: Array of award objects
- Parameters:
-
get_team_event_awards
- Get awards won by a team at a specific event- Parameters:
team_key
(string),event_key
(string) - Returns: Array of award objects
- Parameters:
-
get_team_media
- Get media for a team in a specific year- Parameters:
team_key
(string),year
(number) - Returns: Array of media objects (photos, videos, etc.)
- Parameters:
-
get_team_media_by_tag
- Get media for a team filtered by tag- Parameters:
team_key
(string),media_tag
(string) - Returns: Array of filtered media objects
- Parameters:
-
get_team_media_by_tag_year
- Get media for a team by tag and year- Parameters:
team_key
(string),media_tag
(string),year
(number) - Returns: Array of filtered media objects
- Parameters:
-
get_team_social_media
- Get social media information for a team- Parameters:
team_key
(string) - Returns: Array of social media links and handles
- Parameters:
-
get_events
- Get all FRC events for a specific year- Parameters:
year
(number, 1992-current+1) - Returns: Array of detailed event objects
- Parameters:
-
get_events_simple
- Get simplified events for a year- Parameters:
year
(number) - Returns: Array of basic event data
- Parameters:
-
get_events_keys
- Get event keys for a year- Parameters:
year
(number) - Returns: Array of event key strings
- Parameters:
-
get_event
- Get detailed information about a specific event- Parameters:
event_key
(string) - Returns: Complete event details including dates, location, webcasts
- Example:
get_event(event_key="2023casj")
- Parameters:
-
get_event_simple
- Get simplified event information- Parameters:
event_key
(string) - Returns: Basic event data
- Parameters:
-
get_event_teams
- Get teams participating in an event- Parameters:
event_key
(string) - Returns: Array of detailed team objects
- Parameters:
-
get_event_teams_simple
- Get simplified teams in an event- Parameters:
event_key
(string) - Returns: Array of basic team data
- Parameters:
-
get_event_teams_keys
- Get team keys in an event- Parameters:
event_key
(string) - Returns: Array of team key strings
- Parameters:
-
get_event_rankings
- Get team rankings for an event- Parameters:
event_key
(string) - Returns: Rankings object with team standings, records, statistics
- Parameters:
-
get_event_alliances
- Get elimination alliances for an event- Parameters:
event_key
(string) - Returns: Array of alliance objects with picks, status, records
- Parameters:
-
get_event_awards
- Get awards from a specific event- Parameters:
event_key
(string) - Returns: Array of award objects
- Parameters:
-
get_event_matches
- Get detailed matches for an event- Parameters:
event_key
(string) - Returns: Array of complete match objects
- Parameters:
-
get_event_matches_simple
- Get simplified matches for an event- Parameters:
event_key
(string) - Returns: Array of basic match data
- Parameters:
-
get_event_matches_keys
- Get match keys for an event- Parameters:
event_key
(string) - Returns: Array of match key strings
- Parameters:
-
get_event_insights
- Get event-specific insights and statistics- Parameters:
event_key
(string) - Returns: Qualification and playoff statistics and insights
- Parameters:
-
get_event_oprs
- Get OPR, DPR, and CCWM ratings for teams at an event- Parameters:
event_key
(string) - Returns: Object with OPR (Offensive Power Rating), DPR (Defensive Power Rating), CCWM (Calculated Contribution to Winning Margin)
- Parameters:
-
get_event_predictions
- Get TBA-generated predictions for an event- Parameters:
event_key
(string) - Returns: Match and ranking predictions
- Parameters:
-
get_event_district_points
- Get district points for teams at an event- Parameters:
event_key
(string) - Returns: District points breakdown by team
- Parameters:
-
get_match
- Get detailed information about a specific match- Parameters:
match_key
(string) - Returns: Complete match data with scores, alliances, breakdown
- Example:
get_match(match_key="2023casj_qm1")
- Parameters:
-
get_match_simple
- Get simplified match information- Parameters:
match_key
(string) - Returns: Basic match data
- Parameters:
-
get_match_zebra
- Get Zebra MotionWorks data for a match (robot tracking)- Parameters:
match_key
(string) - Returns: Robot position tracking data (if available)
- Parameters:
-
get_districts
- Get all districts for a specific year- Parameters:
year
(number) - Returns: Array of district objects
- Parameters:
-
get_district_rankings
- Get team rankings within a district- Parameters:
district_key
(string) - Returns: Array of district ranking objects with points breakdown
- Example:
get_district_rankings(district_key="2023fim")
- Parameters:
-
get_district_events
- Get events in a specific district- Parameters:
district_key
(string) - Returns: Array of detailed event objects
- Parameters:
-
get_district_events_simple
- Get simplified events in a district- Parameters:
district_key
(string) - Returns: Array of basic event data
- Parameters:
-
get_district_events_keys
- Get event keys in a district- Parameters:
district_key
(string) - Returns: Array of event key strings
- Parameters:
-
get_district_teams
- Get teams in a specific district- Parameters:
district_key
(string) - Returns: Array of detailed team objects
- Parameters:
-
get_district_teams_simple
- Get simplified teams in a district- Parameters:
district_key
(string) - Returns: Array of basic team data
- Parameters:
-
get_district_teams_keys
- Get team keys in a district- Parameters:
district_key
(string) - Returns: Array of team key strings
- Parameters:
-
get_teams
- Get paginated list of all teams (detailed)- Parameters:
page_num
(number, 0-indexed) - Returns: Array of complete team objects (500 teams per page)
- Parameters:
-
get_teams_simple
- Get paginated list of teams (simplified)- Parameters:
page_num
(number, 0-indexed) - Returns: Array of basic team data
- Parameters:
-
get_teams_keys
- Get paginated list of team keys- Parameters:
page_num
(number, 0-indexed) - Returns: Array of team key strings
- Parameters:
-
get_teams_by_year
- Get teams that competed in a specific year (detailed)- Parameters:
year
(number),page_num
(number, 0-indexed) - Returns: Array of complete team objects
- Parameters:
-
get_teams_by_year_simple
- Get teams from a year (simplified)- Parameters:
year
(number),page_num
(number, 0-indexed) - Returns: Array of basic team data
- Parameters:
-
get_teams_by_year_keys
- Get team keys from a specific year- Parameters:
year
(number),page_num
(number, 0-indexed) - Returns: Array of team key strings
- Parameters:
-
get_status
- Get TBA API status information- No parameters required
- Returns: API status including current season, downtime info, app versions
All tools implement strict parameter validation:
- Team Keys: Must match format
frcXXXX
(e.g.,frc86
,frc1234
) - Years: Must be between 1992 and current year + 1
- Event Keys: String format like
2023casj
,2024week1
- Match Keys: String format like
2023casj_qm1
,2024week1_sf1m1
- District Keys: String format like
2023fim
,2024pnw
- Page Numbers: 0-indexed integers (≥ 0)
- Simple: Basic information for lists and overviews
- Detailed: Complete information including all available fields
- Keys: Just the identifier strings for efficient lookups
Find a team's performance at a specific event:
- Use
get_team_event_matches
to get their matches - Use
get_event_rankings
to see their final ranking
Analyze an event:
- Use
get_event
for basic event info - Use
get_event_teams
to see participating teams - Use
get_event_rankings
for final standings - Use
get_event_alliances
for elimination results
npm run build
npm test # Run unit tests
npm run test:watch # Run unit tests in watch mode
npm run test:integration # Run all integration tests
npm run test:integration:ui # Run with Playwright UI
npm run test:integration:debug # Debug mode
npm run test:all # Run both unit and integration tests
Note: Integration tests require a valid TBA API key set as TBA_API_KEY
environment variable.
npm run lint
npm run lint:fix
# Install dependencies
npm ci
# Run unit tests in watch mode during development
npm run test:watch
# Build the project
npm run build
# Run all tests (unit + integration)
npm run test:all
# Test with the MCP inspector
npm run inspect
All API responses are validated using Zod schemas ensuring type safety and consistency:
Complete team information including:
key
(string) - Team identifier (e.g., "frc86")team_number
(number) - Numeric team numbernickname
(string) - Team nickname/informal namename
(string) - Official team namecity
,state_prov
,country
(string) - Location detailswebsite
(string) - Team website URLrookie_year
(number) - First year of competitionmotto
(string) - Team motto/slogan- Location data:
lat
,lng
,address
,postal_code
,gmaps_place_id
,gmaps_url
Simplified team data:
key
,team_number
,nickname
,name
city
,state_prov
,country
Complete event information including:
key
(string) - Event identifier (e.g., "2023casj")name
(string) - Official event nameevent_code
(string) - Short event codeevent_type
(number) - Event type identifierstart_date
,end_date
(string) - ISO date stringsyear
(number) - Competition yearweek
(number) - Competition week (null for offseason)- Location:
city
,state_prov
,country
,address
,timezone
district
- District information object (if applicable)webcasts
- Array of webcast objects with type, channel, dateplayoff_type
,playoff_type_string
- Playoff format information
Basic event data:
key
,name
,event_code
,event_type
city
,state_prov
,country
start_date
,end_date
,year
Complete match information:
key
(string) - Match identifier (e.g., "2023casj_qm1")comp_level
(string) - Competition level (qm, ef, qf, sf, f)set_number
,match_number
(number) - Match identifiersalliances
- Red and blue alliance objects containing:score
(number) - Alliance final scoreteam_keys
(string[]) - Array of team identifierssurrogate_team_keys
,dq_team_keys
(string[]) - Special designations
winning_alliance
(string) - "red", "blue", or null for tiesevent_key
(string) - Parent event identifier- Timing:
time
,actual_time
,predicted_time
,post_result_time
score_breakdown
- Detailed scoring breakdown object (game-specific)videos
- Array of video objects with type and key
Basic match data:
key
,comp_level
,set_number
,match_number
- Simplified
alliances
with score and team_keys only winning_alliance
,event_key
- Basic timing:
time
,predicted_time
,actual_time
Award information:
name
(string) - Award nameaward_type
(number) - Award type identifierevent_key
(string) - Event where awardedyear
(number) - Competition yearrecipient_list
- Array of recipient objects:team_key
(string) - Team recipient (if applicable)awardee
(string) - Individual recipient (if applicable)
Event ranking information:
rankings
- Array of ranking objects:team_key
(string) - Team identifierrank
(number) - Current ranking positionmatches_played
(number) - Number of matches playedrecord
- Win/loss/tie record objectqual_average
(number) - Average qualification scoreextra_stats
(number[]) - Additional statisticssort_orders
(number[]) - Tiebreaker values
extra_stats_info
,sort_order_info
- Metadata describing statistics
Elimination alliance information:
name
(string) - Alliance name/numberpicks
(string[]) - Array of team keys in pick orderbackup
- Backup team information (if applicable)declines
(string[]) - Teams that declined alliance invitationsstatus
- Alliance performance object:level
(string) - Current playoff levelstatus
(string) - Current statusrecord
- Overall playoff recordcurrent_level_record
- Record at current levelplayoff_average
(number) - Average playoff score
- District Schema: District information with abbreviation, display name, key, year
- Robot Schema: Robot information with year, name, key, team_key
- Media Schema: Media objects with type, foreign_key, details, URLs
- DistrictPoints Schema: District points breakdown by team
- DistrictRanking Schema: District standings with point totals and event breakdown
- TeamEventStatus Schema: Team status at specific events (qualification rank, alliance, playoff status)
- Insights Schema: Event-specific statistics and insights
- EventOPRs Schema: OPR, DPR, and CCWM ratings
- Zebra Schema: Robot tracking data with position coordinates over time
- Prediction Schema: TBA-generated match and ranking predictions
- Status Schema: API status information
All responses are validated to ensure:
- Type Safety: Correct data types for all fields
- Required Fields: Essential data is always present
- Null Handling: Proper handling of optional/missing data
- Consistency: Uniform structure across all endpoints
- Error Prevention: Invalid data is caught before reaching your application
The server provides detailed error messages for:
- Missing or invalid API keys
- Invalid team keys (must be format
frcXXXX
) - Invalid years (must be 1992 to current year + 1)
- TBA API errors (rate limits, not found, etc.)
- Schema validation failures
The Blue Alliance API has rate limits. The server will pass through any rate limiting errors from the TBA API. Consider implementing request caching or throttling in your client application for heavy usage.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Run the test suite
- Submit a pull request
MIT License - see LICENSE file for details.
- The Blue Alliance - Official FRC data source
- TBA API Documentation - Official API docs
- Model Context Protocol - MCP specification
- FIRST Robotics Competition - Official FRC site