Skip to main content
Glama
HasData

Google Flights MCP Server

Google Flights MCP Server

A hosted Model Context Protocol (MCP) server that gives Claude, Cursor, Windsurf and any other MCP client one Google Flights tool. Search one-way, round-trip and multi-city itineraries with fares, flight legs, carbon emissions and price history, all as structured JSON, with no Google account and no retired travel API to work around.

https://mcp.hasdata.com/api/mcp?apis=google_travel_flights

Glama score tool contract MCP Tools npm PyPI License

Contents

Related MCP server: SkyOdyssey MCP

What you need

An MCP client and a HasData API key from the dashboard, free to create with no card, and the trial covers about 66 calls at the 15-credit rate. This is a remote server, so the simplest path is a URL and an x-api-key header, with no container to run and no Google account anywhere in the flow. A client that only speaks stdio reaches it through a thin launcher, published as @hasdata/google-flights-mcp on npm and hasdata-google-flights-mcp on PyPI, shown below.

Quick start

The server URL is the same for every client. We run it hands-on in Claude Code and Claude Desktop. The other blocks follow each client's own documented format for a remote server.

Field

Value

URL

https://mcp.hasdata.com/api/mcp?apis=google_travel_flights

Transport

HTTP, streamable

Auth header

x-api-key: HASDATA_API_KEY

Clients with OAuth support can add the same URL as a connector and sign in without putting a key in a config file.

claude mcp add --transport http google-flights "https://mcp.hasdata.com/api/mcp?apis=google_travel_flights" \
  --header "x-api-key: HASDATA_API_KEY"

Settings, then Connectors, then Add custom connector, then paste https://mcp.hasdata.com/api/mcp?apis=google_travel_flights and sign in.

For the config-file route, Claude Desktop loads only local (stdio) servers, so it reaches a remote server through a stdio launcher. The @hasdata/google-flights-mcp package is that launcher, and it reads the key from the environment. Add this to claude_desktop_config.json:

{
  "mcpServers": {
    "google-flights": {
      "command": "npx",
      "args": ["-y", "@hasdata/google-flights-mcp"],
      "env": { "HASDATA_API_KEY": "YOUR_KEY" }
    }
  }
}

For Python instead of Node, swap the launcher for the PyPI package, which uvx runs without a manual install:

{
  "mcpServers": {
    "google-flights": {
      "command": "uvx",
      "args": ["hasdata-google-flights-mcp"],
      "env": { "HASDATA_API_KEY": "YOUR_KEY" }
    }
  }
}

~/.cursor/mcp.json for every project, or .cursor/mcp.json for one:

{
  "mcpServers": {
    "google-flights": {
      "url": "https://mcp.hasdata.com/api/mcp?apis=google_travel_flights",
      "headers": { "x-api-key": "HASDATA_API_KEY" }
    }
  }
}

~/.codeium/windsurf/mcp_config.json. Windsurf calls the field serverUrl, not url:

{
  "mcpServers": {
    "google-flights": {
      "serverUrl": "https://mcp.hasdata.com/api/mcp?apis=google_travel_flights",
      "headers": { "x-api-key": "HASDATA_API_KEY" }
    }
  }
}

.vscode/mcp.json in the workspace:

{
  "servers": {
    "google-flights": {
      "type": "http",
      "url": "https://mcp.hasdata.com/api/mcp?apis=google_travel_flights",
      "headers": { "x-api-key": "HASDATA_API_KEY" }
    }
  }
}

Example prompts

Prompts, not code. Paste one in and the agent picks the tool itself. Each is annotated with the calls it takes, because every successful call costs 15 credits.

Find one-way flights from JFK to London Heathrow on September 15, sorted by price, and give me the three cheapest with airline and carbon estimate.

One call, 15 credits. Fares, legs and emissions all come back together.

Same route but non-stop only, in business class, and tell me which option has the lowest emissions.

One call, 15 credits. Cabin and stops are filters on the one request.

Is $295 a good price for JFK to LHR right now, given the price history?

One call, 15 credits. The response carries priceInsights with a typical range and a price level.

Round trip JFK to LHR, out September 15 back September 22, cheapest fare.

Two calls, 30 credits. Google returns outbound options first, then the return leg is a second call keyed by the option you pick.

A round trip is two calls by design. The first returns outbound itineraries each with a departureToken, and you pass that token back to get the matching return flights. One-way and the price check are a single call each.

Tools

