SleepBot
Provides real-time Telegram alerts with Approve/Deny and Override controls for autonomous league manager actions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SleepBotshow me my roster for this week"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
SleepBot
An MCP server that connects Claude to fantasy football leagues. Phase 1: read-only tools over Sleeper's public API (no auth required). Built to extend to write actions, ESPN, and multiple leagues without changing the tool interface.
Architecture
The core is platform-agnostic. Every tool talks to a LeagueAdapter interface,
never to a platform SDK directly:
tools ──▶ LeagueAdapter (interface) ◀── SleeperAdapter ──▶ api.sleeper.app
│ (EspnAdapter later)
└──▶ config (leagues[] registry)Adding a league or a platform is a config change, not a code change. The
architecture is mapped with Cairn in
cairn.blueprint; run cairn scan to reconcile the map against the code.
Related MCP server: sleeper-mcp
Setup
npm install
cp config/leagues.example.json config/leagues.json # then edit with your league
npm run buildFind your Sleeper league id in the app URL or via
https://api.sleeper.app/v1/user/<username>/leagues/nfl/<season>.
config/leagues.json
{
"leagues": [
{
"id": "my-main-league", // your own label, passed to every tool
"platform": "sleeper", // "sleeper" | "espn"
"sleeper": { "leagueId": "123456789012345678", "username": "yourusername" }
}
]
}Secrets are never stored inline — a value like "env:ESPN_S2" is resolved from
the environment at runtime (see .env.example). Phase 1 needs no secrets.
Run
npm start # serves over stdio (built)
npm run dev # serves over stdio (tsx, no build)Register with Claude Code
// .mcp.json / claude mcp add
{
"mcpServers": {
"sleepbot": { "command": "node", "args": ["dist/index.js"] }
}
}Tools (Phase 1 — all read-only)
Tool | Purpose |
| Configured leagues (from config, no API call) |
| Settings, scoring, season, roster positions |
| Every roster: starters, bench, IR (player names resolved), record |
| Your own roster, identified from the configured |
| Weekly matchups + scores (defaults to current week) |
| Ranked by wins, then points-for |
| Trades, waivers, add/drops (defaults to current week) |
| Players by name, filter by position/team |
| Sleeper's most-added / most-dropped |
Every tool takes your leagueId label, so multi-league support is just "pass a
different id." Set sleeper.username in config and rosters/standings/matchups
are flagged with isYou, so SleepBot knows which team is yours without asking.
Tools (Phase 2 — write actions, confirm-by-default)
Tool | Purpose |
| Draft a trade (runs rules); returns a draft, never sends |
| Draft a waiver claim (add/drop + FAAB); draft only |
| Draft a free-agent add/drop; draft only |
| Send a previously-proposed action, by actionId — MCP only (a human-in-the-loop client). The chat panel and HTTP API cannot send from a proposal; approval is a separate, explicit step |
| Drafts awaiting confirmation |
| Whether writes are authorized ( |
Nothing changes your league silently: a propose_* tool ALWAYS returns a
draft and never dispatches. Sending is a separate, explicit step — the web
app's Pending approvals list (Activity page), a Telegram tap, or the MCP
execute_action tool. Guardrails live in config/rules.json
(copy config/rules.example.json):
{
"mode": "manual", // DEPRECATED / no-op: proposals are always drafts.
// Automation is per-league via `agent.autonomy`.
"protect": [ // hard blocks
{ "playerName": "Ja'Marr Chase", "actions": ["trade", "drop"] }
],
"warn": [ // non-blocking flags
{ "type": "trade_value_diff", "thresholdPct": 20 }
]
}trade_value_diff uses KeepTradeCut (KTC) player values, bridged to Sleeper
ids by name+position (~99% match). A snapshot ships in
config/ktc-values.example.json; drop a fresher one at config/ktc-values.json
to update, and set SLEEPBOT_KTC_MODE=oqb for 1-QB leagues (default superflex).
Values from KeepTradeCut via
cameron-eth/sleeper-sdk.
Enabling writes (unofficial Sleeper API)
Sleeper has no official write API. Writes go through its private GraphQL
endpoint (https://sleeper.com/graphql), authenticated with a session JWT —
there is no password automation. To enable them:
Log in at sleeper.com in a desktop browser.
DevTools → Network → filter
graphql→ click any request → copy the fullauthorizationheader value (a longeyJ...JWT).Put it in
.envasSLEEPER_TOKEN=eyJ...(never commit it;.envis ignored).
The token is a JWT, so SleepBot reads its expiry and reports needs-reauth
before attempting a doomed write. Check status any time with the
get_auth_status tool. When the token expires or is rejected, writes pause,
reads keep working, and you're notified to re-capture — no refresh endpoint
exists, so recovery is a manual re-capture by design. Some networks/regions may
need a VPN to reach the endpoint.
Protocol reverse-engineered by the community (cameron-eth/sleeper-sdk); it is unofficial and may change without notice.
Run the tests with npm test.
GUI (Phase 3)
A local React (Vite) app over a thin HTTP API that reuses the same core operations as the MCP server. Screens: My Team, Standings, Matchups, Draft, the Audit log, and a Chat panel (server-side Claude with the same tools).
npm run build && npm run api # HTTP API on :8787 (reuses the core)
cd web && npm install && npm run dev # GUI on :5173 (proxies /api -> :8787)Then open http://localhost:5173. Secrets (SLEEPER_TOKEN, ANTHROPIC_API_KEY)
live on the server only; the browser never sees them. The Chat panel needs
ANTHROPIC_API_KEY — without it, chat returns a clear message and everything
else keeps working.
Cloud deploy: one container serves the API + GUI, with Postgres for state
(set DATABASE_URL) and the leagues config as an env secret
(SLEEPBOT_CONFIG_JSON). See docs/deploy.md — there's a
Dockerfile and a Fly.io walkthrough.
Roadmap
Phase 2 (built) — write actions (confirm-by-default) wired to Sleeper's private GraphQL API, rules engine, audit log, JWT session handling with fail-safe re-auth. Add
SLEEPER_TOKENto enable real sends.Phase 3 (built) — local GUI (Vite/React) + HTTP API + in-app Claude chat, all over the shared core. Surfaces the audit log ("what SleepBot did while I was away").
Drafts (built) — read-only draft assistant for mock and real drafts: live board (status, on-the-clock, your next pick), and best-available recommendations by KTC value + roster need. Tools
get_drafts/get_draft_board/get_draft_recommendations, a GUI Draft tab (auto-refresh while live), and chat with real draft context. Picks are made by you in Sleeper (their pick-submit is an undocumented real-time websocket).Autonomous (built) — an opt-in per-league manager: a scheduled sweep reasons with Claude (+ web search for news) and proposes waiver/add-drop/trade moves through the same rules → pipeline → audit. Real-time Telegram alerts with Approve / Deny, and Override for rule-blocked moves.
automode auto-executes clean actions; warned/blocked always wait. Opt in with anagentblock in the league config +TELEGRAM_BOT_TOKEN/TELEGRAM_CHAT_ID.Phase 4 —
EspnAdapteragainst ESPN's cookie-based API, same interface
License & disclaimer
MIT — see LICENSE. You're free to use, modify, and distribute it.
Not affiliated with Sleeper, ESPN, or KeepTradeCut. SleepBot talks to Sleeper's unofficial, undocumented private API for writes; that can break at any time and may be against their terms — use it at your own risk, with your own account. The write protocol is derived from the community project cameron-eth/sleeper-sdk, and player values come from KeepTradeCut data. The software is provided "as is", without warranty (see the LICENSE).
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only ESPN, Sleeper, and Fantrax fantasy leagues for Claude, ChatGPT, and other AI tools.
Read-only fantasy analysis for ESPN, Yahoo, and Sleeper leagues via MCP
WHOOP recovery, strain, sleep and workouts in Claude via official WHOOP OAuth. Free, open source.
- platform7nOAuthtech.p7n
Connect Claude to your Platform7n workspaces — chat, links, and tasks. One-click OAuth.
Related MCP Servers
- FlicenseBqualityCmaintenanceEnables comprehensive Sleeper Fantasy Football integration with Claude, providing real-time player projections, historical performance analytics, league management, and waiver wire analysis. Supports advanced NFL metrics, lineup optimization, and matchup analysis for fantasy football decision-making.6121-
- AlicenseNot gradedqualityBmaintenanceEnables Claude to interact with Sleeper fantasy football leagues via MCP tools for roster, waiver, matchup, and transaction queries, plus a dashboard for daily reports, live scoring, and game-day alerts.72 npmMIT
- FlicenseNot gradedqualityBmaintenanceEnables Claude to securely read Sleeper fantasy football league data over the internet via the public API, supporting access from both Claude Desktop and mobile devices.-
- FlicenseNot gradedqualityCmaintenanceEnables Claude to query Sleeper's public fantasy football API over Streamable HTTP, covering leagues, rosters, drafts, matchups, player stats, trends, and player search. Roster data keeps IR (reserve) and taxi players distinct and enriched with player names, positions, teams, and statuses.-