pitstop

praneethravuri/pitstop

3.2

If you are the rightful owner of pitstop and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

Pitstop is a Model Context Protocol (MCP) server that provides access to comprehensive Formula 1 data, including championship standings and race results.

Tools
2
Resources
0
Prompts
0

Pitstop 🏎️

Comprehensive Formula 1 data via Model Context Protocol (MCP) for Claude Desktop

Python 3.13+ MCP FastF1 100% Free

Production-ready MCP server with 25 optimized F1 data tools, comprehensive logging, health checks, and flexible configuration. Aggregates data from 4 free sources (FastF1, OpenF1, Ergast, 25+ RSS feeds) covering Formula 1 from 1950 to present.


🚀 Quick Start

Installation

git clone https://github.com/praneethravuri/pitstop.git
cd pitstop
uv sync

# Optional: Configure environment variables
cp .env.example .env
# Edit .env to customize settings

Configure Claude Desktop

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "pitstop": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/absolute/path/to/pitstop",
        "mcp",
        "run",
        "/absolute/path/to/pitstop/server.py"
      ]
    }
  }
}

Note: Replace /absolute/path/to/pitstop with your installation path. Use double backslashes (\\) on Windows.

Restart Claude Desktop to activate.


📊 Data Sources

SourceCoverageData Types
FastF12018-presentSession data, telemetry, weather, race control
Ergast API1950-2024Historical results, standings, driver/team info
RSS FeedsLatest F1 NewsLatest news from 25+ sources
OpenF1 API2023-presentReal-time radio, pit stops, intervals

Note: RSS feeds only contain recent articles. For historical F1 news (e.g., 2013 Indian GP), use web search instead.


🛠️ Available Tools

Core Session Data

ToolDescriptionKey Parameters
get_session_detailsComplete session overview with results and weatheryear, gp, session
get_session_resultsFinal classification/resultsyear, gp, session
get_lapsLap-by-lap data including fastest laps, sectors, pit stopsyear, gp, session, driver?, lap_type?
get_session_driversList of drivers in sessionyear, gp, session
get_tire_strategyTire compound usage and stint datayear, gp, session, driver?
get_qualifying_sessionsSplit qualifying into Q1/Q2/Q3 segmentsyear, gp, segment?
get_track_evolutionTrack lap time improvement through sessionyear, gp, session, max_laps?

Telemetry & Analysis

ToolDescriptionKey Parameters
get_lap_telemetryHigh-frequency telemetry datayear, gp, session, driver, lap_number
compare_driver_telemetrySide-by-side telemetry comparisonyear, gp, session, driver1, driver2, lap1?, lap2?
get_analysisRace pace, tire degradation, stintsyear, gp, session, analysis_type, driver?
get_session_weatherHistorical weather data throughout sessionyear, gp, session

Race Control & Track

ToolDescriptionKey Parameters
get_race_control_messagesAll race control messages (flags, penalties, etc.)year, gp, session, message_type?
get_circuitCircuit layout, corners, track statusyear, gp, data_type, session?

Note: get_race_control_messages supports filtering with message_type: "all", "penalties", "investigations", "flags", "safety_car"

Live Timing - OpenF1

ToolDescriptionKey Parameters
get_driver_radioTeam radio messages with transcriptsyear, country, session_name?, driver_number?
get_live_pit_stopsPit stop timing and statisticsyear, country, session_name?, driver_number?
get_live_intervalsReal-time gaps and intervalsyear, country, session_name?, driver_number?
get_meeting_infoMeeting and session scheduleyear, country
get_stints_liveReal-time tire stint trackingyear, country, session_name?, driver_number?, compound?

Championship & Schedule

ToolDescriptionKey Parameters
get_standingsDriver/constructor standingsyear, round?, type?, driver_name?, team_name?
get_scheduleF1 calendar with sessionsyear, include_testing?, round?, event_name?, only_remaining?

Reference & Media

ToolDescriptionKey Parameters
get_reference_dataDriver info, team details, circuitsreference_type, year?, name?
get_f1_newsLatest F1 newssource?, limit?, keywords?, driver?, team?

Parameter Conventions:

  • year: Season year (2018+ for FastF1, 1950+ for Ergast, 2023+ for OpenF1)
  • gp: Grand Prix name (e.g., "Monaco", "Silverstone") or round number
  • session: Session type - "FP1", "FP2", "FP3", "Q", "S", "R"
  • driver: 3-letter code (e.g., "VER") or driver number
  • ? suffix: Optional parameter

💡 Usage Examples

# Session Analysis
"Get qualifying results from Monaco 2024"
"What was Verstappen's tire strategy in the race?"
"Show me sector times for all drivers"

# Telemetry
"Compare telemetry between Verstappen and Hamilton in qualifying"
"Get Leclerc's fastest lap data"

# Race Control
"What penalties were given in Monaco?"
"Show me all flag periods from the race"
"Get safety car periods"

# Live Data
"Get team radio messages from the race"
"Show me pit stop times for all drivers"
"What was the gap between Verstappen and Hamilton?"

# News & Schedule (Recent only)
"What's the latest F1 news?"
"Show me recent news about Ferrari"
"What are the transfer rumors this week?"
"When is the next race?"

# Note: For historical news (e.g., "2013 Indian GP"), use web search

⚙️ Configuration

Environment Variables (.env)

Pitstop uses environment variables for configuration. A .env file is included for easy setup:

# Copy the example file and customize
cp .env.example .env

Available Configuration Options:

VariableDefaultDescription
PITSTOP_ENVdevelopmentEnvironment mode:development or production
PITSTOP_LOG_LEVELDEBUG (dev) / INFO (prod)Logging level:DEBUG, INFO, WARNING, ERROR, CRITICAL
PITSTOP_ENABLE_CACHINGtrueEnable caching for improved performance
PITSTOP_CACHE_TTL300Cache time-to-live in seconds (5 minutes)
PITSTOP_RATE_LIMIT_ENABLEDfalseEnable rate limiting per client
PITSTOP_RATE_LIMIT1000Maximum requests per hour per client
PITSTOP_TIMEOUT30Default timeout in seconds
PITSTOP_TELEMETRY_TIMEOUT60Telemetry timeout in seconds

Production Mode (PITSTOP_ENV=production):

  • ✅ Structured JSON logging for log aggregation
  • ✅ Error message masking for security
  • ✅ Optimized performance settings
  • ✅ Health check resources enabled

Development Mode (PITSTOP_ENV=development):

  • ✅ Human-readable text logging
  • ✅ Detailed error messages with stack traces
  • ✅ Debug-level logging by default
  • ✅ Full error context for debugging

Cache Management

FastF1 caches session data in cache/ for performance. Clear if needed:

rm -rf cache/     # Unix/macOS
rmdir /s cache    # Windows

Health Check

Access server status and health information via the server://status resource:

{
  "server": "Pitstop F1 MCP Server",
  "version": "1.0.0",
  "status": "operational",
  "environment": "production",
  "tools_count": 25,
  "data_sources": {
    "fastf1": "operational (2018-present)",
    "openf1": "operational (2023-present)",
    "ergast": "operational (1950-2024)",
    "rss_feeds": "operational (25+ sources)"
  }
}

🧪 Testing

Test individual tools:

# Test session tool
python tools/session/results.py

# Test telemetry
python tools/telemetry/lap_telemetry.py

# Test OpenF1 live data
python tools/live/radio.py

# Test race control
python tools/control/messages.py

🤝 Contributing

Contributions welcome! Please submit a Pull Request.


📄 License

MIT License - see file


🙏 Acknowledgments


Built with ❤️ for F1 fans and data enthusiasts