tstapler/sleeper-mcp
If you are the rightful owner of sleeper-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Machine Context Protocol (MCP) server for integrating Sleeper fantasy sports data with Goose AI.
Sleeper MCP Server
A Machine Context Protocol (MCP) server for integrating Sleeper fantasy sports data with Goose AI. This server implements the MCP specification to provide structured access to Sleeper's API data.
Overview
The Sleeper MCP Server acts as a bridge between Goose AI and the Sleeper Fantasy Sports platform, implementing the Model Context Protocol (MCP) for seamless integration.
Features:
- Structured access to fantasy sports data via MCP
- Rate-limited API access
- Data caching and optimization
- OpenAPI documentation
- MCP-compliant function specifications
Installation
# Clone the repository
git clone https://github.com/yourusername/sleeper-mcp.git
cd sleeper-mcp
# Install dependencies using Poetry
poetry install
# Start the server
poetry run uvicorn src.main:app
Integration with Goose
The Sleeper MCP server integrates with Goose in two ways:
- Start the server:
poetry run uvicorn src.main:app
- Use with Goose:
a. Via session:
goose session --with-extension "uvicorn src.main:app"
b. Via single command:
goose run --with-extension "uvicorn src.main:app" -t "your instructions"
Available functions:
get_user(identifier: str)
- Get user informationget_user_leagues(user_id: str, season: str)
- Get leagues for a userget_league(league_id: str)
- Get league detailsget_league_rosters(league_id: str)
- Get league rostersget_league_users(league_id: str)
- Get league usersget_nfl_state()
- Get NFL season state
MCP Protocol Implementation
This server implements the Model Context Protocol (v2024-11-05) which includes:
-
Initialization Phase:
- Server capability discovery
- Protocol version negotiation
- Feature negotiation
-
Operation Phase:
- Function discovery and invocation
- Resource access
- Error handling
-
Security:
- Rate limiting
- Error reporting
- Access controls
Development
Project Structure
sleeper-mcp/
āāā docs/
ā āāā openapi.yaml # API specification
ā āāā sleeper_api_raw.html # Raw API documentation
āāā src/
ā āāā api/ # API endpoints
ā āāā models/ # Data models
ā āāā mcp/ # MCP protocol implementation
ā āāā services/ # Business logic
ā āāā config/ # Configuration
āāā tests/ # Test suites
āāā pyproject.toml # Project dependencies
āāā README.md # This file
āāā TODO.md # Development tasks
Running Tests
poetry run pytest
Development Server
poetry run uvicorn src.main:app --reload
Security Considerations
As per MCP specification:
- No authentication required (read-only API)
- Rate limiting enforced (1000 requests/minute)
- No sensitive data exposure
- Clear error reporting
API Documentation
- OpenAPI documentation:
/docs
- Raw API documentation:
/docs/sleeper_api_raw.html
- MCP capabilities:
/capabilities
License
[Add your chosen license]
Acknowledgments
- Sleeper API Team
- Model Context Protocol Specification
- Goose AI Team