Skip to content

Commit 3842b05

Browse files
committed
feat: remove start/end time and use implicit default 1 minute
1 parent a4bd416 commit 3842b05

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

packages/mcp-server-supabase/src/server.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,7 @@ export function createSupabaseMcpServer(options: SupabaseMcpServerOptions) {
355355
ref: project_id,
356356
},
357357
query: {
358-
// Limit to the last minute
359-
iso_timestamp_start: new Date(now - 60 * 1000).toISOString(),
360-
iso_timestamp_end: new Date(now).toISOString(),
358+
// Omitting start and end time defaults to the last minute
361359
sql: getLogQuery(service),
362360
},
363361
},

packages/mcp-server-supabase/test/mocks.ts

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,7 @@ export const mockManagementApi = [
265265
/**
266266
* Get logs for a project
267267
*/
268-
http.get<
269-
{ projectId: string },
270-
{ iso_timestamp_start: string; iso_timestamp_end: string; sql: string }
271-
>(
268+
http.get<{ projectId: string }, { sql: string }>(
272269
`${API_URL}/v1/projects/:projectId/analytics/endpoints/logs.all`,
273270
async ({ params, request }) => {
274271
const project = mockProjects.get(params.projectId);
@@ -279,26 +276,6 @@ export const mockManagementApi = [
279276
);
280277
}
281278

282-
const url = new URL(request.url);
283-
284-
const iso_timestamp_start =
285-
url.searchParams.get('iso_timestamp_start') ?? undefined;
286-
const iso_timestamp_end =
287-
url.searchParams.get('iso_timestamp_end') ?? undefined;
288-
const sql = url.searchParams.get('sql') ?? undefined;
289-
290-
if (!iso_timestamp_start || !iso_timestamp_end || !sql) {
291-
return HttpResponse.json(
292-
{ message: 'Missing required query parameters' },
293-
{ status: 400 }
294-
);
295-
}
296-
297-
const start = new Date(iso_timestamp_start);
298-
const end = new Date(iso_timestamp_end);
299-
300-
expect(end.getTime() - start.getTime()).toBeLessThanOrEqual(60 * 1000);
301-
302279
return HttpResponse.json([]);
303280
}
304281
),

0 commit comments

Comments
 (0)