Token导航 LogoToken导航TokenDH.com
API Football MCP Server logo
AI代理stdio官方级别未说明来源级核验

API Football MCP Server

MCP Server

一个通过API-Football服务提供足球数据的模型上下文协议(MCP)服务器,支持自然语言查询。

工具数

0

提示词数

0

GitHub Stars

2

资源数

0
自然语言查询PythonClaudeAPI集成ClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

dankniight

提供方

dankniight

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

API-足球MCP服务器

模型上下文协议(MCP)服务器,通过API-football服务提供对足球/足球数据的访问。 这为语言模型与此API交互创建了一种标准化的方式,并为用户提供了一种用自然语言进行查询的方式。

img.png

建筑

graph TD
    LLM["`**LLM with MCP Client**
    Claude/GPT-4/etc.`"]
    
    subgraph Server ["`**MCP Server**
    Football Data Gateway`"]
        direction TB
        MCP["`**MCP Protocol Handler**
        Request Router & Response Manager`"]
        
        subgraph Functions ["`**Available Functions**`"]
            direction LR
            API1["`**get_leagues**
            Fetch league data`"]
            API2["`**get_teams**
            Fetch team data`"] 
            API3["`**get_players**
            Fetch player data`"]
            API4["`**get_fixtures**
            Fetch match data`"]
        end
        
        MCP --> Functions
    end
    
    ExtAPI["`**API-Football**
    External Sports Data API`"]
    
    %% Main connections
    LLM  MCP
    
    %% Function connections to external API
    API1  ExtAPI
    API2  ExtAPI
    API3  ExtAPI
    API4  ExtAPI
    
    %% Styling with improved colors
    classDef llm fill:#4CAF50,stroke:#2E7D32,stroke-width:3px,color:#fff
    classDef mcp fill:#2196F3,stroke:#1565C0,stroke-width:2px,color:#fff
    classDef functions fill:#FF9800,stroke:#F57C00,stroke-width:2px,color:#fff
    classDef external fill:#9C27B0,stroke:#6A1B9A,stroke-width:3px,color:#fff
    classDef server fill:#E3F2FD,stroke:#1976D2,stroke-width:2px,color:#1976D2
    
    class LLM llm
    class MCP mcp
    class API1,API2,API3,API4 functions
    class ExtAPI external
    class Server server

1.克隆和设置

克隆存储库:

git clone https://github.com/danknight/api-football-mcp-server.git
cd api-football-mcp-server

安装依赖项:

pip install -r requirements.txt

2.获取API密钥并设置环境

创建一个 .env 使用您的凭据文件:

API_FOOTBALL_KEY=your_api_key_here

注册 API-足球 以获取API密钥。

3.配置MCP客户端

在您的MCP客户端中注册此服务器(例如Cursor、Claude for Desktop)。

{
  "mcpServers": {
    "api-football": {
      "command": "python",
      "args": ["absolute/path/to/server.py"],
      "env": {
        "API_FOOTBALL_KEY": "YOUR_API_KEY"
      }
    }
  }
}

或者直接从命令行运行并使用 检查员:

python server.py

工具

MCP客户端可以使用以下工具:

联盟信息

工具名称描述参数
get_leagues获取可用联赛country (str,可选), season (int,可选)
get_league_info获取详细的联盟信息league_id (int)
get_countries获取可用国家/地区
get_standings获取联赛排名league_id (int), season (int)

团队信息

工具名称描述参数
get_teams让球队加入联盟league_id (int), season (int,可选)
get_team_stats获取团队的统计数据team_id (int), league_id (int), season (int,可选)
get_team_id_by_name按团队名称获取团队IDteam_name (str), league_id (int,可选), season (int,可选)
get_team_transfers获取团队的转会信息team_id (int)

玩家信息

工具名称描述参数
get_players让球员加入团队team_id (int), season (int)
get_player_stats获取玩家的统计数据player_id (int), season (int)

比赛/赛程信息

工具名称描述参数
get_fixtures获取赛程/比赛league_id (int,可选), team_id (int,可选), season (int,可选), date (str,可选), next (int,可选), last (int,可选)
get_fixture_stats获取夹具的统计数据fixture_id (int)
get_predictions获取赛程预测fixture_id (int)
get_head_to_head获取团队之间的直接统计数据team1_id (int), team2_id (int)

球员统计

工具名称描述参数
get_top_scorers在联盟中获得最高得分者league_id (int), season (int)
get_top_assists获得联盟中的顶级助理league_id (int), season (int)

其他信息

工具名称描述参数
get_venue获取会场信息venue_id (int)
get_injuries获取受伤信息team_id (int), player_id (int), season (int)

使用示例

获取特定国家的联赛

get_leagues(country="England")

在特定联赛中组建球队

get_teams(league_id=39, season=2023)  # Premier League 2023

获取团队统计数据

get_team_stats(team_id=42, league_id=39, season=2023)  # Arsenal stats

为团队获取固定装置

get_fixtures(team_id=42, next=5)  # Next 5 Arsenal matches

在联盟中获得最高得分者

get_top_scorers(league_id=39, season=2023)  # Premier League top scorers

发展

运行测试

目前,尚未实施任何测试。要添加测试,请执行以下操作:

  1. 创建一个 tests/ 目录
  2. 按照命名约定添加测试文件 test_*.py
  3. 使用运行测试 python -m pytest

添加新工具

要添加新工具,请执行以下操作:

  1. 在中添加新功能 main.py 装饰有 @mcp.tool()
  2. 使用实现API调用 make_api_request()
  3. 用新的工具信息更新此README
  4. 使用MCP检查器测试工具

目录标签

目录标签

自然语言查询PythonClaudeAPI集成足球数据本地部署API服务MCP协议

支持客户端

ClaudeCursor

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP