An intelligent ESPN Fantasy Football management system that combines automated GitHub Actions workflows with Claude Desktop integration through MCP (Model Context Protocol). The system analyzes your ESPN leagues and provides AI-driven recommendations for lineup optimization, waiver wire targets, and trade analysis.
Transform your fantasy football management with AI that:
- Analyzes your ESPN leagues - Fetches real-time data from ESPN Fantasy API
- Optimizes lineups - Sets optimal lineups based on projections and matchups
- Identifies waiver targets - Finds breakout players before your competition
- Evaluates trades - Provides fair trade analysis with projected impact
- Runs automatically - GitHub Actions or on-demand through Claude Desktop
Best for: Users who want automated daily/weekly analysis sent to Discord
Best for: Users who want conversational AI help with fantasy decisions
Best for: Developers who want to test ESPN API integration
- Setup Guide for Friends - Easy setup guide for non-developers
- GitHub Actions Flow - Visual flowchart of the automation workflow
- MCP + Claude Desktop Flow - Integration with Claude Desktop
- Technical Fixes - Recent ESPN API data collection improvements
- Phase 4 Intelligence - Advanced AI system documentation
- CLAUDE.md - Instructions for Claude Code development
- System Prompt - AI prompting guidelines
- Node.js 16+ and npm
- ESPN Fantasy Football account
- GitHub account (for Actions) OR Claude Desktop (for MCP)
- Fork this repository
- Get ESPN cookies (see Authentication section)
- Add GitHub Secrets:
ESPN_S2 # Your espn_s2 cookie ESPN_SWID # Your SWID cookie LEAGUE_1_ID # Your league ID LEAGUE_1_TEAM_ID # Your team ID GEMINI_API_KEY # Google Gemini API key (free tier) DISCORD_WEBHOOK_URL # Discord channel webhook - Enable GitHub Actions in your fork
- Automated runs:
- Daily at 8 AM ET
- Hourly during games (Sun/Mon/Thu)
- Manual trigger anytime
-
Clone repository:
git clone https://github.com/yourusername/FantasyCoManager.git cd FantasyCoManager/fantasy-engine/mcp-server -
Build MCP server:
npm install npm run build
-
Configure Claude Desktop (
~/.config/Claude/claude_desktop_config.json):{ "mcpServers": { "fantasy-football": { "command": "node", "args": ["/path/to/fantasy-engine/mcp-server/dist/index.js"], "cwd": "/path/to/fantasy-engine/mcp-server" } } } -
Restart Claude Desktop and ask:
- "Help me with my fantasy team"
- "Who should I start this week?"
- "Find waiver wire targets"
# Clone and navigate
git clone https://github.com/yourusername/FantasyCoManager.git
cd FantasyCoManager/fantasy-engine
# Quick start (both frontend and backend)
./start-poc.sh
# Or manually:
cd server && npm install && npm run dev # Backend on :3003
cd client && npm install && npm run dev # Frontend on :5173- Login to ESPN Fantasy in Chrome/Firefox
- Open DevTools (F12) β Application β Cookies
- Find on fantasy.espn.com:
espn_s2- Long authentication tokenSWID- UUID in curly braces like{123-456-789}
- Copy these values for configuration
From your ESPN Fantasy league URL:
https://fantasy.espn.com/football/league?leagueId=123456
^^^^^^ Your League ID
https://fantasy.espn.com/football/team?leagueId=123456&teamId=3
^^^^^^ Your Team ID
Once configured, the system automatically:
- Thursday 6 PM: Pre-game optimization
- Sunday 11 AM: Final lineup checks
- Monday 8 AM: Waiver wire analysis
- Tuesday 10 AM: Trade recommendations
Results sent to your Discord channel.
Ask Claude naturally:
- "Show me my current roster"
- "Who should I start: Player A or Player B?"
- "What's the best waiver pickup this week?"
- "Is this trade fair: My RB1 for their WR1?"
Access http://localhost:5173 to:
- View your roster with live ESPN data
- Test ESPN API endpoints
- See player projections and stats
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β User Interfaces β
ββββββββββββ¬βββββββββββββ¬βββββββββββββ¬βββββββββββββ€
β GitHub β Claude β Web β CLI β
β Actions β Desktop β POC β Tools β
ββββββββββββ΄βββββββββββββ΄βββββββββββββ΄βββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Core Services Layer β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β’ ESPN API Integration (Authentication, Data) β
β β’ FantasyPros Rankings Integration β
β β’ AI Orchestration (Gemini, Claude, GPT) β
β β’ Data Processing & Slot Categorization β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Data Sources β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β’ ESPN Fantasy API (Rosters, Matchups, Stats) β
β β’ FantasyPros (Expert Rankings, Projections) β
β β’ Weather API (Game Conditions) β
β β’ News Feeds (Injury Reports, Breaking News) β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
GitHub Actions Automation (fantasy-engine/automation/)
- Phase 4 Advanced Intelligence System
- Scheduled and manual workflows
- Discord webhook notifications
- Multi-league support
MCP Server (fantasy-engine/mcp-server/)
- 10+ MCP tools for ESPN data access
- Lineup optimization algorithms
- Trade and waiver analysis
- Direct Claude Desktop integration
Web POC (fantasy-engine/client/ + fantasy-engine/server/)
- React 19 + TypeScript frontend
- Express + Puppeteer backend
- ESPN authentication handling
- API testing interface
Shared Library (fantasy-engine/shared/)
- ESPN API client with 2025 season support
- Roster slot categorization (26 position types)
- Projection normalization (weekly vs season)
- AI workflow orchestration
β
Fixed weekly vs season projection logic
β
Enhanced FantasyPros player matching with position validation
β
Standardized ESPN API to use 2025 season
β
Improved slot categorization for all roster positions
β
Added comprehensive logging for debugging
β
Removed duplicate MCP server (saved 40% repository size)
β
Cleaned up 18 outdated documentation files
β
Streamlined to essential, current documentation
"ESPN authentication failed"
- Cookies expire after ~30 days
- Get fresh cookies from ESPN website
- Update secrets/config with new values
"No roster data available"
- Verify League ID and Team ID are correct
- Check if league is private (requires auth)
- Ensure cookies are from correct ESPN account
"Port already in use" (Local POC)
- Another instance is running
- Kill existing process or use different port
GitHub Actions not running
- Check if Actions are enabled in fork
- Verify all secrets are set correctly
- Check workflow logs for specific errors
# Test ESPN authentication
curl -H "Cookie: espn_s2=YOUR_COOKIE; SWID=YOUR_SWID" \
"https://lm-api-reads.fantasy.espn.com/apis/v3/games/ffl/seasons/2025/segments/0/leagues/YOUR_LEAGUE_ID"
# Check MCP server
node fantasy-engine/mcp-server/dist/index.js
# View GitHub Actions logs
# Go to Actions tab β Select workflow β View logs- ESPN API Response: < 500ms average
- Lineup Optimization: < 2 seconds
- Full Analysis: < 5 seconds
- MCP Tool Execution: < 1 second each
- GitHub Actions Runtime: ~2-3 minutes total
- ESPN cookies stored as secrets (GitHub) or locally (MCP/POC)
- No credentials sent to third parties
- AI providers receive only anonymized fantasy data
- All data processing happens in your environment
Contributions welcome! Areas for improvement:
- Additional MCP tools for Claude
- Enhanced trade algorithms
- More LLM provider support
- Dynasty league features
- Keeper league optimization
MIT License - See LICENSE file for details
- ESPN Fantasy API (unofficial)
- FantasyPros for expert rankings
- Anthropic for Claude and MCP
- Google for Gemini API
- The fantasy football community
Built with β€οΈ for fantasy football managers who want an AI edge
Not affiliated with ESPN or Disney. Use responsibly and within ESPN's terms of service.