SleepBot
SleepBot
一个将 Claude 连接到梦幻橄榄球联赛的 MCP 服务器。第一阶段:通过 Sleeper 的公共 API 提供只读工具(无需认证)。设计为可扩展至写入操作、ESPN 和多个联赛,而无需更改工具接口。
架构
核心是平台无关的。每个工具都通过 LeagueAdapter 接口通信,绝不直接与平台 SDK 交互:
tools ──▶ LeagueAdapter (interface) ◀── SleeperAdapter ──▶ api.sleeper.app
│ (EspnAdapter later)
└──▶ config (leagues[] registry)添加一个联赛或平台是配置更改,而非代码更改。该架构已使用 Cairn 在 cairn.blueprint 中映射;运行 cairn scan 可将映射与代码进行核对。
Related MCP server: sleeper-mcp
设置
npm install
cp config/leagues.example.json config/leagues.json # then edit with your league
npm run build在应用 URL 中或通过 https://api.sleeper.app/v1/user/<username>/leagues/nfl/<season> 找到你的 Sleeper 联赛 ID。
config/leagues.json
{
"leagues": [
{
"id": "my-main-league", // your own label, passed to every tool
"platform": "sleeper", // "sleeper" | "espn"
"sleeper": { "leagueId": "123456789012345678", "username": "yourusername" }
}
]
}密钥从不内联存储——像 "env:ESPN_S2" 这样的值会在运行时从环境中解析(参见 .env.example)。第一阶段不需要任何密钥。
运行
npm start # serves over stdio (built)
npm run dev # serves over stdio (tsx, no build)使用 Claude Code 注册
// .mcp.json / claude mcp add
{
"mcpServers": {
"sleepbot": { "command": "node", "args": ["dist/index.js"] }
}
}工具(第一阶段——全部只读)
工具 | 用途 |
| 已配置的联赛(来自配置,不调用 API) |
| 设置、计分、赛季、阵容位置 |
| 每个阵容:首发、替补、IR(球员姓名已解析)、战绩 |
| 你自己的阵容,通过配置的 |
| 每周对阵 + 比分(默认当前周) |
| 按胜场排序,再按总得分排序 |
| 交易、弃权、增删(默认当前周) |
| 按姓名搜索球员,可按位置/球队筛选 |
| Sleeper 上被添加/被弃用最多的球员 |
每个工具都接受你的 leagueId 标签,因此多联赛支持只需“传入不同的 ID”。在配置中设置 sleeper.username,阵容/排名/对阵会标记为 isYou,这样 SleepBot 无需询问即可知道哪支球队是你的。
使用 npm test 运行测试。
路线图
第二阶段 — Sleeper 写入操作(默认确认)+ 规则引擎(
src/rules,已存根)第三阶段 — 基于相同工具的本地 GUI(Vite/React)
第四阶段 — 针对 ESPN 基于 Cookie 的 API 的
EspnAdapter,使用相同接口
This server cannot be deployed
Maintenance
Related MCP Connectors
Free fantasy sports AI: ESPN, Sleeper and Fantrax league data for Claude and ChatGPT. Read-only.
Fantasy analysis for your ESPN, Yahoo, and Sleeper leagues. Reads your leagues, never changes them.
Fantasy football for any AI agent: draft board, start/sit, waivers, your Sleeper league. Free.
WHOOP recovery, strain, sleep and workouts in Claude via official WHOOP OAuth. Free, open source.
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.121-
- 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.99 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.-