Skip to main content

MCP server for ESPN Fantasy Sports API

Project description

ESPN Fantasy MCP Server

Tests Python License: MIT

MCP (Model Context Protocol) server providing access to ESPN Fantasy Baseball data, for use with Claude Code and other MCP clients.

Features

  • Read league settings, standings, and team information
  • View rosters with player details and lineup positions
  • Look up players by name with fuzzy matching
  • Browse and add free agents, submit waiver claims
  • Modify lineups
  • Propose, accept, decline, and cancel trades

Quick Start

1. Get ESPN Cookies

To access private leagues, you need ESPN authentication cookies:

  1. Log in to ESPN Fantasy Baseball
  2. Open browser DevTools → Application → Cookies → https://fantasy.espn.com
  3. Copy espn_s2 (long string) and SWID (format: {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX})

2. Add to Claude Code

claude mcp add --scope user --transport stdio espn-fantasy \
  --env ESPN_S2=your_espn_s2_cookie \
  --env ESPN_SWID={your_espn_swid_cookie} \
  --env ESPN_LEAGUE_ID=your_league_id \
  --env ESPN_TEAM_ID=your_team_id \
  --env ESPN_SEASON_YEAR=2026 \
  -- uvx --from git+https://github.com/i-am-david-weinstein/espn-fantasy-mcp espn-fantasy-mcp

Keep the curly braces in the SWID value. uvx handles installation automatically — no separate install step needed.

3. Verify

Restart Claude Code or run /mcp and confirm "espn-fantasy" appears in the server list. Then try: "Show me my fantasy baseball league settings"

Documentation

Local Development

git clone https://github.com/i-am-david-weinstein/espn-fantasy-mcp.git
cd espn-fantasy-mcp
pip install -e ".[dev]"
pytest

To use a local install with Claude Code, replace the uvx ... portion of the claude mcp add command with python3 -m espn_fantasy_mcp.

Contributing

Contributions welcome — open an issue or submit a pull request.

License

MIT

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

espn_fantasy_mcp-0.1.0.tar.gz (34.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

espn_fantasy_mcp-0.1.0-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file espn_fantasy_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: espn_fantasy_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 34.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for espn_fantasy_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6f288b91f9cf7d83610f6f1bf209d42d63ae2a63aeb168b6809d71662c44dd71
MD5 ff89cbf1c54806680c5ec732edd0e197
BLAKE2b-256 2c2cc5ee729a7fbef8558294577c55cb12020bf9d076c27ff4c524089e38f984

See more details on using hashes here.

Provenance

The following attestation bundles were made for espn_fantasy_mcp-0.1.0.tar.gz:

Publisher: publish.yml on i-am-david-weinstein/espn-fantasy-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file espn_fantasy_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for espn_fantasy_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f3e1383cf75137b577b9996c0ba6f8b29268543fd2ccc8918ffbff1f1e32789
MD5 c1dca64b90c0899236a2ffd153528fce
BLAKE2b-256 ca58b1d1f0a42380f3ef9daf36bb98f5ff83238b7888ab1e8b78bbcd7204f7e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for espn_fantasy_mcp-0.1.0-py3-none-any.whl:

Publisher: publish.yml on i-am-david-weinstein/espn-fantasy-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page