Conversation
New MCP for searching flights via SerpAPI's Google Flights integration. Features: - Search one-way, round-trip, and multi-city flights - Filter by airlines, stops, duration, price - Support for flexible dates and nearby airports - Returns detailed flight info including prices, airlines, layovers
🚀 Preview Deployments Ready!Your changes have been deployed to preview environments: 📦
|
There was a problem hiding this comment.
3 issues found across 14 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="google-flights/server/tools/flights.ts">
<violation number="1" location="google-flights/server/tools/flights.ts:236">
P2: Formatting with `toISOString()` can shift dates by a day in non-UTC time zones. Format using local date parts so the calculated day matches the intended local travel date.</violation>
</file>
<file name="google-flights/server/main.ts">
<violation number="1" location="google-flights/server/main.ts:38">
P1: Guard the pbcopy call to macOS (and/or handle spawn errors) to avoid crashing the server on non-macOS deployments.</violation>
</file>
<file name="google-flights/server/lib/flights-client.ts">
<violation number="1" location="google-flights/server/lib/flights-client.ts:129">
P2: Date-only strings are parsed as UTC, but you're comparing against a local midnight date. This can incorrectly reject same-day departures or accept past dates depending on timezone. Parse dates in local time (or compare date-only values) to avoid the UTC/local mismatch.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
|
||
| // Copy MCP URL to clipboard on macOS | ||
| import { spawn } from "node:child_process"; | ||
| const pbcopy = spawn("pbcopy"); |
There was a problem hiding this comment.
P1: Guard the pbcopy call to macOS (and/or handle spawn errors) to avoid crashing the server on non-macOS deployments.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At google-flights/server/main.ts, line 38:
<comment>Guard the pbcopy call to macOS (and/or handle spawn errors) to avoid crashing the server on non-macOS deployments.</comment>
<file context>
@@ -0,0 +1,41 @@
+
+// Copy MCP URL to clipboard on macOS
+import { spawn } from "node:child_process";
+const pbcopy = spawn("pbcopy");
+pbcopy.stdin.write(mcpUrl);
+pbcopy.stdin.end();
</file context>
| returnDate.setDate(departureDate.getDate() + tripLength); | ||
|
|
||
| const formatDate = (date: Date) => { | ||
| return date.toISOString().split("T")[0] ?? ""; |
There was a problem hiding this comment.
P2: Formatting with toISOString() can shift dates by a day in non-UTC time zones. Format using local date parts so the calculated day matches the intended local travel date.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At google-flights/server/tools/flights.ts, line 236:
<comment>Formatting with `toISOString()` can shift dates by a day in non-UTC time zones. Format using local date parts so the calculated day matches the intended local travel date.</comment>
<file context>
@@ -0,0 +1,276 @@
+ returnDate.setDate(departureDate.getDate() + tripLength);
+
+ const formatDate = (date: Date) => {
+ return date.toISOString().split("T")[0] ?? "";
+ };
+
</file context>
| departureDate: string, | ||
| returnDate?: string, | ||
| ): { valid: boolean; error?: string } { | ||
| const departure = new Date(departureDate); |
There was a problem hiding this comment.
P2: Date-only strings are parsed as UTC, but you're comparing against a local midnight date. This can incorrectly reject same-day departures or accept past dates depending on timezone. Parse dates in local time (or compare date-only values) to avoid the UTC/local mismatch.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At google-flights/server/lib/flights-client.ts, line 129:
<comment>Date-only strings are parsed as UTC, but you're comparing against a local midnight date. This can incorrectly reject same-day departures or accept past dates depending on timezone. Parse dates in local time (or compare date-only values) to avoid the UTC/local mismatch.</comment>
<file context>
@@ -0,0 +1,155 @@
+ departureDate: string,
+ returnDate?: string,
+): { valid: boolean; error?: string } {
+ const departure = new Date(departureDate);
+ const today = new Date();
+ today.setHours(0, 0, 0, 0);
</file context>
New MCP for searching flights via SerpAPI's Google Flights integration.
Features:
Summary by cubic
Add a Google Flights MCP that lets users search flights, find airport codes, and get travel date suggestions. It returns structured results and a Google Flights URL to view real prices.
New Features
Dependencies
Written for commit cab13cc. Summary will update on new commits.