A comprehensive Model Context Protocol (MCP) Server for integrating with Sleeper Fantasy Football. This server enables AI assistants like Claude to perform advanced fantasy football analysis and provide strategic recommendations.
# Install globally (recommended)
npm install -g sleeper-mcp
# Or use with npx (no installation needed)
npx sleeper-mcp- User Information: Sleeper profiles and league memberships
- League Details: Scoring settings, roster positions, team overviews
- Current Matchups: Who's playing whom, scores, lineups
- Player Search: Find any NFL player in the Sleeper database
- Trending Players: Hottest waiver wire pickups
- Injury Status: Current injury reports with web research
- Player Comparisons: Head-to-head analysis for trade decisions
- Lineup Analysis: Automatic start/sit recommendations
- Waiver Wire Tips: Personalized pickup suggestions
- Matchup Strategies: Opponent analysis and winning strategies
- Transaction Tracking: Follow league activity and trends
Choose one of these installation methods:
npm install -g sleeper-mcpnpx sleeper-mcpgit clone https://github.com/yourusername/sleeper-mcp.git
cd sleeper-mcp
npm install
npm run build{
"mcpServers": {
"sleeper-mcp": {
"command": "sleeper-mcp",
"args": [],
"env": {}
}
}
}{
"mcpServers": {
"sleeper-mcp": {
"command": "npx",
"args": ["sleeper-mcp"],
"env": {}
}
}
}{
"mcpServers": {
"sleeper-mcp": {
"command": "node",
"args": ["/full/path/to/sleeper-mcp/dist/index.js"],
"env": {}
}
}
}npm test
npm run test:coverage # Show detailed code coverageThe server includes comprehensive tests covering:
- MCP Protocol: Server initialization and tool registration
- Error Handling: Invalid tools and malformed requests
- JSON-RPC: Proper request/response formatting
- Basic API: NFL state, player search, trending players
- User Management: Invalid user handling
- League Data: Invalid league ID handling
- Cache System: Clear cache confirmation logic
- Empty Arrays: Graceful handling of empty player lists
- Missing Parameters: Required field validation
- Invalid IDs: Non-existent user/league/player handling
- Parameter Validation: Type checking and bounds testing
File Coverage: 55.13% statements | 62.36% branches | 35.52% functions
Test Results: 13/13 passing (100%)
Tool Coverage: 8/19 tools tested (42%)
Edge Cases: ~90% covered
Handler Functions: 27.35% (core logic)
Tools Registry: 93.06% (tool definitions)
Sleeper Client: 51.21% (API integration)
Server Core: 100% (MCP protocol)
Commands:
npm test # Run all tests
npm run test:coverage # Show detailed coverage report
npm run coverage # Alias for test:coverageKey tested scenarios:
- Server startup and MCP handshake
- Basic API functionality with real data
- Invalid input handling and error responses
- Cache management and confirmation flows
- Parameter validation and type checking
Start a conversation with Claude and try:
"Show me my current lineup against my opponent this week"
"Which players are questionable this week and should I replace them?"
"Give me waiver wire recommendations based on trends"
get_user_info- Retrieve user informationget_user_leagues- Get all leagues for a userget_league_info- Details of a specific leagueget_league_rosters- All team rosters in a leagueget_league_users- All users/managers in a league
get_current_matchups- Current week matchupsget_matchup_details- Detailed matchup informationget_nfl_state- Current NFL status (week, season)
search_players- Search players in the databaseget_trending_players- Trending add/drop playersget_player_details- Detailed player informationcompare_players- Head-to-head player comparisons
analyze_lineup- AI-powered lineup analysisresearch_player_status- Web research on player statusget_waiver_suggestions- Waiver wire recommendationsget_start_sit_advice- Specific start/sit adviceget_transactions- Recent league transactions
- Find Your User Info:
get_user_infowith your Sleeper username - Get Your Leagues:
get_user_leagueswith your user ID - Analyze Current Matchup:
get_matchup_detailsfor your league - Check Injured Players:
research_player_statusfor questionable players - Find Waiver Pickups:
get_waiver_suggestionsfor improvements
- Compare Players:
compare_playersfor trade targets - Research Status:
research_player_statusfor injury concerns - Analyze Impact:
analyze_lineupto model trade effects
- No API Keys Required - Uses Sleeper's public API
- Intelligent Caching - Player data cached for 24 hours
- Rate Limit Respecting - Handles Sleeper's 1000 calls/minute limit
- Comprehensive Error Handling - Robust error recovery
- Web Research Integration - Automatic injury report research
- Personalized Recommendations - All advice tailored to your specific league
- SETUP.md - Detailed installation and configuration guide
- EXAMPLES.md - Comprehensive usage examples and scenarios
- Inline Documentation - Fully commented codebase
- TypeScript for type safety
- Zod for input validation
- MCP SDK for Claude integration
- Read-only API - Cannot modify lineups (Sleeper limitation)
- Real-time Data - Always current information
# Install globally
npm install -g sleeper-mcp
# Or use directly
npx sleeper-mcp# Clone the repository
git clone https://github.com/yourusername/sleeper-mcp.git
cd sleeper-mcp
npm install
# Development with hot reload
npm run dev
# Build for production
npm run build
npm start
# Watch mode (automatic rebuilding)
npm run watch
# Run tests
npm test
npm run test:coverage- Sleeper API is read-only (no lineup modifications possible)
- Rate limit: Maximum 1000 API calls per minute
- Player data automatically cached (24h refresh)
MIT License
This server can be extended with:
- Additional Sleeper API endpoints
- Enhanced analysis and recommendations
- Integration with other fantasy platforms
- Historical data analysis
Dominate your fantasy league with AI-powered analysis! ๐