Connects Claude to official MLB statistics through eight core operations: pull game schedules and live feeds, check standings, grab team rosters and profiles, look up player stats and bios, and fetch full box scores for any game. Useful when you're building baseball analytics, need real-time game data for a chatbot, or want to answer stats questions without scraping. Part of the Pipeworx gateway, so you can either use it standalone or get it bundled with 673+ other data sources. Supports a natural language query mode that picks the right API call based on your question instead of making you specify tools manually.
Public tool metadata for what this MCP can expose to an agent.
get_stats2 paramsparamsobjectendpointstringget_scheduleGet list of games for a given date/range and/or team/opponent.9 paramsGet list of games for a given date/range and/or team/opponent.
datevalueseasonvaluegame_idvalueteam_idvalueend_datevaluesport_idintegerstart_datevalueopponent_idvalueinclude_series_statusbooleanget_player_statsReturns a list of current season or career stat data for a given player.4 paramsReturns a list of current season or career stat data for a given player.
groupstringstatsstringseasonvalueplayer_idintegerget_standingsReturns a dict of standings data for a given league/division and season.4 paramsReturns a dict of standings data for a given league/division and season.
seasonvalueleague_idvaluedivision_idvaluestandings_typesstringget_team_leadersReturns a python list of stat leader data for a given team5 paramsReturns a python list of stat leader data for a given team
limitvalueseasonvalueteam_idintegerleader_categorystringleader_game_typestringlookup_playerGet data about players based on first, last, or full name.1 paramsGet data about players based on first, last, or full name.
namestringget_boxscoreGet a formatted boxscore for a given game.2 paramsGet a formatted boxscore for a given game.
game_idintegertimecodevalueget_team_rosterGet the roster for a given team.4 paramsGet the roster for a given team.
datevalueseasonintegerteam_idintegerroster_typestringget_game_paceReturns data about pace of game for a given season (back to 1999).1 paramsReturns data about pace of game for a given season (back to 1999).
seasonvalueget_metaGet available values from StatsAPI for use in other queries, or look up descriptions for values found in API results. For example, to get a list of leader categories to use when calling team_leaders(): statsapi.meta('leagueLeaderTypes')2 paramsGet available values from StatsAPI for use in other queries, or look up descriptions for values found in API results. For example, to get a list of leader categories to use when calling team_leaders(): statsapi.meta('leagueLeaderTypes')
fieldsvaluetype_namestringget_available_endpointsGet MLB StatsAPI endpoints directlyGet MLB StatsAPI endpoints directly
No parameter schema in public metadata yet.
get_notesGet additional notes on an endpoint1 paramsGet additional notes on an endpoint
endpointstringget_game_scoring_play_dataReturns a dictionary of scoring plays for a given game containing 3 keys: * home - home team data * away - away team data * plays - sorted list of scoring play data1 paramsReturns a dictionary of scoring plays for a given game containing 3 keys: * home - home team data * away - away team data * plays - sorted list of scoring play data
game_idintegerget_last_gameGet the gamePk (game_id) for the given team's most recent completed game.1 paramsGet the gamePk (game_id) for the given team's most recent completed game.
team_idintegerget_league_leader_dataReturns a list of stat leaders overall or for a given league (103=AL, 104=NL).6 paramsReturns a list of stat leaders overall or for a given league (103=AL, 104=NL).
limitvalueseasonvalueleague_idvaluegame_typesvaluestat_groupvalueleader_categoriesstringget_linescoreGet formatted linescore data for a specific MLB game.1 paramsGet formatted linescore data for a specific MLB game.
game_idintegerget_next_gameGet the game ID for a team's next scheduled game.1 paramsGet the game ID for a team's next scheduled game.
team_idintegerget_game_highlight_dataReturns a list of highlight data for a given game.1 paramsReturns a list of highlight data for a given game.
game_idintegerget_statcast_dataPulls statcast play-level data from Baseball Savant for a given date range. INPUTS: start_dt: YYYY-MM-DD : the first date for which you want statcast data end_dt: YYYY-MM-DD : the last date for which you want statcast data team: optional (defaults to None) : city abbreviation...7 paramsPulls statcast play-level data from Baseball Savant for a given date range. INPUTS: start_dt: YYYY-MM-DD : the first date for which you want statcast data end_dt: YYYY-MM-DD : the last date for which you want statcast data team: optional (defaults to None) : city abbreviation...
teamvalueend_dtvalueend_rowvalueverbosebooleanparallelbooleanstart_dtvaluestart_rowvalueget_statcast_batter_dataPulls statcast pitch-level data from Baseball Savant for a given batter. ARGUMENTS start_dt : YYYY-MM-DD : the first date for which you want a player's statcast data end_dt : YYYY-MM-DD : the final date for which you want data player_id : INT : the player's MLBAM ID. Find this...5 paramsPulls statcast pitch-level data from Baseball Savant for a given batter. ARGUMENTS start_dt : YYYY-MM-DD : the first date for which you want a player's statcast data end_dt : YYYY-MM-DD : the final date for which you want data player_id : INT : the player's MLBAM ID. Find this...
end_dtvalueend_rowvaluestart_dtvalueplayer_idintegerstart_rowvalueget_statcast_pitcher_dataPulls statcast pitch-level data from Baseball Savant for a given pitcher. ARGUMENTS start_dt : YYYY-MM-DD : the first date for which you want a player's statcast data end_dt : YYYY-MM-DD : the final date for which you want data player_id : INT : the player's MLBAM ID. Find thi...5 paramsPulls statcast pitch-level data from Baseball Savant for a given pitcher. ARGUMENTS start_dt : YYYY-MM-DD : the first date for which you want a player's statcast data end_dt : YYYY-MM-DD : the final date for which you want data player_id : INT : the player's MLBAM ID. Find thi...
end_dtvalueend_rowvaluestart_dtvalueplayer_idintegerstart_rowvalueget_statcast_batter_exitvelo_barrelsRetrieves batted ball data for all batters in a given year. ARGUMENTS year: The year for which you wish to retrieve batted ball data. Format: YYYY. minBBE: The minimum number of batted ball events for each player. If a player falls below this threshold, they will be excluded f...4 paramsRetrieves batted ball data for all batters in a given year. ARGUMENTS year: The year for which you wish to retrieve batted ball data. Format: YYYY. minBBE: The minimum number of batted ball events for each player. If a player falls below this threshold, they will be excluded f...
yearintegerminBBEvalueend_rowvaluestart_rowvalueget_statcast_pitcher_exitvelo_barrelsRetrieves batted ball against data for all qualified pitchers in a given year. ARGUMENTS year: The year for which you wish to retrieve batted ball against data. Format: YYYY. minBBE: The minimum number of batted ball against events for each pitcher. If a player falls below thi...4 paramsRetrieves batted ball against data for all qualified pitchers in a given year. ARGUMENTS year: The year for which you wish to retrieve batted ball against data. Format: YYYY. minBBE: The minimum number of batted ball against events for each pitcher. If a player falls below thi...
yearintegerminBBEvalueend_rowvaluestart_rowvalueget_statcast_batter_expected_statsRetrieves expected stats based on quality of batted ball contact in a given year. ARGUMENTS year: The year for which you wish to retrieve expected stats data. Format: YYYY. minPA: The minimum number of plate appearances for each player. If a player falls below this threshold,...4 paramsRetrieves expected stats based on quality of batted ball contact in a given year. ARGUMENTS year: The year for which you wish to retrieve expected stats data. Format: YYYY. minPA: The minimum number of plate appearances for each player. If a player falls below this threshold,...
yearintegerminPAvalueend_rowvaluestart_rowvalueget_statcast_pitcher_expected_statsRetrieves expected stats based on quality of batted ball contact against in a given year. ARGUMENTS year: The year for which you wish to retrieve expected stats data. Format: YYYY. minPA: The minimum number of plate appearances against for each pitcher. If a player falls below...4 paramsRetrieves expected stats based on quality of batted ball contact against in a given year. ARGUMENTS year: The year for which you wish to retrieve expected stats data. Format: YYYY. minPA: The minimum number of plate appearances against for each pitcher. If a player falls below...
yearintegerminPAvalueend_rowvaluestart_rowvalueget_statcast_batter_percentile_ranksRetrieves percentile ranks for batters in a given year. ARGUMENTS year: The year for which you wish to retrieve percentile data. Format: YYYY. start_row: optional (defaults to None) : starting row index for truncating large results (0-based, inclusive) end_row: optional (defau...3 paramsRetrieves percentile ranks for batters in a given year. ARGUMENTS year: The year for which you wish to retrieve percentile data. Format: YYYY. start_row: optional (defaults to None) : starting row index for truncating large results (0-based, inclusive) end_row: optional (defau...
yearintegerend_rowvaluestart_rowvalueget_statcast_pitcher_percentile_ranksRetrieves percentile ranks for each player in a given year, including batters with 2.1 PA per team game and 1.25 for pitchers. It includes percentiles on expected stats, batted ball data, and spin rates, among others. ARGUMENTS year: The year for which you wish to retrieve per...3 paramsRetrieves percentile ranks for each player in a given year, including batters with 2.1 PA per team game and 1.25 for pitchers. It includes percentiles on expected stats, batted ball data, and spin rates, among others. ARGUMENTS year: The year for which you wish to retrieve per...
yearintegerend_rowvaluestart_rowvalueget_statcast_batter_pitch_arsenalRetrieves outcome data for batters split by the pitch type in a given year. ARGUMENTS year: The year for which you wish to retrieve pitch arsenal data. Format: YYYY. minPA: The minimum number of plate appearances for each player. If a player falls below this threshold, they wi...4 paramsRetrieves outcome data for batters split by the pitch type in a given year. ARGUMENTS year: The year for which you wish to retrieve pitch arsenal data. Format: YYYY. minPA: The minimum number of plate appearances for each player. If a player falls below this threshold, they wi...
yearintegerminPAintegerend_rowvaluestart_rowvalueget_statcast_pitcher_pitch_arsenalRetrieves high level stats on each pitcher's arsenal in a given year. ARGUMENTS year: The year for which you wish to retrieve expected stats data. Format: YYYY. minP: The minimum number of pitches thrown. If a player falls below this threshold, they will be excluded from the r...5 paramsRetrieves high level stats on each pitcher's arsenal in a given year. ARGUMENTS year: The year for which you wish to retrieve expected stats data. Format: YYYY. minP: The minimum number of pitches thrown. If a player falls below this threshold, they will be excluded from the r...
minPvalueyearintegerend_rowvaluestart_rowvaluearsenal_typestringget_statcast_single_gamePulls statcast play-level data from Baseball Savant for a single game, identified by its MLB game ID (game_pk in statcast data) INPUTS: game_pk : 6-digit integer MLB game ID to retrieve start_row: optional (defaults to None) : starting row index for truncating large results (0...3 paramsPulls statcast play-level data from Baseball Savant for a single game, identified by its MLB game ID (game_pk in statcast data) INPUTS: game_pk : 6-digit integer MLB game ID to retrieve start_row: optional (defaults to None) : starting row index for truncating large results (0...
end_rowvaluegame_pkintegerstart_rowvaluecreate_strike_zone_plotProduces a pitches overlaid on a strike zone using StatCast data Args: data: (pandas.DataFrame) StatCast pandas.DataFrame of StatCast pitcher data title: (str), default = '' Optional: Title of plot colorby: (str), default = 'pitch_type' Optional: Which category to color the ma...5 paramsProduces a pitches overlaid on a strike zone using StatCast data Args: data: (pandas.DataFrame) StatCast pandas.DataFrame of StatCast pitcher data title: (str), default = '' Optional: Title of plot colorby: (str), default = 'pitch_type' Optional: Which category to color the ma...
dataobjecttitlestringcolorbystringannotationstringlegend_titlestringcreate_spraychart_plotProduces a spraychart using statcast data overlayed on specified stadium Args: data: (pandas.DataFrame) StatCast pandas.DataFrame of StatCast batter data team_stadium: (str) Team whose stadium the hits will be overlaid on title: (str), default = '' Optional: Title of plot size...8 paramsProduces a spraychart using statcast data overlayed on specified stadium Args: data: (pandas.DataFrame) StatCast pandas.DataFrame of StatCast batter data team_stadium: (str) Team whose stadium the hits will be overlaid on title: (str), default = '' Optional: Title of plot size...
dataobjectsizeintegertitlestringwidthintegerheightintegercolorbystringlegend_titlestringteam_stadiumstringcreate_bb_profile_plotPlots a given StatCast parameter split by bb_type Args: df: (pandas.DataFrame) pandas.DataFrame of StatCast batter data (retrieved through statcast, statcast_batter, etc) parameter: (str), default = 'launch_angle' Optional: Parameter to plot2 paramsPlots a given StatCast parameter split by bb_type Args: df: (pandas.DataFrame) pandas.DataFrame of StatCast batter data (retrieved through statcast, statcast_batter, etc) parameter: (str), default = 'launch_angle' Optional: Parameter to plot
dataobjectparameterstringcreate_teams_plotPlots a scatter plot with each MLB team Args: data: (pandas.DataFrame) pandas.DataFrame of Fangraphs team data (retrieved through team_batting or team_pitching) x_axis: (str) Stat name to be plotted as the x_axis of the chart y_axis: (str) Stat name to be plotted as the y_axis...4 paramsPlots a scatter plot with each MLB team Args: data: (pandas.DataFrame) pandas.DataFrame of Fangraphs team data (retrieved through team_batting or team_pitching) x_axis: (str) Stat name to be plotted as the x_axis of the chart y_axis: (str) Stat name to be plotted as the y_axis...
dataobjecttitlevaluex_axisstringy_axisstringget_pitching_stats_brefGet all pitching stats for a set season. If no argument is supplied, gives stats for current season to date.1 paramsGet all pitching stats for a set season. If no argument is supplied, gives stats for current season to date.
seasonvalueget_pitching_stats_rangeGet all pitching stats for a set time range. This can be the past week, the month of August, anything. Just supply the start and end date in YYYY-MM-DD format.2 paramsGet all pitching stats for a set time range. This can be the past week, the month of August, anything. Just supply the start and end date in YYYY-MM-DD format.
end_dtvaluestart_dtstringget_pitching_statsGet season-level pitching data from FanGraphs. Args: start_season: First season to retrieve data from end_season: Final season to retrieve data from. If None, returns only start_season. league: Either "all", "nl", "al", or "mnl" qual: Minimum number of plate appearances to be...5 paramsGet season-level pitching data from FanGraphs. Args: start_season: First season to retrieve data from end_season: Final season to retrieve data from. If None, returns only start_season. league: Either "all", "nl", "al", or "mnl" qual: Minimum number of plate appearances to be...
indintegerqualvalueleaguestringend_seasonvaluestart_seasonintegerget_playerid_lookupLookup playerIDs (MLB AM, bbref, retrosheet, FG) for a given player Args: last (str, required): Player's last name. first (str, optional): Player's first name. Defaults to None. fuzzy (bool, optional): In case of typos, returns players with names close to input. Defaults to Fa...3 paramsLookup playerIDs (MLB AM, bbref, retrosheet, FG) for a given player Args: last (str, required): Player's last name. first (str, optional): Player's first name. Defaults to None. fuzzy (bool, optional): In case of typos, returns players with names close to input. Defaults to Fa...
laststringfirstvaluefuzzybooleanreverse_lookup_playerRetrieve a table of player information given a list of player ids :param player_ids: list of player ids :type player_ids: list :param key_type: name of the key type being looked up (one of "mlbam", "retro", "bbref", or "fangraphs") :type key_type: str :rtype: :class:`pandas.co...2 paramsRetrieve a table of player information given a list of player ids :param player_ids: list of player ids :type player_ids: list :param key_type: name of the key type being looked up (one of "mlbam", "retro", "bbref", or "fangraphs") :type key_type: str :rtype: :class:`pandas.co...
key_typestringplayer_idsarrayget_schedule_and_recordRetrieve a team's game-level results for a given season, including win/loss/tie result, score, attendance, and winning/losing/saving pitcher. If the season is incomplete, it will provide scheduling information for future games. ARGUMENTS season: Integer. The season for which y...2 paramsRetrieve a team's game-level results for a given season, including win/loss/tie result, score, attendance, and winning/losing/saving pitcher. If the season is incomplete, it will provide scheduling information for future games. ARGUMENTS season: Integer. The season for which y...
teamstringseasonintegerget_player_splitsReturns a dataframe of all split stats for a given player. If player_info is True, this will also return a dictionary that includes player position, handedness, height, weight, position, and team4 paramsReturns a dataframe of all split stats for a given player. If player_info is True, this will also return a dictionary that includes player position, handedness, height, weight, position, and team
yearvalueplayeridstringplayer_infobooleanpitching_splitsbooleanget_pybaseball_standingsReturns a pandas DataFrame of the standings for a given MLB season, or the most recent standings if the date is not specified. ARGUMENTS season (int): the year of the season1 paramsReturns a pandas DataFrame of the standings for a given MLB season, or the most recent standings if the date is not specified. ARGUMENTS season (int): the year of the season
seasonvalueget_team_battingGet season-level Batting Statistics for Specific Team (from Baseball-Reference) ARGUMENTS: team : str : The Team Abbreviation (i.e. 'NYY' for Yankees) of the Team you want data for start_season : int : first season you want data for (or the only season if you do not specify an...4 paramsGet season-level Batting Statistics for Specific Team (from Baseball-Reference) ARGUMENTS: team : str : The Team Abbreviation (i.e. 'NYY' for Yankees) of the Team you want data for start_season : int : first season you want data for (or the only season if you do not specify an...
indintegerleaguestringend_seasonvaluestart_seasonintegerget_team_fieldingGet season-level Fielding Statistics for Specific Team (from Baseball-Reference) ARGUMENTS: team : str : The Team Abbreviation (i.e., 'NYY' for Yankees) of the Team you want data for start_season : int : first season you want data for (or the only season if you do not specify...4 paramsGet season-level Fielding Statistics for Specific Team (from Baseball-Reference) ARGUMENTS: team : str : The Team Abbreviation (i.e., 'NYY' for Yankees) of the Team you want data for start_season : int : first season you want data for (or the only season if you do not specify...
indintegerleaguestringend_seasonvaluestart_seasonintegerget_team_pitchingGet season-level Pitching Statistics for Specific Team (from Baseball-Reference) ARGUMENTS: team : str : The Team Abbreviation (i.e. 'NYY' for Yankees) of the Team you want data for start_season : int : first season you want data for (or the only season if you do not specify a...4 paramsGet season-level Pitching Statistics for Specific Team (from Baseball-Reference) ARGUMENTS: team : str : The Team Abbreviation (i.e. 'NYY' for Yankees) of the Team you want data for start_season : int : first season you want data for (or the only season if you do not specify a...
indintegerleaguestringend_seasonvaluestart_seasonintegerget_top_prospectsRetrieves the top prospects by team or leaguewide. It can return top prospect pitchers, batters, or both. ARGUMENTS team: The team name for which you wish to retrieve top prospects. If not specified, the function will return leaguewide top prospects. playerType: Either "pitche...2 paramsRetrieves the top prospects by team or leaguewide. It can return top prospect pitchers, batters, or both. ARGUMENTS team: The team name for which you wish to retrieve top prospects. If not specified, the function will return leaguewide top prospects. playerType: Either "pitche...
teamvalueplayer_typevalueMLB Stats API MCP — official MLB statistics (keyless).
Part of Pipeworx — an MCP gateway connecting AI agents to 785+ live data sources.
| Tool | Description |
|---|
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
{
"mcpServers": {
"mlb-stats": {
"url": "https://gateway.pipeworx.io/mlb-stats/mcp"
}
}
}
Or connect to the full Pipeworx gateway for access to all 785+ data sources:
{
"mcpServers": {
"pipeworx": {
"url": "https://gateway.pipeworx.io/mcp"
}
}
}
Instead of calling tools directly, you can ask questions in plain English:
ask_pipeworx({ question: "your question about Mlb Stats data" })
The gateway picks the right tool and fills the arguments automatically.
MIT