ESPN Fantasy MCP
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 MCP Who are the top free agents in my league right now?"
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 MCP
A small, read-only Model Context Protocol server for ESPN Fantasy Football. It gives an MCP-compatible LLM access to normalized league snapshots, team rosters, and free-agent data.
This project calls ESPN's undocumented Fantasy read API. It is not an ESPN official developer integration, so endpoints and response shapes may change. Use it only with an account and leagues you are authorized to access, and review ESPN's terms before distributing or hosting it for other users.
What is included
The initial vertical slice exposes three read-only tools:
get_league_snapshot: settings, teams, rosters, schedule, and status.get_team_roster: one normalized team and roster.get_free_agents: free agents and waiver players, with a bounded result set.
Write operations such as adding, dropping, trading, or setting a lineup are intentionally not included. ESPN's mutation requests are undocumented and can make irreversible league changes; they should be added only with a preview, explicit confirmation, and strong validation.
Related MCP server: Sleeper Fantasy Football MCP
Requirements
Python 3.11+
uvor another Python package managerAn ESPN Fantasy league ID and season year
ESPN_S2andESPN_SWIDcookies for private leagues
Install
uv sync --extra dev
cp .env.example .envFill in .env with your own values. Do not commit .env or put cookie values
in prompts, tool arguments, logs, or source control.
For a private league, the cookies are the values named espn_s2 and SWID
in your authenticated ESPN browser session. The server reads them only from
environment variables. Public leagues may work without them.
Run
For a local MCP host that launches stdio servers:
uv run espn-fantasy-mcpExample generic MCP configuration:
{
"mcpServers": {
"espn-fantasy": {
"command": "uv",
"args": [
"run",
"--directory",
"/absolute/path/to/EspnMCP",
"espn-fantasy-mcp"
],
"env": {
"ESPN_S2": "your-cookie-value",
"ESPN_SWID": "your-cookie-value",
"ESPN_BASE_URL": "https://lm-api-reads.fantasy.espn.com"
}
}
}
}The server does not need to know a default league: tools receive league_id
and season explicitly, which makes accidental cross-league access less
likely.
Test and lint
The tests mock ESPN and never contact the live service:
uv run pytest
uv run ruff check .Architecture
MCP host / LLM
|
v
src/espn_mcp/server.py Tool schemas and MCP transport
|
v
src/espn_mcp/espn.py ESPN HTTP adapter and normalization
|
v
ESPN Fantasy read API Undocumented, cookie-authenticated for private leaguesThe adapter isolates ESPN-specific payloads from the MCP layer. If ESPN
changes hosts, views, filters, or response shapes, update espn.py and its
fixtures rather than changing tool contracts.
Available Tools
3 toolsget_free_agentsC
Find available free agents and waiver players. This is read-only.
Inputs: season (required), league_id (required), limit, positions. Returns: result
get_league_snapshotB
Get league settings, teams, rosters, schedule, and matchup data.
This is read-only. Use the league ID visible in the ESPN Fantasy URL.
Inputs: season (required), league_id (required), scoring_period_id. Returns: object
get_team_rosterB
Get one team's normalized roster and record. This is read-only.
Inputs: season (required), team_id (required), league_id (required), scoring_period_id. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: league-wide snapshot, specific team roster, and free agent list. No meaningful overlap in functionality.
All tool names follow the same 'get_' + noun pattern with snake_case, making them predictable and consistent.
With only 3 tools, the set is minimal but fits a narrow read-only fantasy football use case. It is not bloated, though it borders on sparse.
The surface covers core read operations (league, team roster, free agents) but misses obvious fantasy football needs like standings, player details, or transaction history, leaving the domain partially incomplete.
Maintenance
Related MCP Connectors
Fantasy football for any AI agent: draft board, start/sit, waivers, your Sleeper league. Free.
NFL analytics tools for AI agents: stats, fantasy, injuries, schedules, and advanced analysis.
Fantasy analysis for your ESPN, Yahoo, and Sleeper leagues. Reads your leagues, never changes them.
ESPN MCP — keyless multi-sport live scores, teams, and news via ESPN's public site API.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides read-only access to Sleeper fantasy football leagues, enabling team snapshots, available players, matchups, trade context, and league history through standardized MCP tools.MIT
- AlicenseAqualityDmaintenanceA read-only MCP server that supplies live context from Sleeper fantasy-football leagues, including rosters, trade analysis, draft picks, and league settings via Sleeper's public API.11MIT
- FlicenseNot gradedqualityCmaintenanceRead-only MCP server that provides access to public Sleeper NFL fantasy data, including leagues, rosters, matchups, waivers, drafts, and player information. It enables AI clients to retrieve fantasy football details without requiring authentication or account modifications.-
- AlicenseAqualityBmaintenanceEnables LLMs to access and analyze ESPN fantasy football leagues through read-only MCP tools, covering rosters, scores, transactions, standings, lineup audits, and league-specific rules.19MIT