Skip to main content
Glama

Fantasy Premier League MCP Server

梦幻英超联赛 MCP 服务器

一个模型上下文协议 (MCP) 服务器,提供对梦幻英超联赛 (FPL) 数据和工具的访问。此服务器允许您在 Claude for Desktop 和其他兼容 MCP 的客户端中与 FPL 数据进行交互。

梦幻英超联赛 MCP 服务器运行演示

支持的平台

  • 克劳德桌面
  • 光标
  • 风帆冲浪
  • 其他 MCP 兼容桌面 LLM

目前不支持移动设备。

特征

  • 丰富的玩家数据:通过 FPL API 访问全面的玩家统计数据
  • 球队信息:获取英超联赛球队的详细信息
  • 比赛周数据:查看当前和过去的比赛周信息
  • 球员搜索:按姓名或球队查找球员
  • 球员比较:比较任意两名球员的详细统计数据

要求

  • Python 3.10 或更高版本
  • Claude Desktop(用于AI集成)

安装

选项 1:从 PyPI 安装(推荐)

pip install fpl-mcp

选项 1b:安装开发依赖项

pip install "fpl-mcp[dev]"

选项 2:从 GitHub 安装

pip install git+https://github.com/rishijatia/fantasy-pl-mcp.git

选项 3:克隆并本地安装

git clone https://github.com/rishijatia/fantasy-pl-mcp.git cd fantasy-pl-mcp pip install -e .

运行服务器

安装后,您可以通过多种方式运行服务器:

1.使用 CLI 命令

fpl-mcp

2. 使用 Python 模块

python -m fpl_mcp

3. 与 Claude Desktop 一起使用

通过编辑claude_desktop_config.json文件配置 Claude Desktop 以使用已安装的包:

方法一:直接使用Python模块(最可靠)

{ "mcpServers": { "fantasy-pl": { "command": "python", "args": ["-m", "fpl_mcp"] } } }

方法 2:使用完整路径的安装命令(如果使用 pip 安装)

{ "mcpServers": { "fantasy-pl": { "command": "/full/path/to/your/venv/bin/fpl-mcp" } } }

/full/path/to/your/venv/bin/fpl-mcp替换为可执行文件的实际路径。激活虚拟环境后,您可以在终端中运行which fpl-mcp来找到它。

**注意:**仅使用"command": "fpl-mcp"可能会导致spawn fpl-mcp ENOENT错误,因为 Claude Desktop 可能无法访问虚拟环境的 PATH。使用完整路径或 Python 模块方法有助于避免此问题。

用法

在 Claude 桌面版中

  1. 启动 Claude 桌面版
  2. 您应该可以通过锤子图标看到可用的 FPL 工具
  3. 示例查询:
    • “比较穆罕默德·萨拉赫和埃尔林·哈兰德过去五场比赛的表现”
    • “找到所有阿森纳中场球员”
    • “当前比赛周情况如何?”
    • “显示得分最高的 5 名前锋”
Fantasy-PL MCP 使用说明
基本命令:
  • 比较玩家:“比较[玩家 1] 和 [玩家 2]”
  • 查找球员:“查找来自 [球队] 的球员”或“搜索 [球员姓名]”
  • 赛程难度:“显示[球队]即将举行的赛程”
  • 队长建议:“在 [Player1] 和 [Player2] 之间我应该担任谁的队长?”
高级功能:
  • 统计分析:“比较[Player1]和[Player2]的基础统计数据”
  • 状态检查:“显示目前状态良好的球员”
  • 差价选择:“建议购买 10% 以下的差价”
  • 球队优化:“评价我的球队并提出转会建议”
尖端:
  • 为获得准确的结果,请具体说明球员姓名
  • 搜索时包括位置(FWD、MID、DEF、GK)
  • 想要获得最佳队长建议,请询问球队状态、赛程和基本数据
  • 请求比较具体指标(xG、禁区内射门数等)。

MCP 开发检查员

对于开发和测试:

