ESPN Fantasy Football MCP Server
The ESPN Fantasy Football MCP Server gives Claude Desktop full read/write access to your ESPN fantasy football league for analysis, advice, and roster management.
League overview: Get league name, settings, current week, team count, scoring format, roster rules, playoff structure.
Standings & rankings: View standings, power rankings, playoff picture, and league settings.
Teams & rosters: List teams, view any team's full roster with projections/injuries/starters vs bench, and identify your own team.
Matchups & scores: Get weekly matchups, live scoreboard, head-to-head history, and projected scores.
Player research: Look up player stats, season/weekly scores, injury status, NFL bye week, and remaining schedule.
Free agency & waivers: Browse top free agents by position, view recent transactions, waiver order, and pending claims.
Trades: See recent trade activity, find trade candidates for weak positions, and analyze teams for trade/improvement advice.
Lineup advice: Compare teams side-by-side, analyze roster strengths/weaknesses, get start/sit recommendations with projection-based swaps and bye/injury flags.
Write tools (with confirmation): Add/drop players, submit waiver claims with FAAB bids, set lineup starters/bench, and cancel pending claims.
Data freshness: Cache with TTL and a
refresh_leaguetool to force re-fetching all data.
Click on "Deploy 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., "@ESPN Fantasy Football MCP Server show me this week's matchups and start/sit advice for my team"
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.
ESPN Fantasy Football MCP Server
A Model Context Protocol server that gives Claude Desktop full read access to your ESPN Fantasy Football league — standings, rosters, matchups, free agents, trades, and purpose-built tools for trade and roster-improvement analysis — plus the outside context a real analyst uses: Vegas lines and weather, snap / carry / target share, official NFL depth charts and injury reports, head coaches, offense rankings, schedules, and dated news.
Ask casually; it does the research. "Should I trade Hubbard for Zay Flowers?"
runs evaluate_trade, which pulls both rosters, both teams' needs, lineup impact,
byes, and a full situational dossier on every player (is a teammate about to come
back from IR? is he in a committee? how's the offense and the coach? playoff
schedule?). The server's instructions tell Claude to call get_fantasy_context
first for anything about your team, so you never have to spell out "consider my
needs and week 6 too".
Built on espn-api and the
mcp Python SDK.
Tools exposed
Tool | What it does |
| League name, settings, current week, team count |
| Teams ranked by record and points, with streaks |
| Every team + owner (use to find names for other tools) |
| Report which team is configured as yours |
| Roster for a team (defaults to yours; starters/bench, projections, injuries) |
| All matchups for a week (scores + projections) |
| Current week's live scores |
| Season history between two teams |
| Top available FAs by position |
| A player's season stats, weekly scores, status |
| Start here. Date/week, your record & standing, scoring, roster with flags, position strength vs league, byes, injuries, pending claims, best free agents |
| Full dossier on one player: form, floor/ceiling, snap/carry/target share by week, team record + offense rank + head coach, official depth-chart slot, every teammate in his positional room with injury status, health/practice, Vegas implied total + weather, rest-of-season & playoff schedule, market, dated news |
| "Should I trade A for B?" in one call: both rosters, both teams' needs, roster legality, optimal lineup before/after, depth and byes after, dossiers on every player |
| "X or Y?" — summary table + dossiers for 2-5 players (start/sit, waiver pick, value) |
| Dated Rotowire/ESPN blurbs, practice reports and ESPN's current story for a player |
| The real NFL team: coach, offense/defense rank, official depth chart with injuries, schedule |
| Power rankings for a week |
| Recent completed trades |
| Recent adds, drops, waiver claims, and trades |
| Waiver priority / FAAB budgets + processing schedule |
| Seeds, clinched / in-contention / eliminated |
| Side-by-side starter comparison, position by position |
| Scoring format, roster slots, playoff/trade rules |
| Remaining schedule + opponent strength |
| A player's NFL bye week + remaining matchups |
| Aggregated snapshot for improvement advice |
| Trade targets for a team's weakest position |
| Projection-based start/sit swaps + injury/bye flags |
| Force a re-fetch of all league data |
Write tools (change your roster)
These modify your real ESPN team. They require the private-league cookies
(ESPN_S2 / ESPN_SWID) and act only on the team detected as yours.
Tool | What it does |
| Add a free agent and drop a player to make room (immediate) |
| Queue a waiver claim (+ FAAB bid) for the next waiver run |
| Move a player into a starting slot or the bench (start/sit) |
| Withdraw one of your pending waiver / FA claims |
There's also a read tool, get_pending_claims, that lists your own submitted-but-
unprocessed claims (add/drop, FAAB bid, and a claim id). Despite a widespread
belief that ESPN hides pending claims from the API, the mTransactions2 view
returns them for the authenticated owner — cancel_pending_claim uses that id to
withdraw one.
Every write tool is two-step: called without confirm=true it only previews
the exact move and changes nothing. It submits to ESPN only when called again with
confirm=true. Ask for the preview first, check it, then confirm.
How writes work. The read tools use the
espn-apilibrary, which is GET-only. The write tools instead POST directly to ESPN's undocumentedlm-api-writestransactions endpoint, reusing your cookies. That endpoint is reverse-engineered and unsupported by ESPN — it can change or break, and a dropped player is released to the league immediately. ESPN also can't read back pending waiver claims, so a submitted claim won't reappear in any read tool until it processes; check/cancel it in the ESPN app.
All team-name arguments accept either the team name or the owner name, matched case-insensitively as a substring. If nothing matches, the tool returns the list of valid teams so you can try again. Player names can be partial or misspelled ("chuba hubard"); ambiguous names return suggestions.
Prompts (Claude Desktop "+" menu)
trade_check, weekly_briefing, start_or_sit, waiver_targets — one-click
entry points that run the right tools and frame the answer.
Where the outside data comes from
All free, no-auth, cached, and non-fatal (a dead source blanks a section, never
breaks a tool). Set ESPN_MCP_EXTERNAL=0 to run ESPN-only.
Signal | Source |
Vegas O/U, spread, implied team totals, kickoff, weather | ESPN scoreboard API |
Offense / defense rank, points for & against, record | ESPN standings API |
Head coach, full NFL roster with injury status / IR / practice squad | ESPN team roster API |
Official offensive depth chart | ESPN core depth-chart API |
NFL schedule + bye week | ESPN team schedule API |
Snap %, carries / targets and share of team, red-zone looks (weekly) | Sleeper stats API |
Depth order, injury notes, practice participation, add/drop trends | Sleeper players API |
Dated news blurbs, current story, season outlook | ESPN fantasy news + athlete overview APIs |
The server instructions (config.GUIDANCE) also tell Claude to use web search,
when it has it, for anything newer than the dated blurbs — beat reports, practice
reports, coach quotes — before a consequential call.
Related MCP server: Yahoo Fantasy MCP
Project layout
server.py # entry point Claude Desktop runs (delegates to the package)
espn_fantasy_mcp/
config.py # env vars, constants, prompting guidance
app.py # the MCP server instance + main()
client.py # ESPN League caching (get_league / reset_league)
formatting.py # version-tolerant helpers (projections, fuzzy match, weeks…)
signals.py # per-player stats math (form, volatility, usage) — no network
sources.py # external data: Vegas, team strength, NFL rosters/depth charts, Sleeper, news
prompts.py # MCP prompts (trade_check, weekly_briefing, …)
tools/
league.py # league-wide tools (overview, standings, matchups, settings…)
teams.py # roster, head-to-head, schedule, comparison, analysis
players.py # free agents, player stats, player NFL schedule
analysis.py # analyze_player + the shared player dossier
research.py # composite tools: get_fantasy_context, evaluate_trade, compare_players, news, NFL team
advice.py # trade candidates + start/sit
roster_moves.py # WRITE tools: add/drop, waiver claim, set lineupImporting espn_fantasy_mcp.tools runs the @mcp.tool() decorators, so main()
registers every tool by importing that package before starting the stdio server.
1. Install dependencies
Requires Python 3.10+ (the mcp SDK does not support 3.8/3.9). Check with
python3 --version; if it's older, install/use a newer one (e.g. python3.11).
cd ESPN-Fantasy-MCP
python3.11 -m pip install -r requirements.txt(Or python3.11 -m pip install espn-api mcp directly.)
2. Get your ESPN cookies (private leagues only)
Public leagues need only ESPN_LEAGUE_ID. Private leagues also need two cookies,
ESPN_S2 and SWID. To find them:
In a desktop browser, log in to https://fantasy.espn.com and open your league.
Open Developer Tools (
F12, or right-click → Inspect).Go to the Application tab (Chrome/Edge) or Storage tab (Firefox).
In the left sidebar, expand Cookies and click
https://fantasy.espn.com.Find these two cookies and copy their Value:
espn_s2— a long string (often with%characters). This is yourESPN_S2.SWID— looks like{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}(keep the braces). This is yourESPN_SWID.
Your league id is in the league URL:
https://fantasy.espn.com/football/league?leagueId=123456 → ESPN_LEAGUE_ID=123456.
Keep these cookies private — they authenticate as your ESPN account. Never commit them.
3. Add to Claude Desktop
Edit your claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add this block (command must be a Python 3.10+ interpreter that has the deps
installed — plain python/python3 may be too old):
{
"mcpServers": {
"espn-fantasy": {
"command": "python3.11",
"args": ["path/to/server.py"],
"env": {
"ESPN_LEAGUE_ID": "your_league_id",
"ESPN_S2": "your_espn_s2_cookie",
"ESPN_SWID": "your_swid_cookie",
"ESPN_YEAR": "2026"
}
}
}
}Notes:
For a public league, omit
ESPN_S2andESPN_SWID.ESPN_YEARis optional; it defaults to the current calendar year.Identifying your team (so tools default to it and you don't repeat who you are): for a private league nothing extra is needed — your
ESPN_SWIDcookie is your owner id, so the server auto-detects your team. To set it explicitly (or for a public league), addESPN_TEAM_ID(preferred, stable) orESPN_TEAM_NAME. Resolution order isESPN_TEAM_ID→ESPN_TEAM_NAME→ auto-detect fromESPN_SWID. Confirm with theget_my_teamtool.ESPN_CACHE_TTLis optional (default180seconds). League data is cached between calls for speed, but any tool call made after the cache passes this age transparently re-fetches from ESPN, so rosters and waiver results stay current without a manual refresh. Set to0to cache for the whole process (onlyrefresh_leaguere-fetches); lower it for fresher live-scoring reads.Better analysis (external enrichment). By default the analytical tools go beyond ESPN's projection by pulling free, no-auth context — Vegas implied team totals (game environment), opponent defense strength, and Sleeper depth-chart role / injury / add-drop trends. These need only outbound HTTPS (no keys) and degrade gracefully if a source is slow or down. Turn the whole layer off with
"ESPN_MCP_EXTERNAL": "0"in theenvblock; tune withESPN_MCP_EXTERNAL_TIMEOUT(default 8s) and theESPN_MCP_TTL_*cache knobs.analyze_playeris the flagship tool built on this;get_start_sitandget_free_agentsannotate rows with the same context.commandneeds an absolute path ifpython3.11isn't on Claude Desktop's PATH (find yours withwhich python3.11). A venv's Python works too (e.g."/absolute/path/to/.venv/bin/python").Use an absolute path for
server.py.
Restart Claude Desktop. The espn-fantasy tools will appear in the tools menu (the
hammer/plug icon).
Usage tips
Ask Claude things like:
"What are the current standings?"
"Show me the roster for the Gridiron Gang."
"Compare my team to the first-place team."
"Analyze my roster and tell me my weakest position."
"Who should I target in a trade to fix my RB depth?"
"What free-agent WRs are available this week?"
The server ships with prompting guidance (in server.py) telling Claude to check
scoring settings, bye weeks, and schedule strength before giving trade or start/sit
advice.
Troubleshooting
"Could not load league …" — check
ESPN_LEAGUE_ID, and for private leagues verify both cookies.espn_s2is long and may contain%characters; copy the whole value.Data looks stale — cached data auto-refreshes once it passes
ESPN_CACHE_TTL(default 3 min), so most staleness clears on the next call. To force the latest immediately (e.g. a waiver just ran), callrefresh_leagueor ask Claude to refresh. Roster tools also print a "Data as of HH:MM" line so you can see the age.A player isn't found — try a fuller name; lookups are provided by ESPN's search.
Tools don't appear in Claude Desktop — confirm the JSON is valid, the path to
server.pyis absolute, and the configuredpythoncan importmcpandespn_api.
Available Tools
20 toolscompare_teamsB
Compare two teams' starting lineups side by side, position by position.
Args: team_name_1: First team (name or owner, fuzzy). team_name_2: Second team (name or owner, fuzzy).
Groups starters by position and shows projected points for each slot, plus a projected-points total for each team.
Inputs: team_name_1 (required), team_name_2 (required). Returns: result
get_free_agentsA
List the top available free agents.
Args: position: Optional position filter (QB, RB, WR, TE, K, DST). Omit for all. limit: Maximum number of players to return (default 10).
Sorted by projected points (falling back to average points).
Inputs: limit, position. Returns: result
get_head_to_headB
Get the season head-to-head history between two teams.
Args: team_name_1: First team (name or owner, fuzzy). team_name_2: Second team (name or owner, fuzzy).
Scans each team's weekly schedule for games against the other and reports the results and point totals.
Inputs: team_name_1 (required), team_name_2 (required). Returns: result
get_league_overviewB
Get a high-level overview of the league.
Returns the league name, season year, current week, number of teams, and key settings (scoring type, playoff team count).
Inputs: no named parameters. Returns: result
get_league_settingsA
Get the league's scoring format and roster/structure settings.
Essential context for evaluating player value: scoring type (PPR / half / standard), roster slot requirements, playoff structure, trade deadline, and waiver/FAAB type.
Inputs: no named parameters. Returns: result
get_matchupsB
Get all matchups for a given week with scores and projections.
Args: week: Week number. Defaults to the current week.
Inputs: week. Returns: result
get_player_scheduleA
Show a player's NFL bye week and remaining NFL matchups.
Args: player_name: Full or partial player name.
Useful for spotting bye-week conflicts and upcoming tough/easy stretches.
Inputs: player_name (required). Returns: result
get_player_statsB
Look up a specific player's season stats and current status.
Args: player_name: Full or partial player name.
Returns season totals/averages, projected points, injury status, and available weekly scores.
Inputs: player_name (required). Returns: result
get_playoff_pictureA
Show the projected playoff picture.
Ranks teams by record and points for, marks the current playoff seeds, and gives a rough clinched / in-contention read based on games remaining.
Inputs: no named parameters. Returns: result
get_power_rankingsB
Get power rankings for a week, if the library can compute them.
Args: week: Week number. Defaults to the current week.
Inputs: week. Returns: result
get_scoreboardA
Get the current week's live scores across all matchups.
Inputs: no named parameters. Returns: result
get_standingsA
Get league standings ranked by record and points for.
Includes each team's wins-losses(-ties), points for/against, and current win/loss streak.
Inputs: no named parameters. Returns: result
get_start_sitA
Recommend start/sit moves for a team's lineup for a given week.
Args: team_name: Team name or owner name (fuzzy, case-insensitive substring). week: Week number. Defaults to the upcoming (actionable) week — if the current week's games are already final, this is next week.
Flags starters who are injured or on bye, then compares bench players to the current starters at slots they are eligible to fill and suggests any swap where a bench player out-projects a starter. Purely projection-driven — treat it as a starting point, not gospel (matchups and game scripts still matter).
Inputs: team_name (required), week. Returns: result
get_team_analysisA
Aggregated snapshot of a team for trade / improvement advice.
Args: team_name: Team name or owner name (fuzzy).
Returns:
Full roster with average points and a last-3-weeks trend (up/down/flat)
Bye-week conflicts (weeks where multiple starters are out)
Position-group strength vs the league average at that position
Bench depth by position
Inputs: team_name (required). Returns: result
get_team_rosterB
Get the full roster for any team in the league.
Args: team_name: Team name or owner name (fuzzy, case-insensitive substring). week: Week to project for. Defaults to the upcoming (actionable) week — if the current week's games are already final, this is next week.
Shows each player's name, position, projected points, injury status, and whether they are in a starting slot or on the bench.
Inputs: team_name (required), week. Returns: result
get_teamsA
List every team in the league with its team name and owner.
Use this first so you know the exact names to pass to other tools. Team lookups elsewhere accept either the team name or the owner name.
Inputs: no named parameters. Returns: result
get_team_scheduleA
Show a team's remaining schedule with opponent strength.
Args: team_name: Team name or owner name (fuzzy).
Lists each remaining week's opponent along with that opponent's record and points for, so you can gauge schedule difficulty.
Inputs: team_name (required). Returns: result
get_trade_activityB
List recent completed trades in the league.
Inputs: no named parameters. Returns: result
get_trade_candidatesA
Identify potential trade targets for a team.
Args: team_name: Team name or owner name (fuzzy).
Finds the team's weakest starting position group, then scans every other team for players at that position who sit on the bench or represent surplus depth. Returns candidates grouped by position need, with the owning team so the user knows whom to approach.
Inputs: team_name (required). Returns: result
refresh_leagueA
Force a re-fetch of all league data from ESPN.
Use this when scores, rosters, or transactions may have changed since the server started. All other tools use cached data until this is called.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Several tools overlap in purpose: get_matchups and get_scoreboard both return weekly scores, and get_standings, get_power_rankings, and get_playoff_picture all rank teams. Descriptions help differentiate, but an agent may still hesitate between the scoreboard and matchups tools.
All tools use snake_case with a consistent verb_noun pattern (get_*, refresh_league, compare_teams). The convention is predictable and readable throughout.
With 20 tools, the server is on the heavy side for the domain, but each tool covers a distinct facet of fantasy football management. Some redundancy exists (e.g., scoreboard vs. matchups), but overall the count is reasonable.
The toolset covers most in-season fantasy football needs: league info, standings, matchups, player stats, rosters, trades, waivers, and start/sit advice. Minor gaps include a full transaction log and waiver bid suggestions, but core workflows are supported.
Related MCP Connectors
Fantasy analysis for your ESPN, Yahoo, and Sleeper leagues. Reads your leagues, never changes them.
Free fantasy AI for ESPN, Sleeper, Fantrax: football, basketball and hockey in Claude and ChatGPT.
Fantasy football for any AI agent: draft board, start/sit, waivers, your Sleeper league. Free.
Fantasy football across all your leagues: Yahoo, ESPN, Sleeper. Who to root for, waivers, scores.
Related MCP Servers
- FlicenseBqualityCmaintenanceEnables comprehensive Sleeper Fantasy Football integration with Claude, providing real-time player projections, historical performance analytics, league management, and waiver wire analysis. Supports advanced NFL metrics, lineup optimization, and matchup analysis for fantasy football decision-making.121-
- FlicenseNot gradedqualityDmaintenanceEnables Claude to interact with Yahoo Fantasy Baseball and Basketball leagues, allowing roster analysis, matchup tracking, free agent browsing, and player stats retrieval via natural language.-
- AlicenseNot gradedqualityBmaintenanceConnects Claude to Sleeper fantasy football leagues, providing read-only tools for rosters, matchups, standings, transactions, player search, and trending players, with multi-league support.MIT
- AlicenseAqualityBmaintenanceGives Claude read-only access to your ESPN fantasy football team, including roster, weekly matchup, free agents, and player profiles.13GPL 2.0