yahoo-fantasy-mcp
yahoo-fantasy-mcp
An MCP server over Yahoo Fantasy Sports, backed by a self-owned Yahoo Developer OAuth2 app. Read-only — it reports on leagues, rosters, and matchups but does not set lineups or make transactions.
Runs over stdio, registered in ~/.claude.json as yahoo-fantasy.
Tools
Tool | Purpose |
| Fantasy games (NFL, NBA, MLB, NHL) the account has played |
| Leagues for the account, optionally filtered by game |
| Scoring rules, roster slots, league configuration |
| Current standings with W/L/T and points |
| Adds, drops, and trades |
| Matchups and scores for a given week |
| A team's roster, optionally for a specific week |
| A team's full matchup history |
| Player search within a league, with filters |
| Escape hatch — arbitrary path against the Fantasy API |
yahoo_fantasy_raw_get exists because Yahoo's API surface is much wider than the
typed tools above, and its response shapes are too irregular to wrap exhaustively.
Use it when a typed tool doesn't cover what you need.
Auth
OAuth2 with a refresh token in credentials/token.json (gitignored). Yahoo
does rotate refresh tokens on use, so the stored token is rewritten after each
refresh — meaning credentials/ must be writable, and restoring an old backup of
it will fail with an invalid-grant error rather than working.
npm run authorize # one-time browser consent
npm run check-auth # verify the stored token still worksSetup
Requires Node 20+.
Create an app at developer.yahoo.com/apps with Fantasy Sports → Read permission. Set the redirect URI to OOB (out-of-band): Yahoo displays the code on screen instead of redirecting, so there is no callback server to run.
Save the id and secret to
credentials/client_secret.json— seecredentials/client_secret.example.json.credentials/is git-ignored.Authorize and register:
npm ci npm run authorize claude mcp add yahoo-fantasy -- node <path>/yahoo-fantasy-mcp/src/index.js
Tests
npm testRegistration plus the OAuth constants that silently break consent if changed — notably the out-of-band redirect. No network and no credentials.
Layout
src/auth.js token load, rotate-on-refresh, caching
src/fantasy.js all tool registrations
src/index.js McpServer construction + stdio transport
scripts/authorize.js one-time OAuth consent flow
scripts/check-token.js token health checkNotes
Yahoo's resource keys are positional and awkward: a league key looks like
nfl.l.123456, a team key likenfl.l.123456.t.7.yahoo_get_my_leaguesis the reliable way to discover the keys the other tools need.The API returns XML-shaped JSON with numeric-string object keys and
countfields rather than plain arrays. Responses are passed through as-is, so expect that structure rather than idiomatic JSON.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/brettadams0/yahoo-fantasy-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server