Flight Booking MCP Server
Allows sending free-form questions to GPT-3.5 through the OpenAI API and returning the generated answer.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Flight Booking MCP Server
A Model Context Protocol server that gives AI assistants flight search, booking, and GPT-powered Q&A.
Overview
Flight Booking MCP Server is a prototype Model Context Protocol (MCP) server built with FastMCP. It exposes a mock flight-booking domain to MCP-compatible AI clients through all three MCP primitives: tools, resources, and prompts. An assistant can search flights, create bookings, read airport and airline reference data, and use reusable prompt templates for recommendations and rebooking.
The server also includes an ask_openai tool that lets the model delegate free-form questions to GPT-3.5 through a lazily initialised OpenAI client. All flight data is hardcoded, so the project works as a compact, readable reference for building MCP servers in Python.
Related MCP server: SC-MCP-SERVER
Features
Flight search:
search_flightsfilters a flight list by origin and destination airport codes.Booking creation:
create_bookingreturns a confirmation with a generated booking reference.Reference resources:
file://airportsandfile://airlinesexpose airport and airline data (airline fleet sizes included) for clients to read.Prompt templates:
find_best_flight(budget and cabin preference) andhandle_disruption(original flight and reason) guide recommendations and rebooking.GPT-3.5 integration:
ask_openaisends a question togpt-3.5-turbo. The client is created on first use, and a missing API key or API error comes back as a readable message.CLI entry point:
main.pystarts the server, warns whenOPENAI_API_KEYis missing, and handles shutdown and errors.Test scripts (partial):
simple_test.pyandtest_server.pyare print-based smoke scripts with no assertions.test_server.pyuses privatemcpinternals and may not work on newer SDK versions. SeeTESTING_GUIDE.md.
Architecture
The project is a single-process MCP server that communicates over stdio. main.py imports the FastMCP instance from server.py and runs it. server.py registers tools, resources, and prompts with decorators and serves them from in-memory data.
flowchart LR
subgraph sg1["Client"]
n_client["MCP client (AI assistant)"]
end
subgraph sg2["Backend"]
n_main["main.py entry point"]
n_server["FastMCP server (server.py)"]
end
subgraph sg3["Data"]
n_data[("Hardcoded flight and airport data")]
end
subgraph sg5["External services"]
n_openai{{"OpenAI API (GPT-3.5)"}}
end
n_client -->|MCP over stdio| n_main
n_main -->|mcp.run| n_server
n_server -->|tool and resource lookups| n_data
n_server -->|chat completion for ask_openai| n_openaiHow it works
An MCP client (an AI assistant) launches
python main.pyand talks to it over stdio.main.pycallsmcp.run()on the FastMCP instance defined inserver.py.For flight and reference-data requests, the server reads the hardcoded in-memory data.
For
ask_openai, the server creates an OpenAI client on first use fromOPENAI_API_KEYand returns GPT-3.5's reply.
Tech Stack
Layer | Technology |
Language | Python 3.10+ |
MCP framework | MCP Python SDK (FastMCP) |
AI | OpenAI Python SDK ( |
Tooling | uv, setuptools |
Project Structure
.
├── main.py # Entry point: starts the server, checks the API key
├── server.py # FastMCP server: tools, resources, prompts
├── simple_test.py # Smoke-test script
├── test_server.py # Additional smoke-test script
├── TESTING_GUIDE.md # Notes on testing
├── pyproject.toml # Project metadata and dependencies
├── uv.lock
├── .env.example
└── LICENSEGetting Started
Prerequisites
Python 3.10+
An OpenAI API key (optional, only needed for
ask_openai)uv (optional)
Installation
git clone https://github.com/zain-mirza-1060/flight-booking-mcp-server.git
cd flight-booking-mcp-server
pip install -e .Environment Variables
Variable | Description | Required |
| API key for the | No |
cp .env.example .env
export OPENAI_API_KEY="your-openai-api-key-here"Running locally
python main.pyTo inspect the server interactively with the MCP CLI:
mcp dev server.pyRunning tests
python simple_test.pyThis script prints results rather than asserting them. test_server.py accesses private attributes (mcp._tools) and may fail on newer SDK versions.
Usage
Tools
Tool | Arguments | Example result |
|
|
|
|
|
|
|
| Returns GPT-3.5's answer as text |
Resources
file://airportslists LAX, JFK, and LHR.file://airlineslists AA, BA, DL, and UA with country and fleet size.
Prompts
find_best_flight(budget, preferences="economy")handle_disruption(original_flight, reason)
Roadmap
Replace hardcoded data with real flight data
Persist bookings
License
Released under the MIT License, see LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Flight search MCP server providing search, pagination, and itinerary details for AI assistants.
Search and compare flight offers through a cache-aware Streamable HTTP MCP server for AI agents.
AI marketplace — flights, tours, activities, transport & more via MCP. No auth required.
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to query flight routes, real-time flight tracking, weather, and transfer flights via standardized MCP tools.10MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for AI agents to execute the complete NevioServiceCenter flight booking flow. It provides 10 tools for flight search, cart management, passenger details, seat selection, ancillaries, and booking confirmation with automatic JWT token management.-
- FlicenseCqualityDmaintenanceEnables AI assistants to search for flights, book them, check booking status, and cancel bookings using mock flight data with no API keys required.4-
- FlicenseNot gradedqualityDmaintenanceProvides mock travel planning tools including flight and hotel search, recommendations, and multi-turn trip drafting. Supports stdio and HTTP transports and is intended for testing/demo purposes only.-