Skip to main content
Glama

Google-Flights-MCP-Server

from typing import Any import asyncio from playwright.async_api import async_playwright async def fetch_with_playwright(url: str) -> str: async with async_playwright() as p: browser = await p.chromium.launch() page = await browser.new_page() await page.goto(url) if page.url.startswith("https://consent.google.com"): await page.click('text="Accept all"') locator = page.locator('.eQ35Ce') await locator.wait_for() body = await page.evaluate( "() => document.querySelector('[role=\"main\"]').innerHTML" ) await browser.close() return body def local_playwright_fetch(params: dict) -> Any: url = "https://www.google.com/travel/flights?" + "&".join(f"{k}={v}" for k, v in params.items()) body = asyncio.run(fetch_with_playwright(url)) class DummyResponse: status_code = 200 text = body text_markdown = body return DummyResponse

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