An enhanced Model Context Protocol (MCP) server for comprehensive airline booking operations, built with FastMCP 2.0 and Python.
- Flight Search & Booking: Multi-criteria search, booking creation, modifications
- Check-in & Services: Online check-in, seat selection, baggage, meal preferences
- Real-time Operations: Flight tracking, price alerts, disruption handling
- Loyalty & Groups: Frequent flyer integration, group bookings, special assistance
- Airport information with timezones
- Real-time flight status
- Seat maps and availability
- Weather impact data
- Airline policies
- Gate information
- Upgrade availability
- Loyalty benefits
- Intelligent flight search assistance
- Complete booking workflow guidance
- Multi-city trip planning
- Disruption management
- Loyalty optimization
- Accessibility support
- Python 3.10 or higher
- UV package manager (recommended) or pip
- Clone the repository:
git clone <repository-url>
cd flight-sim-mcp- Install dependencies using UV (recommended):
uv pip install -r requirements.txtOr using pip:
pip install -r requirements.txt- Copy environment configuration:
cp .env.example .env- Configure your
.envfile with appropriate values.
Start the MCP server:
python src/server.pyThe server will start in stdio mode by default, suitable for integration with Claude Desktop or other MCP clients.
-
Open your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the flight simulator server:
{
"mcpServers": {
"flight-simulator": {
"command": "python",
"args": ["/path/to/flight-sim-mcp/src/server.py"],
"env": {}
}
}
}- Restart Claude Desktop
Flight Search:
"Find me a flight from San Francisco to New York next Friday"
Group Booking:
"I need to book flights for 8 people from SFO to JFK on March 15th"
Check-in:
"Check me in for booking BK12345ABC"
Flight Tracking:
"Track flight UA123"
Loyalty Optimization:
"How can I maximize my miles on upcoming trips?"
search_flights- Search with multiple criteriaget_flight_details- Detailed flight informationcreate_booking- Book flightsget_booking- Retrieve booking detailscancel_booking- Cancel with refund calculationmodify_booking- Change flights or dates
check_in- Online check-in with boarding passesselect_seats- Choose specific seatsadd_baggage- Add checked bagsadd_services- Meals, WiFi, priority boardingtravel_insurance- Trip protection optionsspecial_assistance- Accessibility services
track_flight- Live flight statusprice_alert- Monitor price changesloyalty_account- Link frequent flyer accountsgroup_booking- 5+ passenger bookingsupgrade_seat- Request upgrades
- Install MCP Inspector:
npm install -g @modelcontextprotocol/inspector- Run the inspector:
npx mcp-inspector python src/server.py- Access the web UI at
http://localhost:5173
pytest tests/flight-sim-mcp/
βββ src/
β βββ server.py # Main MCP server
β βββ tools/ # Tool implementations
β βββ resources/ # Resource endpoints
β βββ models/ # Pydantic data models
β βββ data/ # Mock database
β βββ prompts/ # AI prompt templates
βββ tests/ # Test files
βββ pyproject.toml # Project configuration
βββ README.md # This file
- Create a new file in
src/tools/ - Import the MCP instance:
from ..server import mcp - Define tools using the
@mcp.tool()decorator - Import the module in
server.py
The server uses a mock database that generates realistic flight data for demonstrations. In production, this would connect to real airline APIs.
- API tokens should be stored in environment variables
- Payment tokens are mocked - implement real payment integration for production
- Personal data handling follows privacy best practices
- Rate limiting is recommended for production deployments
The default stdio transport is perfect for local development and testing with Claude Desktop.
For remote access, configure SSE transport:
# In server.py or via environment variables
MCP_TRANSPORT=sse
MCP_HOST=0.0.0.0
MCP_PORT=8080Deploy options:
- Docker container (Dockerfile included)
- Railway/Render (one-click deploy)
- AWS Lambda (serverless)
- Any Python-capable hosting platform
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Submit a pull request
MIT License - see LICENSE file for details
For issues, questions, or contributions:
- Open an issue on GitHub
- Check existing documentation
- Review MCP protocol specs at modelcontextprotocol.io