google-flights-proto-mcp
Provides Google Flights search and itinerary verification, including round-trip flight pairing, ranking, exact booking URL generation, and Playwright-based price verification.
Click on "Install 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., "@google-flights-proto-mcpfind cheap round-trip flights from Lisbon to Berlin next month and verify the top result"
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.
Google Flights Protobuf MCP
Reverse engineered Google Flights and coded a lil smth to help plan my flights across Europe!
A standalone MCP server for this deliberately bounded pipeline:
protobuf tfs query
-> browser-impersonating HTTP discovery
-> outbound/return pairing
-> deterministic ranking
-> top 1-3 exact /booking?tfs= links
-> Playwright price + itinerary verificationHow the protobuf reverse-engineering works
Google Flights does not expose a supported public shopping API. Its web UI
stores the search state in the tfs query parameter used by URLs such as:
https://www.google.com/travel/flights/search?tfs=<URL_SAFE_BASE64>&hl=en&gl=PT&curr=EURThe tfs value is a serialized Protocol Buffers message encoded with URL-safe
Base64 and stripped of trailing = padding. The schema in
flights.proto is inferred from
the web application; it is not published or guaranteed by Google.
The encoder follows this path:
SearchRequest
-> Info protobuf
-> FlightData for each direction
-> airports, dates, stops, airlines and time filters
-> passengers, cabin, baggage, trip type and maximum price
-> SerializeToString()
-> URL-safe Base64 without padding
-> /travel/flights/search?tfs=...Important inferred fields include:
Message | Field | Meaning used here |
| 3 | Repeated outbound/inbound |
| 8 | Repeated passenger types |
| 9 | Cabin/seat class |
| 12 | Maximum fare filter |
| 13 | Baggage filters |
| 19 | Round trip or one way |
| 2 | Travel date |
| 4 | Selected physical flight legs |
| 5 | Maximum stops |
| 6 | Airline filters |
| 13 / 14 | Origin and destination airports |
The schema was reconstructed by changing one Google Flights control at a
time, decoding the resulting Base64 tokens, comparing protobuf wire tags, and
then validating the inferred type and field number by generating a new URL.
Unknown booking-only fields retain neutral names such as marker_one; the
project does not claim semantics that have not been demonstrated.
Why complete itinerary pairing takes two searches
A return fare cannot safely be produced by adding the cheapest outbound and cheapest inbound. Google reprices the trip after the outbound is selected. This project therefore:
searches and parses the available outbound directions;
embeds one selected outbound in field 4 of the outbound
FlightData;requests the repriced inbound choices for that selection;
pairs each inbound with that outbound and keeps Google's combined total;
embeds every physical leg from both directions in a booking
tfstoken.
This creates a deep link for one complete itinerary instead of a generic route/date search. Search-page prices are still discovery quotes until the Playwright verifier confirms the rendered total and provider handoff.
HTTP discovery is not an API
The fast discovery layer requests the normal Google Flights HTML using a
browser-compatible TLS fingerprint. It extracts the embedded ds:1 data from
AF_initDataCallback, parses both the top and other-flight groups, and rejects
consent pages, CAPTCHA responses, malformed payloads, and airport
substitutions. There is no stable JSON endpoint involved.
Google can change the protobuf schema, the embedded array layout, consent handling, or anti-automation policy at any time. The parsers are defensive, but this integration requires monitoring and should not be treated as a contracted production API. Use it responsibly and comply with Google's terms and applicable law.
The original public demonstration of this general tfs protobuf technique is
the AWeirdDev/flights project. This
repository reimplements the schema and adds complete itinerary pairing,
ranking, explicit verification states, MCP tools, the semester scanner, and
the Railway dashboard.
Related MCP server: fli
Install and run
cd google-flights-proto-mcp
uv sync --all-extras
uv run google-flights-proto-mcpFor streamable HTTP MCP:
uv run google-flights-proto-mcp-httpThe default endpoint is http://127.0.0.1:8010/mcp/. HTTP clients must send:
Accept: application/json, text/event-streamSet HOST and PORT to change the bind address. Browser discovery prefers an
installed Chrome/Chromium automatically. Override it with:
export GOOGLE_FLIGHTS_MCP_BROWSER_EXECUTABLE=/path/to/chromeIf Google rotates its EU consent cookie, set
GOOGLE_FLIGHTS_MCP_SOCS_COOKIE. The default is a consent-choice cookie, not
an account/session credential.
MCP tools
build_protobuf_search_url: builds a search URL without network access.discover_and_rank_complete: fast HTTP discovery, full round-trip pairing, ranking, and top 1-3 exact booking links. Its prices are explicitly marked as discovery prices.search_and_verify_top: the full pipeline. A price is verified only atshortlist[].verification.verified_pricewhenverifiedis true.
The discovered_price is Google Flights' HTTP shopping price for a fully
paired itinerary. It must never be relabelled as browser-verified. Exact
booking URLs pin dates, airports, passengers, cabin, airlines, and flight
numbers in protobuf; they do not freeze inventory or price.
Ranking
Ranking operates only on completed itinerary pairs:
50% total price
25% useful time at the destination
15% total flight time
10% stops
The initial outbound list is trimmed by price/stops/duration only to bound HTTP fan-out. That preliminary trim is not presented as the final ranking.
Verification contract
Playwright opens the exact /travel/flights/booking?tfs=... page and requires:
the rendered
Lowest total priceamount;the encoded passenger count and cabin;
all encoded flight legs and dates;
Google's required-taxes-and-fees notice;
a same-priced booking option and a successful provider handoff that repeats the same total.
On any mismatch or anti-automation challenge, verified_price remains null.
Even a provider-confirmed price can change before purchase, and optional
baggage or payment charges may still apply.
Fast weekend price scanner (no MCP, no Playwright)
For broad destination discovery, use the search-page scanner directly:
uv run python scripts/search_weekend_prices.py --top 5 --workers 4The scanner defaults to one adult. Override it explicitly with --adults N
when a different passenger count is needed.
It reads config/semester_2026.json, generates one
/travel/flights/search?tfs=<protobuf> URL per airport/weekend, fetches the
embedded Google search results, rejects alternate-airport substitutions, and
writes ranked JSON and CSV files under outputs/.
Useful overrides:
uv run python scripts/search_weekend_prices.py \
--weekend '25–28 Sep' \
--destinations BCN,FNC,NCE,MAD \
--max-stops 1 \
--max-price 500 \
--airlines U2,VY,FRThese are live Google search-page quotes, not checkout-verified prices. The scanner records anti-automation failures separately and never converts a blocked query into a false “no flights” result.
Bucket-list deal ranking
After scanning the bucket-list airport universe, compare every destination with its own median quote across the semester windows and build the coverage-first plan:
uv run python scripts/rank_bucket_deals.pyThe output calls this baseline semester_window_median. It is an auditable
comparison within this scan, not Google's historical “typical price” signal.
Hourly Google Sheet refresh on macOS
scripts/refresh_google_sheet.py runs the bucket-airport scan for one adult,
retries transient failures, recalculates route medians, reranks exactly three
options per weekend, and overwrites only the values in 3 per Weekend!A2 and
3 per Weekend!A5:N43. Existing formatting and conditional-format rules are
preserved. The last good Sheet remains untouched if the scan is incomplete.
The default retry policy uses two workers and paced backoff because a complete
104-destination scan across 13 windows makes 1,352 Google searches and can
encounter HTTP 429 responses.
The job uses the official Google Sheets API for workbook writes. Create a
Google Cloud service account, enable the Google Sheets API, download its JSON
key outside this repository, and share the workbook with the service account's
client_email as an editor. Then test without changing the Sheet:
GOOGLE_APPLICATION_CREDENTIALS=/absolute/path/to/service-account.json \
uv run python scripts/refresh_google_sheet.py --dry-runRun one real refresh:
GOOGLE_APPLICATION_CREDENTIALS=/absolute/path/to/service-account.json \
uv run python scripts/refresh_google_sheet.pyFor an hourly macOS job, copy
com.kasperhong.fli-sheet-refresh.plist.example to
/Users/kasperhong/Library/LaunchAgents/com.kasperhong.fli-sheet-refresh.plist,
change the credentials path if needed, and load it:
launchctl bootstrap gui/$(id -u) \
/Users/kasperhong/Library/LaunchAgents/com.kasperhong.fli-sheet-refresh.plistInspect the log at outputs/hourly-refresh.log. To reload after editing the
plist, boot it out first and then bootstrap it again:
launchctl bootout gui/$(id -u) \
/Users/kasperhong/Library/LaunchAgents/com.kasperhong.fli-sheet-refresh.plistThe hourly rows remain Google search-page quotes. Provider-checkout Playwright verification is intentionally not run across the full route universe each hour; that should be limited to the current top one to three candidates.
Railway website
The Railway-ready FastAPI dashboard serves the last successful snapshot immediately and refreshes prices in the background. It includes:
up to three realistic options per weekend, with a hard €250 return ceiling;
exact one-adult protobuf Google Flights links;
hourly scanning, median recalculation, and reranking;
atomic snapshot publishing so blocked scans never replace good data;
/healthz,/api/status, and/api/dealsendpoints;an optional token-protected
POST /api/refreshendpoint.
Run it locally without starting background Google searches:
FLI_REFRESH_ENABLED=false uv run google-flights-proto-webThen open http://127.0.0.1:8000.
For Railway, deploy this directory as the service root. Railway detects the
included Dockerfile, starts the server on its injected PORT, and checks
/healthz. Add a persistent volume mounted at /data so successful snapshots
survive deployments. Use one replica; multiple replicas would each run their
own scanner.
Optional Railway variables:
Variable | Default | Purpose |
|
| Enable the background worker |
|
| Start a refresh after boot |
|
| Refresh interval |
|
| Concurrent Google requests |
|
| Maximum retry passes |
|
| Linear retry backoff |
| unset | Enables authenticated manual refresh |
Manual refresh, when FLI_ADMIN_TOKEN is configured:
curl -X POST -H "X-Refresh-Token: YOUR_TOKEN" \
https://YOUR-DOMAIN/api/refreshThe website intentionally labels prices as search-page quotes. Hosting does not turn them into checkout-verified fares, and Railway datacenter IPs may be rate-limited more often than a residential connection.
Available Tools
3 toolsbuild_protobuf_search_urlBuild Google Flights Protobuf URLARead-only
Build a real tfs protobuf search URL without making a network request.
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes | One Google Flights search and the controls used by the ranking pipeline. |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The readOnlyHint annotation already indicates no side effects, and the description reinforces this with 'without making a network request.' It adds useful behavioral context by clarifying that the tool performs local construction only, which is meaningful beyond the annotation alone.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, focused sentence with no filler. It front-loads the core action and resource, then adds the most important behavioral qualifier: no network request.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the output schema exists and the input schema fully documents the request object, the description only needs to convey the tool's high-level purpose and side-effect profile. 'Build a real tfs protobuf search URL without making a network request' does exactly that, leaving no significant gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage, including a well-described nested request object with defaults, ranges, and field-level descriptions. The description itself adds no parameter-level meaning, so the baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Build') and resource ('tfs protobuf search URL') and adds the critical distinction that it does not make a network request. This clearly differentiates the tool from siblings such as discover_and_rank_complete and search_and_verify_top, which imply actual searching and verification.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The 'without making a network request' clause signals that this tool is for pure URL construction rather than executing a flight search, which gives an agent clear situational context. It does not explicitly name alternative tools, but the distinction from the sibling tools is strongly implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
discover_and_rank_completeDiscover and Rank Complete ItinerariesBRead-only
Use protobuf+HTTP to pair full itineraries, rank them, and return top 1-3.
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes | One Google Flights search and the controls used by the ranking pipeline. |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, and the description adds the protobuf+HTTP transport and the top-1-3 return behavior, which is modest extra context. It does not explain ranking criteria, external-call semantics, or failure behavior, but the read-only annotation lowers the burden.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single efficient sentence that front-loads the core action and result. It contains no filler, though 'Use protobuf+HTTP' is terse and could be more descriptive without becoming bloated.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity—a large nested request, an output schema, and two sibling tools—the description omits important context about what 'complete itineraries' means, how ranking works, and when to select this over the siblings. The output schema covers return structure, but behavioral and selection context are lacking.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, with the nested request object documented as 'One Google Flights search and the controls used by the ranking pipeline.' The description adds no parameter-level detail, so it does not exceed the baseline established by the rich schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a concrete outcome ('pair full itineraries, rank them, and return top 1-3') and hints at a distinct mechanism ('protobuf+HTTP'), which helps separate it from the URL-building and verification siblings. However, 'pair' is jargon and not explained, so it stops short of a fully self-contained purpose statement.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool versus build_protobuf_search_url or search_and_verify_top, and no mention of prerequisites or exclusions. The word 'Use' implies a general directive, but the description does not provide selection conditions or alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_and_verify_topSearch and Verify Top ItinerariesBRead-only
Run protobuf → HTTP → pairing → ranking → top 1-3 → Playwright verification.
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes | One Google Flights search and the controls used by the ranking pipeline. |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, so the read-only safety profile is established. The description adds the pipeline stages and the notable Playwright verification step, but it does not explain what verification entails, potential latency, or whether browser automation could have observable side effects. With annotations covering the main safety burden, this is adequate but not rich.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely compact, with no filler words, and the arrows convey a clear execution order. It is front-loaded and efficient, though the internal jargon makes it less immediately readable than a plain-language sentence.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of the request object and the existence of an output schema, the description provides only a pipeline synopsis. It omits when to call the tool, what 'verification' actually validates, and how results are returned. Annotations and schema fill some gaps, but the description is incomplete for a tool this rich.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the request object is described as a Google Flights search with ranking controls. The tool description adds no parameter-level meaning beyond the schema; 'top 1-3' maps loosely to top_n, but the schema already documents that. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a concrete pipeline—protobuf to HTTP to pairing/ranking to top 1-3 to Playwright verification—and the title clarifies the resource: top itineraries. It is specific enough to distinguish this from the siblings at a high level, though it does not explicitly contrast with discover_and_rank_complete or state the final return value.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no explicit statement about when to use this tool versus build_protobuf_search_url or discover_and_rank_complete. The 'top 1-3' mention weakly implies small result sets, but no when/when-not conditions or alternative routing are provided.
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.
3 tool updates
v0.1.0- First observed
build_protobuf_search_url - First observed
discover_and_rank_complete - First observed
search_and_verify_top
TDQS
Scored across 3 tools
build_protobuf_search_url is clearly distinct as a URL builder, but discover_and_rank_complete and search_and_verify_top overlap heavily since both perform the same core search and ranking flow, differing only in the verification step. The descriptions help, but an agent could easily pick the wrong one when it only needs unverified results.
All tool names use snake_case and begin with a verb, which is a solid pattern. The minor inconsistency is that build_protobuf_search_url uses a simple verb_noun structure while the other two use verb_and_verb_complement, making the set slightly uneven but still readable.
Three tools is a reasonable size for a focused flight-search server that exposes a small pipeline: build URL, run search and ranking, then optionally verify. Each tool has a real purpose, though the set is slightly thin if broader flight-search operations were intended.
The tools cover the main workflow from URL construction through ranking and verification, so most end-to-end flight search needs are addressed. Minor gaps exist such as no tool to view raw intermediate protobuf/HTTP responses, but agents can work around this by chaining the available tools.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Google Flights search data: fares, routes, stops, and price insights via a hosted MCP server.
Flight search MCP server providing search, pagination, and itinerary details for AI assistants.
Flight Intelligence MCP — search, cheapest dates, multi-city, airline compare via Google Flights
Real-time Google Flights fares for agents. Three things people do with this server. Scan for deals: one call takes a date range and a list of destination airports, expands every combination server side, and returns each fare with Google's own low, typical or high verdict. Put live search in your app: flat JSON with a bookable link on every result, and round trips priced as paired legs. Run a 24/7 AI travel agent: add the server, sign in with Google, and schedule it. No ads, no sponsored content. You bring your own RapidAPI key, so every search is billed to your plan and never to anyone else's. Add https://flights.flightpowers.com/mcp , click Sign in, sign in with Google, and paste your RapidAPI key once on the page that opens. Scripts and clients without a sign-in button send the key as x-rapidapi-key on the same URL.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceA remote MCP server that searches Google Flights for flight information and airport codes. It enables users to find flights, locate airports, and generate travel dates through natural language interactions.-
- AlicenseNot gradedqualityCmaintenanceEnables flight search and fare calendar exploration by interacting with Google Flights' API, supporting detailed filters for origin, destination, dates, cabin class, airlines, and more.3,138MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to query flight routes, real-time flight tracking, weather, and transfer flights via standardized MCP tools.MIT
- AlicenseAqualityAmaintenanceEnables real-time flight fare searches across date ranges and multiple destinations, with historical price insights and booking links. Provides one-way and round-trip search tools through MCP.41MIT