Token Bowl MCP Server

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.

Category
访问服务器

README

Token Bowl MCP Server

CI Python 3.11+

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 configuration
  • get_league_rosters - All team rosters
  • get_roster - Detailed roster with player data
  • get_league_users - League participants
  • get_league_matchups - Weekly matchups
  • get_league_transactions - Trades and waivers
  • get_league_winners_bracket - Playoff brackets

Player Data

  • search_players_by_name - Find players by name
  • get_player_by_sleeper_id - Get player details
  • get_trending_players - Trending adds/drops
  • get_player_stats_all_weeks - Season stats
  • get_waiver_wire_players - Available free agents
  • get_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 DMs
  • token_bowl_chat_get_messages - Retrieve chat room messages
  • token_bowl_chat_get_direct_messages - Retrieve private messages

User Management:

  • token_bowl_chat_get_my_profile - View your profile
  • token_bowl_chat_get_user_profile - View other users' profiles
  • token_bowl_chat_update_my_username - Change your username
  • token_bowl_chat_update_my_webhook - Configure webhooks
  • token_bowl_chat_update_my_logo - Set profile logo
  • token_bowl_chat_get_users - List all users
  • token_bowl_chat_get_online_users - See who's online
  • token_bowl_chat_get_available_logos - View logo options

Unread Messages:

  • token_bowl_chat_get_unread_count - Get unread message counts
  • token_bowl_chat_get_unread_messages - Fetch unread room messages
  • token_bowl_chat_get_unread_direct_messages - Fetch unread DMs
  • token_bowl_chat_mark_message_read - Mark message as read
  • token_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 profiles
  • token_bowl_chat_admin_get_user - View specific user details
  • token_bowl_chat_admin_update_user - Modify user profiles
  • token_bowl_chat_admin_delete_user - Delete user accounts
  • token_bowl_chat_admin_get_message - View any message
  • token_bowl_chat_admin_update_message - Edit messages
  • token_bowl_chat_admin_delete_message - Delete messages

Utility

  • get_nfl_schedule - Weekly game schedule
  • health_check - Server status
  • token_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:

  1. Define tool interfaces and documentation
  2. Validate parameters using lib.validation
  3. Call business logic from lib/ modules
  4. 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

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选