Query MLB teams, standings, daily schedule/scores, rosters, player bios via @pipeworx/mcp-mlb-stats — credential-free
@pipeworx/mcp-mlb-stats v0.1.1 — Official MLB Statistics API, credential-free
Install: npm install @pipeworx/mcp-mlb-stats Transport: Library-style TypeScript export ({tools, callTool} — NOT stdio MCP server). Setup: copy src/index.ts out of node_modules, run with node --experimental-strip-types --no-warnings --input-type=module. API: statsapi.mlb.com — keyless, no auth required.
5 tools
| Tool | Params | What it does |
|---|---|---|
get_teams | {} | All 30 MLB teams with id, name, abbreviation, location, league, division, venue |
get_standings | {season?, league_id?} | Division standings (W/L/pct/GB/rank/streak) — defaults to 2024 if omitted |
get_schedule | {date?} | Daily game schedule with scores, status, venues — omit date for today |
get_roster | {team_id} | Active roster: player id, name, jersey number, position |
get_player | {person_id} | Player bio: name, number, DOB, age, height, weight, position, bats/throws, debut |
Verified trace (14 calls, 100% success, p50=177ms)
get_teams: 30 teams. Athletics now in Sacramento (Sutter Health Park). Each team includes league and division.
get_standings (2024 default): Yankees 94-68 (AL East 1st), Guardians 92-69 (AL Central 1st), Astros 88-73 (AL West 1st). Full 6-division breakdown with W/L/pct/GB/rank/streak.
get_standings (2025): Blue Jays and Yankees tied 94-68 (AL East). Confirms historical seasons work.
get_standings (2026 — current season): Rays 54-36 (AL East 1st), mid-season standings with current streaks. Live data.
get_standings (AL only, league_id=103): Correctly filters to 3 AL divisions only.
get_schedule (2024-10-25 — World Series G1): Dodgers 6, Yankees 3 at Dodger Stadium. gamePk=775300, status="Final".
get_schedule (today): 13 games scheduled, pre-game status with venues. Yankees at Rays, Braves at Pirates, etc.
get_schedule (2024-12-25 — Christmas): {count: 0, games: []} — correct, no MLB on Christmas.
get_roster (147 — Yankees): 26 players. Aaron Judge #99, Anthony Volpe #11, Cody Bellinger #35, etc.
get_roster (119 — Dodgers): 26 players. Freddie Freeman #5, etc.
get_roster (99999 — invalid): {count: 0, roster: []} — graceful empty, no error.
get_player (660271 — Ohtani): Shohei Ohtani, #17, Two-Way Player, 6'4" 210lbs, bats Left/throws Right, debut 2018-03-29, age 32.
get_player (592450 — Judge): Aaron Judge, #99, Outfielder, 6'7" 282lbs, bats Right/throws Right, debut 2016-08-13, age 34.
get_player (1 — invalid): {error: "MLB Stats API: 404 ..."} — proper error with message body.
get_player (string "660271"): Same result as numeric ID — both types accepted.
Key gotchas
- ⚠️ `season` defaults to "2024" if omitted — NOT the current year. Always pass the year you want explicitly.
- ⚠️ `team_id` and `person_id` accept both number and string — type union
[number, string]in schema. - ⚠️ Invalid team returns empty roster `{count:0}`, not an error — no way to distinguish "team exists but empty roster" from "team doesn't exist".
- ⚠️ Invalid player returns `{error: ...}` object (not thrown exception) — check for
errorkey in result. - ⚠️ Unknown tool returns `{error: "Unknown tool: ..."}` gracefully — no crash.
- First call ~926ms (connection init to statsapi.mlb.com), subsequent calls 147-201ms.
- Schedule includes `gamePk` — unique game identifier for cross-referencing.
- Athletics relocated — listed as "Sacramento" with Sutter Health Park, not Oakland.
- Standings `gamesBack` is "-" for division leader (string dash), not 0 or null.
- `streak` format is "W4", "L2" — letter + count shorthand.
{ "server": "@pipeworx/mcp-mlb-stats", "version": "0.1.1", "transport": "library-style", "tools": ["get_teams", "get_standings", "get_schedule", "get_roster", "get_player"], "calls": 14, "success_rate": 1, "p50_ms": 177, "teams_tested": ["Yankees (147)", "Dodgers (119)"], "players_tested": ["Ohtani (660271)", "Judge (592450)"], "seasons_tested": ["2024", "2025", "2026"], "key_data": { "total_teams": 30, "yankees_2024": "94-68", "ohtani_position": "Two-Way Player", "judge_height": "6'7"", "ws_2024_g1": "Dodgers 6 Yankees 3", "today_games": 13 } }