One tool, read-only. The sample below is trimmed from a real call, and fares move constantly. Read it as a shape. The tool name links to its endpoint reference, which carries the full parameter list.

The sample is the payload, not the whole response. A tools/call result carries one text block, and that text is itself JSON holding url, status, text and json, with the scraped data under json. From a raw JSON-RPC response the path is result.content[0].text, parsed, then .json. A chat client unwraps that for you and code talking to the endpoint directly does not.

Get Google Flights results

hasdata_google_travel_flights_getGoogleFlights

Itineraries for a route and date, with fares, legs, emissions and price history.

Parameter

Type

Required

Notes

departureId

string

yes

IATA code such as JFK, or a location kgmid like /m/02_286. Comma-separate several airports

arrivalId

string

yes

Same format as departureId

outboundDate

string

yes

YYYY-MM-DD

type

string

roundTrip by default, oneWay, or multiCity with multiCityJson

returnDate

string

Required when type is roundTrip

travelClass

string

economy, premiumEconomy, business or first

stops

string

nonStop, oneStopOrFewer or twoStopsOrFewer

sortBy

string

topFlights default, plus price, duration, emissions, departureTime, arrivalTime

adults / children / infantsInSeat / infantsOnLap

number

Passenger mix

maxPrice / maxDuration / bags

number

Ceilings and carry-on count

includeAirlines / excludeAirlines

string

Comma-separated IATA airline codes, one or the other, not both

departureToken

string

Select an outbound option and fetch its return or next leg

bookingToken

string

Fetch booking options for a chosen itinerary

currency / gl / hl

string

Currency and the country and language of the search

deepSearch

boolean

Match what Google shows in a browser, slower to return

The reference also documents includeConnections, excludeConnections, layoverDuration, outboundTimes, returnTimes, showHidden, lessEmissions and multiCityJson.

Results split into bestFlights and otherFlights. Each itinerary carries price, type, totalDuration in minutes, a flights array of legs, a carbonEmissions object, and a bookingToken. Each leg holds the departureAirport and arrivalAirport (each with id, name and local time), duration, airline, flightNumber, airplane, legroom, travelClass, an extensions array, and oftenDelayedByOver30Min on legs Google flags. A non-stop itinerary has one leg, a connection has several.

carbonEmissions is in grams, not kilograms. thisFlight: 433000 is 433 kg. differencePercent compares it to typicalForThisRoute, so a negative number is a greener-than-average flight.

{
  "price": 295,
  "type": "One way",
  "totalDuration": 415,
  "flights": [
    {
      "departureAirport": { "id": "JFK", "name": "John F. Kennedy International Airport", "time": "2026-09-15 8:15" },
      "arrivalAirport": { "id": "LHR", "name": "Heathrow Airport", "time": "2026-09-15 20:10" },
      "duration": 415,
      "airline": "Virgin Atlantic",
      "flightNumber": "VS 26",
      "airplane": "Boeing 787",
      "travelClass": "Economy"
    }
  ],
  "carbonEmissions": { "thisFlight": 367000, "typicalForThisRoute": 419000, "differencePercent": -12 },
  "bookingToken": "W1t7..."
}

priceInsights sits alongside the itineraries with lowestPrice, a typicalPriceRange, a priceLevel such as typical, and a priceHistory of [timestamp, price] points. airports echoes the resolved departure and arrival airports with city and country.

Errors and failure paths

Your client almost never sees an HTTP error code from a tool call. The MCP layer answers 200 and puts the failure inside the result, with isError set to true and the reason as text. The agent reads a message where you might expect a status line.

A wrong key surfaces as tool output, not as a failed connection. tools/list accepts any non-empty key and returns the tool, so the client completes its handshake and shows green. The first tool call then comes back with isError: true and the text HasData API error: 401 Unauthorized. Watch for that string, because nothing earlier in the flow reports the problem.

A missing key is the one real HTTP error. Authorization runs before any tool, and the connection itself fails with 401. CORS headers are present, and a browser client reads the status and not an opaque network failure.

An argument that breaks the tool's schema is rejected before it becomes a scrape. The server answers with isError: true and the text MCP error -32602: Input validation error, naming the offending field. A roundTrip without a returnDate, or includeAirlines together with excludeAirlines, is caught here.

A route with no flights on the date returns a successful result with the itinerary arrays empty, not an error. requestMetadata.status still reads ok. Test for the flights before you rank them.

A bad airport code returns 400 with requestMetadata.status set to error. Use IATA codes or kgmids, not city names.

Results that carry data also carry a requestMetadata.id worth quoting in support.

