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
-
license - not tested
-
quality - not tested

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

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

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              A Claude Desktop MCP server that helps you track flights in real-time using Flightradar24 data. Perfect for aviation enthusiasts, travel planners, or anyone curious about flights overhead!
              Last updated -
              2
              12
              JavaScript
              MIT License
              • Apple
            • A
              security
              F
              license
              A
              quality
              An MCP protocol server that enables web search functionality using the Tavily API, allowing AI assistants to perform internet searches in real-time.
              Last updated -
              4
              2
              Python
            • -
              security
              F
              license
              -
              quality
              An MCP server that enables AI assistants to access and interact with Google Classroom data, allowing users to view courses, course details, and assignments through natural language commands.
              Last updated -
              508
              1
              JavaScript
            • -
              security
              F
              license
              -
              quality
              An MCP server that enables AI models to search the web using OpenAI's 4o-mini Search model, allowing access to up-to-date information for just a few cents per search.
              Last updated -
              1
              JavaScript
              • Apple
              • Linux

            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