
flight agent
基于FastAPI的航班预订系统,集成Amadeus API实现搜索、定价、预订和管理功能。
Repository Info
About This Server
基于FastAPI的航班预订系统,集成Amadeus API实现搜索、定价、预订和管理功能。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Flight Booking API
A FastAPI-based flight booking API that integrates with the Amadeus Travel API to provide flight searching, pricing, booking, and management capabilities.
Setup
- Create a virtual environment:
uv venv .venv --python 3.12
- Activate the virtual environment:
source .venv/bin/activate
- Install dependencies:
uv pip sync requirements.txt
-
Set up Amadeus API credentials (required):
- Create an account at Amadeus for Developers
- Get API Key and API Secret
- Set environment variables:
export AMADEUS_CLIENT_ID=your_api_key export AMADEUS_CLIENT_SECRET=your_api_secret
-
Run the server:
uvicorn app.main:app --reload
The server will start at http://localhost:8000
MCP Server
This project also includes a Model Context Protocol (MCP) server, allowing interaction with the flight services through MCP clients.
- Ensure Amadeus credentials are set as environment variables (see Setup step 4).
- Run the MCP server via sse:
python app/mcp_server.py
This will start the MCP server. You can then use the MCP client to interact with the server via sse.
API Endpoints
Flight Management
GET /flights/locations/search- Search for airports and citiesGET /flights/destinations- Get direct flight destinations from an originGET /flights/search- Search for available flightsPOST /flights/offer-price- Get final price for a flight offer
Booking Management
POST /flights/bookings- Create a new flight bookingGET /flights/bookings/{booking_id}- Get booking detailsDELETE /flights/bookings/{booking_id}- Cancel a booking
API Documentation
Once the server is running, you can access:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- Detailed API documentation: See API_DOCUMENTATION.md
Technology Stack
- FastAPI: Web framework
- Amadeus Travel API: Flight data and booking management
- UVicorn: ASGI server
- Python 3.12+
Quick Start
Clone the repository
git clone https://github.com/thepushkarp/flight-agentInstall dependencies
cd flight-agent
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.