足球 MCP 服务器
一个使用 API-Football 服务实现足球统计数据和实时比赛数据的模型上下文协议 (MCP) 的 Python 服务器。
概述
该服务器提供了一套全面的工具,可通过 API-Football API 访问足球数据。它充当应用程序和足球数据服务之间的桥梁,提供全球联赛、球队和球员的实时比赛信息和历史统计数据。
特征
- 联赛数据(排名、赛程、赛程)
- 球队信息和赛程
- 球员统计数据和资料
- 实时比赛数据(事件、统计数据、时间线)
- 比赛分析(统计数据、事件)
配置
该服务器需要 RapidAPI 的 API 密钥来提供 API-Football 服务:
工具
联赛数据
- 通过名称获取联赛 ID
- 检索给定联赛名称的联赛 ID
- 例如:
get_league_id_by_name(league_name="Premier League")
- 获取所有联赛 ID
- 检索所有足球联赛的 ID 列表
- 可以按国家/地区过滤
- 例如:
get_all_leagues_id(country=["England", "Spain"])
- 获取排名
- 检索多个联赛和赛季的联赛排名
- 可以按团队筛选
- 例如:
get_standings(league_id=[39, 140], season=[2022, 2023])
- 获取联赛信息
- 检索有关特定足球联赛的信息
- 例如:
get_league_info(league_name="Champions League")
- 获取联赛赛程
- 检索特定联赛和赛季的所有赛程
- 例如:
get_league_fixtures(league_id=39, season=2023)
- 按日期获取联赛赛程
- 检索指定日期的联赛赛程
- 例如:
get_league_schedule_by_date(league_name="Premier League", date=["2024-03-08", "2024-03-09"], season="2023")
玩家数据
- 获取玩家 ID
- 检索与姓名匹配的玩家 ID 和信息
- 例如:
get_player_id(player_name="Messi")
- 获取玩家资料
- 通过姓氏检索玩家的个人资料
- 例如:
get_player_profile(player_name="Messi")
- 获取玩家统计数据
- 按赛季和联赛名称检索详细的球员统计数据
- 例如:
get_player_statistics(player_id=154, seasons=[2022, 2023], league_name="La Liga")
- 获取玩家统计信息2
- 按赛季和联赛 ID 检索详细的球员统计数据
- 例如:
get_player_statistics_2(player_id=154, seasons=[2022, 2023], league_id=140)
团队数据
- 获取球队赛程
- 返回某支球队过去或即将举行的比赛
- 例如:
get_team_fixtures(team_name="Manchester United", type="past", limit=3)
- 按日期范围获取球队比赛安排
- 检索某个日期范围内某支球队的比赛安排
- 例如:
get_team_fixtures_by_date_range(team_name="Liverpool", from_date="2023-09-01", to_date="2023-09-30", season="2023")
- 获取团队信息
- 检索特定团队的基本信息
- 例如:
get_team_info(team_name="Real Madrid")
比赛/赛程数据
- 获取固定装置统计数据
- 检索特定装置的详细统计数据
- 例如:
get_fixture_statistics(fixture_id=867946)
- 获取装置事件
- 检索某场比赛的所有比赛事件(进球、出牌、替补)
- 例如:
get_fixture_events(fixture_id=867946)
- 获取多个装置统计数据
- 一次检索多个装置的统计数据
- 例如:
get_multiple_fixtures_stats(fixture_ids=[867946, 867947, 867948])
比赛直播数据
- 获取团队的实时比赛
- 检查某支球队是否正在比赛
- 例如:
get_live_match_for_team(team_name="Chelsea")
- 获取团队的实时统计数据
- 检索比赛中某支球队的实时比赛统计数据
- 例如:
get_live_stats_for_team(team_name="Liverpool")
- 获取直播比赛时间线
- 检索某支球队的现场比赛的实时事件时间表
- 例如:
get_live_match_timeline(team_name="Manchester City")
用法
该服务器采用Fast MCP框架实现,可以作为独立服务运行。
配置
- 服务器运行时有 30 秒的超时时间,以确保更可靠的运行
- 实现信号处理程序以实现正常关机(Ctrl+C)
与 Claude Desktop 一起使用
选项 1:使用 Docker(推荐)
- 克隆此存储库
- 安装依赖项
- 构建 Docker 镜像
- 运行 Docker 容器(确保您的 API 密钥作为环境变量传递)
- 将其添加到您的
claude_desktop_config.json
中:
选项 2:直接执行 Python
- 克隆此存储库
- 安装依赖项
- 设置 API 密钥环境变量
- 将其添加到您的
claude_desktop_config.json
中,根据需要调整 Python 路径:
添加您选择的配置后,重新启动 Claude Desktop 以加载足球服务器。之后,您就可以在与 Claude 的对话中使用所有足球数据工具了。
技术细节
该服务器建立在:
- 通过 RapidAPI 的 API-Football
- MCP API接口
- Pydantic 用于输入验证
- API 通信请求
执照
此 MCP 服务器在 MIT 许可下可用。
This server cannot be installed
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.
通过 API-Football 提供对综合足球统计数据和实时比赛数据的编程访问,使应用程序能够检索联赛排名、球队赛程、球员统计数据和实时比赛事件。
Related MCP Servers
- AsecurityAlicenseAqualityAn MCP server providing access to college football statistics sourced from the College Football Data API within Claude Desktop.Last updated -99PythonMIT License
- -securityFlicense-qualityProvides structured access to NHL data including teams, players, standings, schedules, and statistics through the Model-Context Protocol pattern.Last updated -TypeScript
- -securityFlicense-qualityThis server enables Claude to access Team Fight Tactics (TFT) game data, allowing users to retrieve match histories and detailed match information through the Riot Games API.Last updated -2TypeScript
opgg-esportsofficial
AsecurityFlicenseAqualityConnect AI agents to OP.GG Esports data and retrieve upcoming League of Legends match schedules effortlessly. Access structured match information through a standardized interface, enhancing your AI's capabilities with real-time esports data.Last updated -1TypeScript