FastballAPI MCP Server
Provides MLB baseball data and analytics, including pitch-by-pitch data, plate appearances, box scores, standings, team and player stats, Elo ratings, run values, sportsbook odds, line movement, and player prop lines and history for MLB seasons since 2015.
This server has a remotely hosted endpoint. Open its connector listing for connection details, authentication requirements, and setup instructions:
FastballAPI MCP server
The baseball data API. Pitch-by-pitch data with pitch type, velocity and location, every plate appearance with base-out state and the batted ball, box scores, standings, our own ratings and run values, sportsbook lines by book and MLB player prop lines. MLB since 2015 plus the NCAA Division I games we cover. REST API and MCP server. 500 free credits every month, no card.
Website: https://fastballapi.com?utm_source=github&utm_medium=readme&utm_campaign=fastballapi-mcp · Docs: https://fastballapi.com/docs?utm_source=github&utm_medium=readme&utm_campaign=fastballapi-mcp · Get a key: https://fastballapi.com/signup?utm_source=github&utm_medium=readme&utm_campaign=fastballapi-mcp
You: "What is Gerrit Cole's whiff rate by pitch type this season?"
Claude: [calls get_pitch_mix]
You: "How often did Aaron Judge homer on a 3-2 count in 2025?"
Claude: [calls get_plate_appearances]
You: "How often has Shohei Ohtani gone over his total bases line since 2023?"
Claude: [calls get_prop_history]Run it locally (stdio)
Most clients connect to https://mcp.fastballapi.com/mcp directly. For a client that launches a local process instead:
git clone https://github.com/sports-data-hq/fastballapi-mcp.git && cd fastballapi-mcp && npm install
FASTBALLAPI_API_KEY=your_key node index.js{ "mcpServers": { "fastballapi": { "command": "node", "args": ["/path/to/fastballapi-mcp/index.js"], "env": { "FASTBALLAPI_API_KEY": "your_key" } } } }It forwards to the hosted server with your key, so every tool and credit cost is the same.
Related MCP server: Baseball Stats MCP Server
Try it now, no key
A free season of baseball data: the last completed season as CSV (games, standings, player season totals and our ratings). Download the zip or browse what's in it.
Open it in Colab:
loads the pack and answers three questions in a minute.
Ask Claude without a key: install the skills below;
season-pack-offlineanswers from the pack until you connect.
With a free key it does far more: every earlier season, today's games, play-by-play, lineups, odds and player props with their history and movement, and every skill below running on live data. Get a free key: 500 credits a month, no card.
Skills
10 Claude skills for baseball ship in this repo, plus 13 analytics skills for models, backtests, calibration and comparing a model with the market. Every number in an answer comes from a live FastballAPI tool call, and odds are information only: no stakes, no picks.
Claude Code:
/plugin marketplace add sports-data-hq/fastballapi-mcp
/plugin install mlb-data@fastballapi
/plugin install sports-analytics-core@fastballapiCodex: codex plugin marketplace add sports-data-hq/fastballapi-mcp. Any agent that reads skills: npx skills add sports-data-hq/fastballapi-mcp.
Skill | What it does |
| Where a batter hits the ball: trajectory and field direction, with hit rates and counts |
| Stacks and lineups from your salary file, with implied team totals and hitter and pitcher projections |
| Waiver pickups by playing time over the last two weeks, then quality, with sample-size flags |
| One-page preview: records, run differential, our Elo, the starters' arsenals, injuries and the line |
| How an MLB moneyline, run line or total moved by book, opening to closing, with the alternate-line ladders |
| Has a pitcher changed? Pitch usage, velocity and whiff rate by pitch type across games or seasons |
| Strikeout, outs, hits, home run and total bases lines by sportsbook, with the record against the line and workload |
| Who is due to regress: results against steadier rates like BABIP, strikeouts, walks and home runs per fly |
| Fantasy streaming plan for the week: probable starters, opponents and park context |
| The biggest win-probability swings of a game, plate appearance by plate appearance |
The analytics skills: backtesting, data-pipeline, elo-engineering, feature-engineering, market-vs-model, model-building, odds-market-analysis, prediction-tracker, probability-calibration, season-pack-offline, sports-data-preflight, visualization, walk-forward-validation.
Real answers on live data, with the credits each used: example answers.
All nine sports' skills live in sports-data-hq/sportsdatahq-skills. The copies here are synced from there, so please open issues and pull requests there.
Python
The official Python client is on PyPI: fastballapi.
pip install fastballapi
export FASTBALLAPI_API_KEY=sk_live_...from fastballapi import Client, to_dataframe
client = Client()
props = client.get_player_props(
game_id="401815991",
market="batter_home_runs",
)
df = to_dataframe(props, key="props")
print(df[["player_name", "bookmaker", "line", "over_odds", "under_odds"]].head(10))Typed errors for a bad key, no credits left, not found and rate limits, automatic retries, and to_dataframe for pandas.
Quick start
This is a hosted (remote) MCP server over Streamable HTTP. There is nothing to install.
Claude Code
claude mcp add --transport http fastballapi "https://mcp.fastballapi.com/mcp?key=YOUR_API_KEY"Claude Desktop, Cursor and other clients
{
"mcpServers": {
"fastballapi": {
"url": "https://mcp.fastballapi.com/mcp?key=YOUR_API_KEY"
}
}
}The key can also be sent as an x-api-key header or Authorization: Bearer. Connecting and listing tools works without a key; calling a tool needs one.
REST
curl -X POST https://mcp.fastballapi.com/v1/list_teams -H "x-api-key: YOUR_API_KEY"Every tool is POST /v1/{tool} with a JSON body.
Examples
Runnable Python (standard library only) and Node 18+ (no dependencies) examples live in examples/:
examples/python/quickstart.pyandexamples/node/quickstart.mjs: schedule plus a headline call.examples/python/mlb_pitch_mix_and_props.py: A pitcher's arsenal (usage, velocity, whiff rate and ball rate per pitch type) followed by his strikeout prop lines against what he actually threw, game by game.
export FASTBALLAPI_API_KEY=your_key
python3 examples/python/quickstart.py
node examples/node/quickstart.mjsSee examples/README.md for details. Get a free key (500 credits a month, no card) at https://fastballapi.com/signup?utm_source=github&utm_medium=readme&utm_campaign=fastballapi-mcp.
Starter projects
mlb-pitch-mix: a pitcher's arsenal, what he throws in each count and his velocity by inning, in one Python script.
Use it in
Claude, ChatGPT, Cursor, VS Code, Gemini CLI, Grok, Perplexity, Le Chat: add
https://mcp.fastballapi.com/mcpas a remote MCP server. Step-by-step for each: https://fastballapi.com/mcp?utm_source=github&utm_medium=readme&utm_campaign=fastballapi-mcpGemini CLI:
gemini extensions install https://github.com/sports-data-hq/fastballapi-mcpCursor: the SportsDataHQ plugins for Cursor
Google Sheets:
=SDHQ("fastballapi","list_teams")fills a live table: https://sportsdatahq.com/sheets?utm_source=github&utm_medium=readme&utm_campaign=fastballapi-mcpREST:
POST https://mcp.fastballapi.com/v1/<tool>with anx-api-keyheader: https://fastballapi.com/docs?utm_source=github&utm_medium=readme&utm_campaign=fastballapi-mcp
Tools (23)
Tool | What it returns |
| Team ids, abbreviations and colours for a season |
| Find players by name |
| Games with runs, hits and errors by season, date, range or team |
| Upcoming games with the median line across sportsbooks |
| Standings from every final game, with run differential and Pythagorean record |
| The latest injury report |
| Our team Elo ratings, ranked |
| One game: every batting and pitching line, each book's line, win probability |
| Season batting (AVG, OBP, SLG, OPS, RE24) and pitching (ERA, WHIP, K/9) |
| A player's full batting and pitching game log |
| Season leaders among qualified batters and pitchers |
| Runs for and against, team batting and opponents' batting |
| A pitcher's arsenal: usage, velocity, whiff rate per pitch type |
| Every sportsbook's moneyline, run line and total for a game (5) or a day (10) |
| Plate-appearance play-by-play with base-out state, batted ball, win probability, RE24 |
| Pitch-by-pitch: count, type, velocity, location, result |
| Where a batter or team hits the ball, by trajectory and field |
| Snapshots of each sportsbook's line before first pitch |
| Player prop lines by sportsbook: the closing line (one pre-game capture per line before October 2026) |
| A player's prop lines against the result, game by game |
| How one player's prop line moved before a game, every capture by sportsbook |
| Opening and closing lines by sportsbook for the first-5-innings and first-inning markets (history from May 2023) |
| Alternate run lines and totals by sportsbook: every point on each book's ladder, opening and closing, from 2023 |
Leagues: mlb (default), ncaabase (NCAA Division I games we cover; pitch tools, spray charts and injuries are not offered for college).
Data
MLB games since 2015 with pitch-by-pitch data (every pitch from 2018; 2015 to 2017 have about 98 to 99% of each season's pitches)
Every plate appearance with base-out state, batted ball, win probability and RE24
Per-sportsbook moneylines, run lines and totals: 4 to 13 books per game from 2015 to 2023 (about 4 in 2015, 10 in 2016 and 2017, 7 to 8 in 2018 to 2020, 12 in 2021 to 2023), usually one book since 2024, plus opening and closing lines since July 2020 (a median of 7 books in 2021 to 2023 and 8 since 2024); pre-game line snapshots from launch: once a day, and every hour for games in the next two days
MLB player prop lines by sportsbook (hits, home runs, total bases, RBI, pitcher strikeouts, pitcher outs) from May 2023, with the result against each line (
get_player_props,get_prop_history); none for collegeNCAA Division I college baseball for the games we cover (not every Division I game)
Coverage by season, read live from the database: https://fastballapi.com/docs?utm_source=github&utm_medium=readme&utm_campaign=fastballapi-mcp
Useful pages
Docs: every endpoint with parameters and a live example response
Data atlas: what exists, which tool exposes it, coverage by season
MLB odds: upcoming moneylines, run lines and totals by sportsbook
MLB player props today: hits, home runs, total bases, RBIs and pitcher strikeouts, best price per player across books
Guides: pitch data for a model, pitch mix and whiff rate, Pythagorean standings, run value with runners in scoring position, spray charts
Data: pitch-by-pitch, spray charts, odds history, player props
College baseball: the NCAA Division I games we cover
Pricing: free tier and paid plans
Pricing
500 free credits every month, no card. Plans: Starter $19/mo (10,000 credits), Pro $49/mo (30,000), Scale $149/mo (125,000), Business $299/mo (300,000). Wallet top-ups from $5, never expire. https://fastballapi.com/pricing?utm_source=github&utm_medium=readme&utm_campaign=fastballapi-mcp
Attribution
Ratings and run values are ours. Not affiliated with MLB, the NCAA or any team.
License
MIT for the contents of this repository. Data terms as above.
Use with Codex
The SportsDataHQ skills marketplace also works in Codex (it reads .agents/plugins/marketplace.json):
codex plugin marketplace add sports-data-hq/sportsdatahq-skillsInstall mlb-data, which bundles the baseball skills and the FastballAPI MCP server.
Use with Gemini CLI
export FASTBALLAPI_API_KEY=your_key
gemini extensions install https://github.com/sports-data-hq/fastballapi-mcpThe extension adds the FastballAPI MCP server (https://mcp.fastballapi.com/mcp) and sends the key in the x-api-key header. Get a free key (500 credits a month) at https://fastballapi.com/signup?utm_source=github&utm_medium=readme&utm_campaign=fastballapi-mcp.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Provides easy access to MLB, Baseball Savant, Statcast, and Fangraphs baseball data. Query detaile…
Live sports stats and pre-computed analysis for AI assistants across NBA, MLB, NFL, and NHL.
Sports odds, player props and source coverage for AI assistants. Connect with your own API key.
Remote MCP server for live sports data. Ask for scores, standings, player stats and Elo ratings across 9 sports directly from Claude or any MCP client. Backed by the Big Balls Sports API, with one unified schema for every sport.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables users to query MLB Statcast, FanGraphs, and Baseball Reference data using natural language through an AI assistant. It provides comprehensive tools for analyzing player performance, pitch-level data, season leaderboards, and team standings.2436MIT
- AlicenseNot gradedqualityDmaintenanceProvides comprehensive baseball analytics through 32 tools covering pitching, batting, defensive metrics, and visualizations via the Model Context Protocol, enabling natural language queries for advanced Statcast and MLB statistics.MIT
- AlicenseNot gradedqualityCmaintenanceProvides access to official MLB statistics via a keyless API, enabling AI agents to query MLB data through natural language or direct tools.73 npmMIT
- AlicenseBqualityBmaintenanceEnables AI agents to query live and historical sports analytics, consensus betting odds, predictions, scores, schedules, standings, rosters, news, play-by-play, and win probabilities through structured tools and resources.52332 PyPIApache 2.0