F1

F1 Results, Drivers, Lap Times, Telemetry MCP Server

Explore F1 results, driver profiles, lap times, telemetry and circuit data via the MCP server for instant access and race analysis.

Overview

This MCP (Model Context Protocol) server provides instant programmatic access to Formula 1 race data: results, driver profiles, lap times, telemetry, and circuit metadata. It exposes the underlying datasets via REST endpoints and MCP-compatible tool descriptors so LLMs and downstream services can request context snippets or run structured queries against the F1 dataset. The server is designed to make historical and live race information available to AI agents, dashboards, analytics pipelines, and developer tools.

You can use the server to fetch single resources (a driver profile or circuit), run aggregated queries (compare lap times across sessions), or integrate real-time telemetry into an LLM workflow using MCP tool descriptors. The API returns JSON and supports filtered queries, payloads for telemetry playback, and CSV/JSON exports for analytics.

Features

  • REST API endpoints for drivers, races, lap times, telemetry, and circuits
  • MCP tool descriptors for seamless LLM integration (tool listing + run endpoints)
  • Filtered and paginated queries (season, race, session, driver)
  • Lap and telemetry data export in JSON or CSV
  • Aggregation endpoints for comparative analysis (best laps, stint comparisons)
  • Lightweight configuration; run locally or inside Docker
  • Designed for analytics workflows and real-time context provisioning to models

Installation / Configuration

Clone the repository and follow the steps below. The examples cover common installation options — check the repository README for project-specific commands if they differ.

  1. Clone the repo
git clone https://github.com/AbhiJ2706/f1-mcp.git
cd f1-mcp
  1. Install dependencies (Node.js example)
# If the project uses npm
npm install
# or if it uses yarn
yarn install
  1. Environment variables Create a .env file in the project root (example variables):
PORT=8080
DATA_PATH=./data
MCP_BASE=/mcp
LOG_LEVEL=info
  1. Run locally
# npm
npm start

# or explicitly (if using node entry file)
node src/server.js
  1. Run with Docker
# build
docker build -t f1-mcp:latest .

# run
docker run -p 8080:8080 -e PORT=8080 f1-mcp:latest

Note: If the project uses Python/Flask/FastAPI, replace npm commands with pip and the appropriate run command (e.g., uvicorn main:app –reload). Consult the repository README for language-specific details.

Available Resources

The server exposes a set of logical endpoints. The exact paths may vary; replace BASE with your server root (e.g., http://localhost:8080).

EndpointMethodPurpose
BASE/driversGETList drivers or search by name; supports ?season= and ?team=
BASE/drivers/{driverId}GETDriver profile (bio, seasons, teams, stats)
BASE/racesGETRace calendar and results by season
BASE/races/{raceId}/resultsGETRace classification, points, finishing status
BASE/lapsGETQuery lap times with filters: season, race, session, driver
BASE/laps/{raceId}/{session}/driver/{driverId}GETAll lap times for a driver in a session
BASE/telemetryGET/WSTelemetry streams or snapshots (position, speed, throttle, brake)
BASE/circuitsGETCircuit metadata and sector maps
BASE/mcp/toolsGETMCP tool descriptors (for LLM tool discovery)
BASE/mcp/tools/{toolName}/runPOSTRun a tool with structured JSON args (returns context payload)

Example: fetch a driver profile

curl -sS "http://localhost:8080/drivers/leclerc" | jq

Example: run an MCP tool to get race-summary context

curl -X POST "http://localhost:8080/mcp/tools/race_summary/run" \
  -H "Content-Type: application/json" \
  -d '{"season":2024, "round":1}'

Example response fields (driver profile)

{
  "id": "leclerc",
  "name": "Charles Leclerc",
  "nationality": "Monégasque",
  "stats": {
    "starts": 120,
    "wins": 7,
    "poles": 10
  },
  "seasons": [
    {"year": 2024, "team": "Ferrari"}
  ]
}

Use Cases

  • LLM context retrieval: Use the MCP tool descriptors endpoint so a language model can discover available tools and request structured race summaries, driver bios, or recent-lap context before answering a user query.
  • Comparative lap analysis: Pull lap times for two drivers in the same session and compute delta times, best sectors, and stint performance for data-driven commentary.
  • Telemetry playback: Stream telemetry to a visualization tool for replays or to extract features (e.g., top speed, max throttle) for automated reports.
  • Race dashboards and ETL: