README.md•4.07 kB
# Pitstop - Formula 1 Data MCP Server
A Model Context Protocol (MCP) server that provides access to Formula 1 data including championship standings, race results, and more.
## Features
### Current Features (MVP)
- **Driver Standings**: Get current or historical driver championship standings
- **Constructor Standings**: Get current or historical constructor/team championship standings
### Planned Features
- Live race data and telemetry
- Race calendar and schedules
- Historical race results
- Latest F1 headlines and news
- Head-to-head driver comparisons
- Track information and layouts
- All-time records and statistics
## Data Sources
Pitstop integrates with multiple Formula 1 data sources:
- **FastF1**: Official F1 timing data, telemetry, and race information (currently implemented)
- **Unofficial APIs**: Real-time race data (planned)
- **RSS Feeds**: Latest F1 news and headlines (planned)
## Installation
### Prerequisites
- Python 3.10 or higher
- pip
### Install from source
```bash
# Clone or navigate to the pitstop directory
cd pitstop
# Install the package in development mode
pip install -e .
```
## Usage
### Running as an MCP Server
The Pitstop server uses the Model Context Protocol to provide F1 data to MCP clients like Claude Desktop.
#### Configure Claude Desktop
Add this to your Claude Desktop configuration file:
**On MacOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**On Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
```json
{
"mcpServers": {
"pitstop": {
"command": "python",
"args": ["-m", "pitstop.server"],
"cwd": "C:\\projects\\pitstop\\src"
}
}
}
```
Note: Update the `cwd` path to match your installation directory.
#### Restart Claude Desktop
After updating the configuration, restart Claude Desktop to load the Pitstop server.
### Available Tools
#### get_driver_standings
Get Formula 1 driver championship standings.
**Parameters:**
- `year` (optional): Year (e.g., "2024") or "current" for current season (default: "current")
- `round` (optional): Round number (e.g., "5") or "last" for latest round. Leave empty for final standings.
**Example queries to ask Claude:**
- "Show me the current F1 driver standings"
- "What were the driver standings after round 10 in 2023?"
- "Who won the 2020 driver championship?"
#### get_constructor_standings
Get Formula 1 constructor (team) championship standings.
**Parameters:**
- `year` (optional): Year (e.g., "2024") or "current" for current season (default: "current")
- `round` (optional): Round number (e.g., "5") or "last" for latest round. Leave empty for final standings.
**Example queries to ask Claude:**
- "Show me the current constructor standings"
- "What were the team standings in 2021?"
- "Show me the constructor standings after the last race"
## Project Structure
```
pitstop/
src/
pitstop/
__init__.py # Package initialization
server.py # MCP server implementation
data_sources/
__init__.py
fastf1_client.py # FastF1 data client
features.txt # Feature roadmap
pyproject.toml # Project configuration
README.md # This file
```
## Development
### Install development dependencies
```bash
pip install -e ".[dev]"
```
### Code formatting
```bash
# Format code with Black
black src/
# Lint with Ruff
ruff check src/
```
### Testing
```bash
pytest
```
## API Credits
- [FastF1](https://github.com/theOehrly/Fast-F1) - Python library for accessing Formula 1 timing data and telemetry
## License
MIT
## Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
## Future Enhancements
See `features.txt` for the full roadmap of planned features including:
- Live race data and telemetry
- Race weekend mode with real-time updates
- Head-to-head driver comparisons
- Track information and weather forecasts
- F1 news and headlines
- Historical statistics and records