travel-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@travel-mcp-server what's the cheapest flight from Lahore to London on 15 December?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
travel-mcp-server
Ask your AI assistant real travel questions, like "What's the cheapest flight from Lahore to London on 15 December?", and get answers from live flight data, using your own API key.
🎬 Demo GIF coming soon. See docs/DEMO.md to record one.
travel-mcp-server is a Model Context Protocol server. It gives Claude Desktop, Claude Code, Cursor, Gemini CLI, ChatGPT and other MCP clients tools for:
✈️ Flight prices: one-way and round-trip fares from 700+ airlines and agents (via FlightAPI).
🛰️ Flight status: is EK623 on time? Which gate?
🛫 Airport boards: upcoming departures and arrivals at any airport.
🔎 Airport search: "Lahore" →
LHE, "Makkah" →JED. Works offline and needs no key.💱 Currency conversion: European Central Bank reference rates. Free, no key.
It is built to protect your API credits: it caches responses, enforces per-minute and per-day limits, and shows usage on request.
Contents
Related MCP server: Aviation MCP Server
Quick start (5 minutes)
1. Get a FlightAPI key (about 1 minute). Sign up at flightapi.io and copy your key from the dashboard. The free plan includes 100 requests per 30 days. A price search costs 2 credits.
No key yet? You can still install the server.
search_airportsandconvert_currencywork without one, and the flight tools explain how to add a key.
2. Add the server to your AI app (about 2 minutes). Pick your client below. You need Node.js 20+ for npx.
3. Ask. Restart your app and try:
What's the cheapest flight from Lahore to London on 15 December?
Claude Desktop
Open Settings → Developer → Edit Config. This opens claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\). Add:
{
"mcpServers": {
"travel": {
"command": "npx",
"args": ["-y", "mcp-server-travel"],
"env": {
"FLIGHTAPI_KEY": "your_flightapi_key"
}
}
}
}Fully quit and reopen Claude Desktop. The tools appear under the 🔧 / "Search and tools" menu.
Claude Code
claude mcp add --transport stdio --scope user --env FLIGHTAPI_KEY=your_flightapi_key travel -- npx -y mcp-server-travelCheck it with claude mcp list, or /mcp inside a session. Drop --scope user to add it to the current project only.
Cursor
Create or edit ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project):
{
"mcpServers": {
"travel": {
"command": "npx",
"args": ["-y", "mcp-server-travel"],
"env": {
"FLIGHTAPI_KEY": "your_flightapi_key"
}
}
}
}Then open Cursor Settings → MCP and make sure travel is enabled. Ask your question in Agent mode.
Gemini CLI
Add to ~/.gemini/settings.json (all projects) or .gemini/settings.json (one project):
{
"mcpServers": {
"travel": {
"command": "npx",
"args": ["-y", "mcp-server-travel"],
"env": {
"FLIGHTAPI_KEY": "$FLIGHTAPI_KEY"
}
}
}
}Gemini CLI expands $FLIGHTAPI_KEY from your shell environment, so the key stays out of the file. Run /mcp in Gemini CLI to check the server is connected.
ChatGPT (HTTP mode)
ChatGPT connects to remote MCP servers over HTTPS. That needs the Streamable HTTP transport and a public URL.
ChatGPT's connector settings offer OAuth or "No authentication", not a custom bearer header. So for ChatGPT, enable the secret-path token: the URL itself acts as the password.
# 1. Start the server in HTTP mode (keep this terminal open)
export FLIGHTAPI_KEY=your_flightapi_key
export MCP_HTTP_TOKEN=$(openssl rand -hex 32)
export MCP_HTTP_ALLOW_PATH_TOKEN=true
echo "Your token: $MCP_HTTP_TOKEN"
npx -y mcp-server-travel --http
# 2. In another terminal, give it a public HTTPS URL, e.g. with Cloudflare Tunnel:
cloudflared tunnel --url http://localhost:3000
# -> https://random-words.trycloudflare.comRestart step 1 with MCP_HTTP_ALLOWED_HOSTS=random-words.trycloudflare.com so the server accepts that hostname. This is DNS rebinding protection: requests with any other Host header get a 403.
Then, in ChatGPT, turn on Developer mode and create a connector (app) with:
MCP server URL:
https://random-words.trycloudflare.com/mcp/<your token>Authentication: No authentication. The secret path is the credential.
OpenAI moves these settings around from time to time. See OpenAI's Developer mode guide for the current menu location and which plans support it.
Any client that can send headers should use
Authorization: Bearer <token>againsthttps://your-host/mcpinstead. For a permanent setup, see Running remotely.
Example conversations
These show real questions and the shape of what the tools return to the model. The airport results are real output. Flight prices, times and exchange rates are illustrative: they show the exact output format, but live values depend on the day you ask.
"What's the cheapest flight from Lahore to London on 15 December?"
The model first resolves both cities (offline, no credits):
search_airports {"query": "Lahore"}
LHE/OPLA - Allama Iqbal International Airport, Lahore, Pakistan (large airport)
search_airports {"query": "London"}
LHR/EGLL - London Heathrow Airport, London, United Kingdom (large airport)
LGW/EGKK - London Gatwick Airport, London, United Kingdom (large airport)
LCY/EGLC - London City Airport, London, United Kingdom (medium airport)
...Then it searches prices (2 credits; cached for 30 minutes):
search_flight_prices {"origin": "LHE", "destination": "LHR", "departure_date": "2026-12-15", "currency": "GBP"}
One-way LHE -> LHR, 2026-12-15, 1 adult, economy
Showing 5 cheapest of 87 priced itineraries.
1. 412.30 GBP - Qatar Airways
Out: LHE 2026-12-15 04:10 -> LHR 2026-12-15 13:05 | 13h 55m | 1 stop via DOH | Qatar Airways [QR629, QR3]
Sold by: Qatar Airways, Mytrip
2. 455.80 GBP - Pakistan International Airlines
Out: LHE 2026-12-15 10:00 -> LHR 2026-12-15 14:40 | 9h 40m | non-stop | Pakistan International Airlines [PK757]
...
Note: prices are indicative, collected from airlines and travel agents by FlightAPI, and normally cover all passengers in the search. They change quickly and may exclude baggage or payment fees. Times are local to each airport. This tool cannot book; confirm and book on the airline or agent website.The assistant then answers in plain language, for example: "The cheapest option is about £412 with Qatar Airways via Doha (13h 55m). PIA's non-stop is about £456 and saves over 4 hours…"
"Is EK623 on time today?"
get_flight_status {"flight_number": "EK623", "date": "2026-10-17"}
Flight EK623 on 2026-10-17: In the air (1 hr 12 min remaining)
Departure: Dubai (DXB), terminal 3
scheduled 09:45, Oct 17, took off 10:02, Oct 17
Arrival: Allama Iqbal Intl (LHE)
scheduled 13:50, Oct 17, estimated 14:01, Oct 17
Times are local to each airport. Gates can change; check airport screens before travelling."What's leaving Doha in the next few hours?"
get_airport_schedule {"airport_code": "DOH", "type": "departures", "limit": 3}
Departures at Doha Hamad International Airport (DOH), times in Asia/Qatar
13:40 QR8221 to Frankfurt (FRA) - Qatar Airways - Scheduled
15:30 QR8860 to London (LHR) - Qatar Airways - Scheduled - gate C12
..."Umrah in February: what are my options from Karachi?"
Use the built-in umrah_flight_options prompt (in Claude Desktop: the ➕ / prompts menu). It resolves Karachi, searches both Jeddah (JED) and Madinah (MED) on a couple of dates, and compares them in a table. It keeps the number of searches small to save credits.
"How much is 450 GBP in US dollars?"
convert_currency {"amount": 450, "from": "GBP", "to": "USD"}
450 GBP = 607.93 USD (1 GBP = 1.350961 USD, ECB reference rate of 2026-10-16). Indicative only; card and bank rates differ."How many API calls have we used?"
get_usage {}
Usage since 2026-10-17T09:12:03.000Z (this server process):
FlightAPI key configured: yes
FlightAPI: 3 calls (~5 credits), 2 served from cache, 0 errors
Exchange rates: 1 call(s), 3 from cache
Safety limits: 9 of 10 left this minute, 97 of 100 left in the last 24h
Note: counters reset when the server restarts. Your FlightAPI dashboard shows your account-wide balance.Tools
Tool | What it does | Key inputs | Credits |
| Find airports by city, name, country or IATA/ICAO code. Understands aliases like Makkah, Madinah, Bombay. Main airports rank first. |
| 0 (offline) |
| Cheapest one-way or round-trip options: price, airlines, stops, duration, local departure/arrival times, sellers. |
| 2 per uncached search |
| Live status of one flight: scheduled/estimated/actual times, terminals, gates, baggage belt. |
| 1 per uncached call |
| Upcoming departures or arrivals: flight, airline, destination/origin, times, status, terminal, gate. |
| 2 per uncached call |
| Convert using ECB reference rates (about 30 major currencies). |
| 0 (free API) |
| Calls made, cache hits, estimated credits used, remaining safety limits. | none | 0 |
All inputs are validated with strict schemas before any API call:
IATA codes must be 3 letters and exist in the bundled airport list.
Dates must be real calendar dates, and not in the past.
Infants cannot outnumber adults, and seated passengers are capped at 9.
Unknown parameters are rejected.
Errors come back as short, friendly messages with a hint (for example [RATE_LIMITED] … Wait about 40 seconds…), never as stack traces.
Prompts
Prompt | Arguments | What it does |
|
| Searches airports, then prices, then summarizes the 3 best options (cheapest / fastest / best balance). |
|
| Compares flights to Jeddah (JED) and Madinah (MED) on two dates in the month, with a recommendation. |
Configuration
All settings are environment variables. See .env.example for a commented template. In desktop apps, put them in the server's "env" block.
Variable | Default | Description |
| none | Your FlightAPI key. Needed for prices, status and schedules. |
|
| Currency for prices when the user doesn't specify one. |
|
| Max FlightAPI requests per rolling minute ( |
|
| Max FlightAPI requests per rolling 24 h ( |
|
| Price search cache lifetime (minutes). |
|
| Flight status / airport board cache lifetime (minutes). |
|
| Exchange-rate cache lifetime (hours). |
|
| Persist the cache to |
| none | Custom cache file path (implies file cache). |
|
| Upstream timeout per attempt. |
|
|
|
|
| HTTP bind address ( |
|
| HTTP port ( |
| none | Required in HTTP mode. Bearer token, 16+ characters. |
|
| Also accept |
| none | Comma-separated public hostnames allowed in the |
|
|
|
CLI: npx -y mcp-server-travel [--http] [--port 3000] [--host 127.0.0.1] [--version] [--help]
How your credits are protected
FlightAPI charges per request, and AI models sometimes call tools more often than needed. The server stands between the model and your wallet:
Validation first. Malformed codes, past dates, impossible passenger mixes and unknown airports are rejected locally, so they never cost a credit.
Caching. Identical price searches are answered from cache for 30 minutes, flight status and airport boards for 2 minutes, and exchange rates for 12 hours. Requests are normalized (
lhe=LHE), so trivial differences still hit the cache. If two identical calls arrive at the same time, they share one upstream request. EnableENABLE_FILE_CACHE=trueto keep the cache across restarts.Limits. At most
FLIGHTAPI_MAX_PER_MINUTE(default 10) andFLIGHTAPI_MAX_PER_DAY(default 100) real FlightAPI calls. Cache hits are free and still served when a limit is reached. The model gets a clear message such as "Per-minute safety limit reached… Wait about 40 seconds" and can tell you.Conservative retries. Each request times out after 10 s. Network errors and timeouts are retried once with backoff. HTTP errors (4xx and 5xx) are never retried, because a retry could be billed again.
Bounded queries. Airport boards always request a single day. Without that, FlightAPI returns 10 days and charges accordingly.
Visibility.
get_usagereports calls per endpoint, cache hits and estimated credits (from FlightAPI's published costs). Your FlightAPI dashboard remains the source of truth for your balance.
Running remotely (HTTP mode, Docker, HTTPS)
HTTP mode serves stateless Streamable HTTP at POST /mcp. Cache, limits and usage are shared across all requests. There is also a GET /healthz health check.
FLIGHTAPI_KEY=... MCP_HTTP_TOKEN=$(openssl rand -hex 32) npx -y mcp-server-travel --http
# -> http://127.0.0.1:3000/mcp
curl -s http://127.0.0.1:3000/mcp \
-H "Authorization: Bearer $MCP_HTTP_TOKEN" \
-H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_airports","arguments":{"query":"Dubai"}}}'Clients that support remote servers with headers connect to https://your-host/mcp with Authorization: Bearer <token>. For example, Claude Code:
claude mcp add --transport http travel https://your-host/mcp --header "Authorization: Bearer YOUR_TOKEN"Docker
docker build -t travel-mcp-server .
docker run -d --name travel-mcp -p 127.0.0.1:3000:3000 \
-e FLIGHTAPI_KEY=your_flightapi_key \
-e MCP_HTTP_TOKEN=$(openssl rand -hex 32) \
-e MCP_HTTP_ALLOWED_HOSTS=travel.example.com \
travel-mcp-serverThe image runs as a non-root user, listens on 0.0.0.0:3000 inside the container, and includes a health check.
HTTPS (required for anything beyond localhost)
The server itself speaks plain HTTP and binds to 127.0.0.1 by default. Do not expose it directly to the internet. Put a TLS-terminating proxy in front:
Caddy (automatic certificates):
travel.example.com { reverse_proxy 127.0.0.1:3000 }nginx:
proxy_pass http://127.0.0.1:3000;inside aserver { listen 443 ssl; ... }block. Setproxy_buffering off;so streamed responses flush.Cloudflare Tunnel:
cloudflared tunnel --url http://localhost:3000(quick tests) or a named tunnel (permanent).
Then set MCP_HTTP_ALLOWED_HOSTS=travel.example.com. Use a long random token, keep FLIGHTAPI_MAX_PER_DAY set so a leaked token cannot drain your credits, and see SECURITY.md.
Troubleshooting
Symptom | Fix |
Tools don't appear in Claude Desktop | Fully quit the app (not just close the window) and reopen. Check the JSON is valid. Logs: macOS |
| The app can't find Node. Install Node 20+, or use the absolute path to |
|
|
| The key is wrong or inactive. Copy it again from the FlightAPI dashboard. |
| Your FlightAPI plan limit is used up (free plan: 100 requests / 30 days). Wait for the reset or upgrade. |
| This server's own safety limit. Wait, or raise |
"No priced itineraries were returned" | FlightAPI sometimes needs a second request to fill in results. Try again in a few minutes (empty results are cached for only 2 min), or try a nearby date. |
| Use |
| ECB publishes about 30 currencies. Ask |
HTTP mode: | Send |
HTTP mode: | Add your public hostname to |
Want to see what's happening | Set |
Data sources and licenses
Data | Source | License |
Flight prices, status, airport schedules | FlightAPI.io with your API key, under FlightAPI's terms | Commercial API |
Airports ( | Public domain | |
Airline names ( | OpenFlights airline database | |
Exchange rates | Frankfurter (European Central Bank reference rates) | Free, keyless API |
Regenerate the bundled datasets with npm run data:build (see scripts/build-datasets.ts). How the FlightAPI endpoints are used, and where the FlightAPI docs leave gaps, is documented in docs/FLIGHTAPI.md.
This project is not affiliated with FlightAPI, OurAirports, OpenFlights, Frankfurter or the ECB. Prices are indicative; always confirm with the airline or agent before booking.
Development
git clone https://github.com/lalchand07/travel-mcp-server.git && cd travel-mcp-server
npm install
npm test # 130+ tests, no network or API key needed
npm run dev # run from source (stdio)
npm run build && npm run inspect # MCP Inspector UIProject layout: src/tools/ (one file per tool), src/providers/ (FlightAPI, Frankfurter, airport and airline data), src/summarize/ (compact, model-friendly output), src/lib/ (cache, limiter, HTTP client, validation). See PLAN.md for the design and CONTRIBUTING.md for guidelines.
Roadmap
🏨 Hotels: search and price comparison through a hotel provider.
🛂 Visa requirements: entry rules by passport and destination.
🔌 More flight providers: pluggable providers (e.g. Amadeus, Duffel, Kiwi) so you can use the key you already have.
📅 Flexible dates: cheapest day in a month, with a strict credit budget.
🔐 OAuth for HTTP mode: first-class ChatGPT and remote client auth instead of the secret path.
🌍 More currencies: an optional provider for currencies the ECB doesn't publish (PKR, AED, SAR, ...).
Ideas and pull requests are welcome. Open an issue.
Built by
[Your Name], [Your Company]. [Contact / website link]
If this project saves you time, a ⭐ on GitHub helps others find it.
License
MIT. Bundled data has its own licenses; see Data sources and licenses.
Available Tools
6 toolsconvert_currencyConvert currencyARead-onlyIdempotent
Convert an amount between currencies using European Central Bank reference rates (published once per working day). Good for comparing fares quoted in different currencies. Free and keyless; rates are cached for 12 hours. Covers about 30 major currencies (USD, EUR, GBP, INR, TRY, CNY, JPY, ...); currencies the ECB does not publish (e.g. PKR, AED, SAR) are not available.
Inputs: to (required), from (required), amount (required).
get_airport_scheduleGet airport departures or arrivalsARead-onlyIdempotent
Upcoming departures or arrivals at an airport (flight number, airline, destination/origin, scheduled and estimated local times, status, terminal and gate). Use type "departures" or "arrivals". Uses the FlightAPI key (2 credits per uncached call); results are cached for 2 minutes.
Inputs: type (required), airport_code (required), day, limit.
get_flight_statusGet flight statusARead-onlyIdempotent
Live status of a specific flight by flight number and date: scheduled/estimated/actual times, terminals, gates, baggage belt and whether it has departed or landed. Example: flight_number "EK623", date "2026-12-15". Uses the FlightAPI key (1 credit per uncached call); results are cached for 2 minutes.
Inputs: date (required), flight_number (required), departure_airport.
get_usageGet API usageARead-only
Shows how many FlightAPI and exchange-rate calls this server has made since it started, how many were served from cache, estimated FlightAPI credits spent, and the remaining per-minute and per-day safety limits. Uses no credits.
Inputs: no named parameters.
search_airportsSearch airportsARead-onlyIdempotent
Find airports by city, airport name, country, or IATA/ICAO code (e.g. "Lahore", "Heathrow", "JED", "OPLA"). Use this first to turn a city name into the 3-letter IATA codes required by search_flight_prices, get_flight_status and get_airport_schedule. Works offline from a bundled OurAirports dataset and uses no API credits. Larger airports are ranked first.
Inputs: query (required), limit.
search_flight_pricesSearch flight pricesARead-onlyIdempotent
Search live flight prices between two airports for a date (one-way), or with return_date (round trip). Returns the cheapest options with airline, total price, stops, duration and local departure/arrival times. Airports must be 3-letter IATA codes: call search_airports first if you only know the city. Uses the FlightAPI key (2 credits per uncached search); identical searches are cached for 30 minutes. Prices are indicative; booking happens on the airline or travel agent website.
Inputs: origin (required), destination (required), departure_date (required), adults, +6 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct resource and action: airport lookup, price search, flight status, airport schedule, currency conversion, and usage stats. There is no meaningful overlap—search_airports (reference data) is clearly separated from search_flight_prices (live pricing) and get_flight_status (single flight) vs get_airport_schedule (airport-wide board).
All names follow a consistent snake_case verb_noun pattern (get_usage, search_airports, search_flight_prices, get_flight_status, get_airport_schedule, convert_currency). The verbs vary but each semantically matches its action, which is appropriate rather than inconsistent.
Six tools is well-scoped for a flight/currency lookup server—each one earns its place and there is no filler. Neither sparse nor bloated.
The surface covers the full read-only travel-info workflow: resolve codes, search prices, check live status, view schedules, convert currencies, and monitor limits. Booking is explicitly deferred to external sites, so the only minor gaps are niceties like multi-city or seat availability, which are arguably out of scope.
Maintenance
Related MCP Connectors
Search and compare flight offers through a cache-aware Streamable HTTP MCP server for AI agents.
Flight search MCP server providing search, pagination, and itinerary details for AI assistants.
AI marketplace — flights, tours, activities, transport & more via MCP. No auth required.
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.
Related MCP Servers
- AlicenseAqualityBmaintenanceProvides real-time foreign-exchange rates, historical data, and multi-currency lookups to MCP-compatible AI coding assistants like Claude Code and Cursor.4MIT
- AlicenseAqualityDmaintenanceMCP server giving AI agents access to real-time aviation data — live flight tracking, airport weather, airline and airport information.103MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to query flight routes, real-time flight tracking, weather, and transfer flights via standardized MCP tools.10MIT
- AlicenseAqualityAmaintenanceEnables AI assistants to search flights and hotels, compare travel dates, explore destinations, and look up airport codes via a local MCP server, with results including prices and links.22968 PyPI62MIT