Skip to main content

Local MCP server for Formula 1 race intelligence — connect to Claude Desktop or any MCP-compatible client

Project description

fastf1-mcp

A 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.

No hosted API. No credentials for data. Everything runs locally on your machine.

Install

pip install fastf1-mcp

Use with Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "f1": {
      "command": "fastf1-mcp"
    }
  }
}

Restart Claude Desktop. Then ask:

"Load the 2024 Monaco qualifying and tell me who got pole"

"Compare Verstappen and Leclerc's race pace at Silverstone"

"What was Hamilton's pit strategy at Monza?"

What It Does

The MCP server exposes 17 tools that Claude can call to fetch specific F1 data:

Tool What It Answers
load_session Load a race, qualifying, or practice session
season_calendar "What races are in 2024?"
race_result "Who won?", "What was the podium?"
qualifying_result "Who got pole?", "Q3 times?"
lap_times "How consistent was Leclerc?"
fastest_laps "Who set the fastest lap?"
pit_stops "When did everyone pit?"
tire_stints "What compounds did they use?"
driver_telemetry "What was Verstappen's top speed?"
head_to_head "Compare Norris vs Piastri"
weather "Was it wet?"
session_summary "Give me an overview of the race"
track_evolution "Did the track get faster?"
overtake_analysis "Who gained the most positions?"
identify_driver "Who is car 44?"
list_drivers "Who was in this session?"
session_status "What session is loaded?"

Fuzzy Input Normalization

You don't need to know exact driver codes or race names. The server resolves natural language:

You Say Resolves To
"Leclerc", "charles", "LEC", "16" Charles Leclerc (LEC)
"checo", "Perez", "11" Sergio Perez (PER)
"spa" Belgian Grand Prix
"monza" Italian Grand Prix
"silverstone" British Grand Prix
"qualifying", "quali", "Q" Qualifying session

How It Works

You ask Claude: "Who won the 2024 Bahrain race?"
     │
     ▼
Claude picks tool: load_session(year=2024, race="Bahrain", session="race")
     │
     ▼
fastf1-mcp loads data via FastF1 (cached locally after first download)
     │
     ▼
Claude picks tool: race_result()
     │
     ▼
fastf1-mcp returns structured JSON with the classification
     │
     ▼
Claude answers: "Verstappen won from Perez and Sainz..."
  • First load of a session downloads from F1 servers (~10-30 seconds)
  • Every load after is instant (cached at ~/.cache/f1_mcp/)
  • No API keys needed for F1 data — it's public timing data via FastF1
  • Claude only sees small JSON tool results, not raw telemetry dumps

Data Coverage

  • Seasons: 2018 onwards (FastF1 limitation)
  • Sessions: Race, Qualifying, Sprint, Practice (FP1/FP2/FP3)
  • Data: Results, lap times, pit stops, tyre stints, telemetry (speed/throttle/brake), weather, circuit info

Testing

pip install fastf1-mcp[test]

# Unit tests (no network, instant)
pytest tests/ -m "not integration" -v

# Full suite (downloads F1 data on first run, cached after)
pytest tests/ -v

133 tests covering normalization, session management, tool execution, and MCP protocol (stdio JSON-RPC handshake, tool listing, tool calls).

Use as a Python Library

You can also import the package directly without MCP:

from f1_mcp.session import SessionManager

mgr = SessionManager()
mgr.load(2024, "Monaco", "qualifying")

print(mgr.qualifying_result())
print(mgr.lap_times("Leclerc"))
print(mgr.head_to_head("Verstappen", "Norris"))

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastf1_mcp-0.2.0.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastf1_mcp-0.2.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file fastf1_mcp-0.2.0.tar.gz.

File metadata

  • Download URL: fastf1_mcp-0.2.0.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fastf1_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 69c3f68a747b3ec901b3065ec5c5b3c6386b5946a38f184cb40833986bd4a21f
MD5 b6493ce1bf2532a5fa2477508a901643
BLAKE2b-256 ade20146a402f985386c2698772865474799a198a52651886c7b32f86c3f314f

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastf1_mcp-0.2.0.tar.gz:

Publisher: publish.yml on aashnakunk/fastf1-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastf1_mcp-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fastf1_mcp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fastf1_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c4e339a3f43be8f1d384c9833f2480bc4c23b12134f34b40869edfa3a5b86537
MD5 eedd419b338c33a85b575d0baf679c8f
BLAKE2b-256 f994500f8a42a84f941f7c2638ad2f29a3f68f6d3fb83a7c67713a3652e5ce8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastf1_mcp-0.2.0-py3-none-any.whl:

Publisher: publish.yml on aashnakunk/fastf1-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page