# If you have mcp[cli] installed mcp dev -m fpl_mcp # Or use npx npx @modelcontextprotocol/inspector python -m fpl_mcp

可用资源

  • fpl://static/players - 所有玩家数据及综合统计
  • fpl://static/players/{name} - 按名称搜索玩家数据
  • fpl://static/teams - 所有英超球队
  • fpl://static/teams/{name} - 按名称搜索团队数据
  • fpl://gameweeks/current - 当前比赛周数据
  • fpl://gameweeks/all - 所有比赛周数据
  • fpl://fixtures - 本赛季所有赛程
  • fpl://fixtures/gameweek/{gameweek_id} - 特定比赛周的赛程
  • fpl://fixtures/team/{team_name} - 特定球队的赛程
  • fpl://players/{player_name}/fixtures - 特定球员的即将到来的比赛
  • fpl://gameweeks/blank - 有关即将到来的空白游戏周的信息
  • fpl://gameweeks/double - 关于即将到来的双周比赛的信息

可用工具

  • get_gameweek_status - 获取有关当前、之前和下一个比赛周的精确信息
  • analyze_player_fixtures - 分析球员即将进行的比赛,并评估其难度等级
  • get_blank_gameweeks - 获取有关即将到来的空白游戏周的信息
  • get_double_gameweeks - 获取有关即将到来的双周比赛的信息
  • analyze_players - 根据多个标准过滤和分析 FPL 玩家
  • analyze_fixtures - 分析球员、球队或位置的即将到来的比赛
  • compare_players - 比较多个玩家在各个指标上的差异
  • check_fpl_authentication - 检查 FPL 身份验证是否正常工作
  • get_my_team - 查看您已验证的团队(需要验证)
  • get_team - 查看具有特定 ID 的任何团队(需要身份验证)
  • get_manager_info - 获取经理详细信息(需要身份验证)

提示模板

  • player_analysis_prompt - 创建提示以深入分析 FPL 玩家
  • transfer_advice_prompt - 根据预算和位置获取球员转会建议
  • team_rating_prompt - 创建对 FPL 团队进行评级和分析的提示
  • differential_players_prompt - 创建提示以查找所有权较低的差异玩家
  • chip_strategy_prompt - 创建芯片策略建议提示

发展

添加功能

要添加新功能:

  1. fpl_mcp/fpl/resources/中的相应文件中添加资源处理程序
  2. fpl_mcp/fpl/tools/中的相应文件中添加工具处理程序
  3. 更新__main__.py文件以注册新的资源和工具
  4. 在部署到 Claude for Desktop 之前使用 MCP Inspector 进行测试

验证

要使用需要身份验证的功能(例如访问您的团队或私人联赛),您需要设置您的 FPL 凭证:

# Run the credential setup tool fpl-mcp-config setup

该交互式工具将:

  1. 提示您输入 FPL 电子邮件、密码和团队 ID
  2. 让您选择存储在 config.json 还是 .env 文件中
  3. 将凭证安全地保存到 ~/.fpl-mcp/

您可以使用以下方式测试您的身份验证:

fpl-mcp-config test

或者,您可以手动配置身份验证:

  1. 使用以下命令创建~/.fpl-mcp/.env文件:
    FPL_EMAIL=your_email@example.com FPL_PASSWORD=your_password FPL_TEAM_ID=your_team_id
  2. 或者创建~/.fpl-mcp/config.json
    { "email": "your_email@example.com", "password": "your_password", "team_id": "your_team_id" }
  3. 或者设置环境变量:
    export FPL_EMAIL=your_email@example.com export FPL_PASSWORD=your_password export FPL_TEAM_ID=your_team_id

限制

  • FPL API 没有官方记录,可能会更改,恕不另行通知
  • 目前仅支持读取操作

故障排除

常见问题

1. Claude Desktop 中出现“spawn fpl-mcp ENOENT”错误

发生这种情况是因为 Claude Desktop 无法在其 PATH 中找到fpl-mcp可执行文件。

