Flight Search
MCP Server implementation for the Model Context Protocol (MCP) enabling AI tool usage - Realtime Flight Search
Installation
npx mcp-flight-searchAsk AI about Flight Search
Powered by Claude Β· Grounded in docs
I know everything about Flight Search. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
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.
