MCP Sport

io.github.andrequeiroz2由 GitHub 账号 andrequeiroz2 发布v0.1.0更新于 Oct 24, 2026

MCP server that exposes Formula 1 data from the OpenF1 API.

已验证STDIO仅桌面位置与生活数据与分析

概览

AI 生成的概览

从 OpenF1 API 获取一级方程式数据,让助理查询赛程、成绩、圈速、遥测与积分榜。

可以做什么
查询赛程与场次:练习、排位、冲刺与正赛,以及大奖赛周末与车手名单。获取比赛结果:最终排名、发车顺位与位置变化历程。分析比赛过程:圈速与分段、进站、轮胎阶段、车距、旗号与安全车、超车与车队无线电。读取遥测与环境数据:速度、转速、挡位、油门、刹车、DRS、车辆位置与赛道天气。查看车手与车队积分榜(Beta)。另有两个交互视图(积分榜看板与赛事回放动画),仅在支持 MCP Apps 的宿主中显示,其他客户端只会收到 JSON。
适用场景
适合想让助理查询 2023 年起的一级方程式赛事数据、车手成绩、圈速、进站、遥测与天气,并以对话方式整理赛事分析时使用。若需要实时数据或交互式图表,则需额外条件。
运行要求
以本地进程运行(stdio),需 Python 3.13 以上环境与 uv 管理依赖,并可通过 uvx 启动。需能连接 OpenF1 API;历史数据自 2023 年起免费,实时数据需付费订阅。可选环境变量 MCP_SPORT_LOG_LEVEL 可调整日志级别。
安装前请注意
遥测与位置查询每次可能返回上万条样本,建议以速度或时间范围等条件缩小查询。赛果与发车顺位在官方公布前可能返回 404,积分榜端点仍为 Beta。交互视图需以 HTTP 运行并开启跨源设置,且仅在支持 MCP Apps 的宿主中显示。

安装

在 SourceWeft 中

  1. 打开 控制台中的 MCP Sport,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

MCP Sport — F1 Telemetry MCP 🏎️

[Animated race replay]

An MCP (Model Context Protocol) server that exposes Formula 1 data from the OpenF1 API as tools for AI assistants (Claude Desktop, Cursor, MCP Inspector, etc.).

Full coverage: 18 data tools matching the 18 documented OpenF1 endpoints — sessions, meetings, drivers, results, laps, pit stops, stints, telemetry, weather, championships and more. Two MCP App views sit on top of that data: a drivers standings board and an animated race replay. Hosts that render MCP Apps show the HTML. Cursor and Claude Desktop do not: they return the same payload as JSON.

Stack

LayerTechnology
LanguagePython 3.13+
MCP frameworkFastMCP 4.x
ValidationPydantic v2
DataOpenF1 API (REST, free for historical data 2023+)
Project managementuv + pyproject.toml
Transportstdio

Installation

bash
# Clone and install dependenciesgit clone https://github.com/andrequeiroz2/mcp-sport.git mcp-sportcd mcp-sportuv sync

Usage

Run the server (stdio)

bash
.venv/bin/python src/mcp_sport/server.py

MCP Inspector (web UI to test the tools)

bash
npx @modelcontextprotocol/inspector@latest .venv/bin/python src/mcp_sport/server.py

In the Inspector UI: transport STDIO, command .venv/bin/python, args src/mcp_sport/server.py → Connect.

Claude Desktop / Cursor

Add to the client's MCP configuration:

json
{  "mcpServers": {    "f1-telemetry": {      "command": "/absolute/path/mcp-sport/.venv/bin/python",      "args": ["/absolute/path/mcp-sport/src/mcp_sport/server.py"]    }  }}

The 18 data tools work in both clients. The views do not render there.

Views (MCP Apps)

get_drivers_championship_view and get_race_replay_view return interactive HTML. Cursor and Claude Desktop are incompatible with MCP Apps: they ignore the UI and show the JSON payload. The MCP Inspector also treats the result as text.

