Skip to main content
Glama
einreke

Sleeper API MCP

by einreke

卧铺 API MCP

该模型上下文协议 (MCP) 服务器提供对 Sleeper Fantasy Football API 的访问。它使代理能够从 Sleeper 平台获取有关用户、联赛、选秀、球员名单、对阵和球员信息的数据。

特征

  • 访问用户信息和联赛

  • 检索联赛详细信息、名单和用户

  • 获取比赛信息和季后赛对阵表

  • 查看交易和交易选秀权

  • 访问选秀信息和选秀权

  • 获取玩家数据和趋势玩家信息

  • 无需 API 密钥(Sleeper API 是只读的)

Related MCP server: Fantasy Premier League MCP Server

设置

要求

pip install requests

用法

  1. 将此 MCP 放置在名为mcp_sleeper的目录中

  2. 使用以下.cursor/mcp.json代码片段配置 Cursor:

{ "mcpServers": { "sleeper": { "command": "python server.py" } } }
  1. 使用以下命令启动 MCP:

cursor run-mcp sleeper

API 方法

MCP 提供以下工具:

用户数据

  • getUserInfo :通过用户名或 user_id 获取用户信息

  • getUserLeagues :获取用户在指定运动和赛季的所有联赛

  • getUserDrafts :获取用户针对特定运动和赛季的所有选秀

联赛数据

  • getLeagueInfo :获取有关特定联赛的信息

  • getLeagueRosters :获取联盟中的所有球员名单

  • getLeagueUsers :获取联盟中的所有用户

  • getLeagueMatchups :获取特定周的联赛对阵情况

  • getLeagueWinnersBracket :获取联赛季后赛冠军阵容

  • getLeagueLosersBracket :获取联赛季后赛失败者名单

  • getLeagueTransactions :获取特定周的联赛交易

  • getLeagueTradedPicks :获取联盟中所有交易选秀权

  • getLeagueDrafts :获取联盟的所有选秀

草稿数据

  • getDraftInfo :获取有关特定草稿的信息

  • getDraftPicks :获取选秀中的所有选秀

  • getDraftTradedPicks :获取选秀中的所有交易选秀权

玩家数据

  • getAllPlayers :获取某项特定运动的所有运动员的信息

  • getTrendingPlayers :根据添加/删除活动获取热门玩家

状态数据

  • getNFLState :获取当前 NFL 状态

示例用法

代理可以使用以下 MCP 从 Sleeper 检索数据:

# Get user information user_info = getUserInfo({"username_or_user_id": "sleeper_username"}) # Get user's leagues for the 2023 NFL season leagues = getUserLeagues({"user_id": user_info["user_id"], "sport": "nfl", "season": "2023"}) # Get information about a specific league league_info = getLeagueInfo({"league_id": leagues[0]["league_id"]}) # Get rosters for a league rosters = getLeagueRosters({"league_id": league_info["league_id"]}) # Get matchups for a specific week matchups = getLeagueMatchups({"league_id": league_info["league_id"], "week": 1}) # Get trending players trending_players = getTrendingPlayers({"sport": "nfl", "type": "add", "lookback_hours": 24, "limit": 10})

速率限制

请注意 API 调用的频率。根据 Sleeper 的文档,每分钟 API 调用次数应保持在 1000 次以下,以免被 IP 封禁。

进一步阅读

-
security - not tested
F
license - not found
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/einreke/sleeper-scraper-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server