Claude Flight Search Server
БесплатноНе проверенEnables flight search, airport information lookup, and price comparison through Claude Desktop.
Описание
Enables flight search, airport information lookup, and price comparison through Claude Desktop.
README
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
Установка Claude Flight Search Server
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/adeyholar/claude-flight-search-mcpFAQ
Claude Flight Search Server MCP бесплатный?
Да, Claude Flight Search Server MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Claude Flight Search Server?
Нет, Claude Flight Search Server работает без API-ключей и переменных окружения.
Claude Flight Search Server — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Claude Flight Search Server в Claude Desktop, Claude Code или Cursor?
Открой Claude Flight Search Server на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzCompare Claude Flight Search Server with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
