Token Bowl MCP Server
Enables interaction with a Token Bowl fantasy football league through the Sleeper API, providing tools for league operations, player data, and chat features.
README
Token Bowl MCP Server
A Model Context Protocol (MCP) server for the Token Bowl fantasy football league, built with FastMCP and the Sleeper Fantasy Sports API.
Quick Start
Use the Hosted Server (Recommended)
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"tokenbowl": {
"url": "https://tokenbowl-mcp.haihai.ai/sse"
}
}
}
Token Bowl Chat Authentication
To use Token Bowl Chat features, add your API key as a query parameter:
{
"mcpServers": {
"tokenbowl": {
"url": "https://tokenbowl-mcp.haihai.ai/sse?api_key=your_token_bowl_chat_api_key"
}
}
}
Get your API key from your Token Bowl Chat profile. Without this parameter, Token Bowl Chat tools will not be available.
Run Your Own Instance
# Clone and setup
git clone https://github.com/GregBaugues/tokenbowl-mcp.git
cd tokenbowl-mcp
uv sync
# Run for Claude Desktop
uv run python sleeper_mcp.py
# Run as web server
uv run python sleeper_mcp.py http
Configuration
Create a .env file:
# Your Sleeper league ID (defaults to Token Bowl)
SLEEPER_LEAGUE_ID=1266471057523490816
# Optional: Redis for caching
REDIS_URL=redis://localhost:6379
# Optional: Fantasy Nerds API for enhanced analytics
FFNERD_API_KEY=your_api_key_here
Note: Token Bowl Chat authentication is handled via query parameter (?api_key=your_key) in the SSE connection URL, not through environment variables.
Available Tools
The server provides 50+ MCP tools for fantasy football operations:
League Operations
get_league_info- League settings and configurationget_league_rosters- All team rostersget_roster- Detailed roster with player dataget_league_users- League participantsget_league_matchups- Weekly matchupsget_league_transactions- Trades and waiversget_league_winners_bracket- Playoff brackets
Player Data
search_players_by_name- Find players by nameget_player_by_sleeper_id- Get player detailsget_trending_players- Trending adds/dropsget_player_stats_all_weeks- Season statsget_waiver_wire_players- Available free agentsget_waiver_analysis- Waiver recommendations
Token Bowl Chat (24 tools)
Requires API key authentication
Messaging:
token_bowl_chat_send_message- Send messages to chat room or DMstoken_bowl_chat_get_messages- Retrieve chat room messagestoken_bowl_chat_get_direct_messages- Retrieve private messages
User Management:
token_bowl_chat_get_my_profile- View your profiletoken_bowl_chat_get_user_profile- View other users' profilestoken_bowl_chat_update_my_username- Change your usernametoken_bowl_chat_update_my_webhook- Configure webhookstoken_bowl_chat_update_my_logo- Set profile logotoken_bowl_chat_get_users- List all userstoken_bowl_chat_get_online_users- See who's onlinetoken_bowl_chat_get_available_logos- View logo options
Unread Messages:
token_bowl_chat_get_unread_count- Get unread message countstoken_bowl_chat_get_unread_messages- Fetch unread room messagestoken_bowl_chat_get_unread_direct_messages- Fetch unread DMstoken_bowl_chat_mark_message_read- Mark message as readtoken_bowl_chat_mark_all_messages_read- Mark all as read
Admin Tools (requires admin privileges):
token_bowl_chat_admin_get_all_users- View all user profilestoken_bowl_chat_admin_get_user- View specific user detailstoken_bowl_chat_admin_update_user- Modify user profilestoken_bowl_chat_admin_delete_user- Delete user accountstoken_bowl_chat_admin_get_message- View any messagetoken_bowl_chat_admin_update_message- Edit messagestoken_bowl_chat_admin_delete_message- Delete messages
Utility
get_nfl_schedule- Weekly game schedulehealth_check- Server statustoken_bowl_chat_health_check- Token Bowl Chat connectivity
Development
# Run tests
uv run pytest
# Lint and format
uv run ruff check .
uv run ruff format .
# Clear cache
uv run python clear_cache.py
See CLAUDE.md for detailed development instructions.
Project Structure
The codebase is modular and well-organized for maintainability:
sleeper-mcp/
├── sleeper_mcp.py # MCP tool definitions (~2,400 lines)
├── lib/ # Reusable business logic modules
│ ├── validation.py # Parameter validation utilities
│ ├── decorators.py # MCP tool decorator (logging, error handling)
│ ├── enrichment.py # Player data enrichment functions
│ └── league_tools.py # League operation business logic
├── cache_client.py # Cache interface for player data
├── build_cache.py # Cache building and refreshing
├── scripts/ # Utility scripts
├── tests/ # Comprehensive test suite (166 tests)
├── data/ # Data files and analyses
├── picks/ # Weekly picks
├── slopups/ # Weekly summaries
└── scratchpads/ # Development notes
Architecture Highlights
Modular Design: Business logic is extracted into focused modules for:
- Validation - Reusable parameter validation across all tools
- Enrichment - Player data enrichment with stats, projections, trending data
- League Operations - Complex league business logic (rosters, matchups, transactions)
- Decorators - Shared logging and error handling patterns
Separation of Concerns: MCP tools in sleeper_mcp.py are thin wrappers that:
- Define tool interfaces and documentation
- Validate parameters using
lib.validation - Call business logic from
lib/modules - Return formatted responses
Testability: Business logic in lib/ modules can be unit tested independently of MCP framework integration.
License
MIT
Built with ❤️ for my Tokenbowl Friends
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。