Claude Flight Search MCP Server
Enables flight search, airport information lookup, and price comparison through Claude Desktop.
README
Claude Flight Search MCP Server
A Model Context Protocol (MCP) server that provides flight search capabilities for integration with Claude Desktop.
Features
- āļø Flight search between airports
- š¢ Airport information lookup
- š Price comparison across multiple dates
- š Mock data for development (easily replaceable with real APIs)
- š”ļø Environment variable management for API keys
Quick Start
1. Clone and Setup
git clone <your-repo-url>
cd claude-flight-search-mcp
# Create and activate conda environment
conda env create -f environment.yml
conda activate claude-flight-mcp
# Alternative: Create environment manually
# conda create -n claude-flight-mcp python=3.11 -y
# conda activate claude-flight-mcp
# pip install -r requirements.txt
2. Environment Configuration
Create a .env file in the project root:
# Optional: For real Amadeus API integration
AMADEUS_CLIENT_ID=your_amadeus_client_id
AMADEUS_CLIENT_SECRET=your_amadeus_client_secret
3. Test the Server
# Test the server directly
python src/flight_search_server.py
4. Configure Claude Desktop
Edit your Claude Desktop configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
Add this configuration:
{
"mcpServers": {
"flight-search": {
"command": "python",
"args": ["/full/path/to/claude-flight-search-mcp/src/flight_search_server.py"],
"cwd": "/full/path/to/claude-flight-search-mcp",
"env": {
"PYTHONPATH": "/full/path/to/claude-flight-search-mcp/src"
}
}
}
}
Important: Replace /full/path/to/claude-flight-search-mcp with the actual absolute path to your project directory.
5. Restart Claude Desktop
Restart Claude Desktop to load the new MCP server.
Usage Examples
Once configured, you can ask Claude:
- "Search for flights from LAX to JFK on December 15th"
- "Find flights from London to Tokyo next week for 2 passengers"
- "What's the airport information for SFO?"
- "Compare flight prices from LAX to JFK over the next 7 days"
Available Tools
search_flights
Search for flights between airports with detailed results.
Parameters:
origin(required): Origin airport code (3-letter IATA code)destination(required): Destination airport code (3-letter IATA code)departure_date(required): Departure date in YYYY-MM-DD formatreturn_date(optional): Return date for round-trip flightspassengers(optional): Number of passengers (default: 1)
get_airport_info
Get detailed information about an airport.
Parameters:
airport_code(required): 3-letter IATA airport code
compare_flight_prices
Compare flight prices across multiple dates.
Parameters:
origin(required): Origin airport codedestination(required): Destination airport codestart_date(required): Start date for comparisondays_range(optional): Number of days to compare (default: 7)
Current Airport Database
The server currently includes information for:
- LAX (Los Angeles International Airport)
- JFK (John F. Kennedy International Airport)
- LHR (London Heathrow Airport)
- NRT (Narita International Airport)
Development
Adding Real Flight API Integration
- Sign up for Amadeus for Developers
- Get your API credentials
- Add them to your
.envfile - Uncomment the Amadeus dependency in
requirements.txt - Replace the mock data calls with real API calls
Adding More Airports
Edit the AIRPORT_DATABASE dictionary in src/flight_search_server.py to add more airports.
Running Tests
pytest tests/
Code Formatting
black src/
flake8 src/
Project Structure
claude-flight-search-mcp/
āāā src/
ā āāā flight_search_server.py # Main MCP server
āāā tests/ # Test files
āāā docs/ # Documentation
āāā examples/ # Example configurations
āāā requirements.txt # Python dependencies
āāā .env.example # Environment variable template
āāā .gitignore # Git ignore rules
āāā README.md # This file
Troubleshooting
Server Not Connecting
- Check that the path in your Claude Desktop config is correct
- Ensure Python virtual environment is properly set up
- Verify all dependencies are installed
- Check Claude Desktop logs for error messages
Mock Data vs Real Data
The server currently uses mock flight data for development. To use real flight data, you'll need to:
- Set up API credentials with a flight data provider
- Implement the real API calls
- Handle rate limiting and error responses
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
License
MIT License - see LICENSE file for details.
As-Built Documentation: Claude Flight Search MCP Server
Project: Flight Search Integration with Claude Desktop via Model Context Protocol (MCP)
Implementation Date: September 2-3, 2025
Version: 1.0.0
Status: Deployed with Partial Functionality
Executive Summary
Successfully implemented a Model Context Protocol (MCP) server that integrates flight search capabilities with Claude Desktop. The system includes Amadeus API integration, SQLite caching, price tracking, and intelligent fallback mechanisms. While API authentication is functional, flight search requests currently fall back to mock data, indicating parameter or endpoint configuration issues that require further investigation.
System Architecture
Overview
Claude Desktop ā MCP Protocol ā Flight Search Server ā Amadeus API
ā
SQLite Cache Database
Components Implemented
1. MCP Server Framework
- Language: Python 3.11
- Framework: Anthropic MCP Server SDK
- Communication: Standard I/O protocol
- Deployment: Local conda environment
2. Flight Search Service
- Primary API: Amadeus for Developers (Test Environment)
- Fallback: Mock data generation
- Cache: SQLite database with 1-hour TTL
- Rate Limiting: Built-in via API quotas
3. Database Layer
- Engine: SQLite (flight_cache.db)
- Tables: flight_searches, price_tracking
- Purpose: API response caching and price history
Technical Implementation
Core Technologies
- Python: 3.11.13
- MCP Framework: 1.13.1
- HTTP Client: httpx 0.28.1
- Environment Management: python-dotenv 1.1.1
- Database: SQLite (built-in)
- Deployment: Conda environment management
API Integration
- Provider: Amadeus for Developers
- Environment: Test (test.api.amadeus.com)
- Authentication: OAuth2 Client Credentials
- Rate Limit: 2,000 requests/month (free tier)
- Token Management: Automatic refresh with 60-second safety margin
Supported Operations
- search_flights: Individual flight searches with real-time pricing
- find_best_price: Date range optimization across multiple days
- get_airport_info: Airport details and metadata
- compare_flight_prices: Price trends across date ranges
- get_price_history: Historical pricing analysis (planned)
Configuration
Environment Variables
# API Credentials
AMADEUS_CLIENT_ID=WWVc2tHiHUvcsYq1eTiShAGqgTxpxolG
AMADEUS_CLIENT_SECRET=[REDACTED]
# Operational Settings
USE_REAL_API=true
API_FALLBACK_TO_MOCK=true
DEBUG=true
LOG_LEVEL=INFO
# Server Configuration
SERVER_NAME=flight-search
SERVER_VERSION=1.0.0
Claude Desktop Integration
{
"mcpServers": {
"flight-search": {
"command": "D:\\ai\\conda\\envs\\claude-flight-mcp-3.11\\python.exe",
"args": ["D:\\AI\\Gits\\claude-flight-search-mcp\\src\\flight_search_server.py"],
"cwd": "D:\\AI\\Gits\\claude-flight-search-mcp",
"env": {
"PYTHONPATH": "D:\\AI\\Gits\\claude-flight-search-mcp\\src"
}
}
}
}
Airport Database
Supported Airports (12 locations)
North America: LAX, JFK, SFO, IND, ATL, ORD, DEN, MIA
Europe: LHR, CDG, FRA
Africa: LOS
Asia: NRT, DXB
Airport Data Structure
{
"name": "Airport Name",
"city": "City",
"state": "State (if applicable)",
"country": "Country",
"timezone": "IANA timezone",
"iata": "3-letter code",
"icao": "4-letter code"
}
Current Status
Functional Components ā
- MCP server initialization and protocol handling
- Amadeus API authentication (OAuth2 token acquisition)
- SQLite database creation and management
- Airport database validation
- Mock data generation and formatting
- Claude Desktop integration via MCP protocol
- Environment variable management
- Error handling and logging
- Diagnostics and health checking
Authentication Status ā
- Token Endpoint: Successfully authenticating with test.api.amadeus.com
- Credentials: Valid 32-character Client ID and 16-character Secret
- Token Lifecycle: Automatic refresh with 1799-second expiration
- Headers: Proper Content-Type and Authorization formatting
Known Issues ā
- Flight Search API: Requests falling back to mock data despite successful authentication
- Root Cause: Likely parameter formatting or endpoint configuration issues
- Impact: All flight searches return $1,285 mock pricing instead of real market data
- Routes Affected: Both domestic (LAX-JFK) and international (IND-LOS) routes
Data Quality
- Mock Data: Realistic airline codes, routing via appropriate hubs
- Price Simulation: Static $1,285 across all dates and routes
- Expected Real Data: $700-900 range for IND-LOS based on market research
File Structure
claude-flight-search-mcp/
āāā src/
ā āāā flight_search_server.py # Main MCP server (28,737 bytes)
ā āāā flight_search_server_clean.py # Clean backup version
āāā diagnostics.py # Comprehensive system diagnostics
āāā .env # Environment configuration
āāā .env.example # Template for environment setup
āāā environment.yml # Conda environment specification
āāā requirements.txt # Python dependencies
āāā flight_cache.db # SQLite cache (auto-generated)
āāā README.md # Project documentation
āāā .gitignore # Git exclusions
API Endpoints Used
Authentication
- URL:
https://test.api.amadeus.com/v1/security/oauth2/token - Method: POST
- Headers:
Content-Type: application/x-www-form-urlencoded - Status: ā Working
Flight Search
- URL:
https://test.api.amadeus.com/v2/shopping/flight-offers - Method: GET
- Headers:
Authorization: Bearer {token},Content-Type: application/json - Status: ā Parameter or configuration issue
Parameters Sent
{
"originLocationCode": "IND",
"destinationLocationCode": "LOS",
"departureDate": "2024-09-26",
"adults": 1,
"max": 10,
"currencyCode": "USD"
}
Performance Characteristics
Response Times
- Authentication: ~500ms (cached for 30 minutes)
- Mock Data Generation: ~100ms
- Database Queries: <10ms
- End-to-End Search: ~600ms (mock mode)
Resource Usage
- Memory: ~50MB baseline
- Storage: 50KB (cache database grows with usage)
- API Quota: 0-3 calls per search (depending on date range)
Caching Strategy
- Duration: 1 hour per search combination
- Key Format:
{origin}_{destination}_{date}_{passengers} - Invalidation: Time-based expiration only
Diagnostics and Monitoring
Health Check Results
Environment Check: ā
All systems operational
Dependencies: ā
All packages installed correctly
Configuration: ā
Environment variables properly set
Server File: ā
All components present and valid
API Authentication: ā
Successfully obtaining tokens
Server Startup: ā
All imports and initialization successful
Claude Integration: ā
MCP protocol properly configured
Logging Implementation
- Startup: Service initialization with configuration status
- API Calls: Token requests and flight search attempts
- Errors: Detailed error messages with context
- Fallbacks: Clear indication when using mock data
Security Implementation
Credential Management
- Environment variable isolation
- No hardcoded secrets in source code
- .gitignore protection for sensitive files
- Test environment credentials only
Data Protection
- Local SQLite database (no external data exposure)
- No persistent storage of API responses beyond cache TTL
- No personal data collection or retention
Testing and Validation
Test Coverage
- Unit Tests: Basic functionality validation
- Integration Tests: MCP protocol communication
- API Tests: Authentication flow verification
- End-to-End Tests: Claude Desktop interaction
Validation Methods
- Manual flight searches via Claude interface
- Diagnostics script comprehensive checking
- Direct API credential testing via curl
- Mock data fallback verification
Future Development Requirements
Immediate Priorities
- Debug Flight Search API: Investigate parameter formatting and endpoint configuration
- Error Handling: Implement specific error codes and user-friendly messages
- Date Validation: Ensure proper date format and future date handling
- Route Coverage: Verify test API route availability
Enhancement Opportunities
- Real-time Price Alerts: Database-driven price monitoring
- Multi-airline Aggregation: Additional API provider integration
- Advanced Filtering: Cabin class, airline preferences, layover duration
- Historical Analytics: Price trend analysis and prediction
- Production Migration: Upgrade to production Amadeus API
Scalability Considerations
- API Quota Management: Intelligent request batching and prioritization
- Database Optimization: Indexing and query optimization
- Caching Strategy: Redis migration for distributed caching
- Load Balancing: Multiple API provider failover
Lessons Learned
Successful Patterns
- MCP Integration: Standard I/O protocol handles Claude communication efficiently
- Fallback Architecture: Mock data ensures service availability during API issues
- Environment Management: Conda provides consistent dependency resolution
- Diagnostics: Comprehensive health checking significantly reduced debugging time
Challenges Encountered
- API Documentation: Amadeus test vs production endpoint differences
- Date Handling: Timezone and format considerations for international routes
- Error Context: Distinguishing between authentication and search failures
- Development vs Production: Test environment limitations on route coverage
Technical Debt
- Hard-coded Airport Database: Should migrate to external data source
- Static Mock Data: Should reflect realistic price variations
- Limited Error Handling: Needs more granular error classification
- Manual Configuration: Claude Desktop config requires manual path updates
Conclusion
The Claude Flight Search MCP Server represents a functional proof-of-concept with strong architectural foundations. While the Amadeus API authentication is working correctly, the flight search functionality requires parameter debugging to transition from mock data to real pricing. The system demonstrates successful MCP protocol implementation and provides a solid foundation for a year-long development and testing initiative.
The implementation successfully proves the viability of integrating external APIs with Claude Desktop through the MCP protocol, establishing patterns for future API integrations and demonstrating the value of intelligent fallback mechanisms in maintaining service reliability.
Document Version: 1.0
Last Updated: September 3, 2025
Next Review: Upon resolution of flight search API issues
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.