Purpose
google-flights-mcp is a hosted Google Flights MCP server provided by HasData, designed to expose Google Flights flight query capabilities as a tool to AI clients. Claude, Cursor, Windsurf, and other MCP clients can call this tool through the Model Context Protocol to obtain fares, flight segments, carbon emissions, and price history for one-way, round-trip, and multi-city itineraries, returned as structured JSON.
Since Google discontinued the QPX Express flights API in 2018 and has not provided a replacement, this server reads the results publicly displayed on the Google Flights website and converts them to JSON, so users do not need a Google account.
Key capabilities
- Query flight information for one-way, round-trip, and multi-city itineraries.
- Return fares, flight segments (departure/arrival airports, times, duration, airline, flight number, aircraft type, legroom, cabin class, etc.), carbon emission estimates, and price history.
- Results are divided into bestFlights and otherFlights, with each itinerary containing price, type, totalDuration, a flights array, a carbonEmissions object, and bookingToken.
- carbonEmissions is in grams; thisFlight: 433000 means 433 kg; differencePercent compares against the route average, with negative values indicating greener than average.
- priceInsights provides lowestPrice, typicalPriceRange, priceLevel, and priceHistory ([timestamp, price] points).
- Supports parameters such as includeConnections, excludeConnections, layoverDuration, outboundTimes, returnTimes, showHidden, lessEmissions, and multiCityJson.
- Provides 1 preset prompt and 7 resources; resources correspond to lists of optional values for parameters, and reading them does not consume credits.
- Through the apis query parameter, control the scope of tools visible to the client, for example ?apis=google_travel_flights exposes only one tool; omitting this parameter exposes all 57 HasData tools.
Usage
Requires an MCP client and a HasData API key (can be created for free in the dashboard, no credit card required). This is a remote server; the simplest approach is to use the URL and the x-api-key request header, with no need to run a container.
Server URL:https://mcp.hasdata.com/mcp?apis=google_travel_flights
OAuth-capable clients can add this URL as a connector and sign in, without writing a key into a config file. Claude Desktop only loads local (stdio) servers, so a remote server must be connected via a stdio launcher; @hasdata/google-flights-mcp is a launcher on npm that reads the key from an environment variable. Python users can use the PyPI package hasdata-google-flights-mcp, running it via uvx without manual installation.
Cursor uses ~/.cursor/mcp.json (global) or .cursor/mcp.json (single project); Windsurf uses ~/.codeium/windsurf/mcp_config.json, with the field name serverUrl rather than url; VS Code uses the workspace's .vscode/mcp.json.
Round trips by design require two calls: the first returns outbound options, each with a departureToken; pass the selected token back to get matching return flights. One-way and price checks are one call each.
When to use
- Query flights for a given route and date in an AI client, sort by price, and get airline and carbon emission estimates.
- Filter for nonstop, business class, or lowest-emission options.
- Combine with price history to judge whether the current fare is reasonable.
- Query round-trip and multi-city itineraries.
- Connect flight data into automated processes or agent workflows.
Limitations
- Read-only tools; no booking or payment is provided; only the token Google uses to enter booking is returned, and the booking steps must be completed yourself.
- Each successful call consumes 15 credits; response size does not affect price, and deep search costs the same as standard search; a round trip is two calls, so budget 30 credits.
- The free tier is 1,000 credits per month (about 66 searches), resetting with the billing cycle; paid plans start at $59/month and include 200,000 credits (about 13,000 searches), with unit price decreasing as usage grows.
- Concurrency limits: 5 concurrent requests for the free and Startup tiers, 15 for Basic, and 50 to 500 for the Growth tiers.
- Non-200 responses are not billed.
- Error handling: tool calls usually return 200, with failure information placed inside the result and isError set to true; a wrong key returns 401 Unauthorized text on the first tool call; a missing key causes the connection itself to return 401; parameters that do not match the schema return MCP error -32602; a route with no flights returns an empty array rather than an error; a wrong airport code returns 400, and you must use an IATA code or kgmid, not a city name.
- When calling the endpoint directly, the data path in the raw JSON-RPC response is .json after parsing result.content[0].text.
- Only public data is accessed; platform terms may restrict automated access, and users must ensure compliance themselves.
- The repository itself is the configuration and documentation for the remote server, with no build step and no need for containerization.
Other information
The project uses the MIT license. Tests are in the test/ directory and verify the tool contract (?apis=google_travel_flights returns exactly one tool, required parameters, names unchanged, key usable), where the live check makes real calls and consumes 15 credits; CI runs on every push and on a weekly schedule.