Yahoo Fantasy Baseball MCP Server
Fetches player statistics and advanced metrics from the MLB Stats API, including traditional stats (G, PA, HR, RBI, R, SB, BA, OBP, SLG, OPS, BABIP) and Statcast data (exit velocity, barrel rate, expected stats like xBA, xSLG, xwOBA, sprint speed) via integration with Baseball Savant and FanGraphs.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Yahoo Fantasy Baseball MCP Servershow my roster and player stats"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Yahoo Fantasy Baseball MCP Server
A Yahoo Fantasy Baseball MCP server for Claude and Codex.
For Claude Desktop, just drag the .mcpb file into Claude and you're done. No npm, no terminal, no config files. Codex is also supported through standard MCP configuration.
Let your AI assistant look after your Yahoo Fantasy Baseball team: check your roster, scout free agents, review your matchup, and more. Everything runs on your own computer with your own Yahoo access.
Note: Adding/dropping players and setting lineups are not supported — Yahoo has deprecated the write-scope Fantasy Sports API (yfpy#79).
Part 1 · Install
Using OpenAI Codex instead of Claude? Skip this section — follow Use with OpenAI Codex to register the server, then continue from Part 2 to connect your Yahoo team.
Download
yahoo-fantasy-baseball-vX.X.X.mcpbfrom the Releases page.Open Claude Desktop — get it at claude.ai/download if needed.
Go to Settings → Extensions.
Drag the
.mcpbfile into the Extensions window and click Install.
Leave the Client ID / Client Secret boxes empty for now — you'll fill them in during setup.
Related MCP server: flaim
Part 2 · Connect your Yahoo team
You only do this once. In a chat, type fantasy start and follow the prompts.
a) Create your free Yahoo app
Go to developer.yahoo.com/apps/create and fill in:
Application Name: anything (e.g. "My Fantasy Helper")
Homepage URL:
https://localhost:8488Redirect URI(s):
https://localhost:8488/callbackOAuth Client Type: Confidential Client
API Permissions: Fantasy Sports → Read
Click Create App
Yahoo gives you a Client ID and Client Secret.
b) Enter those values
Paste them into the chat (or, on Claude Desktop, enter them in Settings → Extensions → Yahoo Fantasy Baseball), then say fantasy start again.
c) Authorize and finish
Click the authorization link, then click Agree. If your browser warns about a self-signed certificate, click Advanced → Proceed to localhost. Once you see "Authorization complete!", say fantasy authorize. The AI will find your leagues, set your team as default, and you're ready. 🎉
Stuck? Type
fantasy statusto see what's left.
Part 3 · Talk to your team
Say this… | …to |
| Show your current roster |
| Summarize this week's matchup |
| Show league standings |
| Find the best free agents |
| Show your team's weekly totals |
| List recent adds, drops, and trades |
| List probable starting pitchers for a date (add "and who's a free agent" for ownership) |
| Pull Statcast, xStats, FanGraphs WAR/wRC+, and recent splits |
| Run the above for every player on your roster |
You can also ask naturally: "Who on my bench should I start tonight?" or "Is there a better closer available?"
What "analyze" pulls
Source | Stats |
MLB Stats API | Season totals + 14-day & 30-day splits |
Baseball Savant | xBA, xSLG, xwOBA vs. actual; exit velocity, barrel %, hard-hit % |
FanGraphs | WAR, wRC+/FIP/xFIP, K%, BB%, SwStr%, GB/FB% |
Analysis automatically targets your league's scoring categories. Results include links to each player's page on Baseball Savant, MLB.com, Baseball Reference, and FanGraphs. Leaderboard data is cached for one hour.
Install the roster review skill
We provide a Fantasy Roster Review skill for a more structured roster review
workflow. The skill only drives the Yahoo tools from this MCP server, so it's a
separate install from the server — register the server first (Part 1 or the
MCP client steps), then add the
skill for your client below. Once both are in place, ask for fantasy roster review.
Claude Desktop
The .mcpb extension carries the tools but not the skill, and the command
above doesn't target the desktop app — upload the skill manually:
Download
fantasy-roster-review-skill.zipfrom the Releases page.In Claude Desktop, turn on code execution under Settings → Capabilities (skills require it).
Go to Customize → Skills, click + → Create skill → Upload a skill, and select the ZIP.
The skill then appears in your list, ready to toggle on.
Claude Code, Codex & other CLI agents
Install the skill with one command — it detects your installed agents and drops the skill into each one's skills folder:
npx skills add dingyiyi0226/fantasy-baseball-mcpThen restart your client.
Use with Claude Code, Codex & other MCP clients
The one-click .mcpb bundle in Part 1 is for Claude Desktop only. Every other MCP client — Claude Code, OpenAI Codex, and the rest — runs the same server over stdio. Register it once with the steps below, then connect your Yahoo team exactly as in Part 2 (fantasy start).
Use with Claude Code or any MCP client
claude mcp add yahoo-fantasy-baseball \
-e YF_CLIENT_ID=your_id -e YF_CLIENT_SECRET=your_secret \
-- node /absolute/path/to/dist/cli.js serveOr add to claude_desktop_config.json:
{
"mcpServers": {
"yahoo-fantasy-baseball": {
"command": "node",
"args": ["/absolute/path/to/dist/cli.js", "serve"],
"env": { "YF_CLIENT_ID": "your_id", "YF_CLIENT_SECRET": "your_secret" }
}
}
}Use with OpenAI Codex
Codex has no one-click bundle like Claude's .mcpb. The server is the same; only how you register it differs. No clone or build needed — npx fetches the published package. After registering, restart Codex and run fantasy start to connect your Yahoo team.
Requires Node.js 18+ (it provides
npx). Install it from nodejs.org/download — or on macOS just runbrew install node. Unlike Claude Desktop, which bundles a Node runtime, Codex launches the command in your own environment, so Node must be installed.
Desktop app — Settings → MCP → Connect to a custom MCP, choose STDIO, and fill in:
Field | Value |
Name |
|
Command to launch |
|
Arguments |
|
Environment variables |
|
Working directory | leave blank |
"Command not found"? GUI apps don't always inherit your shell
PATH. Runwhich npxin a terminal and paste that absolute path into "Command to launch."
CLI / IDE extension — add to ~/.codex/config.toml (/mcp confirms the connection):
[mcp_servers.yahoo-fantasy-baseball]
command = "npx"
args = ["-y", "yahoo-fantasy-baseball-mcp@latest", "serve"]
[mcp_servers.yahoo-fantasy-baseball.env]
YF_CLIENT_ID = "your_id"
YF_CLIENT_SECRET = "your_secret"From a local checkout instead of npm: run
npm install && npm run build, then usenodeas the command with/absolute/path/to/dist/cli.js serveas the arguments.
A copy-paste version lives in codex.config.example.toml.
FAQ
Is my data safe? Your Yahoo keys are stored only on your computer (~/.yahoo-fantasy-mcp/config.json) and in your OS keychain. Nothing is sent anywhere but Yahoo's API.
Why do I need my own Yahoo app? Yahoo requires each person to use their own keys — no shared secrets.
Rate limit errors? Yahoo limits heavy use. Wait an hour and try again.
Does this cost anything? No. Both the Yahoo app and this extension are free.
analyze commands fail with a connection error? Your AI client may need explicit permission to reach the stats APIs. On Claude Desktop / Claude.ai, go to Settings → Capabilities (Team/Enterprise: Organization settings → Capabilities) and add these under Additional allowed domains:
Domain | Used for |
| MLB Stats API |
| Statcast / expected stats |
| FanGraphs WAR/wRC+ |
On Codex or other clients, check your client's network/domain allowlist settings.
For developers
Local MCP server (Node.js + TypeScript, stdio transport) for the Yahoo Fantasy Sports v2 API.
npm install
npm run build # compile TypeScript → dist/
node dist/cli.js auth # optional terminal auth
node dist/cli.js serve # run MCP server over stdio
npm run pack # build .mcpb bundleTools
Onboarding: fantasy_status, fantasy_login, fantasy_authorize, fantasy_logout, fantasy_select_team
Read: list_leagues, get_league, get_standings, get_teams, get_roster, get_roster_stats, get_team_stats_week, get_team_stats_season, get_matchups, get_team_matchups, get_player_stats, list_players, rank_players, search_players, get_league_scoring_categories, get_transactions
Several tools come in a light/detailed pair — prefer the lighter one unless stats are needed: get_standings vs get_teams (+matchups), get_roster vs get_roster_stats (+stats), list_players vs rank_players (+stats).
Analysis (public APIs; list_probable_starters adds optional Yahoo ownership): analyze_player_stats, analyze_roster_stats (accepts optional playerKeys array, max 10 per call), list_probable_starters (MLB probable starting pitchers for a date; fantasyContext: true labels each by ownership)
Write (deprecated by Yahoo — require force: true): add_drop_player, set_lineup
Credentials resolve from the saved config or YF_CLIENT_ID / YF_CLIENT_SECRET env vars. Releases are published automatically by GitHub Actions on a v* tag.
License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dingyiyi0226/fantasy-baseball-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server