The views were validated in the official basic-host from modelcontextprotocol/ext-apps. The server must be HTTP, with CORS exposing the MCP session headers. Otherwise the browser cannot complete the Streamable HTTP handshake.

Terminal 1 — MCP server on port 8765:

bash
uv run python -c "import uvicornfrom starlette.middleware import Middlewarefrom starlette.middleware.cors import CORSMiddlewarefrom mcp_sport.server import mcp
app = mcp.http_app(middleware=[Middleware(    CORSMiddleware,    allow_origins=['*'],    allow_methods=['*'],    allow_headers=['*'],    expose_headers=['mcp-session-id', 'mcp-protocol-version'],)])uvicorn.run(app, host='127.0.0.1', port=8765)"

Terminal 2 — basic-host (needs Node.js; npm start requires bun, so use tsx):

bash
git clone --depth 1 https://github.com/modelcontextprotocol/ext-apps.gitcd ext-apps/examples/basic-hostnpm installnpm run buildSERVERS='["http://127.0.0.1:8765/mcp"]' npx tsx serve.ts

Open http://localhost:8080 (sandbox on :8081) and call get_drivers_championship_view or get_race_replay_view. After a change to the view HTML, hard-refresh the page (Ctrl+Shift+R) before running the tool again. The host caches the ui:// resource.

Available tools (18)

DomainToolDescription
Navigationget_sessionsSessions (practice, qualifying, sprint, race)
get_meetingsGrand Prix and testing weekends
Registryget_driversDrivers by session/meeting
Resultsget_session_resultsFinal classification of a session
get_starting_gridStarting grid
get_positionsPosition history throughout a session
Raceget_lapsLap times, sectors and speeds
get_pit_stopsPit stops
get_stintsStints and tyre compounds
get_intervalsReal-time gaps (leader and car ahead)
get_race_controlFlags, safety car, incidents
Contextget_weatherTrack weather (per-minute samples)
get_overtakesOvertakes
get_team_radioTeam radio excerpts (MP3)
Telemetryget_car_dataSpeed, RPM, gear, throttle, brake, DRS (~3.7 Hz)
get_locationApproximate car position on the circuit (~3.7 Hz)
Championshipsget_drivers_championshipDrivers standings (beta)
get_teams_championshipTeams standings (beta)

Example conversation with the AI

"How many points did Norris score in the last two races?"

The AI orchestrates: get_sessions(session_type="Race") to discover recent sessions → get_session_results(session_key=..., driver_number=4) on each one.

Project structure

src/mcp_sport/├── server.py           # Entrypoint: FastMCP instance + tool registration├── exceptions.py       # Domain exceptions├── logging_config.py   # Logging to stderr (stdout is the protocol channel)├── clients/openf1.py   # Single OpenF1 HTTP client├── schemas/            # Pydantic: input (BaseInput) and output per endpoint├── validators/         # Business validations per endpoint├── services/           # Orchestration per endpoint├── tools/              # MCP tools (thin layer) per endpoint└── apps/               # MCP App views (Custom HTML, ui:// resource)    ├── championship_view.py  # Drivers standings board    └── race_replay_view.py   # Animated race replay

Canonical documentation

DocumentContents
docs/Technical_Reference.mdStack, versions and official links (source of truth)
docs/Architectural_Design.mdImplementation patterns and procedure for new endpoints
docs/Logging_Strategy.mdLogging strategy (stderr + per-request telemetry)
tasks/History of planned and executed tasks

Configuration

VariableDefaultDescription
MCP_SPORT_LOG_LEVELINFOLog level on stderr (DEBUG, INFO, WARNING, ERROR)

Known limitations

  • Historical data from 2023 onwards; real-time data requires a paid OpenF1 subscription
  • session_result and starting_grid return HTTP 404 until official results are published
  • Telemetry (car_data, location) returns 18–24k samples per session/driver. Narrow the call with range filters such as speed_min and date_from/date_to
  • Championship endpoints are in beta on OpenF1

License

MIT. OpenF1 is an unofficial project, not associated in any way with the Formula 1 companies.

来源:README.md,提交 84692f8

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 22, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分