
该仓库是公开的,允许用户下载《发展中棒球》的Statcast MCP。
概览
一个MCP(模型上下文协议)服务器,允许你查询。向你的AI助手询问球员、比赛、统计、排行榜等——无需编码。 该服务器基于pybaseball,为AI助手提供直接访问来自、、和的数据。 连接后,只需自然地与你的AI助手对话: - “亚伦·贾奇2024年7月的打击表现如何?” - “给我看看格里特·科尔本赛季的投球武器库” - “2024年谁的出局速度最高?” - “2023年底国家联盟排名如何?”- “帮我找出最被低估的打者——将xBA与实际打击率对比” - “整个洋基打线及其五名先发的预期数据”(使用逗号分隔的expected_stats_batch)- “目前棒球界最快的球员是谁?”- “给我看2024年7月4日洋基对红袜比赛的每一球” AI会自动将你的问题转化为正确的数据查询。
概述(AI 翻译)
一个MCP(模型上下文协议)服务器,允许你用通俗易懂的英语查询MLB统计数据。向你的AI助手询问球员、比赛、统计、排行榜等——无需编码。
该服务器基于pybaseball,允许AI助手直接访问Baseball Savant、FanGraphs和Baseball Reference的数据。
你能问什么?
连接后,只需自然地与你的AI助手对话:
- “亚伦·贾奇在2024年7月的表现如何?”
- “给我看看格里特·科尔本赛季的投球武器库”
- “2024年谁拥有最高的退出速度?”
- “2023年底国家联盟排名如何?”
- “帮我找出最被低估的击球手——将xBA与实际BA进行比较”
- “整个洋基队打线及其五名先发的预期数据”(使用
expected_stats_batch,并用逗号分隔的名字) - “目前棒球界最快的球员是谁?”
- “给我看2024年7月4日洋基对红袜比赛的每一次投球”
AI会自动将你的问题转化为正确的数据查询。
示例:提示与回应
以下是使用Statcast MCP时的典型交换流程:
提示词
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
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_batchwith 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 (default 10 rows; up to 5000 if many fuzzy matches) |
statcast_search |
Pitch-by-pitch data for a date range (optionally filtered by team); default 100 pitch rows, up to 5000 |
statcast_batter |
Every pitch a specific batter saw in a date range (default 100 rows, up to 5000) |
statcast_batter_pitch_arsenal |
Batting stats by pitch type (BA, SLG, wOBA vs fastballs, sliders, etc.) |
安装
npx @modelcontextprotocol/inspector statcast-mcp配置
{
"mcpServers": {
"statcast": {
"command": "statcast-mcp"
}
}
}