内容
-F1 MCP 服务器
一个提供 Formula 1 数据的MCP(模型上下文协议)服务器,通过 [Fast-F1](https://github.com/theOehrly/Fast-F1) Python 库。查询比赛结果、圈速、遥测数据、轮胎策略、天气等信息 — 直接从 Claude 或任何 MCP 客户端获取。
## 工具列表
| 工具 | 描述 |
|------|-------------|
| `get_schedule` | 获取某赛季的赛事日程 |
| `get_event_info` | 获取特定比赛周末的详细信息 |
| `get_session_results` | 获取官方比赛结果(比赛、排位赛、短跑赛、练习赛) |
| `get_championship_standings` | 获取通过某一轮比赛的车手和车队积分榜 |
| `get_lap_times` | 获取圈速和扇区时间,支持车手/圈数/轮胎类型的筛选 |
| `get_tyre_strategy` | 获取每位车手的轮胎使用策略(轮胎类型、圈数范围、平均速度) |
| `compare_drivers` | 车手之间的性能比较(2-4 名车手) |
| `get_telemetry` |圈数的速度、油门、刹车、档位、转速等遥测数据 |
| `get_weather` | 获取比赛期间的气温、湿度、风速、降雨量等天气数据 |
| `get_race` | 获取比赛控制消息(旗帜、处罚、安全车、DRS 启用) |
| `get_circuit_info` | 获取赛道信息(弯道位置、裁判区、赛道布局) |
## 数据可用性
- **遥测数据**(速度、油门、刹车等):2018 年及以后
- **圈速和比赛结果**:2018 年及以后(完整详细信息)
- **基本比赛结果**:1950 年及以后(通过 Ergast)
## 安装配置
需要 [uv](https://docs.astral.sh/uv/) 和 Python 3.11+。
```bash
git clone https://github.com/warshanks/Fast-F1-mcp.git
cd Fast-F1-mcp
uv sync
```
### Claude 代码
添加到 `~/.claude/mcp.json` 或项目的 `.mcp.json` 中:
```json
{
"mcpServers": {
"fast-f1": {
"command": "uv",
"args": [
"--directory",
"/path/to/Fast-F1-mcp",
"run",
"fast-f1-mcp"
]
}
}
}
```
### Claude 桌面版
添加到 `~/Library/Application Support/Claude/claude_desktop_config.json`(macOS)或 `%APPDATA%\Claude\claude_desktop_config.json`(Windows):
```json
{
"mcpServers": {
"fast-f1": {
"command": "uv",
"args": [
"--directory",
"/path/to/Fast-F1-mcp",
"run",
"fast-f1-mcp"
]
}
}
}
```
## 配置选项
| 环境变量 | 默认值 | 描述 |
|---------------------|---------|-------------|
| `FASTF1_CACHE_DIR` | `~/.cache/fastf1` | Fast-F1 的 HTTP 响应缓存目录 |
| `FASTF1_MAX_SESSIONS` | `5` | 内存中保留的最大会话数(LRU 淘汰) |
## 示例查询
配置完成后,您可以向 Claude 询问以下问题:
- "谁赢得了 2024 年意大利大奖赛?"
- "显示 Verstappen 在 2024 年巴林大奖赛中的圈速"
- "比较 Hamilton 和 Norris 在 2024 年银石大奖赛中的表现"
- "Leclerc 在 2024 年蒙扎大奖赛中采用了什么轮胎策略?"
- "显示 Verstappen 在 2024 年斯帕赛道排位赛中最快圈速的遥测数据"
- "2024 年摩大奖赛期间的比赛控制消息是什么?"
- "2024 年英国大奖赛期间的天气"
## 许可证
MIT