Pricing, free tier and limits

Every Google Flights call costs 15 credits per successful call. Response size does not change the price, and the deep search costs the same as a standard one.

The free trial is 1,000 credits over 30 days with no card, which is about 66 flight searches. After that an active account keeps getting 100 credits topped up each day whenever its balance drops below 100, so a low-volume agent runs on the free tier indefinitely.

Paid plans start at $49 a month for 200,000 credits, which is about 13,000 searches. The unit price falls with volume, from $3.68 per 1,000 calls on the entry plan to $1.49 on Business, $1.25 on Growth and $1.12 on the largest high-volume plans.

Your plan also sets concurrency. The free trial allows 1 request at a time, Startup 15, Business 30, Growth 50, and the high-volume plans run from 200 to 1,500. Handle the overflow case defensively in anything unattended.

A request that comes back non-200 is not billed. A round trip is two calls, so budget for it.

Tool selection

The apis query parameter decides which tools your agent sees. Fewer tools means less context spent on tool definitions, and fewer chances for the model to reach for the wrong one.

?apis=google_travel_flights          the one tool in this repo
?apis=google_travel                   add Google Hotels
?apis=google_travel_flights,airbnb    flights plus Airbnb stays

The parameter takes provider names like google_travel and individual API names like google_travel_flights. Misspelled names are ignored. If every name is wrong the request fails with 400, and the body lists both what it did not recognise and every valid value. Drop the parameter and the same endpoint exposes all 57 HasData tools.

How it compares

Google retired its QPX Express flight API in 2018 and never replaced it, so there is no official Google Flights API. The remaining routes are scraping the public results or licensing raw GDS fare data, which is heavy and expensive. This server reads the same results the site shows and returns them as JSON.

Official Google API

This server

Availability

None since QPX Express closed in 2018

Maintained schema over the live results

Emissions data

Not offered

Per-itinerary, compared to the route average

Price history

Not offered

priceInsights with a typical range

Setup

Nothing to set up, because it does not exist

One key and one URL

Cost

Not applicable

Paid past the trial, 15 credits a call

What this server does not do. No booking and no payment. It reads fares, legs and the tokens Google itself uses to move to booking, and hands the booking step back to you.

FAQ

Is there an official Google Flights API?

No. Google closed QPX Express in 2018 and has not shipped a replacement. Every option reads the same public results the website serves. This one is maintained by HasData and returns them as structured JSON.

What is a Google Flights MCP server?

A server that exposes Google Flights as a tool an AI client can call. The client sends a tool call over the Model Context Protocol, the server fetches the itineraries and returns structured JSON, and the model works with the result. This one exposes a single tool and runs remotely.

Why is a round trip two calls?

Google returns outbound options first, each with a departureToken. You pick one and pass its token back to get the return flights that pair with it. That mirrors how the site works, and it is why a round trip costs 30 credits.

Are the carbon numbers in kilograms?

No, grams. thisFlight: 433000 means 433 kg, and differencePercent compares it to the route average.

A slower mode that returns exactly what Google Flights shows in a browser. Leave it off for speed, turn it on when you need parity with the site.

Can I use this together with other HasData APIs?

Yes. The apis parameter takes a list, and ?apis=google_travel adds Google Hotels alongside flights. Drop the parameter and you get everything.

Compliance and personal data

HasData accesses publicly available data only. A platform's terms may restrict automated access, and you are responsible for your own compliance.

Product page and request builder

Google Flights API

Server documentation

MCP server docs

All 57 tools in one server

HasData/hasdata-mcp

Client walkthroughs

MCP clients and integrations

Everything else we scrape

Google Flights API and 54 more

Plans and credit costs

Plans and credit costs

Keys and usage

HasData dashboard

Node launcher on npm

@hasdata/google-flights-mcp

Python launcher on PyPI

hasdata-google-flights-mcp

Development

This repository is configuration and documentation for a remote server. There is no build step and nothing to containerize.

The tests in test/ assert the tool contract, the part that can break without a commit here. They check that ?apis=google_travel_flights returns exactly one tool, that it still declares its required parameters, that the name has not changed, and that the key in use is actually accepted. That last check calls the tool for real and costs 15 credits, which is the price of a canary that can fail for the right reason.

# macOS and Linux
HASDATA_API_KEY=your_key_here npm test

# Windows PowerShell
$env:HASDATA_API_KEY="your_key_here"; npm test

