fastf1-mcp-server
This MCP server exposes comprehensive Formula 1 data to AI assistants, covering historical stats (1950–present via Ergast) and detailed session/telemetry data (2018–present via FastF1).
21 Tools spanning:
Schedule & Events: Full race calendar, circuit info, list events/drivers per season
Standings & Driver Info: Driver/constructor championship standings, driver biographical details
Race Results: Historical results (1950–present) and detailed session classifications (race, qualifying, sprint, practice)
Lap Times & Pace: All lap times per driver, fastest laps, average race pace (with filters for SC/pit/opening laps)
Strategy & Pit Stops: Tire stint analysis (compound, lap range, avg pace), pit stop events with durations
Qualifying Analysis: Q1/Q2/Q3 breakdown, sector times & theoretical best laps, speed trap data
Telemetry: Sampled telemetry (speed, throttle, brake, gear, DRS) for specific laps; side-by-side driver telemetry comparison with speed and time deltas
Cache Management: Check and clear the in-memory LRU session cache
4 MCP Resources for quick reference: schedule, driver, constructor, and circuit data.
5 Guided Prompts for common analyses: race recap, qualifying deep-dive, driver comparison, strategy analysis, and weekend preview.
Additional capabilities: Automatic CSV export for large datasets (lap times, stints, telemetry), structured error responses, and async LRU caching for fast repeat queries.
fastf1-mcp
An MCP server that exposes Formula 1 data to AI assistants via the FastF1 library. Ask Claude (or any MCP-compatible client) questions about race results, lap times, telemetry, standings, and more.
Features
21 tools covering standings, race results, lap times, telemetry, pit stops, and qualifying
4 MCP resources for schedule, driver, constructor, and circuit reference data
5 guided prompts for race recaps, qualifying analysis, strategy deep-dives, and weekend previews
Async-safe LRU session cache — repeat queries are instant after the first load
Distance-based telemetry sampling — large raw datasets compressed to ≤ 500 points
All errors returned as structured dicts — the server never crashes on bad input
Requirements
Python 3.12+
uv (recommended) or pip
Installation
With uv (recommended)
git clone https://github.com/Surya96t/fastf1-mcp
cd fastf1-mcp
uv syncWith pip
pip install fastf1-mcp-serverRunning the server
# via uv (development)
uv run fastf1-mcp-server
# or directly
python -m fastf1_mcpMCP Inspector (development / debugging)
# Option A — official npx inspector
npx @modelcontextprotocol/inspector uv --directory . run fastf1-mcp-server
# Option B — fastmcp wrapper
uv run fastmcp dev inspector -m fastf1_mcp.server --with-editable .Both open the inspector at http://localhost:6274.
Claude Desktop configuration
Add the following to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"fastf1": {
"command": "uv",
"args": ["run", "fastf1-mcp-server"],
"cwd": "/absolute/path/to/fastf1-mcp",
"env": {
"FASTF1_MCP_LOG_LEVEL": "INFO",
"FASTF1_MCP_MAX_CACHED_SESSIONS": "10"
}
}
}
}Restart Claude Desktop after saving. The server name fastf1 will appear in the tools panel.
Configuration
All settings are read from environment variables with the FASTF1_MCP_ prefix.
Variable | Default | Description |
|
| Disk cache for FastF1 session files |
|
| Max sessions held in memory (LRU) |
|
| Default telemetry sample points |
|
| Hard cap on telemetry sample points |
|
| Directory for CSV exports (relative to server cwd) |
|
| Auto-export to CSV when the bulk array exceeds this many rows. Set to |
|
| Python logging level |
Exporting full datasets for analysis
get_lap_times, get_stint_analysis, get_lap_telemetry, and
compare_telemetry route the bulk data array through CSV when the user
needs the file rather than the inline JSON.
Two ways the export gets triggered:
Auto-export (default for large responses) — when the response's bulk array would exceed
FASTF1_MCP_AUTO_EXPORT_ROWSrows (default 50), the server writes it to CSV inFASTF1_MCP_EXPORT_DIRand the response carriesexportPath+ anoteinstead of the array. This catches full-race lap-time queries, full-grid stint analyses, and 200-point telemetry traces — exactly the cases where MCP clients would otherwise silently spill the response to an opaque temp file.Explicit
export_pathparameter — pass it on the tool call:export_path=True→ write to<FASTF1_MCP_EXPORT_DIR>/<auto-named>.csvexport_path="data/laps"→ write the auto-named file into the given directoryexport_path="data/ver-monaco.csv"→ write to exactly that file
The summary field is always included so a chat-only user can still
answer "what was the fastest lap / what's the strategy" without opening
the file. Relative paths resolve against the MCP server's working
directory — under Claude Desktop, that's the cwd set in your MCP
config, so files land in the user's project directory by default.
Tools
Quick Lookup (Ergast API — 1950-present)
Tool | Description |
| Get the F1 race calendar for a season. |
| Get driver championship standings. |
| Get constructor championship standings. |
| Get driver information. |
| Get historical race results (pre-2018 or when session data unavailable). |
| Get circuit information. |
Session Data (FastF1 Live Timing — 2018-present)
Tool | Description |
| Get session classification/results. |
| Get all lap times for a driver in a session. |
| Get fastest laps in a session, one per driver. |
| Calculate average race pace for all drivers. |
| Analyze tire stints for a race. |
| Get all pit stops from a race. |
| Get qualifying results split by Q1/Q2/Q3. |
Telemetry (FastF1 Live Timing — 2018-present)
Tool | Description |
| Get telemetry data for a specific lap. |
| Compare telemetry between two drivers on the same session. |
| Get speed trap and top-speed data for all drivers in a session. |
| Get best sector times and theoretical best lap for each driver. |
Utility
Tool | Description |
| List all events in a season. |
| List all drivers in a season, optionally filtered to a specific event. |
| Check server in-memory session cache status. |
| Clear cached sessions from in-memory storage. |
Resources
URI | Description |
| Full race calendar for a season |
| All drivers who competed in a season |
| All constructors in a season |
| All F1 circuits (all-time) |
Prompts
Prompt | Args | What it does |
|
| Calls results + fastest laps + pit stops + stints, then narrates the race |
|
| Q breakdown + sector times + top laps analysis |
|
| Season-level head-to-head: standings, races, qualifying |
|
| Stints + pit timing + race pace — explains who won the strategy battle |
|
| Circuit details + recent history + championship context |
Example queries (Claude Desktop)
Who won the 2024 Monaco Grand Prix and what was the strategy?
→ use race_recap prompt or call get_session_results + get_stint_analysis
Compare Verstappen and Leclerc's telemetry in 2024 Monaco qualifying
→ compare_telemetry(2024, "Monaco", "Q", "VER", "LEC")
Who had the fastest theoretical lap in 2024 Silverstone qualifying?
→ get_sector_times(2024, "Silverstone", "Q")
Show me the 2024 constructor standings after round 10
→ get_constructor_standings(2024, after_round=10)Development
# Install dev dependencies
uv sync --dev
# Run tests
uv run pytest
# Run tests with coverage
uv run pytest --cov=fastf1_mcp
# Lint
uv run ruff check src/Data sources & coverage
Source | Coverage | Used for |
Ergast API (via FastF1) | 1950 – present | Standings, schedules, historical results, circuit info |
2018 – present | Lap times, telemetry, qualifying, pit stops, tire data |
Note: FastF1 session data is only available from 2018 onwards. Use
get_race_results_historicalfor earlier seasons.
License
MIT
Maintenance
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Surya96t/fastf1-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server