Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables flight search, airport information lookup, and price comparison through Claude Desktop.

README.md

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 format
  • return_date (optional): Return date for round-trip flights
  • passengers (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 code
  • destination (required): Destination airport code
  • start_date (required): Start date for comparison
  • days_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

  1. Sign up for Amadeus for Developers
  2. Get your API credentials
  3. Add them to your .env file
  4. Uncomment the Amadeus dependency in requirements.txt
  5. 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

  1. Check that the path in your Claude Desktop config is correct
  2. Ensure Python virtual environment is properly set up
  3. Verify all dependencies are installed
  4. 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:

  1. Set up API credentials with a flight data provider
  2. Implement the real API calls
  3. Handle rate limiting and error responses

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. 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

  1. search_flights: Individual flight searches with real-time pricing
  2. find_best_price: Date range optimization across multiple days
  3. get_airport_info: Airport details and metadata
  4. compare_flight_prices: Price trends across date ranges
  5. 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

  1. Debug Flight Search API: Investigate parameter formatting and endpoint configuration
  2. Error Handling: Implement specific error codes and user-friendly messages
  3. Date Validation: Ensure proper date format and future date handling
  4. Route Coverage: Verify test API route availability

Enhancement Opportunities

  1. Real-time Price Alerts: Database-driven price monitoring
  2. Multi-airline Aggregation: Additional API provider integration
  3. Advanced Filtering: Cabin class, airline preferences, layover duration
  4. Historical Analytics: Price trend analysis and prediction
  5. Production Migration: Upgrade to production Amadeus API

Scalability Considerations

  1. API Quota Management: Intelligent request batching and prioritization
  2. Database Optimization: Indexing and query optimization
  3. Caching Strategy: Redis migration for distributed caching
  4. 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

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Search servers.