fastf1-mcp-server
An MCP server that gives AI assistants access to Formula 1 data, charts, analysis, and live replay commentary via FastF1.
Look up schedules, driver/constructor standings, driver and circuit info, historical results, session classifications, and qualifying breakdowns.
Retrieve lap times, fastest laps, race pace, stint strategies, pit stops, sector times, speed-trap data, and corner/DRS analysis.
Get lap telemetry and compare two drivers’ telemetry with sampled distance traces and summary stats.
Analyze race control messages, weather, position changes, tyre degradation, and live championship projections.
Generate PNG charts for speed traces, race positions, tyre strategy, lap times, track maps, and offline circuit outlines.
Follow an f1-race-replay stream for current race state and watch for overtakes, pit stops, safety cars, and race-control updates.
Export large datasets to CSV and manage the in-memory session cache.
Use MCP resources for schedules, drivers, constructors, and circuits, plus guided prompts for race recaps, qualifying, strategy, previews, and replay commentary.
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
36 tools covering standings, race results, lap times, telemetry, pit stops, qualifying, race control, weather, race progression, tyre degradation, corner analysis, DRS zones and live championship projections
Real circuit maps offline — every F1 circuit since 2018 drawn from bundled outline data, no download needed
Charts — track maps, speed traces, race position charts, tyre strategies and lap-time plots returned as PNG images Claude can show inline
Live replay bridge — follow a race playing in f1-race-replay and get race-engineer commentary
4 MCP resources for schedule, driver, constructor, and circuit reference data
6 guided prompts for race recaps, qualifying analysis, strategy deep-dives, weekend previews and live replay commentary
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
Related MCP server: F1 MCP Server
Gallery
These are unedited PNGs from the server's chart tools, the same images Claude shows inline, drawn from real F1 timing data via FastF1. Under each one is a question that brings it up and the tool it calls.
Quick start
No clone needed — uv runs the published package.
Claude Code
claude mcp add fastf1 -- uvx fastf1-mcp-serverClaude Desktop — add to claude_desktop_config.json and restart:
{
"mcpServers": {
"fastf1": {
"command": "uvx",
"args": ["fastf1-mcp-server"]
}
}
}Then ask: "Plot the tyre strategies from the 2025 British Grand Prix" or "Who led every lap of the 2021 Saudi Arabian GP, and when were the red flags?"
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 (from a clone)
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 |
|
| f1-race-replay telemetry stream host (keep on loopback — the stream is unauthenticated) |
|
| f1-race-replay telemetry stream port |
|
| 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. |
| Corner-by-corner apex/entry/exit speed, gear and brake point for one lap; with a second driver, where each gains or loses time. |
| DRS zones (open/close distance, length, surrounding corners) inferred from where the flap actually opened (fastest laps, or in races the laps with the most DRS use). 2018–2025 (DRS was replaced by active aero in 2026). |
Race Analysis (FastF1 Live Timing — 2018-present)
Tool | Description |
| Race control feed with a session summary: SC/VSC/red-flag periods (with laps), penalties, investigations, track-limits deletions. Filter by category, driver or lap range. |
| Air/track temperature, humidity, wind and rain over a session, with rain periods mapped to laps. |
| Lap-by-lap positions and gaps to the leader, grid→finish movement, laps led and lead changes. |
| Fuel-corrected degradation rate per stint and per compound, plus compound crossover estimates. Works on races and practice long runs. |
| Drivers' and constructors' standings as if the race ended at any lap — live points, lead changes during the race, and final official standings. Handles sprint weekends and the 2019–2024 fastest-lap point. |
Charts (PNG images)
Tool | Description |
| Speed vs distance for one lap, or two drivers overlaid with a time-gap panel and corner markers. |
| Race history chart — every driver's position by lap, up to 8 highlighted. |
| Stint bars coloured (and lettered) by compound, in finishing order. |
| Lap time vs lap for up to 3 drivers, marker shape = compound. |
| Circuit map of a lap coloured by speed or gear, with numbered corners, DRS zones and direction of travel — or, with |
| Real circuit outline from bundled data — works offline. By name ("Monaco", "COTA", "Spa"), Grand Prix, or year + round; with only a year, a sheet of that season's circuits. Shows official length, direction of racing and start/finish. |
All chart tools accept save_path to also write the PNG into the export directory. plot_speed_trace also shades where DRS was open.
Live Replay (f1-race-replay)
These read the telemetry stream that f1-race-replay broadcasts on localhost:9999 while a replay is playing. Start a replay there (python main.py --viewer --year 2024 --round 12), then ask Claude what's happening.
Tool | Description |
| Snapshot: replay time, lap, leader, track status, safety car, weather, live leaderboard (tyre, speed, DRS, pit, gaps) and latest race-control messages. |
| Watch for N seconds and report overtakes, pit entries/exits, SC/VSC/red-flag changes and new race-control messages. |
The client drains the stream continuously and disconnects promptly — f1-race-replay's server writes on its render thread, so a client that stopped reading would freeze the replay.
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 |
|
| Results + position changes + race control + fastest laps + stints, then narrates the race |
|
| Q breakdown + sector times + corner analysis of the pole lap |
|
| Season-level head-to-head: standings, races, qualifying |
|
| Stints + pit timing + tyre degradation + SC/VSC timing + race pace — explains who won the strategy battle |
|
| Circuit details + recent history + championship context |
|
| Race-engineer radio updates on a replay running in f1-race-replay |
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")
Where did Norris lose pole to Verstappen in 2024 Spain qualifying?
→ get_corner_analysis(2024, "Spain", "Q", "NOR", driver2="VER")
Why did everyone pit on lap 34? Were there any penalties?
→ get_race_control_messages(2024, "Hungary")
How quickly did the mediums degrade compared to the hards?
→ get_tyre_degradation(2024, "Bahrain")
Show me how the 2024 Brazil race unfolded
→ plot_position_chart(2024, "Brazil", highlight=["VER", "NOR", "RUS"])
Where was everyone when the safety car came out on lap 34?
→ plot_track_map(2024, "Hungary", "R", at_lap=34)
Draw the Suzuka circuit / show me all the 2026 tracks
→ plot_circuit("Suzuka") / plot_circuit(year=2026)
Who was leading the championship on the road at half distance in Abu Dhabi?
→ get_championship_projection(2024, "Abu Dhabi", after_lap=29)
What's happening in the replay right now?
→ get_replay_state() / watch_replay(duration_sec=10)
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, race control, weather | |
MultiViewer (via FastF1) | 2018 – present | Circuit corner positions (corner analysis, speed-trace markers) |
bacinger/f1-circuits (bundled, MIT) | all F1 circuits used 2018 – 2026 + classics | Offline circuit outlines and 2020 – 2026 calendars ( |
Note: FastF1 session data is only available from 2018 onwards. Use
get_race_results_historicalfor earlier seasons.
License
MIT
Available Tools
36 toolsclear_cacheA
Clear cached sessions from in-memory storage.
Args: year: Optional year filter — only clear sessions for this year event: Optional event filter — requires year to be set
Returns: {"cleared": 3, "remaining": 2}
Example: clear_cache() → {"cleared": 5, "remaining": 0} clear_cache(2024, "Monaco") → {"cleared": 1, "remaining": 4}
Note: Clears the in-memory LRU cache only. The FastF1 disk cache (raw timing files) is preserved and unaffected.
Inputs: year, event. Returns: object
compare_telemetryA
Compare telemetry between two drivers on the same session.
Data source: FastF1 Live Timing Coverage: 2018-present
Set export_path=True when the user wants the comparison data for
analysis (notebook, pandas, ML, "plot where one driver gains time",
"save the comparison"). Comparisons at the default 200 sample size
also auto-export.
Args:
year: Season year (2018+)
event: Race name or round number
session: Session type (R, Q, S, FP1, FP2, FP3)
driver1: First driver code (e.g., "VER")
driver2: Second driver code (e.g., "LEC")
lap: Lap number or "fastest" — applied independently to each driver
sample_size: Telemetry points per driver (default 200, max 500)
export_path: If True, write the per-distance comparison array to
a CSV in the configured export directory (default
./fastf1-exports/, override via FASTF1_MCP_EXPORT_DIR)
and omit comparison from the response. Pass a string
for a custom directory or .csv file path.
Returns: { "driver1": {"code": "VER", "lapNumber": 18, "lapTime": "1:10.123"}, "driver2": {"code": "LEC", "lapNumber": 20, "lapTime": "1:10.456"}, "comparison": [ {"distance": 0.0, "speed1": 280.0, "speed2": 275.0, "speedDelta": 5.0, "timeDelta": 0.0}, ... ], "summary": { "lapTimeDeltaSec": 0.333, "maxSpeedDelta": 8.2, "sectors": { "S1": {"driver1": "0:00:28.123", "driver2": "0:00:28.456", "deltaSec": -0.333}, "S2": {...}, "S3": {...} }, "driver1Telemetry": {"maxSpeedKph": 325.0, "brakingZones": 7, ...}, "driver2Telemetry": {"maxSpeedKph": 320.5, "brakingZones": 8, ...} } }
Example: compare_telemetry(2024, "Monaco", "Q", "VER", "LEC")
Note: timeDelta is the cumulative time gap (seconds) at each distance point: driver1's elapsed time minus driver2's. Negative = driver1 is ahead (reached that point sooner); positive = driver1 is behind. This matches the sign of lapTimeDeltaSec and the sector deltaSec values. Uses the recorded Time channel when present, otherwise integrates speed. Comparison is aligned to driver1's distance axis.
Inputs: year (required), event (required), driver1 (required), driver2 (required), +4 more. Returns: object
get_cache_statusA
Check server in-memory session cache status.
Returns: { "sessions_cached": 3, "max_sessions": 10, "cached_sessions": [ {"year": 2024, "event": "Monaco", "session": "R", "loaded_at": "2024-05-26T14:00:00"}, ... ], "fastf1_cache_path": "~/.fastf1_cache", "fastf1_cache_size_mb": 1234.5 }
Example: get_cache_status() → {"sessions_cached": 2, "max_sessions": 10, ...}
Note: Reports in-memory LRU cache only. The FastF1 disk cache (used for raw timing data) is reported separately as size_mb.
Inputs: no named parameters. Returns: object
get_championship_projectionA
Project the drivers' and constructors' championships as if the race finished in the running order at a given lap ("live" standings).
Data source: FastF1 Live Timing (running order) + Ergast (standings) Coverage: 2018-present
Use for "who was leading the championship on the road at lap 40", "how many points did Norris gain on Verstappen in Brazil", "did the championship lead change during the race", or the final standings after a race.
Args:
year: Season year (2018+)
event: Race name or round number
session: "R" (Grand Prix, default) or "S" (sprint)
after_lap: Running order to use (default: the final lap). On the
final lap the official classification and points are
used, so penalties and the fastest-lap point are exact.
include_history: Also return the projected championship leader and
margin after every lap (leadByLap).
Returns: { "round": 21, "session": "R", "lap": 71, "totalLaps": 71, "source": "official" | "projected", "baseline": {"afterRound": 20, "includesSprint": true}, "drivers": [ {"driver": "VER", "fullName": "Max Verstappen", "team": "Red Bull", "pointsBefore": 362.0, "racePosition": 1, "racePoints": 25.0, "projected": 387.0, "positionBefore": 1, "projectedPosition": 1, "change": 0}, ... ], "constructors": [ {"team": "McLaren", "pointsBefore": 566.0, "racePoints": 33.0, "projected": 599.0, "positionBefore": 1, "projectedPosition": 1, "change": 0}, ... ], "summary": {"leader": "VER", "leaderBefore": "VER", "marginToSecond": 62.0, "leadChanged": false, "constructorsLeader": "McLaren"}, "leadByLap": [{"lap": 1, "leader": "VER", "margin": 63.0}, ...] }
Note: Baseline standings are the official ones after the previous round; for a Grand Prix on a sprint weekend the sprint points of the same round are added. Mid-race projections use the race points table (25-18-15-12-10-8-6-4-2-1, sprint 8…1 or 3-2-1 in 2021) and, for 2019-2024 Grands Prix, +1 for the fastest lap so far if that driver is in the top 10. Half-points races (e.g. Spa 2021) are not modelled mid-race; the final-lap figures use the official points.
Inputs: year (required), event (required), session, after_lap, +1 more. Returns: object
get_circuit_infoB
Get circuit information.
Data source: Ergast API (via FastF1)
Args: circuit_id: Ergast circuit ID (e.g., "monaco", "silverstone") If None, returns all circuits year: Filter to circuits used in this season
Returns: Circuit info: circuitId, circuitName, locality, country, lat, long
Inputs: year, circuit_id. Returns: result
get_constructor_standingsA
Get constructor championship standings.
Data source: Ergast API (via FastF1) Coverage: 1958-present (constructor championship started 1958)
Args: year: Season year after_round: Standings after specific round (default: latest)
Returns: Ordered list of constructors with: position, name, nationality, points, wins
Inputs: year (required), after_round. Returns: result
get_corner_analysisA
Corner-by-corner breakdown of a lap: apex (minimum) speed, gear, approach speed, exit speed and brake point for every numbered corner — and, with a second driver, where each one gains or loses time.
Data source: FastF1 Live Timing telemetry + MultiViewer circuit markers Coverage: 2018-present
Use for "where is Leclerc faster than Verstappen", "what's the slowest corner at Monaco", "who brakes later into turn 1", or "how much time does Norris lose in the final sector corners".
Args: year: Season year (2018+) event: Race name or round number session: Session type (R, Q, S, SQ, FP1, FP2, FP3) driver: Driver code (e.g. "LEC") driver2: Optional second driver code to compare against lap: Lap number or "fastest" (default) — applied to each driver
Returns: { "driver": {"code": "LEC", "lapNumber": 18, "lapTime": "..."}, "driver2": {"code": "VER", ...} | null, "corners": [ {"corner": "T1", "distanceM": 210.0, "driver": {"minSpeedKph": 98.5, "gear": 3, "entrySpeedKph": 290.1, "exitSpeedKph": 165.0, "brakeStartM": 92.0, "apexDistanceM": 215.0}, "driver2": {...}, "minSpeedDeltaKph": 2.1, "timeDeltaSec": -0.034}, ... ], "summary": { "slowestCorner": {"corner": "T6", "minSpeedKph": 48.2}, "fastestCorner": {...}, "driverGainsMost": [{"corner": "T10", "timeDeltaSec": -0.081}, ...], "driverLosesMost": [...], "totalCornerDeltaSec": -0.112 } }
Note:
Deltas are driver − driver2: negative timeDeltaSec = driver was
quicker through that corner; positive minSpeedDeltaKph = driver
carried more apex speed. Each corner's window runs halfway to its
neighbours (max ±150 m), so the corner deltas don't sum exactly to
the lap-time delta (straights are excluded). Corner positions are
approximate (hand-annotated circuit data).
Inputs: year (required), event (required), driver (required), session (required), +2 more. Returns: object
get_driver_infoA
Get driver information.
Data source: Ergast API (via FastF1) Coverage: 1950-present
Args: driver_id: Ergast driver ID (e.g., "max_verstappen", "hamilton") If None, returns all drivers year: Filter to drivers who raced in this season
Returns: Driver info: driverId, code, givenName, familyName, dateOfBirth, nationality, permanentNumber
Note: Use get_session_results to find driver codes, then use this for biographical details.
Inputs: year, driver_id. Returns: result
get_driver_standingsA
Get driver championship standings.
Data source: Ergast API (via FastF1) Coverage: 1950-present
Args: year: Season year after_round: Standings after specific round (default: latest)
Returns: Ordered list of drivers with: position, driver code, full name, team, points, wins
Example: get_driver_standings(2024) → [ {"position": 1, "code": "VER", "name": "Max Verstappen", "team": "Red Bull", "points": 575, "wins": 19}, ... ]
Inputs: year (required), after_round. Returns: result
get_drs_zonesA
Detect the DRS zones of a circuit: where each zone opens and closes, its length, and the corners around it.
Data source: FastF1 Live Timing telemetry (DRS flap channel) Coverage: 2018-2025 (DRS was replaced by active aero from 2026)
Zones are inferred from where the DRS flap was actually open on up to 8 reference laps: the fastest laps of the top drivers, or in a race the laps with the most DRS use (DRS only opens within one second of the car ahead, so fastest race laps are often set without it). Qualifying (default) is the best source: drivers may use DRS in every zone on every flying lap.
Args: year: Season year (2018+) event: Race name or round number session: Session type (default "Q"; R, S, SQ, FP1-FP3 also work)
Returns: { "lapLengthM": 5412, "referenceLaps": 8, "zones": [ {"zone": 1, "startM": 4870, "endM": 5390, "lengthM": 520, "afterCorner": "T14", "beforeCorner": "T1", "seenOnLaps": 8}, ... ] }
Note:
Distances are metres from the start/finish line along the
reference laps. startM is where drivers opened the flap, which
is at or just after the official activation point.
afterCorner / beforeCorner need circuit corner data and are
null when it is unavailable.
Inputs: year (required), event (required), session. Returns: object
get_fastest_lapsA
Get fastest laps in a session, one per driver.
Data source: FastF1 Live Timing Coverage: 2018-present
Args: year: Season year (2018+) event: Race name or round number session: Session type (default "R") top_n: Number of fastest laps to return (default 10)
Returns: Fastest laps sorted by time: lapNumber, lapTime, sector1, sector2, sector3, compound
Example: get_fastest_laps(2024, "Monaco", "R", 5) → [ {"lapNumber": 67, "lapTime": "0:01:15.456", "compound": "SOFT", ...}, ... ]
Note: Returns one fastest lap per driver. Only accurate laps are included.
Inputs: year (required), event (required), top_n, session. Returns: result
get_lap_telemetryA
Get telemetry data for a specific lap.
Data source: FastF1 Live Timing Coverage: 2018-present
Set export_path=True when the user mentions data analysis, notebooks,
pandas, ML, "plot the telemetry", "save the trace", or downstream
processing — the sampled per-distance trace is written to CSV.
Telemetry responses with the default 200 sample points also auto-export
so the user always gets a real file path in the project.
Args:
year: Season year (2018+)
event: Race name or round number
session: Session type (R, Q, S, FP1, FP2, FP3)
driver: Driver code (e.g., "VER")
lap: Lap number or "fastest" (default)
sample_size: Number of telemetry points to return (default 200, max 500)
export_path: If True, write the sampled data array to a CSV in
the configured export directory (default
./fastf1-exports/, override via FASTF1_MCP_EXPORT_DIR)
and omit data from the response. Pass a string for a
custom directory or .csv file path. The server also
auto-exports when data would exceed
FASTF1_MCP_AUTO_EXPORT_ROWS rows (default 50). Use a
larger sample_size if you want more detail in the
exported file.
Returns: { "driver": "VER", "lapNumber": 42, "lapTime": "0:01:23.456", "summary": { "samplePoints": 200, "maxSpeedKph": 327.5, "minSpeedKph": 80.2, "avgSpeedKph": 218.1, "maxGear": 8, "brakingZones": 7, "fullThrottlePct": 64.5 }, "data": [ {"distance": 0.0, "speed": 280.0, "throttle": 95.0, "brake": false, "gear": 7, "drs": 0}, ... ] }
Example: get_lap_telemetry(2024, "Monaco", "Q", "VER") → fastest Q lap telemetry get_lap_telemetry(2024, "Monaco", "R", "VER", lap=45) → lap 45 telemetry
Note:
Raw telemetry has 5000+ points per lap. Response is sampled to
sample_size evenly-spaced distance points (capped at 500).
summary lets a caller answer top-speed / braking-zone questions
without parsing the full per-distance array.
Inputs: year (required), event (required), driver (required), session (required), +3 more. Returns: object
get_lap_timesA
Get all lap times for a driver in a session.
Data source: FastF1 Live Timing Coverage: 2018-present
Set export_path=True when the user mentions data analysis, notebooks,
pandas, ML, "save as CSV", "export the data", or any downstream
processing — the full per-lap array is then written to a CSV file the
user can open directly. Large responses (>50 laps) also auto-export so
the user always gets a real file path in the project rather than the
MCP client silently spilling the response to a temp file.
Args:
year: Season year (2018+)
event: Race name or round number
session: Session type (R, Q, S, FP1, FP2, FP3)
driver: Driver code (e.g., "VER") or number (e.g., "1")
include_deleted: Include deleted lap times (default False)
export_path: If True, write the full per-lap array to a CSV in the
configured export directory (default ./fastf1-exports/,
override via FASTF1_MCP_EXPORT_DIR) and omit laps from
the response. Pass a string for a custom directory or
.csv file path. The server also auto-exports when
the lap count exceeds FASTF1_MCP_AUTO_EXPORT_ROWS
(default 50).
Returns: Default (no export): { "driver": "VER", "fullName": "Max Verstappen", "teamName": "Red Bull Racing", "summary": {...}, "laps": [{"lapNumber": 1, "lapTime": "0:01:30.456", ...}, ...] }
With export_path:
{
"driver": "VER", "fullName": ..., "teamName": ...,
"summary": {...},
"exportPath": "/abs/path/to/get_lap_times_2024_monaco_r_ver_<ts>.csv",
"rowCount": 52
}Note:
Deleted laps (e.g., track limits violations) are excluded by default.
Set include_deleted=True to include them.
summary lets a caller answer fastest/avg/compound questions without
re-parsing the full per-lap array. Use export_path=True to grab the
full dataset as CSV for downstream analysis / ML work.
Inputs: year (required), event (required), driver (required), session (required), +2 more. Returns: object
get_pit_stopsA
Get all pit stops from a race.
Data source: FastF1 Live Timing Coverage: 2018-present
Args: year: Season year (2018+) event: Race name or round number
Returns: Pit stops sorted by lap: driver (code), fullName, teamName, lap, stopNumber, duration, tyreFrom, tyreTo
Example: get_pit_stops(2024, "Monaco") → [ {"driver": "LEC", "fullName": "Charles Leclerc", "teamName": "Ferrari", "lap": 28, "stopNumber": 1, "duration": 23.4, "tyreFrom": "MEDIUM", "tyreTo": "HARD"}, ... ]
Note: Duration is calculated from PitInTime (end of in-lap) to PitOutTime (start of out-lap), in seconds. Stops with implausibly long durations (>120s) are filtered as FastF1 data artifacts — commonly a phantom lap-1 entry tied to session start, not a real pit stop.
Inputs: year (required), event (required). Returns: result
get_position_changesA
Get how a race unfolded: lap-by-lap positions, gaps to the leader, positions gained from the grid, laps led and lead changes.
Data source: FastF1 Live Timing Coverage: 2018-present
Use for "how did the race unfold", "who gained the most places", "when did X take the lead", "how far behind was Y at half distance", or "how many places did Z make up on lap 1".
Args:
year: Season year (2018+)
event: Race name or round number
session: "R" (race, default) or "S" (sprint)
drivers: Optional driver codes to include (e.g. ["VER", "NOR"]).
The session-wide summary always covers the full field.
include_laps: Include the per-lap positions and gapsToLeaderSec
arrays for each driver (default True). Set False for
a compact grid→finish movement table.
export_path: If True (or a directory / .csv path), write a long
format CSV (one row per driver per lap: lap, driver,
position, gapToLeaderSec) and omit the per-lap arrays.
Returns: { "totalLaps": 57, "summary": { "winner": "VER", "lapLeaders": {"VER": 50, "LEC": 7}, "leadChanges": [{"lap": 21, "from": "VER", "to": "LEC"}, ...], "biggestGainers": [{"driver": "HAM", "grid": 18, "finish": 6, "positionsGained": 12}, ...], "biggestLosers": [...] }, "drivers": [ {"driver": "VER", "fullName": "Max Verstappen", "teamName": "Red Bull Racing", "grid": 1, "finish": 1, "status": "Finished", "positionsGained": 0, "lap1Gain": 0, "lapsLed": 50, "bestPosition": 1, "worstPosition": 2, "positions": [1, 1, 1, ...], "gapsToLeaderSec": [0.0, 0.0, ...]}, ... ] }
Note:
positions[i] / gapsToLeaderSec[i] are for lap i+1. The gap is
the time between the leader completing that lap and this driver
completing the same lap (the classic "race history" gap, so lapped
cars show their full deficit). Pit-lane starters have grid 0 in
the source data; their gain is computed from the back of the grid.
Inputs: year (required), event (required), drivers, session, +2 more. Returns: object
get_qualifying_breakdownA
Get qualifying results split by Q1/Q2/Q3.
Data source: FastF1 Live Timing Coverage: 2018-present
Args: year: Season year (2018+) event: Race name or round number
Returns: { "Q1": [{"driver": "VER", "bestTime": "1:10.123", "lapNumber": 3}, ...], "Q2": [...], "Q3": [...], "eliminated_Q1": ["driver1", "driver2", ...], "eliminated_Q2": ["driver3", "driver4", ...] }
Example: get_qualifying_breakdown(2024, "Monaco") → { "Q1": [...20 drivers sorted by best time...], "Q2": [...15 drivers...], "Q3": [...10 drivers...], "eliminated_Q1": ["5 driver codes"], "eliminated_Q2": ["5 driver codes"] }
Note: Uses laps.split_qualifying_sessions() to split by session time. Drivers with no recorded lap time in a segment are omitted from that segment's list.
Inputs: year (required), event (required). Returns: object
get_race_control_messagesA
Get race control messages, penalties, investigations and SC/VSC/red flag periods.
Data source: FastF1 Live Timing Coverage: 2018-present
Use this to answer "why was there a safety car", "who got a penalty", "what happened on lap 34", "how many laps were deleted for track limits", or to explain strategy calls that were triggered by a neutralisation.
Args:
year: Season year (2018+)
event: Race name or round number
session: Session type — R, Q, S, SQ, FP1, FP2, FP3 (default "R")
category: Optional filter on the FastF1 category — "Flag",
"SafetyCar", "Drs", "CarEvent", "Other" (case-insensitive)
driver: Optional driver code or number — only messages about that car
lap_start: Optional first lap to include (inclusive)
lap_end: Optional last lap to include (inclusive)
export_path: If True (or a directory / .csv path), write the full
message list to CSV and omit messages from the
response. Large lists (> FASTF1_MCP_AUTO_EXPORT_ROWS,
default 50) auto-export; narrow with the filters above
to keep them inline.
Returns: { "summary": { "totalMessages": 142, "byCategory": {"Flag": 80, "Other": 40, ...}, "neutralisations": [ {"type": "SC", "startLap": 34, "endLap": 37, "durationSec": 294.9, ...} ], "redFlags": 0, "penalties": [ {"lap": 12, "driver": "SAR", "penalty": "5 SECOND TIME PENALTY", "message": "FIA STEWARDS: 5 SECOND TIME PENALTY FOR CAR 2 ..."} ], "investigations": [...], "trackLimitsDeletions": {"HAM": 3, "VER": 1} }, "messages": [ {"time": "2024-07-07T14:35:12", "lap": 12, "category": "Flag", "flag": "YELLOW", "scope": "Sector", "sector": 7, "driver": null, "tag": null, "message": "YELLOW IN TRACK SECTOR 7"}, ... ] }
Note:
summary is computed over the whole session, before the
category/driver/lap filters are applied, so the neutralisation and
penalty overview is always complete. neutralisations comes from
the track-status feed (more reliable than parsing message text).
Inputs: year (required), event (required), driver, lap_end, +4 more. Returns: object
get_race_paceA
Calculate average race pace for all drivers.
Data source: FastF1 Live Timing Coverage: 2018-present
Args: year: Season year (2018+) event: Race name or round number exclude_first_laps: Number of opening laps to exclude (default 2) exclude_sc_laps: Exclude laps behind safety car or VSC (default True) exclude_pit_laps: Exclude in-laps and out-laps (default True) min_laps: Minimum valid laps required to include a driver (default 10)
Returns: { "filters": { "excludeFirstLaps": 2, "excludeSafetyCarLaps": true, "excludePitLaps": true, "minLaps": 10 }, "drivers": [ {"driver": "LEC", "fullName": "Charles Leclerc", "teamName": "Ferrari", "avgLapTime": "0:01:15.678", "lapCount": 52, "deltaToFastestSec": 0.0, ...}, ... ] }
Note:
SC/VSC filter uses track status "1" (green flag only).
Drivers with fewer than min_laps valid laps are excluded.
The filters block echoes the applied filters so the caller can
clearly state which conditions the pace was computed under.
Inputs: year (required), event (required), min_laps, exclude_sc_laps, +2 more. Returns: object
get_race_results_historicalA
Get historical race results (pre-2018 or when session data unavailable).
Data source: Ergast API (via FastF1) Coverage: 1950-present
Args: year: Season year round_num: Round number
Returns: Results with: position, driver, constructor, grid, laps, status, time (if finished), fastestLapTime, fastestLapRank
Note: For 2018+ races, prefer get_session_results which has more detail.
Inputs: year (required), round_num (required). Returns: result
get_replay_stateA
Snapshot of a race currently playing in f1-race-replay: replay time, lap, leader, track status, safety car, weather, the live leaderboard (position, tyre, tyre age, speed, gear, DRS, pit, last lap, gaps) and the latest race-control messages.
Data source: f1-race-replay telemetry stream (localhost:9999)
Use when the user is watching a replay and asks "who's leading now", "what tyres are they on", "is there a safety car", or wants live commentary. The replay must be running and un-paused.
Args: top_n: Number of leaderboard rows to return (default 20)
Returns: { "replayTime": "00:41:12", "lap": 23, "totalLaps": 57, "leader": "VER", "trackStatus": "SC", "safetyCar": "on_track", "playbackSpeed": 4.0, "paused": false, "progressPct": 40.2, "weather": {"airTempC": 24.1, "trackTempC": 38.0, "rain": "DRY"}, "leaderboard": [ {"position": 1, "driver": "VER", "lap": 23, "tyre": "HARD", "tyreLife": 9, "speedKph": 182.0, "gear": 5, "drsOpen": false, "inPit": false, "lastLapSec": 95.12, "gapToLeaderSec": 0.0, "intervalSec": null}, ... ], "recentRaceControl": [{"replayTimeSec": 2401.2, "category": "SafetyCar", "message": "SAFETY CAR DEPLOYED"}, ...] }
Note: Positions come from the replay's own running order, which can be briefly wrong near the start/finish line or during pit stops (a known limitation of f1-race-replay). Gaps are from the last completed lap.
Inputs: top_n. Returns: object
get_scheduleA
Get the F1 race calendar for a season.
Data source: Ergast API (via FastF1) Coverage: 1950-present
Args: year: Season year (1950-present)
Returns: List of events with: round, raceName, circuitName, country, date, time (if available)
Example: get_schedule(2024) → [ {"round": 1, "raceName": "Bahrain Grand Prix", ...}, ... ]
Inputs: year (required). Returns: result
get_sector_timesA
Get best sector times and theoretical best lap for each driver.
Data source: FastF1 Live Timing Coverage: 2018-present
Set include_laps=True when the user wants per-lap sector breakdowns
(e.g. "show me Antonelli's sector times each lap") rather than just
the per-driver best/theoretical-best summary.
Args:
year: Season year (2018+)
event: Race name or round number
session: Session type (R, Q, S, FP1, FP2, FP3)
driver: Optional driver code to filter (default: all drivers)
include_laps: If True, include a laps array per driver with each
accurate lap's S1/S2/S3 and total lap time. Default
False keeps responses compact for the typical
"fastest sectors / theoretical best" question.
Returns:
For each driver: driver (code), fullName, teamName, bestS1, bestS2,
bestS3, theoreticalBest, actualBest, gapSec. With include_laps,
each entry also has laps: [{lapNumber, s1, s2, s3, lapTime}, ...].
Example: get_sector_times(2024, "Monaco", "Q") → [ {"driver": "VER", "fullName": "Max Verstappen", "teamName": "Red Bull Racing", "bestS1": "0:00:22.123", "bestS2": "0:00:24.456", "bestS3": "0:00:21.789", "theoreticalBest": "0:01:08.368", "actualBest": "0:01:08.570", "gapSec": -0.202}, ... ]
Note: A negative gapSec means the theoretical best (sum of individual sector bests) is faster than the actual best lap — typical, since sector bests usually come from different laps.
Inputs: year (required), event (required), session (required), driver, +1 more. Returns: result
get_session_resultsA
Get session classification/results.
Data source: FastF1 Live Timing Coverage: 2018-present
Args: year: Season year (2018+) event: Race name (e.g., "Monaco") or round number session: Session type — R, Q, S, SQ, FP1, FP2, FP3
Returns: Ordered classification with: position, driverCode, fullName, teamName, gridPosition, time/status, points
Example: get_session_results(2024, "Monaco", "R") → [ {"position": 1, "driverCode": "LEC", "fullName": "Charles Leclerc", "teamName": "Ferrari", "time": "1:45:12.345", ...}, ... ]
Note: Requires year >= 2018. For historical results use get_race_results_historical.
Inputs: year (required), event (required), session. Returns: result
get_speed_trap_dataA
Get speed trap and top-speed data for all drivers in a session.
Data source: FastF1 Live Timing (session results) Coverage: 2018-present
Args: year: Season year (2018+) event: Race name or round number session: Session type (R, Q, S, FP1, FP2, FP3)
Returns: { "source": "results" | "laps", "drivers": [ {"driver": "VER", "fullName": "Max Verstappen", "teamName": "Red Bull Racing", "speedTrap": 298.5, "speedFL": 187.2, "speedI1": 245.0, "speedI2": 268.5}, ... ] }
Example: get_speed_trap_data(2024, "Monza", "Q") → {"source": "results", ...}
Note: SpeedST = official speed trap measurement. SpeedFL = speed at the finish line. SpeedI1/I2 = sector intermediate speed measurements. Values are in km/h.
FastF1 publishes per-driver speed columns on `session.results`, but
for many sessions those columns are entirely empty. When the
results-level data is missing, we fall back to the per-lap max
across `session.laps` for the same columns. `source` indicates
which path produced the response.Inputs: year (required), event (required), session (required). Returns: object
get_stint_analysisA
Analyze tire stints for a race.
Data source: FastF1 Live Timing Coverage: 2018-present
Set export_path=True when the user mentions data analysis, notebooks,
pandas, ML, "save as CSV", "export the strategy data", or any downstream
processing — the full per-stint array is written to CSV. Large
responses (>50 stints, typical for full-grid races) also auto-export.
Args:
year: Season year (2018+)
event: Race name or round number
driver: Optional driver code to filter (default: all drivers)
export_path: If True, write the full per-stint array to a CSV in
the configured export directory (default
./fastf1-exports/, override via FASTF1_MCP_EXPORT_DIR)
and omit stints from the response. Pass a string for
a custom directory or .csv file path. The server
also auto-exports when the stint count exceeds
FASTF1_MCP_AUTO_EXPORT_ROWS (default 50).
Returns: Default (no export): { "summary": {...}, "stints": [{"driver": "LEC", "stintNumber": 1, ...}, ...] }
With export_path:
{
"summary": {...},
"exportPath": "/abs/path/to/get_stint_analysis_<...>.csv",
"rowCount": 45
}Note:
Only accurate laps are included in pace calculations.
Stint numbers match FastF1's internal stint counter.
Phantom lap-1 stints (single-lap entries with no recorded lap time,
paired with the lap-1 pit-stop artifact) are filtered out.
The summary.strategies array gives the 1-stop / 2-stop / compound
sequence per driver in a compact form.
Inputs: year (required), event (required), driver, export_path. Returns: object
get_tyre_degradationA
Estimate tyre degradation (seconds lost per lap of tyre age) per stint and per compound, with fuel-effect correction.
Data source: FastF1 Live Timing Coverage: 2018-present
Use for "how fast did the softs degrade", "which compound was best", "why did X pit so early", "when does the medium overtake the soft", or long-run analysis in practice (session="FP2").
Method: for each stint, keep accurate green-flag laps (no in/out laps,
no lap 1), drop outliers slower than 107% of the stint median, add
fuel_correction_sec_per_lap × (lap − 1) to remove the fuel-burn
effect, then fit lap time against tyre age. The slope is the
degradation rate.
Args:
year: Season year (2018+)
event: Race name or round number
session: "R" (default), "S", or a practice session ("FP1"-"FP3")
driver: Optional driver code to restrict to one driver
min_stint_laps: Minimum clean laps a stint needs to be fitted (default 6)
fuel_correction_sec_per_lap: Lap-time gain per lap from fuel burn
(default 0.06 s/lap; 0 disables)
export_path: If True (or a directory / .csv path), write the
per-stint table to CSV and omit stints.
Returns: { "method": {"fuelCorrectionSecPerLap": 0.06, "minStintLaps": 6}, "summary": { "compounds": { "MEDIUM": {"stints": 14, "medianDegSecPerLap": 0.051, "medianFreshTyrePaceSec": 93.42, "avgStintLaps": 21.3}, "HARD": {...} }, "compoundCrossovers": [ {"faster": "MEDIUM", "slower": "HARD", "freshPaceGapSec": 0.42, "crossoverTyreAge": 18} ], "lowestDeg": [{"driver": "HAM", "compound": "HARD", "degSecPerLap": 0.012}, ...] }, "stints": [ {"driver": "VER", "stintNumber": 2, "compound": "HARD", "startLap": 18, "endLap": 57, "lapsUsed": 33, "tyreAgeStart": 1, "tyreAgeEnd": 40, "degSecPerLap": 0.031, "rawSlopeSecPerLap": -0.029, "r2": 0.62, "freshTyrePaceSec": 93.1, "avgLapTimeSec": 94.2}, ... ] }
Note:
Degradation is an estimate — traffic, dirty air and push/lift
phases add noise; check r2 (closer to 1 = cleaner trend) and
lapsUsed. freshTyrePaceSec is the fitted, fuel-corrected lap
time at tyre age 1, comparable across stints and drivers.
crossoverTyreAge is the tyre age at which the faster-when-fresh
compound's higher degradation makes it slower than the other; it
is null (with a note) when that age is beyond the oldest tyre
run on the faster compound.
Inputs: year (required), event (required), driver, session, +3 more. Returns: object
get_weatherA
Get weather conditions over a session: air/track temperature, rain, wind.
Data source: FastF1 Live Timing (sampled once per minute) Coverage: 2018-present
Use for "was it raining", "how hot was the track", "did conditions change during qualifying", or to explain tyre behaviour and strategy.
Args:
year: Season year (2018+)
event: Race name or round number
session: Session type — R, Q, S, SQ, FP1, FP2, FP3 (default "R")
interval_minutes: Spacing of the returned samples (default 5, min 1).
Summary stats always use every sample.
export_path: If True (or a directory / .csv path), write the
sampled series to CSV and omit samples.
Returns: { "summary": { "airTempC": {"min": 21.3, "max": 24.0, "avg": 22.6, "start": 21.3, "end": 23.9}, "trackTempC": {...}, "humidityPct": {...}, "windSpeedMs": {...}, "rainfall": true, "rainPeriods": [{"startMinute": 31.0, "endMinute": 48.0, "startLap": 18, "endLap": 27}], "durationMinutes": 96.0 }, "samples": [ {"sessionMinute": 0.0, "lap": null, "airTempC": 21.3, "trackTempC": 35.1, "rainfall": false, ...}, ... ] }
Note:
sessionMinute is minutes since the session clock started (the
timing feed starts before lights out, so lap 1 begins a few
minutes in). lap is the lap the leader was on — races only.
Inputs: year (required), event (required), session, export_path, +1 more. Returns: object
list_driversA
List all drivers in a season, optionally filtered to a specific event.
Data source: Ergast API (season list) or FastF1 session (event filter) Coverage: 1950-present (season); 2018-present (event filter)
Args: year: Season year event: Optional race name or round number to filter by event (returns only drivers who participated in that session)
Returns: Drivers with: code, fullName, nationality, team, number
Example: list_drivers(2024) → [ {"code": "VER", "fullName": "Max Verstappen", "nationality": "Dutch", "team": "Red Bull Racing", "number": "1"}, ... ]
Note: When event is provided, data comes from FastF1 session results (requires year >= 2018). Without event, uses Ergast season data.
Inputs: year (required), event. Returns: result
list_eventsA
List all events in a season.
Data source: Ergast API (via FastF1) Coverage: 1950-present
Args: year: Season year (1950-present)
Returns: Events with: round, eventName, country, circuitName, date
Example: list_events(2024) → [ {"round": 1, "eventName": "Bahrain Grand Prix", "country": "Bahrain", "circuitName": "Bahrain International Circuit", "date": "2024-03-02"}, ... ]
Note: Minimal version of get_schedule — useful for discovering valid event names to pass to other tools.
Inputs: year (required). Returns: result
plot_circuitA
Draw a real F1 circuit from stored outline data — works offline, no
session download needed. With only year, draws every circuit on that
season's calendar as a sheet of small maps.
Data source: bundled circuit outlines (bacinger/f1-circuits, MIT), covering every F1 circuit used since 2018 plus classic venues.
Use for "show me the Monaco track", "what does Suzuka look like", "draw the 2026 calendar circuits", or when FastF1 telemetry is not available. For speed/gear-coloured maps, corners and DRS zones from a real lap, use plot_track_map.
Args:
circuit: Grand Prix name, circuit name, location or nickname
("Monaco", "British", "COTA", "Spa", "Yas Marina"), or a
round number together with year.
year: Season. Disambiguates names whose venue changed (the Spanish
GP moves to Madrid in 2026) and is needed for round numbers.
On its own (no circuit), draws that season's calendar
(2020-2026 stored).
save_path: If True, also write the PNG to the export directory
(default ./fastf1-exports/); a string is a directory or
a full .png path.
Returns: An image plus a caption. Structured content has the circuit name, location, official length, direction of racing, first Grand Prix and altitude (or the season's circuit list).
Note: Maps are drawn north-up from geographic coordinates (official F1 maps are often rotated). The outline starts on the start/finish line and the arrow shows the direction of racing.
Inputs: year, circuit, save_path.
plot_lap_timesA
Plot lap time against lap number for up to three drivers, with marker shape showing the tyre compound. Returns a PNG image.
Use for "show me the race pace of X vs Y", "plot their lap times", or to visualise degradation and safety-car phases.
Args:
year: Season year (2018+)
event: Race name or round number
session: Session type (default "R")
drivers: Up to 3 driver codes. Default: the top three finishers.
save_path: If True, also write the PNG to the export directory
(default ./fastf1-exports/); a string is a directory or
a full .png path.
Note: Lap 1, in/out laps and laps slower than 107% of the driver's median (safety car, incidents) are omitted so the y-axis stays readable; the caption reports how many slow laps were dropped and the line breaks across every omitted lap.
Inputs: year (required), event (required), drivers, session, +1 more.
plot_position_chartA
Plot the lap-by-lap race position of every driver (a "race history" chart). Returns a PNG image.
Use when the user wants to see how the race unfolded, overtakes, pit-cycle shuffles or a driver's recovery drive.
Args:
year: Season year (2018+)
event: Race name or round number
session: "R" (default) or "S" (sprint)
highlight: Up to 8 driver codes drawn in colour (others are grey,
all are labelled). Default: the podium finishers.
save_path: If True, also write the PNG to the export directory
(default ./fastf1-exports/); a string is a directory or
a full .png path.
Inputs: year (required), event (required), session, highlight, +1 more.
plot_speed_traceA
Plot a speed-vs-distance trace for one driver's lap, or overlay two drivers with a cumulative time-gap panel underneath. Returns a PNG image.
Use when the user asks to "show", "plot", "chart" or "visualise" telemetry, or to see where one driver is faster than another.
Args:
year: Season year (2018+)
event: Race name or round number
session: Session type (R, Q, S, SQ, FP1, FP2, FP3)
driver: Driver code (e.g. "VER")
driver2: Optional second driver to overlay
lap: Lap number or "fastest" (default) — applied to each driver
show_corners: Mark numbered corners (default True; skipped silently
if circuit data is unavailable)
show_drs: Shade where driver's DRS flap was open on this lap
(default True)
save_path: If True, also write the PNG to the export directory
(default ./fastf1-exports/); a string is a directory or
a full .png path.
Returns:
An image plus a one-line caption. Structured content carries
the lap numbers/times and savedTo when saved.
Inputs: year (required), event (required), driver (required), session (required), +5 more.
plot_track_mapA
Draw the circuit map. Two modes:
Lap trace (default): the racing line of one lap coloured by speed or gear, with numbered corners, DRS zones and the direction of travel.
Car positions (
at_lap=N): where every car was on track at the moment the leader started lap N, with the running order listed.
Returns a PNG image.
Data source: FastF1 Live Timing position data + MultiViewer corners Coverage: 2018-present
Use for "show me the track", "where is the car fastest", "which gear through each corner", or "where was everyone when the safety car came out on lap 34".
Args:
year: Season year (2018+)
event: Race name or round number
session: Session type (default "Q"; use "R"/"S" for at_lap)
driver: Driver whose lap is traced (default: the session's fastest lap)
lap: Lap number or "fastest" (default)
color_by: "speed" (default), "gear" or "none"
at_lap: Draw car positions at the start of this lap instead of a trace
highlight: Up to 8 driver codes coloured in positions mode
(default: the top three at that moment)
show_corners: Number the corners (default True)
show_drs: Highlight DRS zones on the trace (default True)
save_path: If True, also write the PNG to the export directory
(default ./fastf1-exports/); a string is a directory or
a full .png path.
Returns: An image plus a caption. Structured content has the lap used, DRS zones and, in positions mode, the running order.
Inputs: year (required), event (required), lap, at_lap, +7 more.
plot_tyre_strategyA
Plot every driver's tyre strategy as horizontal stint bars coloured by compound, in finishing order. Returns a PNG image.
Use when the user asks to "show the strategies", "visualise the stints" or compare 1-stop vs 2-stop plans at a glance.
Args:
year: Season year (2018+)
event: Race name or round number
session: "R" (default) or "S" (sprint)
save_path: If True, also write the PNG to the export directory
(default ./fastf1-exports/); a string is a directory or
a full .png path.
Inputs: year (required), event (required), session, save_path.
watch_replayA
Watch a running f1-race-replay for a few seconds and report what happened: position changes, pit entries/exits, track-status changes (SC/VSC/red flag), new race-control messages and laps completed.
Data source: f1-race-replay telemetry stream (localhost:9999)
Use for live commentary ("tell me what's happening"), or call it repeatedly to follow a replay like a race engineer. Combine with a faster playback speed to cover more of the race per call.
Args: duration_sec: How long to watch, in real seconds (1-60, default 10)
Returns: { "from": {"replayTime": "00:41:12", "lap": 23}, "to": {"replayTime": "00:42:52", "lap": 24}, "replaySecondsCovered": 100.0, "positionChanges": [{"driver": "NOR", "from": 4, "to": 3, "replayTimeSec": 2388.4}, ...], "netPositionChanges": [{"driver": "NOR", "from": 4, "to": 3}], "pitEntries": ["HAM"], "pitExits": [], "trackStatusChanges": [{"from": "GREEN", "to": "SC", "replayTimeSec": 2401.2}], "newRaceControl": [{"category": "SafetyCar", "message": "SAFETY CAR DEPLOYED", ...}], "leaderNow": "VER", "state": { ...same shape as get_replay_state (top 10)... } }
Note:
Messages are sampled four times a second, so a position swap that
reverts within ~0.25 s of real time can be missed.
positionChanges lists every change seen, in order (an overtake
that is later reversed appears twice); netPositionChanges
compares the start and end of the window. rewound is true if the
user scrubbed backwards; stalled is true if the stream went quiet
(replay paused or closed) before the window ended.
Inputs: duration_sec. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 36 tools
Most tools target clearly distinct resources or analysis angles, and descriptions explicitly separate overlapping areas like historical vs modern results and schedule vs event listing. However, with 36 tools there are several closely related telemetry, pace, strategy, and plotting tools that require careful description reading to avoid misselection.
Names consistently use snake_case with a verb_noun pattern (get_*, list_*, plot_*, compare_*, clear_*, watch_*). The few deviations like compare_telemetry and watch_replay still follow the same readable verb-first convention.
36 tools is a large surface for one server, well above the typical 3–15 range. Although the F1 domain is broad, several analytics and plotting tools could likely be consolidated or parameterized to reduce cognitive load.
The server covers schedule, events, drivers, circuits, standings, results, telemetry, lap times, pit stops, weather, race control, strategy, plotting, and replay. Minor gaps exist, such as no dedicated team radio or constructor profile tool, but most agent workflows are well supported.
Maintenance
Related MCP Connectors
Hosted MCP server for live public-data APIs and Skills for AI agents.
The official Model Context Protocol server for Ambee. It gives any MCP-compatible AI assistant — Claude, ChatGPT, Cursor, VS Code, Ollama, and more direct access to live air quality, pollen, and weather data. To get started, including information on signing up and obtaining your Ambee key, check out the Ambee documentation on https://docs.ambeedata.com
Official Fibery MCP server: query and update your workspace from any AI client via OAuth.
Financial data MCP server for Claude, ChatGPT, Cursor and Codex. Real-time stock quotes, financial statements, options flow, SEC filings, insider trades, 13F holdings, macro data and market news from gloom.sh, the open-source Bloomberg Terminal alternative.
Related MCP Servers
- AlicenseAqualityDmaintenanceA Model Context Protocol server that provides comprehensive Formula One racing data, enabling access to event schedules, driver information, telemetry data, race results, and performance analytics through natural language queries.81MIT
- AlicenseBqualityDmaintenanceProvides comprehensive Formula 1 data access including race schedules, session results, lap times, telemetry data, driver/constructor standings, and circuit information. Enables users to retrieve and analyze F1 racing data through natural language queries using the FastF1 Python package.5MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Formula 1 data through LLM interfaces like Claude. Provides access to F1 information including circuits, constructors, drivers, grand prix, manufacturers, races, and seasons.Apache 2.0
- AlicenseAqualityDmaintenanceA local MCP server that gives Claude (or any MCP-compatible AI client) access to Formula 1 race data. Load any session from 2018 onwards, ask questions in natural language, and get answers backed by real telemetry, timing, and strategy data.171MIT