**解决方案:**使用以下方法之一:

  • 在配置文件中使用可执行文件的完整路径
    { "mcpServers": { "fantasy-pl": { "command": "/full/path/to/your/venv/bin/fpl-mcp" } } }
  • 使用 Python 直接运行模块(首选方法)
    { "mcpServers": { "fantasy-pl": { "command": "python", "args": ["-m", "fpl_mcp"] } } }
2. 服务器立即断开连接

如果服务器启动但立即断开连接:

  • 检查~/Library/Logs/Claude/mcp*.log (macOS) 或%APPDATA%\Claude\logs\mcp*.log (Windows) 中的日志
  • 确保所有依赖项都已安装
  • 尝试使用python -m fpl_mcp手动运行服务器以查看任何错误
3. Claude Desktop 中未显示服务器

如果没有出现锤子图标:

  • 完全重启Claude Desktop
  • 验证你的claude_desktop_config.json是否具有正确的 JSON 语法
  • 确保 Python 或可执行文件的路径是绝对路径,而不是相对路径

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

贡献

欢迎贡献代码!欢迎提交 Pull 请求。

  1. 分叉存储库
  2. 创建你的功能分支( git checkout -b feature/amazing-feature
  3. 提交您的更改( git commit -m 'Add some amazing feature'
  4. 推送到分支( git push origin feature/amazing-feature
  5. 打开拉取请求

更多详细信息请参阅CONTRIBUTING.md文件。

致谢

引文

如果您在研究或项目中使用此包,请考虑引用它:

@software{fpl_mcp, author = {Jatia, Rishi and Fantasy PL MCP Contributors}, title = {Fantasy Premier League MCP Server}, url = {https://github.com/rishijatia/fantasy-pl-mcp}, version = {0.1.0}, year = {2025}, }
-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

模型上下文协议服务器提供对 Fantasy Premier League 数据的访问,允许用户通过 Claude for Desktop 和其他 MCP 兼容客户端比较球员、查找球队信息、查看比赛周数据并获得与 FPL 相关的建议。

  1. 支持的平台
    1. 特征
      1. 要求
        1. 安装
          1. 选项 1:从 PyPI 安装(推荐)
          2. 选项 1b:安装开发依赖项
          3. 选项 2:从 GitHub 安装
          4. 选项 3:克隆并本地安装
        2. 运行服务器
          1. 1.使用 CLI 命令
          2. 使用 Python 模块
          3. 与 Claude Desktop 一起使用
        3. 用法
          1. 在 Claude 桌面版中
          2. MCP 开发检查员
        4. 可用资源
          1. 可用工具
            1. 提示模板
              1. 发展
                1. 添加功能
              2. 验证
                1. 限制
                  1. 故障排除
                    1. 常见问题
                  2. 执照
                    1. 贡献
                      1. 致谢
                        1. 引文

                          Related MCP Servers

                          • -
                            security
                            A
                            license
                            -
                            quality
                            A Model Context Protocol server that allows Claude to interact with Linear's API for managing teams, issues, projects, and cycles.
                            Last updated -
                            18
                            1
                            TypeScript
                            MIT License
                          • -
                            security
                            A
                            license
                            -
                            quality
                            A Model Context Protocol server that enables Claude to interact with the ConnectWise Manage API to perform operations like retrieving, creating, updating, and deleting tickets, companies, contacts, and other entities.
                            Last updated -
                            JavaScript
                            MIT License
                            • Apple
                          • -
                            security
                            F
                            license
                            -
                            quality
                            Provides structured access to NHL data including teams, players, standings, schedules, and statistics through the Model-Context Protocol pattern.
                            Last updated -
                            TypeScript
                          • -
                            security
                            A
                            license
                            -
                            quality
                            An MCP (Model-Controller-Processor) server for accessing League of Legends client data. This server provides a collection of tools that communicate with the League of Legends Live Client Data API to retrieve in-game data.
                            Last updated -
                            Python
                            Apache 2.0

                          View all related MCP servers

                          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/rishijatia/fantasy-pl-mcp'

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