Skip to main content
Glama

Google-Flights-MCP-Server

Google 航班 MCP 服务器

该 MCP 服务器提供了使用捆绑的fast_flights库与 Google Flights 数据交互的工具。

特征

提供以下 MCP 工具:

  • get_flights_on_date :获取两个机场之间特定日期的可用单程航班。
    • 参数: origin (str)、 destination (str)、 date (str,YYYY-MM-DD)、 adults (int,可选)、 seat_type (str,可选)、 return_cheapest_only (bool,可选,默认False )。
  • get_round_trip_flights :获取特定出发和返回日期的可用往返航班。
    • 参数: origin (str)、 destination (str)、 departure_date (str,YYYY-MM-DD)、 return_date (str,YYYY-MM-DD)、 adults (int,可选)、 seat_type (str,可选)、 return_cheapest_only (bool,可选,默认False )。
  • find_all_flights_in_range :查找指定日期范围内的往返航班。可以选择仅返回每个日期范围内找到的最便宜航班。
    • 参数: origin (str)、 destination (str)、 start_date_str (str,YYYY-MM-DD)、 end_date_str (str,YYYY-MM-DD)、 min_stay_days (int,可选)、 max_stay_days (int,可选)、 adults (int,可选)、 seat_type (str,可选)、 return_cheapest_only (bool,可选,默认False )。

设置

  1. 克隆存储库:
    git clone https://github.com/opspawn/Google-Flights-MCP-Server.git cd Google-Flights-MCP-Server
  2. 创建虚拟环境(推荐):
    python -m venv .venv source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
  3. 安装依赖项:
    pip install -r requirements.txt
  4. 安装 Playwright 浏览器( fast_flights需要):
    playwright install

运行服务器

您可以直接使用 Python 运行服务器:

python server.py

服务器默认使用 STDIO 传输。

与 MCP 客户端集成(例如 Cline、Claude Desktop)

将服务器添加到 MCP 客户端的配置文件中。例如, cline_mcp_settings.jsonclaude_desktop_config.json

{ "mcpServers": { "google-flights": { "command": "/path/to/your/.venv/bin/python", // Use absolute path to venv python "args": [ "/absolute/path/to/flight_mcp_server/server.py" // Use absolute path to server script ], "env": {}, "disabled": false, "autoApprove": [] } // ... other servers } }

**重要提示:**commandargs中的路径替换为虚拟环境的 Python 可执行文件和系统上的server.py脚本的绝对路径。

笔记

  • 此服务器捆绑了fast_flights库(最初来自https://github.com/AWeirdDev/flights ),用于其核心航班数据抓取功能。请参阅随附的LICENSE文件了解其条款。
  • 根据 Google 航班信息的变化和网络状况,航班数据抓取有时会不可靠或缓慢。这些工具包含基本的错误处理功能。
  • find_all_flights_in_range工具可能会占用大量资源,因为它会检查许多日期组合。
-
security - not tested
A
license - permissive license
-
quality - not tested

该 MCP 服务器允许 AI 助手使用 Google Flights 在线搜索航班信息。它可以查找特定日期的航班,也可以搜索一定范围内的日期以查找所有选项或仅查找最便宜的选项。

  1. 特征
    1. 设置
      1. 运行服务器
        1. 与 MCP 客户端集成(例如 Cline、Claude Desktop)
          1. 笔记

            Related MCP Servers

            • A
              security
              F
              license
              A
              quality
              An MCP (Model Context Protocol) server that provides Google search capabilities and webpage content analysis tools. This server enables AI models to perform Google searches and analyze webpage content programmatically.
              Last updated -
              3
              52
              83
              TypeScript
            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol (MCP) based search API server that provides standardized access to Google Maps, Google Flights, Google Hotels and other services. This server enables AI assistants to access various search services through a unified interface.
              Last updated -
              57
              Python
              MIT License
              • Apple
            • -
              security
              F
              license
              -
              quality
              An MCP server that provides access to Google's API Discovery Service, allowing agents to discover and interact with Google APIs through natural language commands.
              Last updated -
              Python
              • Linux
              • Apple
            • -
              security
              F
              license
              -
              quality
              This MCP Server provides a natural language interface to interact with Google's Policy Analyzer API, allowing users to analyze policies and evaluate compliance through conversations.
              Last updated -
              Python
              • Linux
              • Apple

            View all related MCP servers

            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/opspawn/Google-Flights-MCP-Server'

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