fastf1-mcp-server
v0.3.0MCP server for Formula 1 data via FastF1
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_schedule
Get the F1 race calendar for a season. Data source: Ergast API (via FastF1) Coverage: 1950-present
| Parameter | Type | Description |
|---|---|---|
year * | integer | Season year (1950-present) |
get_driver_standings
Get driver championship standings. Data source: Ergast API (via FastF1) Coverage: 1950-present
| Parameter | Type | Description |
|---|---|---|
year * | integer | Season year |
after_round | Standings after specific round (default: latest) |
get_constructor_standings
Get constructor championship standings. Data source: Ergast API (via FastF1) Coverage: 1958-present (constructor championship started 1958)
| Parameter | Type | Description |
|---|---|---|
year * | integer | Season year |
after_round | Standings after specific round (default: latest) |
get_driver_info
Get driver information. Data source: Ergast API (via FastF1) Coverage: 1950-present
| Parameter | Type | Description |
|---|---|---|
driver_id | Ergast driver ID (e.g., "max_verstappen", "hamilton") If None, returns all drivers | |
year | Filter to drivers who raced in this season |
get_race_results_historical
Get historical race results (pre-2018 or when session data unavailable). Data source: Ergast API (via FastF1) Coverage: 1950-present
| Parameter | Type | Description |
|---|---|---|
round_num * | integer | Round number |
year * | integer | Season year |
get_circuit_info
Get circuit information. Data source: Ergast API (via FastF1)
| Parameter | Type | Description |
|---|---|---|
circuit_id | Ergast circuit ID (e.g., "monaco", "silverstone") If None, returns all circuits | |
year | Filter to circuits used in this season |
get_session_results
Get session classification/results. Data source: FastF1 Live Timing Coverage: 2018-present
| Parameter | Type | Description |
|---|---|---|
event * | Race name (e.g., "Monaco") or round number | |
year * | integer | Season year (2018+) |
session | string | Session type — R, Q, S, SQ, FP1, FP2, FP3 |
get_lap_times
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.
| Parameter | Type | Description |
|---|---|---|
driver * | string | Driver code (e.g., "VER") or number (e.g., "1") |
event * | Race name or round number | |
session * | string | Session type (R, Q, S, FP1, FP2, FP3) |
year * | integer | Season year (2018+) |
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… | |
include_deleted | boolean | Include deleted lap times (default False) |
get_fastest_laps
Get fastest laps in a session, one per driver. Data source: FastF1 Live Timing Coverage: 2018-present
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
year * | integer | Season year (2018+) |
session | string | Session type (default "R") |
top_n | integer | Number of fastest laps to return (default 10) |
get_race_pace
Calculate average race pace for all drivers. Data source: FastF1 Live Timing Coverage: 2018-present
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
year * | integer | Season year (2018+) |
exclude_first_laps | integer | Number of opening laps to exclude (default 2) |
exclude_pit_laps | boolean | Exclude in-laps and out-laps (default True) |
exclude_sc_laps | boolean | Exclude laps behind safety car or VSC (default True) |
min_laps | integer | Minimum valid laps required to include a driver (default 10) |
get_stint_analysis
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.
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
year * | integer | Season year (2018+) |
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… |
get_pit_stops
Get all pit stops from a race. Data source: FastF1 Live Timing Coverage: 2018-present
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
year * | integer | Season year (2018+) |
get_qualifying_breakdown
Get qualifying results split by Q1/Q2/Q3. Data source: FastF1 Live Timing Coverage: 2018-present
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
year * | integer | Season year (2018+) |
list_events
List all events in a season. Data source: Ergast API (via FastF1) Coverage: 1950-present
| Parameter | Type | Description |
|---|---|---|
year * | integer | Season year (1950-present) |
list_drivers
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)
| Parameter | Type | Description |
|---|---|---|
year * | integer | Season year |
event | Optional race name or round number to filter by event (returns only drivers who participated in that session) |
get_cache_status
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.
clear_cache
Clear cached sessions from in-memory storage.
| Parameter | Type | Description |
|---|---|---|
event | Optional event filter — requires year to be set | |
year | Optional year filter — only clear sessions for this year |
get_lap_telemetry
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.
| Parameter | Type | Description |
|---|---|---|
driver * | string | Driver code (e.g., "VER") |
event * | Race name or round number | |
session * | string | Session type (R, Q, S, FP1, FP2, FP3) |
year * | integer | Season year (2018+) |
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 th… | |
lap | Lap number or "fastest" (default) | |
sample_size | integer | Number of telemetry points to return (default 200, max 500) |
compare_telemetry
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.
| Parameter | Type | Description |
|---|---|---|
driver1 * | string | First driver code (e.g., "VER") |
driver2 * | string | Second driver code (e.g., "LEC") |
event * | Race name or round number | |
session * | string | Session type (R, Q, S, FP1, FP2, FP3) |
year * | integer | Season year (2018+) |
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 `co… | |
lap | Lap number or "fastest" — applied independently to each driver | |
sample_size | integer | Telemetry points per driver (default 200, max 500) |
get_speed_trap_data
Get speed trap and top-speed data for all drivers in a session. Data source: FastF1 Live Timing (session results) Coverage: 2018-present
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
session * | string | Session type (R, Q, S, FP1, FP2, FP3) |
year * | integer | Season year (2018+) |
get_sector_times
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.
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
session * | string | Session type (R, Q, S, FP1, FP2, FP3) |
year * | integer | Season year (2018+) |
driver | Optional driver code to filter (default: all drivers) | |
include_laps | boolean | 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 /… |
get_corner_analysis
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".
| Parameter | Type | Description |
|---|---|---|
driver * | string | Driver code (e.g. "LEC") |
event * | Race name or round number | |
session * | string | Session type (R, Q, S, SQ, FP1, FP2, FP3) |
year * | integer | Season year (2018+) |
driver2 | Optional second driver code to compare against | |
lap | Lap number or "fastest" (default) — applied to each driver |
get_drs_zones
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.
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
year * | integer | Season year (2018+) |
session | string | Session type (default "Q"; R, S, SQ, FP1-FP3 also work) |
get_race_control_messages
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.
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
year * | integer | Season year (2018+) |
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 | |
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) aut… | |
lap_end | Optional last lap to include (inclusive) | |
lap_start | Optional first lap to include (inclusive) | |
session | string | Session type — R, Q, S, SQ, FP1, FP2, FP3 (default "R") |
get_weather
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.
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
year * | integer | Season year (2018+) |
export_path | If True (or a directory / `.csv` path), write the sampled series to CSV and omit `samples`. | |
interval_minutes | integer | Spacing of the returned samples (default 5, min 1). Summary stats always use every sample. |
session | string | Session type — R, Q, S, SQ, FP1, FP2, FP3 (default "R") |
get_position_changes
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".
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
year * | integer | Season year (2018+) |
drivers | Optional driver codes to include (e.g. ["VER", "NOR"]). The session-wide `summary` always covers the full field. | |
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. | |
include_laps | boolean | Include the per-lap `positions` and `gapsToLeaderSec` arrays for each driver (default True). Set False for a compact grid→finish movement table. |
session | string | "R" (race, default) or "S" (sprint) |
get_tyre_degradation
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 agai…
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
year * | integer | Season year (2018+) |
driver | Optional driver code to restrict to one driver | |
export_path | If True (or a directory / `.csv` path), write the per-stint table to CSV and omit `stints`. | |
fuel_correction_sec_per_lap | number | Lap-time gain per lap from fuel burn (default 0.06 s/lap; 0 disables) |
min_stint_laps | integer | Minimum clean laps a stint needs to be fitted (default 6) |
session | string | "R" (default), "S", or a practice session ("FP1"-"FP3") |
get_championship_projection
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.
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
year * | integer | Season year (2018+) |
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 | boolean | Also return the projected championship leader and margin after every lap (`leadByLap`). |
session | string | "R" (Grand Prix, default) or "S" (sprint) |
plot_speed_trace
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.
| Parameter | Type | Description |
|---|---|---|
driver * | string | Driver code (e.g. "VER") |
event * | Race name or round number | |
session * | string | Session type (R, Q, S, SQ, FP1, FP2, FP3) |
year * | integer | Season year (2018+) |
driver2 | Optional second driver to overlay | |
lap | Lap number or "fastest" (default) — applied to each driver | |
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. | |
show_corners | boolean | Mark numbered corners (default True; skipped silently if circuit data is unavailable) |
show_drs | boolean | Shade where `driver`'s DRS flap was open on this lap (default True) |
plot_position_chart
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.
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
year * | integer | Season year (2018+) |
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. | |
session | string | "R" (default) or "S" (sprint) |
plot_tyre_strategy
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.
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
year * | integer | Season year (2018+) |
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. | |
session | string | "R" (default) or "S" (sprint) |
plot_lap_times
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.
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
year * | integer | Season year (2018+) |
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. | |
session | string | Session type (default "R") |
plot_track_map
Draw the circuit map. Two modes: 1. Lap trace (default): the racing line of one lap coloured by speed or gear, with numbered corners, DRS zones and the direction of travel. 2. 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".
| Parameter | Type | Description |
|---|---|---|
event * | Race name or round number | |
year * | integer | Season year (2018+) |
at_lap | Draw car positions at the start of this lap instead of a trace | |
color_by | string | "speed" (default), "gear" or "none" |
driver | Driver whose lap is traced (default: the session's fastest lap) | |
highlight | Up to 8 driver codes coloured in positions mode (default: the top three at that moment) | |
lap | Lap number or "fastest" (default) | |
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. | |
session | string | Session type (default "Q"; use "R"/"S" for at_lap) |
show_corners | boolean | Number the corners (default True) |
show_drs | boolean | Highlight DRS zones on the trace (default True) |
plot_circuit
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.
| Parameter | Type | Description |
|---|---|---|
circuit | Grand Prix name, circuit name, location or nickname ("Monaco", "British", "COTA", "Spa", "Yas Marina"), or a round number together with `year`. | |
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. | |
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 store… |
get_replay_state
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.
| Parameter | Type | Description |
|---|---|---|
top_n | integer | Number of leaderboard rows to return (default 20) |
watch_replay
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.
| Parameter | Type | Description |
|---|---|---|
duration_sec | number | How long to watch, in real seconds (1-60, default 10) |