Skip to main content
Glama
jjaquezito

Football Live MCP

by jjaquezito

Football Live MCP

远程 MCP 服务器,通过 HTTP 暴露来自 API-Football 的实时足球数据,直接实现 JSON-RPC 2.0,不依赖任何 MCP SDK。

它是本地 Football Intelligence MCP 服务器的配套服务:此服务器提供当前赛季的数据,而本地服务器提供存储在 PostgreSQL 中的历史数据库(2010-2025)。

协议

传输方式:HTTP。单端点,每个请求一条 JSON-RPC 消息。

端点

用途

GET /

健康检查。返回服务器名称、版本和工具数量。

POST /mcp

JSON-RPC 2.0 消息。通知返回 202,无响应体。

已实现的方法:initialize、notifications/initialized、ping、tools/list、tools/call。

协议版本:2025-06-18。

Related MCP server: football-api-mcp

工具

工具

参数

返回

get_upcoming_matches

league_id、days(默认 7)

时间窗口内已安排的赛程

get_recent_results

league_id、days(默认 7)

已结束的比赛及比分

get_current_standings

league_id

实时联赛积分榜

get_current_injuries

team_id

受伤/停赛球员

get_live_matches

—

当前正在进行的比赛

search_team_live

query

来自 API-Football 的球队 ID

联赛 ID:39 英超联赛,140 西甲联赛,135 意甲联赛,78 德甲联赛,61 法甲联赛,94 葡超联赛,2 欧洲冠军联赛。

本地运行

pip install -r requirements.txt
export API_FOOTBALL_KEY=your_key_here
python server.py                    # listens on :8080

验证:

curl http://localhost:8080/

curl -X POST http://localhost:8080/mcp \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

部署到 Render

  1. 将此目录推送到 GitHub 仓库。

  2. 在 Render 中,创建一个新 Web 服务并连接该仓库。

  3. Render 会读取 render.yaml;确认运行时为 Python,并采用免费套餐。

  4. 添加环境变量 API_FOOTBALL_KEY,填入你的 API-Football 密钥。

  5. 部署。公共端点将是 https://<service>.onrender.com/mcp。

免费套餐会在不活动后让服务休眠,因此暂停后的第一个请求大约需要 50 秒。在实时演示之前,先访问一次 GET / 将其唤醒。

从 MCP 主机使用

在主机的配置中添加一个带有 url 字段的条目:

{
  "mcpServers": {
    "football_live": { "url": "https://<service>.onrender.com/mcp" }
  }
}

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides programmatic access to comprehensive football statistics and live match data via API-Football, enabling applications to retrieve league standings, team fixtures, player statistics, and real-time match events.
    7
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server for football-data.org API providing access to football data like standings, matches, teams, and scorers.
    MIT
  • F
    license
    A
    quality
    D
    maintenance
    Provides live football data through MCP tools, enabling users to fetch today's matches and top scorers for competitions like the Premier League or World Cup.
    2
    -
  • A
    license
    A
    quality
    D
    maintenance
    Enables MCP clients to access live football data from FotMob, including match stats, team form, injuries, and player workload, without making predictions.
    10
    1
    MIT