Fire in da houseTop Tip:Paying $100+ per month for Perplexity, MidJourney, Runway, ChatGPT and other tools is crazy - get all your AI tools in one site starting at $15 per month with Galaxy AI Fire in da houseCheck it out free

mcp-flight-search

MCP.Pizza Chef: arjunprabhulal

mcp-flight-search is an MCP server that provides real-time flight search capabilities through the Model Context Protocol. It enables AI models like Claude and others to interact with flight search tools, facilitating structured, dynamic queries and responses for travel planning. This server demonstrates practical MCP tool implementation for integrating flight data into AI workflows.

Use This MCP server To

Perform real-time flight availability and pricing queries Integrate flight search into AI travel planning assistants Enable AI models to book or suggest flights dynamically Provide structured flight data for travel itinerary generation Combine flight search with other travel-related MCP tools Automate multi-step travel booking workflows with AI Fetch flight options based on user preferences and constraints

README

MCP Flight Search

A flight search service built with Model Context Protocol (MCP). This service demonstrates how to implement MCP tools for flight search capabilities.

What is Model Context Protocol?

The Model Context Protocol (MCP) is a standard developed by Anthropic that enables AI models to use tools by defining a structured format for tool descriptions, calls, and responses. This project implements MCP tools that can be used by Claude and other MCP-compatible models.

Installation

# Install from PyPI
pip install mcp-flight-search

# Or install from the project directory (development mode)
pip install -e .

Usage

Start the MCP server:

# Using the command-line entry point
mcp-flight-search --connection_type http

# Or run directly
python main.py --connection_type http

You can also specify a custom port:

python main.py --connection_type http --port 5000

Environment Variables

Set the SerpAPI key as an environment variable:

export SERP_API_KEY="your-api-key-here"

Features

  • MCP-compliant tools for flight search functionality
  • Integration with SerpAPI Google Flights
  • Support for one-way and round-trip flights
  • Rich logging with structured output
  • Modular, maintainable code structure

MCP Tools

This package provides the following Model Context Protocol tools:

  • search_flights_tool: Search for flights between airports with parameters:

    • origin: Departure airport code (e.g., ATL, JFK)
    • destination: Arrival airport code (e.g., LAX, ORD)
    • outbound_date: Departure date (YYYY-MM-DD)
    • return_date: Optional return date for round trips (YYYY-MM-DD)
  • server_status: Check if the MCP server is running

Project Structure

mcp-flight-search/
├── mcp_flight_search/
│   ├── __init__.py              # Package initialization and exports
│   ├── config.py                # Configuration variables (API keys)
│   ├── models/
│   │   ├── __init__.py          # Models package init
│   │   └── schemas.py           # Pydantic models (FlightInfo)
│   ├── services/
│   │   ├── __init__.py          # Services package init
│   │   ├── search_service.py    # Main flight search logic
│   │   └── serpapi_client.py    # SerpAPI client wrapper
│   ├── utils/
│   │   ├── __init__.py          # Utils package init
│   │   └── logging.py           # Logging configuration
│   └── server.py                # MCP server setup and tool registration
├── main.py                      # Main entry point
├── pyproject.toml               # Python packaging configuration
├── LICENSE                      # MIT License
└── README.md                    # Project documentation

Author

For more articles on AI/ML and Generative AI, follow me on Medium: https://medium.com/@arjun-prabhulal

License

This project is licensed under the MIT License - see the LICENSE file for details.

mcp-flight-search FAQ

How do I install the mcp-flight-search server?
You can install it via PyPI using 'pip install mcp-flight-search' or in development mode from the project directory with 'pip install -e .'.
How do I start the mcp-flight-search server?
Start the server using the command-line entry point 'mcp-flight-search --connection_type http' or run 'python main.py --connection_type http' directly.
Which AI models can use the mcp-flight-search server?
It supports MCP-compatible models such as Claude, OpenAI's GPT-4, and Google's Gemini.
What protocols does mcp-flight-search support for connections?
It supports HTTP connections for communication between the MCP client and server.
Can mcp-flight-search handle multi-step flight booking workflows?
Yes, it is designed to support complex, multi-step interactions for flight search and booking.
Is mcp-flight-search open source and customizable?
Yes, the project is open source and can be customized or extended to fit specific flight search needs.
How does mcp-flight-search integrate with other MCP tools?
It can be combined with other MCP servers and clients to create comprehensive AI-driven travel solutions.
What kind of flight data does mcp-flight-search provide?
It provides real-time flight availability, pricing, and scheduling information.