Statcast MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add statcast-mcp -- npx -y @alex-rimerman/statcast-mcp
README.md

Query MLB Statcast data using plain English

Statcast MCP Server

A MCP (Model Context Protocol) server that lets you query MLB Statcast data using plain English. Ask your AI assistant about players, games, stats, leaderboards, and more — no coding required.

Built on pybaseball, this server gives AI assistants direct access to data from Baseball Savant, FanGraphs, and Baseball Reference.

What Can You Ask?

Once connected, just talk to your AI assistant naturally:

  • "How did Aaron Judge hit in July 2024?"
  • "Show me Gerrit Cole's pitch arsenal this season"
  • "Who had the highest exit velocity in 2024?"
  • "What were the NL standings at the end of 2023?"
  • "Find me the most undervalued hitters — compare xBA to actual BA"
  • "Expected stats for the whole Yankees lineup and their five starters" (use expected_stats_batch with comma-separated names)
  • "Who are the fastest players in baseball right now?"
  • "Show me every pitch from the Yankees-Red Sox game on July 4, 2024"

The AI translates your questions into the right data queries automatically.

Example: Prompt & Response

Here's what a typical exchange looks like when you use the Statcast MCP:

Prompt

"What were Gerrit Cole's arsenal statistics in 2023?"

Response

Pitch Type Usage Pitches PA BA SLG Whiff% K% Run Val/100
4-Seam Fastball 52.9% 1,737 427 .202 .333 23.0% 28.3% +1.7
Slider 20.8% 683 175 .186 .251 32.7% 29.1% +1.4
Curveball 12.1% 396 97 .215 .269 24.4% 27.8% +1.4
Cutter 7.0% 231 65 .262 .377 31.1% 23.1% +1.6
Changeup 7.1% 233 54 .235 .510 28.6% 13.0% −1.3

His 4-seam fastball was his primary weapon (52.9% usage) with a .202 BA against and +1.7 run value per 100 pitches. The changeup was his only negative pitch (−1.3 run value).


Another prompt

"Who had the highest exit velocity in 2024?"

Response

The AI calls statcast_batter_exitvelo_barrels(year=2024) and returns the leaderboard — Aaron Judge led with a 97.0 mph average exit velocity and 21.8% barrel rate, followed by [other top hitters]...


Available Tools

Tool What It Does
player_lookup Find any player's ID, years active, and database links
statcast_search Pitch-by-pitch data for a date range (optionally filtered by team)
statcast_batter Every pitch a specific batter saw in a date range
statcast_batter_pitch_arsenal Batting stats by pitch type (BA, SLG, wOBA vs fastballs, sliders, etc.)
statcast_pitcher Every pitch a specific pitcher threw in a date range
season_batting_stats Full-season batting stats from FanGraphs (AVG, OPS, WAR, wRC+, etc.)
season_pitching_stats Full-season pitching stats from FanGraphs (ERA, FIP, K/9, WAR, etc.)
team_season_batting_stats Team batting — full roster actual stats (FG, or BRef fallback)
team_season_pitching_stats Team pitching — rotation + bullpen actual stats (FG, or BRef fallback)
statcast_batter_expected_stats xBA, xSLG, xwOBA leaderboard — who deserves better stats?
statcast_pitcher_expected_stats Expected stats allowed by pitchers
expected_stats_batch Expected stats for many batters and/or pitchers in one call (lineups, rotations)
statcast_batter_exitvelo_barrels Exit velocity and barrel rate leaders
statcast_pitcher_exitvelo_barrels Exit velocity and barrel rate allowed by pitchers
statcast_pitcher_pitch_arsenal Pitch mix breakdown (% fastball, slider, curve, etc.)
statcast_pitcher_arsenal_stats Performance stats per pitch type (whiff rate, BA against, etc.)
sprint_speed_leaderboard Fastest players in baseball by sprint speed
team_standings Division standings for any season
batter_percentile_ranks Statcast percentile ranks for hitters (exit velo, barrel%, xwOBA, etc.)
pitcher_percentile_ranks Statcast percentile ranks for pitchers (stuff, spin, whiff%, etc.)
outs_above_average Defensive OAA leaderboard by position (SS, CF, ALL, etc.)
outfield_directional_oaa Outfield OAA by direction (back/in, L/R)
batting_stats_date_range Batting stats over any date range (Baseball Reference)
pitching_stats_date_range Pitching stats over any date range (Baseball Reference)

Team seasons: Use team_season_batting_stats / team_season_pitching_stats with a 3-letter code (PHI, NYY, …) for a full roster’s actual stats (lineup + staff). FanGraphs is tried first; Baseball Reference is used if FG fails or returns nothing.

Player search: Nearly every leaderboard/stat tool a

Tools (24)

player_lookupFind any player's ID, years active, and database links
statcast_searchPitch-by-pitch data for a date range
statcast_batterEvery pitch a specific batter saw in a date range
statcast_batter_pitch_arsenalBatting stats by pitch type
statcast_pitcherEvery pitch a specific pitcher threw in a date range
season_batting_statsFull-season batting stats from FanGraphs
season_pitching_statsFull-season pitching stats from FanGraphs
team_season_batting_statsTeam batting full roster actual stats
team_season_pitching_statsTeam pitching rotation and bullpen actual stats
statcast_batter_expected_statsxBA, xSLG, xwOBA leaderboard
statcast_pitcher_expected_statsExpected stats allowed by pitchers
expected_stats_batchExpected stats for many batters and/or pitchers in one call
statcast_batter_exitvelo_barrelsExit velocity and barrel rate leaders
statcast_pitcher_exitvelo_barrelsExit velocity and barrel rate allowed by pitchers
statcast_pitcher_pitch_arsenalPitch mix breakdown
statcast_pitcher_arsenal_statsPerformance stats per pitch type
sprint_speed_leaderboardFastest players in baseball by sprint speed
team_standingsDivision standings for any season
batter_percentile_ranksStatcast percentile ranks for hitters
pitcher_percentile_ranksStatcast percentile ranks for pitchers
outs_above_averageDefensive OAA leaderboard by position
outfield_directional_oaaOutfield OAA by direction
batting_stats_date_rangeBatting stats over any date range
pitching_stats_date_rangePitching stats over any date range

Configuration

claude_desktop_config.json
{"mcpServers": {"statcast": {"command": "npx", "args": ["-y", "@alex-rimerman/statcast-mcp"]}}}

Try it

How did Aaron Judge hit in July 2024?
Show me Gerrit Cole's pitch arsenal this season
Who had the highest exit velocity in 2024?
What were the NL standings at the end of 2023?
Find me the most undervalued hitters by comparing xBA to actual BA

Frequently Asked Questions

What are the key features of Statcast MCP Server?

Natural language querying of MLB Statcast, FanGraphs, and Baseball Reference data. Comprehensive player performance analysis including pitch-level data. Support for season leaderboards and team standings. Batch processing for lineup and rotation statistics. Defensive metrics including Outs Above Average (OAA).

What can I use Statcast MCP Server for?

Analyzing player pitch arsenals and performance metrics for fantasy baseball research. Comparing expected stats (xBA, xwOBA) against actual results to identify undervalued players. Retrieving historical team standings and roster statistics for sports journalism. Evaluating defensive performance using OAA leaderboards by position.

How do I install Statcast MCP Server?

Install Statcast MCP Server by running: npx -y @alex-rimerman/statcast-mcp

What MCP clients work with Statcast MCP Server?

Statcast MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Statcast MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare