Skip to main content
Glama
smamidipaka6

Google Flights MCP Server

by smamidipaka6

Google Flights MCP Server

A Model Context Protocol (MCP) server implementation that connects your Agents or LLMs to Google Flights data. Access flight information, find the cheapest options, filter by time restrictions, and get Google Flights' best recommendations!

🌍 Overview

This MCP server provides seamless access to Google Flights data, enabling your AI agents to:

  • Retrieve Comprehensive Flight Info

  • Find the Cheapest Available Flights

  • Filter flights based on Specific Time Constraints

  • Get Google Flights' recommended Best Flights

Note: Currently, this tool only does one-ways (if you ask for a round-trip, it'll do two one-ways though!) as I built it as a fun pet project to learn about MCPs.

If anyone actually finds this useful or wants me to, I can work on adding Round-Trip and Multi-City functionality!! Just raise a PR or hit me up!

Related MCP server: fli

πŸŽ₯ Usage & Demo

Just follow the Quick Start to set this up for Claude Desktop, Cursor, or another MCP Client and just ask away to find out about your desired flight info!!

[Insert Claude Desktop Demo Video]

πŸ› οΈ Tools

Available Functions/Tools

  1. get_general_flights_info(): Retrieve comprehensive flight information for a given route

    • Provides detailed flight details for up to 40 flights

    • Returns a list of human-readable flight descriptions

  2. get_cheapest_flights(): Find the most affordable flight options

    • Sorts and returns flights by lowest price

    • Includes current overall route pricing information

  3. get_best_flights(): Get Google Flights' top recommended flights

    • Identifies and returns flights marked as "best" by Google Flights

    • Helps users find optimal flight choices

  4. get_time_filtered_flights(): Filter flights by specific time constraints

    • Search for flights before or after a target time

    • Allows precise scheduling preferences

Input Parameters

Required Parameters

  • origin: str - Origin airport IATA code (e.g., "ATL", "SCL", "JFK")

  • destination: str - Destination airport IATA code (e.g., "DTW", "ICN", "LIR")

  • departure_date: str - Departure date in YYYY-MM-DD format

Optional Parameters

  • trip_type: str - Trip type, either "one-way" or "round-trip" (default: "one-way")

  • seat: str - Seat type: "economy", "premium-economy", "business", or "first" (default: "economy")

  • adults: int - Number of adult passengers (default: 1)

  • children: int - Number of child passengers (default: 0)

  • infants_in_seat: int - Number of infants requiring a seat (default: 0)

  • infants_on_lap: int - Number of infants traveling on a lap (default: 0)

Additional Parameters for Specific Functions

  • n_flights: int - Number of flights to return (default: 40, only for get_general_flights_info())

  • state: str - Time filter state, either "before" or "after" (only for get_time_filtered_flights())

  • target_time_str: str - Target time in HH:MM AM/PM format (only for get_time_filtered_flights())

⚑ Quick Start

Claude Desktop

  1. Make sure you have the latest Claude for Desktop downloaded!

  2. Clone This Repo

  3. Install uv to set up our Python Environment

    MacOS

    # Check if uv is already installed
    uv --version
    
    # If not installed
    curl -LsSf https://astral.sh/uv/install.sh | sh

    Windows

    # Check if uv is already installed
    uv --version
    
    # If not installed
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

    ⚠️ IMPORTANT: After installation, you must restart your terminal for the uv command to get picked up!

  4. Add this flights MCP Server to your Claude for Desktop config:

    MacOS

    • Navigate to the config file location via Terminal: ~/Library/Application Support/Claude/claude_desktop_config.json

    • OR if you have VSCode adn the Code alias, you can just create/edit using:

    code ~/Library/Application\ Support/Claude/claude_desktop_config.json

    Windows

    • Navigate to the config file location via PowerShell: %AppData%\Claude\claude_desktop_config.json

    • OR if you have VSCode adn the Code alias, you can just create/edit using:

    code $env:AppData\Claude\claude_desktop_config.json

    Note: ~/Library/Application Support/Claude/config.json is a different, unrelated file. Do not edit it.

  5. Add this flights MCP Server in the mcpServers key:

    {
      "mcpServers": {
        "flights": {
          "command": "/ABSOLUTE/PATH/.local/bin/uv",
          "args": [
            "--directory",
            "/ABSOLUTE/PATH/TO/PARENT/FOLDER",
            "run",
            "flights.py"
          ]
        }
      }
    }

    Make sure to modify the code to include the Absolute Path for uv for the command param and for the Absolute Path for the args param to this Repo.

    You may need to put the full path to the uv executable in the command field. You can get this by running:

    • which uv on MacOS/Linux

    • where uv on Windows

    Example:

    {
      "mcpServers": {
        "flights": {
          "command": "/Users/sahitmamidipaka/.local/bin/uv",
          "args": [
            "--directory",
            "/Users/sahitmamidipaka/Documents/Google-Flights-MCP-Server",
            "run",
            "flights.py"
          ]
        }
      }
    }
  6. That's it! Open Claude for Desktop and you should see the little MCP Tools icon appear (make sure to re-open the app for updates to take placeβ€”you'll need to do this whenever you change your claude_desktop_config.json file 😊)

For more information, refer to the Official MCP Documentation.

Cursor

  1. Open Cursor & Go to Settings

  2. Press the MCP Tab on the Left Panel

  3. Add a new MCP Server (Choose one):

    Project Configuration

    • Create a .cursor/mcp.json file in your project directory

    • Ideal for tools specific to a single project

    Global Configuration

    • Create a ~/.cursor/mcp.json file in your home directory

    • Makes MCP servers available across all Cursor workspaces

  4. Attach the following configuration in the mcp.json file:

    {
      "mcpServers": {
        "flights": {
          "command": "uv",
          "args": [
            "--directory",
            "/ABSOLUTE/PATH/TO/PARENT/FOLDER",
            "run",
            "flights.py"
          ]
        }
      }
    }

    Make sure to replace /ABSOLUTE/PATH/TO/PARENT/FOLDER with the actual path to this repo.

    You may need to put the full path to the uv executable in the command field. You can get this by running:

    • which uv on MacOS/Linux

    • where uv on Windows

    Example:

    {
      "mcpServers": {
        "flights": {
          "command": "/Users/sahitmamidipaka/.local/bin/uv",
          "args": [
            "--directory",
            "/Users/sahitmamidipaka/Documents/Google-Flights-MCP-Server",
            "run",
            "flights.py"
          ]
        }
      }
    }

For more information, refer to the Official Cursor MCP Documentation.

πŸš€ Example Usage

  • Show me flight options from Atlanta to Shanghai for Jan 1 2026

  • What are the prices like for flights from Detroit to Atlanta this weekend?

  • I live in New York and want to go to Japan. Find the cheapest flight options leaving this Friday and consider all airports near me!

  • Show me flight options for LAX today but only after 8:00 PM

✨ Upcoming Features

  • Better Roundtrip Functionality πŸš€

  • Multi-City Functionality 🌍

  • Explore / Go Anywhere Functionality πŸ—ΊοΈ

  • Price Graphs & Price History πŸ“ˆ

🀝 Contributing

Feel free to:

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

This means you are free to:

  • Use the software commercially

  • Modify the source code

  • Distribute the software

  • Use the software privately

You must include the original copyright notice and citation in any distributed software or derivative works, as per the terms of the MIT License.


Thank you for checking out this project! Always feel free to contact me for any reason.

Note: This project was created for fun and is in no way endorsed or affiliated with Google, Google Flights, or any other Alphabet subsidiary company.

Available Tools

4 tools
get_best_flightsA

Get the best flights as determined by Google Flights for a given origin, destination, and departure date. If the user wants to do a round-trip, you will need to make two one-way trip calls.

Args:
    origin (str): The origin airport IATA code (ex: "ATL", "SCL", "JFK").
    destination (str): The destination airport IATA code (ex: "DTW", "ICN", "LIR").
    departure_date (str): The departure date in YYYY-MM-DD format.

    trip_type (str, optional): The type of trip ("one-way" or "round-trip" only). Defaults to "one-way".
    seat (str, optional): The type of seat ("economy", "premium-economy", "business", or "first" only). Defaults to "economy".
    adults (int, optional): The number of adults. Defaults to 1.
    children (int, optional): The number of children. Defaults to 0.
    infants_in_seat (int, optional): The number of infants in a seat. Defaults to 0.
    infants_lap (int, optional): The number of infants on a lap. Defaults to 0.

Returns:
    list[str]: A list of flight information strings.
ParametersJSON Schema
NameRequiredDescriptionDefault
originYes
destinationYes
departure_dateYes
trip_typeNoone-way
seatNoeconomy
adultsNo
childrenNo
infants_in_seatNo
infants_on_lapNo

TDQS

A3.6/5.0
Behavior2/5

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

No annotations present, so description carries full burden. Does not disclose safety, error handling, rate limits, or return format details beyond 'list of flight information strings'. Minimal transparency for a flight search tool.

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

Conciseness3/5

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

Structured with sections but somewhat verbose, repeating 'optional' and using docstring style. Could be more succinct while retaining clarity.

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

Completeness3/5

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

Covers parameters well but lacks broader context: no explanation of 'best flights' criteria, no mention of error scenarios, and no details on return content beyond string list. Adequate but leaves gaps.

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

Parameters5/5

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

Provides detailed parameter documentation with examples, defaults, and allowed values (e.g., IATA codes, date format, seat types). Compensates fully for 0% schema coverage, giving significant meaning beyond simple titles.

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?

Clearly states it retrieves best flights from Google Flights for given origin, destination, departure date. Explicitly distinguishes from siblings by mentioning round-trip requires two calls, differentiating from get_cheapest_flights and get_general_flights_info.

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

Usage Guidelines3/5

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

Provides guidance for round-trip (make two one-way calls) but does not explicitly state when to use this tool versus siblings. No mention of when to prefer get_cheapest_flights or get_time_filtered_flights.

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

get_cheapest_flightsA

Get the cheapest flight information for a given origin, destination, and departure date. If the user wants to do a round-trip, you will need to make two one-way trip calls.

Args:
    origin (str): The origin airport IATA code (ex: "ATL", "SCL", "JFK").
    destination (str): The destination airport IATA code (ex: "DTW", "ICN", "LIR").
    departure_date (str): The departure date in YYYY-MM-DD format.

    trip_type (str, optional): The type of trip ("one-way" or "round-trip" only). Defaults to "one-way".
    seat (str, optional): The type of seat ("economy", "premium-economy", "business", or "first" only). Defaults to "economy".
    adults (int, optional): The number of adults. Defaults to 1.
    children (int, optional): The number of children. Defaults to 0.
    infants_in_seat (int, optional): The number of infants in a seat. Defaults to 0.
    infants_lap (int, optional): The number of infants on a lap. Defaults to 0.

Returns:
    list[str]: A list of flight information strings.
ParametersJSON Schema
NameRequiredDescriptionDefault
originYes
destinationYes
departure_dateYes
trip_typeNoone-way
seatNoeconomy
adultsNo
childrenNo
infants_in_seatNo
infants_on_lapNo

TDQS

A3.6/5.0
Behavior3/5

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

The description explains the return format (list of flight info strings) and parameter behavior, but lacks disclosure of side effects, permissions, or rate limits. Since no annotations are provided, the description carries full burden and is adequate but not fully transparent.

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 well-structured with an Args/Returns format, but is somewhat lengthy. The round-trip note is useful and front-loaded. Overall, it is organized and clear.

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?

Given 9 parameters, no output schema, and no annotations, the description covers all parameters with examples and defaults, and describes the return type. It is complete for the complexity of the tool.

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

Parameters4/5

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

The description provides detailed parameter explanations with examples (e.g., origin: 'ATL'), default values, and allowed values for trip_type, seat, etc. This adds significant value beyond the input schema, which has 0% description coverage.

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

Purpose4/5

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

The description clearly states it retrieves cheapest flight information for a given origin, destination, and departure date. The purpose is specific and distinct from sibling tools like 'get_best_flights' or 'get_general_flights_info', though it does not explicitly differentiate itself.

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

Usage Guidelines3/5

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

The description provides a usage guideline for round-trip requests (making two one-way calls), but does not include when to use this tool versus alternatives like 'get_best_flights' or 'get_time_filtered_flights'. It implies one-way is the default.

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

get_general_flights_infoA

Get general/comprehensive flight information for N flights for a given origin, destination, and departure date. If the user wants to do a round-trip, you will need to make two one-way trip calls.

Args:
    origin (str): The origin airport IATA code (ex: "ATL", "SCL", "JFK").
    destination (str): The destination airport IATA code (ex: "DTW", "ICN", "LIR").
    departure_date (str): The departure date in YYYY-MM-DD format.

    trip_type (str, optional): The type of trip ("one-way" or "round-trip" only). Defaults to "one-way".
    seat (str, optional): The type of seat ("economy", "premium-economy", "business", or "first" only). Defaults to "economy".
    adults (int, optional): The number of adults. Defaults to 1.
    children (int, optional): The number of children. Defaults to 0.
    infants_in_seat (int, optional): The number of infants in a seat. Defaults to 0.
    infants_lap (int, optional): The number of infants on a lap. Defaults to 0.

    n_flights (int, optional): The number of flights to return. Defaults to 25.

Returns:
    list[str]: A list of flight information strings.
ParametersJSON Schema
NameRequiredDescriptionDefault
originYes
destinationYes
departure_dateYes
trip_typeNoone-way
seatNoeconomy
adultsNo
childrenNo
infants_in_seatNo
infants_on_lapNo
n_flightsNo

TDQS

A3.8/5.0
Behavior3/5

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

No annotations provided, so description carries full burden. Details parameters and return format but does not disclose behavioral traits like rate limits, error handling, or authentication needs.

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?

Well-structured with clear intro, args list, and returns. Slightly verbose (e.g., 'general/comprehensive'), but information is effectively front-loaded.

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?

Covers all 10 parameters and return format with list of strings. Missing output schema and behavioral context like error messages or pagination, but adequate for a data-fetching tool.

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

Parameters5/5

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

Schema has 0% description coverage; the description provides comprehensive, clear parameter explanations including format examples, defaults, and constraints (e.g., IATA codes, date format, seat types). This adds high value beyond schema.

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

Purpose4/5

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

Description clearly states tool fetches general/comprehensive flight information with key parameters. Implicitly distinguishes from siblings by being general, but does not explicitly differentiate.

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

Usage Guidelines3/5

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

Provides guidance for round-trip flights (making two calls), but lacks explicit when-to-use vs siblings like get_cheapest_flights or get_best_flights.

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

get_time_filtered_flightsA

Get time-filtered flight information based on the user's preferences for before or after a certain time for a given origin, destination, and departure date. If the user wants to do a round-trip, you will need to make two one-way trip calls.

Args:
    state (str): The state of the flight ("before" or "after" only). For before, we do before the target time. For after, we do on or after the target time. 
    target_time_str (str): The target time in HH:MM AM/PM format (ex: "7:00 PM").
    origin (str): The origin airport IATA code (ex: "ATL", "SCL", "JFK").
    destination (str): The destination airport IATA code (ex: "DTW", "ICN", "LIR").
    departure_date (str): The departure date in YYYY-MM-DD format.

    trip_type (str, optional): The type of trip ("one-way" or "round-trip" only). Defaults to "one-way".
    seat (str, optional): The type of seat ("economy", "premium-economy", "business", or "first" only). Defaults to "economy".
    adults (int, optional): The number of adults. Defaults to 1.
    children (int, optional): The number of children. Defaults to 0.
    infants_in_seat (int, optional): The number of infants in a seat. Defaults to 0.
    infants_lap (int, optional): The number of infants on a lap. Defaults to 0.

Returns:
    list[str]: A list of flight information strings.
ParametersJSON Schema
NameRequiredDescriptionDefault
stateYes
target_time_strYes
originYes
destinationYes
departure_dateYes
trip_typeNoone-way
seatNoeconomy
adultsNo
childrenNo
infants_in_seatNo
infants_on_lapNo

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are provided, so the description carries full burden. It explains the behavior: returns list of flight strings, with logic for state parameter. It does not disclose safety, idempotency, or side effects, but no contradictions are present.

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 well-structured with Args and Returns sections, and front-loaded with purpose. Though somewhat lengthy, it is efficient for the complexity.

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?

Despite no output schema, the description covers purpose, usage, parameters, and return type. It could be improved by detailing the structure of each flight info string, but overall is quite complete.

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

Parameters5/5

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

Schema description coverage is 0%, but the description provides detailed explanations for all 11 parameters, including allowed values, defaults, and formats, far exceeding the bare 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 clearly states the tool retrieves time-filtered flight information based on user preferences for before/after a certain time, with origin, destination, and departure date. It also explains round-trip handling, distinguishing it from siblings like get_best_flights or get_cheapest_flights.

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 provides context on when to use the tool (time-filtered queries) and how to handle round-trip trips by making two one-way calls. However, it does not explicitly mention when not to use it or compare with sibling tools.

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. 4 tool updatesv0.1.0
    • First observedget_best_flights
    • First observedget_cheapest_flights
    • First observedget_general_flights_info
    • First observedget_time_filtered_flights

TDQS

A3.8/5.0
Disambiguation4/5

Tools are largely distinct: best vs cheapest vs general vs time-filtered. However, 'best' and 'cheapest' could be confused as both relate to pricing, but descriptions clarify the difference.

Naming Consistency4/5

All tools follow a 'get_*flights*' pattern with snake_case. Minor inconsistency: two include '_info' suffix (get_general_flights_info, get_time_filtered_flights?) Actually get_time_filtered_flights does not have _info, while get_general_flights_info does. Slight variation.

Tool Count5/5

4 tools is well-scoped for a flight search server covering key search dimensions (best, cheapest, general, time-filtered). Not too few or too many.

Completeness3/5

Covers basic flight search but lacks direct round-trip support (requires two calls), no multi-city, no filtering by airline/stops, no return date parameter. Missing some common search features.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

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

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Integrates Google Flights data into AI workflows for natural language flight searches, price comparisons, flexible date searches, and multi-city itinerary planning with support for various cabin classes and passenger types.
    9
    4
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables 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,128
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to search for real-time flights between airports using the SearchAPI.io Google Flights API, returning prices, schedules, airlines, and carbon emissions.
    -

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/smamidipaka6/flights-mcp-server'

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