The same suite runs in CI on every push and once a week on a schedule, because the upstream tool list can change without anyone touching this repository. A failure means the tool list moved, the key stopped working, or the endpoint was unreachable, and the assertion message says which.

Contributing

Corrections to the parameter table and the response sample are the most useful contribution, because those are the parts that drift. Include the call you made and the response you got. Pull requests from forks run the suite without a key, and the live checks skip instead of going red.

License

MIT. See LICENSE.

Available Tools

1 tool
hasdata_google_travel_flights_getGoogleFlightsgoogle_travel_flights: GET /AInspect

Get Google Flights Results

Searches Google Flights for one-way, round-trip, or multi-city itineraries with passenger mix (adults, children, infants in-seat/on-lap), travel class, bags, max price, sort order (price, duration, emissions, departure/arrival time), stops, include/exclude airlines and connections, time windows, layover duration, and deep-search mode. Returns per-itinerary price, currency, total duration, stops, flight legs with airline, flight number, aircraft, departure/arrival airports and times, CO2 emissions, plus booking and departure tokens for round-trip returns or booking options. Use for travel-planning agents, fare monitoring, corporate travel dashboards, emission-aware trip optimization, and comparing routes and airlines across markets.

ParametersJSON Schema
NameRequiredDescriptionDefault
glNoThe two-letter country code for the country you want to limit the search to. Provide one exact documented value (245 allowed), e.g. `ac`, `af`.
hlNoThe two-letter language code for the language you want to use for the search. Provide one exact documented value (159 allowed), e.g. `af`, `ak`.
bagsNoNumber of carry-on bags per passenger.
typeNoSpecifies the type of flight. Options: - `roundTrip` (default) - `oneWay` - `multiCity` (requires `multiCityJson` for flight details) For round trips, retrieve return flight details with a separate request using `departureToken`.
stopsNoRestrict the number of stops (layovers) in the flight itinerary.
adultsNoNumber of adult passengers (>= 1 if specified).
sortByNoSort the flight results based on price, departure time, arrival time, etc.
childrenNoNumber of child passengers.
currencyNoParameter defines the currency of the returned prices Provide one exact documented value (71 allowed), e.g. `ALL`, `DZD`.
maxPriceNoMaximum price limit for the flight search, in the selected currency.
arrivalIdYesSpecifies the arrival airport code (IATA) or location kgmid. - **IATA Code**: A 3-letter uppercase code (e.g., `SFO` for San Francisco, `LHR` for London Heathrow). Search on [IATA](https://www.iata.org/en/publications/directories/code-search). - **Location kgmid**: A string starting with `/m/`, found in Wikidata under "Freebase ID" (e.g., `/m/02_286` for New York, NY). Multiple values can be separated by commas (e.g., `JFK,LGA,/m/0hptm`).
deepSearchNoEnable deep search. Returns the same results as Google Flights in a browser, but takes longer to respond. Default is `false`.
returnDateNoThe return travel date in 'yyyy-MM-dd' format. Required when **type** is `roundTrip`.
showHiddenNoIndicates whether to include hidden options in the results.
departureIdYesSpecifies the departure airport code (IATA) or location kgmid. - **IATA Code**: A 3-letter uppercase code (e.g., SFO for San Francisco, LHR for London Heathrow). Search on [IATA](https://www.iata.org/en/publications/directories/code-search). - **Location kgmid**: A string starting with `/m/`, found in Wikidata under "Freebase ID" (e.g., `/m/02_286` for New York, NY). Multiple values can be separated by commas (e.g., `JFK,LGA,/m/0hptm`).
maxDurationNoThe maximum total flight duration in minutes.
returnTimesNoSet up to 4 time boundaries (2 for departure, 2 for arrival) to filter return flights. Each number represents the start of an hour. Examples: - `6,20` → 6:00 AM - 9:00 PM departure - `1,15` → 1:00 AM - 4:00 PM departure - `7,18,2,21` → 7:00 AM - 9:00 PM departure, 2:00 AM - 10:00 PM arrival
travelClassNoThe travel class for the flight (Economy, Premium Economy, Business, or First).
bookingTokenNoUsed to request booking options for selected flights. This token is found in the flight results and cannot be used with `departureToken`.
infantsOnLapNoNumber of infants sitting on an adult's lap.
outboundDateYesThe outbound travel date in 'yyyy-MM-dd' format.
infantsInSeatNoNumber of infants occupying seats.
lessEmissionsNoPrefer flight options with lower carbon emissions.
multiCityJsonNoThis parameter specifies flight details for multi-city trips. It is a JSON string containing multiple flight objects. Each object must include the following fields: - **departureId** – The departure airport code or location KGMID. Uses the same format as the main `departureId` parameter. - **arrivalId** – The arrival airport code or location KGMID. Uses the same format as the main `arrivalId` parameter. - **date** – The flight date. Uses the same format as the `outboundDate` parameter. - **times** *(optional)* – The time range for the flight. Uses the same format as the `outboundTimes` parameter.
outboundTimesNoSet up to 4 time boundaries (2 for departure, 2 for arrival) to filter flights. Each number represents the start of an hour. Examples: - `6,20` → 6:00 AM - 9:00 PM departure - `1,15` → 1:00 AM - 4:00 PM departure - `7,18,2,21` → 7:00 AM - 9:00 PM departure, 2:00 AM - 10:00 PM arrival
departureTokenNoUsed to select a flight and retrieve return flights for a round trip or the next leg of the itinerary for a multi-city trip.
excludeAirlinesNoA comma separated list of airline codes to exclude from results. You can search for airline codes on [IATA](https://www.iata.org/en/publications/directories/code-search). For example, `UA` is United Airlines.
includeAirlinesNoA comma separated list of airline codes to exclusively include in results. You can search for airline codes on [IATA](https://www.iata.org/en/publications/directories/code-search). For example, `UA` is United Airlines. `excludeAirlines` and `includeAirlines` parameters can't be used together.
layoverDurationNoSet the maximum layover duration in minutes to filter flights. For example, `120, 360` filters layovers between 2 hours and 6 hours, while `45, 180` allows layovers from 45 minutes to 3 hours.
excludeConnectionsNoA comma separated list of specific airports to exclude as connections.
includeConnectionsNoA comma separated list of specific airports to allow as connections.

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden for behavioral disclosure. It states what the search returns and implies a read-only operation, but it does not explicitly mention that no mutations occur, nor does it disclose rate limits, latency differences beyond the per-parameter deepSearch note, or any operational constraints such as result limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core action and uses three focused sentences covering operation, returned data, and use cases. The final use-case list includes some reputation-heavy phrases, but for 31 parameters the summary remains scannable and does not repeat schema content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description's enumeration of returned per-itinerary fields is valuable and largely covers the response contract. Input parameters are fully documented in the schema with examples. The main gaps are the lack of pagination/error behavior and some explanation of how booking and departure tokens should be used, but these are partially covered by parameter descriptions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so every parameter is already documented in the input schema. The description only groups parameter types into a summary and adds no new per-parameter semantics, yielding the baseline score for a fully covered schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Searches Google Flights') and a clear resource, and goes beyond the name by enumerating trip types, filter dimensions, and returned data. An agent can immediately understand what this tool does and what its result contract looks like.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit use contexts ('travel-planning agents, fare monitoring, corporate travel dashboards, emission-aware trip optimization') and covers the major itinerary types. There are no sibling tools to compare against, so explicit when-not-to-use or alternative routing is not possible, but the intended use cases are clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 1 tool updatev1.0.0
    • First observedhasdata_google_travel_flights_getGoogleFlights

TDQS

A3.9/5.0
Disambiguation5/5

With only one tool present, there is no possibility of an agent confusing it with another tool. The lone tool is clearly described as the only way to search Google Flights results.

Naming Consistency3/5

The single tool name mixes a snake_case provider/domain prefix with a camelCase verb phrase, which is internally inconsistent. Since there is only one tool, there is no broader set of names to establish a consistent pattern, so the score is moderate.

Tool Count3/5

A single tool for a flight-search MCP server is borderline; it is not a trivial tool, but the surface feels thin for a server that could plausibly support fare calendars, route metadata, or booking workflows. The count is acceptable but not well-rounded.

Completeness4/5

The one tool covers a wide range of search options, including itinerary types, passenger mix, class, bags, price, stops, airlines, time windows, and emissions. For its stated purpose of getting Google Flights search results, it is quite complete, though auxiliary endpoints like airport lookup or flight status are absent.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Enables searching and retrieving flight information using Duffel API, supporting one-way, round-trip, and multi-city queries with flexible search parameters.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI clients to explore cheapest destinations, optimize multi-leg flight itineraries, and reference airport/region data via MCP tools and resources.
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables MCP clients to query the Seats.aero partner API for seat availability, trips, routes, and destinations, including cached and live search options.
    101
    MIT

Latest Blog Posts

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/HasData/google-flights-mcp'

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