Skip to main content
Glama

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.

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

モデルコンテキストプロトコルサーバーは、シンプルなプロンプトを使用して、任意の日付の複数の航空会社、価格、停車地、所要時間を含むリアルタイムのフライト詳細を検索します。

  1. モデルコンテキストプロトコルとは何ですか?
    1. インストール
      1. 使用法
        1. 環境変数
          1. 特徴
            1. MCPツール
              1. プロジェクト構造
                1. 著者
                  1. ライセンス

                    Related MCP Servers

                    • A
                      security
                      A
                      license
                      A
                      quality
                      A Model Context Protocol server enabling product searches across e-commerce platforms, price history tracking, and product specification-based searches using natural language prompts.
                      Last updated -
                      2
                      14
                      Python
                      MIT License
                    • A
                      security
                      A
                      license
                      A
                      quality
                      A Model Context Protocol (MCP) server that provides real-time flight tracking and status information using the AviationStack API.
                      Last updated -
                      3
                      2,401
                      6
                      JavaScript
                      MIT License
                      • Apple
                    • A
                      security
                      F
                      license
                      A
                      quality
                      A Model Context Protocol server implementation that provides tools for querying flight information, weather data, and flight comfort metrics through Variflight services.
                      Last updated -
                      8
                      719
                      12
                    • A
                      security
                      A
                      license
                      A
                      quality
                      A discovery and recommendation service that helps AI assistants find Model Context Protocol servers based on natural language queries.
                      Last updated -
                      676
                      59
                      TypeScript
                      MIT License
                      • Apple
                      • Linux

                    View all related MCP servers

                    MCP directory API

                    We provide all the information about MCP servers via our MCP API.

                    curl -X GET 'https://glama.ai/api/mcp/v1/servers/arjunprabhulal/mcp-flight-search'

                    If you have feedback or need assistance with the MCP directory API, please join our Discord server