@supabase/mcp-server-supabase 0.8.3 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/chunk-6AQ27XVO.js +50 -0
  2. package/dist/chunk-6AQ27XVO.js.map +1 -0
  3. package/dist/chunk-GBJJYLS2.js +17 -0
  4. package/dist/chunk-GBJJYLS2.js.map +1 -0
  5. package/dist/chunk-HJRGMYTR.js +259 -0
  6. package/dist/chunk-HJRGMYTR.js.map +1 -0
  7. package/dist/chunk-I2RM7ZJC.cjs +50 -0
  8. package/dist/chunk-I2RM7ZJC.cjs.map +1 -0
  9. package/dist/chunk-IULV3LEL.cjs +17 -0
  10. package/dist/chunk-IULV3LEL.cjs.map +1 -0
  11. package/dist/chunk-PBHMAKCK.cjs +259 -0
  12. package/dist/chunk-PBHMAKCK.cjs.map +1 -0
  13. package/dist/{chunk-VCRYYVOD.js → chunk-Q7RZ5JID.js} +2 -2
  14. package/dist/chunk-Q7RZ5JID.js.map +1 -0
  15. package/dist/{chunk-QX2UXNCU.cjs → chunk-TJWN2AAW.cjs} +2 -2
  16. package/dist/chunk-TJWN2AAW.cjs.map +1 -0
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +86 -5
  20. package/dist/index.d.ts +86 -5
  21. package/dist/index.js +1 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/platform/api-platform.cjs +1 -1
  24. package/dist/platform/api-platform.js +1 -1
  25. package/dist/platform/index.cjs +1 -1
  26. package/dist/platform/index.cjs.map +1 -1
  27. package/dist/platform/index.d.cts +22 -1
  28. package/dist/platform/index.d.ts +22 -1
  29. package/dist/platform/index.js +1 -1
  30. package/dist/transports/stdio.cjs +1 -1
  31. package/dist/transports/stdio.cjs.map +1 -1
  32. package/dist/transports/stdio.js +1 -1
  33. package/dist/transports/stdio.js.map +1 -1
  34. package/package.json +3 -3
  35. package/dist/chunk-A4DTKSWF.cjs +0 -17
  36. package/dist/chunk-A4DTKSWF.cjs.map +0 -1
  37. package/dist/chunk-KFIVWONT.js +0 -40
  38. package/dist/chunk-KFIVWONT.js.map +0 -1
  39. package/dist/chunk-M64H72M6.js +0 -17
  40. package/dist/chunk-M64H72M6.js.map +0 -1
  41. package/dist/chunk-O4HFTWAB.js +0 -258
  42. package/dist/chunk-O4HFTWAB.js.map +0 -1
  43. package/dist/chunk-OHFANTSW.cjs +0 -40
  44. package/dist/chunk-OHFANTSW.cjs.map +0 -1
  45. package/dist/chunk-QX2UXNCU.cjs.map +0 -1
  46. package/dist/chunk-TQFJHU7I.cjs +0 -258
  47. package/dist/chunk-TQFJHU7I.cjs.map +0 -1
  48. package/dist/chunk-VCRYYVOD.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -469,8 +469,10 @@ declare const databaseToolDefs: {
469
469
  primary_keys: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
470
470
  foreign_key_constraints: z.ZodOptional<z.ZodArray<z.ZodObject<{
471
471
  name: z.ZodString;
472
- source: z.ZodString;
473
- target: z.ZodString;
472
+ source_table: z.ZodString;
473
+ source_columns: z.ZodArray<z.ZodString>;
474
+ target_table: z.ZodString;
475
+ target_columns: z.ZodArray<z.ZodString>;
474
476
  }, z.core.$strip>>>;
475
477
  }, z.core.$strip>>;
476
478
  advisory: z.ZodOptional<z.ZodObject<{
@@ -576,7 +578,7 @@ declare const databaseToolDefs: {
576
578
 
577
579
  declare const debuggingToolDefs: {
578
580
  readonly get_logs: {
579
- readonly description: "Gets logs for a Supabase project by service type. Use this to help debug problems with your app. This will return logs within the last 24 hours.";
581
+ readonly description: "Gets logs for a Supabase project by service type. When the user asks about a specific time range, always pass iso_timestamp_start and iso_timestamp_end to match it; otherwise each call defaults to the last 24 hours and will return logs from a wider window than intended. The window can be up to 24 hours. Edge Function logs are split by kind: `edge-function` returns invocation/request logs, while `edge-function-runtime` returns console output from inside the function. Query one service first, then correlate with other services by timestamp or error anchors. Do not poll get_logs in a loop.";
580
582
  readonly parameters: z.ZodObject<{
581
583
  project_id: z.ZodString;
582
584
  service: z.ZodEnum<{
@@ -584,10 +586,13 @@ declare const debuggingToolDefs: {
584
586
  "branch-action": "branch-action";
585
587
  postgres: "postgres";
586
588
  "edge-function": "edge-function";
589
+ "edge-function-runtime": "edge-function-runtime";
587
590
  auth: "auth";
588
591
  storage: "storage";
589
592
  realtime: "realtime";
590
593
  }>;
594
+ iso_timestamp_start: z.ZodOptional<z.ZodISODateTime>;
595
+ iso_timestamp_end: z.ZodOptional<z.ZodISODateTime>;
591
596
  }, z.core.$strip>;
592
597
  readonly outputSchema: z.ZodObject<{
593
598
  result: z.ZodUnknown;
@@ -600,6 +605,25 @@ declare const debuggingToolDefs: {
600
605
  readonly openWorldHint: false;
601
606
  };
602
607
  };
608
+ readonly query_logs: {
609
+ readonly description: string;
610
+ readonly parameters: z.ZodObject<{
611
+ project_id: z.ZodString;
612
+ sql: z.ZodString;
613
+ iso_timestamp_start: z.ZodOptional<z.ZodISODateTime>;
614
+ iso_timestamp_end: z.ZodOptional<z.ZodISODateTime>;
615
+ }, z.core.$strip>;
616
+ readonly outputSchema: z.ZodObject<{
617
+ result: z.ZodUnknown;
618
+ }, z.core.$strip>;
619
+ readonly annotations: {
620
+ readonly title: "Query project logs";
621
+ readonly readOnlyHint: true;
622
+ readonly destructiveHint: false;
623
+ readonly idempotentHint: true;
624
+ readonly openWorldHint: false;
625
+ };
626
+ };
603
627
  readonly get_advisors: {
604
628
  readonly description: "Gets a list of advisory notices for the Supabase project. Use this to check for security vulnerabilities or performance improvements. Include the remediation URL as a clickable link so that the user can reference the issue themselves. It's recommended to run this tool regularly, especially after making DDL changes to the database since it will catch things like missing RLS policies.";
605
629
  readonly parameters: z.ZodObject<{
@@ -915,6 +939,7 @@ declare const supabaseMcpToolSchemas: {
915
939
  readonly openWorldHint: false;
916
940
  };
917
941
  readOnlyBehavior: undefined;
942
+ hidden: undefined;
918
943
  };
919
944
  get_storage_config: {
920
945
  inputSchema: z.ZodObject<{
@@ -939,6 +964,7 @@ declare const supabaseMcpToolSchemas: {
939
964
  readonly openWorldHint: false;
940
965
  };
941
966
  readOnlyBehavior: undefined;
967
+ hidden: undefined;
942
968
  };
943
969
  update_storage_config: {
944
970
  inputSchema: z.ZodObject<{
@@ -966,6 +992,7 @@ declare const supabaseMcpToolSchemas: {
966
992
  readonly openWorldHint: false;
967
993
  };
968
994
  readOnlyBehavior: undefined;
995
+ hidden: undefined;
969
996
  };
970
997
  list_edge_functions: {
971
998
  inputSchema: z.ZodObject<{
@@ -994,6 +1021,7 @@ declare const supabaseMcpToolSchemas: {
994
1021
  readonly openWorldHint: false;
995
1022
  };
996
1023
  readOnlyBehavior: undefined;
1024
+ hidden: undefined;
997
1025
  };
998
1026
  get_edge_function: {
999
1027
  inputSchema: z.ZodObject<{
@@ -1025,6 +1053,7 @@ declare const supabaseMcpToolSchemas: {
1025
1053
  readonly openWorldHint: false;
1026
1054
  };
1027
1055
  readOnlyBehavior: undefined;
1056
+ hidden: undefined;
1028
1057
  };
1029
1058
  deploy_edge_function: {
1030
1059
  inputSchema: z.ZodObject<{
@@ -1059,6 +1088,7 @@ declare const supabaseMcpToolSchemas: {
1059
1088
  readonly openWorldHint: false;
1060
1089
  };
1061
1090
  readOnlyBehavior: undefined;
1091
+ hidden: undefined;
1062
1092
  };
1063
1093
  search_docs: {
1064
1094
  inputSchema: z.ZodObject<{
@@ -1075,6 +1105,7 @@ declare const supabaseMcpToolSchemas: {
1075
1105
  readonly openWorldHint: false;
1076
1106
  };
1077
1107
  readOnlyBehavior: undefined;
1108
+ hidden: undefined;
1078
1109
  };
1079
1110
  get_project_url: {
1080
1111
  inputSchema: z.ZodObject<{
@@ -1091,6 +1122,7 @@ declare const supabaseMcpToolSchemas: {
1091
1122
  readonly openWorldHint: false;
1092
1123
  };
1093
1124
  readOnlyBehavior: undefined;
1125
+ hidden: undefined;
1094
1126
  };
1095
1127
  get_publishable_keys: {
1096
1128
  inputSchema: z.ZodObject<{
@@ -1117,6 +1149,7 @@ declare const supabaseMcpToolSchemas: {
1117
1149
  readonly openWorldHint: false;
1118
1150
  };
1119
1151
  readOnlyBehavior: undefined;
1152
+ hidden: undefined;
1120
1153
  };
1121
1154
  generate_typescript_types: {
1122
1155
  inputSchema: z.ZodObject<{
@@ -1133,6 +1166,7 @@ declare const supabaseMcpToolSchemas: {
1133
1166
  readonly openWorldHint: false;
1134
1167
  };
1135
1168
  readOnlyBehavior: undefined;
1169
+ hidden: undefined;
1136
1170
  };
1137
1171
  get_logs: {
1138
1172
  inputSchema: z.ZodObject<{
@@ -1142,10 +1176,13 @@ declare const supabaseMcpToolSchemas: {
1142
1176
  "branch-action": "branch-action";
1143
1177
  postgres: "postgres";
1144
1178
  "edge-function": "edge-function";
1179
+ "edge-function-runtime": "edge-function-runtime";
1145
1180
  auth: "auth";
1146
1181
  storage: "storage";
1147
1182
  realtime: "realtime";
1148
1183
  }>;
1184
+ iso_timestamp_start: z.ZodOptional<z.ZodISODateTime>;
1185
+ iso_timestamp_end: z.ZodOptional<z.ZodISODateTime>;
1149
1186
  }, z.core.$strip>;
1150
1187
  outputSchema: z.ZodObject<{
1151
1188
  result: z.ZodUnknown;
@@ -1158,6 +1195,27 @@ declare const supabaseMcpToolSchemas: {
1158
1195
  readonly openWorldHint: false;
1159
1196
  };
1160
1197
  readOnlyBehavior: undefined;
1198
+ hidden: undefined;
1199
+ };
1200
+ query_logs: {
1201
+ inputSchema: z.ZodObject<{
1202
+ project_id: z.ZodString;
1203
+ sql: z.ZodString;
1204
+ iso_timestamp_start: z.ZodOptional<z.ZodISODateTime>;
1205
+ iso_timestamp_end: z.ZodOptional<z.ZodISODateTime>;
1206
+ }, z.core.$strip>;
1207
+ outputSchema: z.ZodObject<{
1208
+ result: z.ZodUnknown;
1209
+ }, z.core.$strip>;
1210
+ annotations: {
1211
+ readonly title: "Query project logs";
1212
+ readonly readOnlyHint: true;
1213
+ readonly destructiveHint: false;
1214
+ readonly idempotentHint: true;
1215
+ readonly openWorldHint: false;
1216
+ };
1217
+ readOnlyBehavior: undefined;
1218
+ hidden: undefined;
1161
1219
  };
1162
1220
  get_advisors: {
1163
1221
  inputSchema: z.ZodObject<{
@@ -1178,6 +1236,7 @@ declare const supabaseMcpToolSchemas: {
1178
1236
  readonly openWorldHint: false;
1179
1237
  };
1180
1238
  readOnlyBehavior: undefined;
1239
+ hidden: undefined;
1181
1240
  };
1182
1241
  list_tables: {
1183
1242
  inputSchema: z.ZodObject<{
@@ -1205,8 +1264,10 @@ declare const supabaseMcpToolSchemas: {
1205
1264
  primary_keys: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1206
1265
  foreign_key_constraints: z.ZodOptional<z.ZodArray<z.ZodObject<{
1207
1266
  name: z.ZodString;
1208
- source: z.ZodString;
1209
- target: z.ZodString;
1267
+ source_table: z.ZodString;
1268
+ source_columns: z.ZodArray<z.ZodString>;
1269
+ target_table: z.ZodString;
1270
+ target_columns: z.ZodArray<z.ZodString>;
1210
1271
  }, z.core.$strip>>>;
1211
1272
  }, z.core.$strip>>;
1212
1273
  advisory: z.ZodOptional<z.ZodObject<{
@@ -1231,6 +1292,7 @@ declare const supabaseMcpToolSchemas: {
1231
1292
  readonly openWorldHint: false;
1232
1293
  };
1233
1294
  readOnlyBehavior: undefined;
1295
+ hidden: undefined;
1234
1296
  };
1235
1297
  list_extensions: {
1236
1298
  inputSchema: z.ZodObject<{
@@ -1253,6 +1315,7 @@ declare const supabaseMcpToolSchemas: {
1253
1315
  readonly openWorldHint: false;
1254
1316
  };
1255
1317
  readOnlyBehavior: undefined;
1318
+ hidden: undefined;
1256
1319
  };
1257
1320
  list_migrations: {
1258
1321
  inputSchema: z.ZodObject<{
@@ -1272,6 +1335,7 @@ declare const supabaseMcpToolSchemas: {
1272
1335
  readonly openWorldHint: false;
1273
1336
  };
1274
1337
  readOnlyBehavior: undefined;
1338
+ hidden: undefined;
1275
1339
  };
1276
1340
  apply_migration: {
1277
1341
  inputSchema: z.ZodObject<{
@@ -1290,6 +1354,7 @@ declare const supabaseMcpToolSchemas: {
1290
1354
  readonly openWorldHint: true;
1291
1355
  };
1292
1356
  readOnlyBehavior: undefined;
1357
+ hidden: undefined;
1293
1358
  };
1294
1359
  execute_sql: {
1295
1360
  inputSchema: z.ZodObject<{
@@ -1307,6 +1372,7 @@ declare const supabaseMcpToolSchemas: {
1307
1372
  readonly openWorldHint: true;
1308
1373
  };
1309
1374
  readOnlyBehavior: "adapt";
1375
+ hidden: undefined;
1310
1376
  };
1311
1377
  create_branch: {
1312
1378
  inputSchema: z.ZodObject<{
@@ -1343,6 +1409,7 @@ declare const supabaseMcpToolSchemas: {
1343
1409
  readonly openWorldHint: false;
1344
1410
  };
1345
1411
  readOnlyBehavior: undefined;
1412
+ hidden: undefined;
1346
1413
  };
1347
1414
  list_branches: {
1348
1415
  inputSchema: z.ZodObject<{
@@ -1379,6 +1446,7 @@ declare const supabaseMcpToolSchemas: {
1379
1446
  readonly openWorldHint: false;
1380
1447
  };
1381
1448
  readOnlyBehavior: undefined;
1449
+ hidden: undefined;
1382
1450
  };
1383
1451
  delete_branch: {
1384
1452
  inputSchema: z.ZodObject<{
@@ -1395,6 +1463,7 @@ declare const supabaseMcpToolSchemas: {
1395
1463
  readonly openWorldHint: false;
1396
1464
  };
1397
1465
  readOnlyBehavior: undefined;
1466
+ hidden: undefined;
1398
1467
  };
1399
1468
  merge_branch: {
1400
1469
  inputSchema: z.ZodObject<{
@@ -1411,6 +1480,7 @@ declare const supabaseMcpToolSchemas: {
1411
1480
  readonly openWorldHint: false;
1412
1481
  };
1413
1482
  readOnlyBehavior: undefined;
1483
+ hidden: undefined;
1414
1484
  };
1415
1485
  reset_branch: {
1416
1486
  inputSchema: z.ZodObject<{
@@ -1428,6 +1498,7 @@ declare const supabaseMcpToolSchemas: {
1428
1498
  readonly openWorldHint: false;
1429
1499
  };
1430
1500
  readOnlyBehavior: undefined;
1501
+ hidden: undefined;
1431
1502
  };
1432
1503
  rebase_branch: {
1433
1504
  inputSchema: z.ZodObject<{
@@ -1444,6 +1515,7 @@ declare const supabaseMcpToolSchemas: {
1444
1515
  readonly openWorldHint: false;
1445
1516
  };
1446
1517
  readOnlyBehavior: undefined;
1518
+ hidden: undefined;
1447
1519
  };
1448
1520
  list_organizations: {
1449
1521
  inputSchema: z.ZodObject<{}, z.core.$strip>;
@@ -1462,6 +1534,7 @@ declare const supabaseMcpToolSchemas: {
1462
1534
  readonly openWorldHint: false;
1463
1535
  };
1464
1536
  readOnlyBehavior: undefined;
1537
+ hidden: undefined;
1465
1538
  };
1466
1539
  get_organization: {
1467
1540
  inputSchema: z.ZodObject<{
@@ -1482,6 +1555,7 @@ declare const supabaseMcpToolSchemas: {
1482
1555
  readonly openWorldHint: false;
1483
1556
  };
1484
1557
  readOnlyBehavior: undefined;
1558
+ hidden: undefined;
1485
1559
  };
1486
1560
  list_projects: {
1487
1561
  inputSchema: z.ZodObject<{}, z.core.$strip>;
@@ -1505,6 +1579,7 @@ declare const supabaseMcpToolSchemas: {
1505
1579
  readonly openWorldHint: false;
1506
1580
  };
1507
1581
  readOnlyBehavior: undefined;
1582
+ hidden: undefined;
1508
1583
  };
1509
1584
  get_project: {
1510
1585
  inputSchema: z.ZodObject<{
@@ -1528,6 +1603,7 @@ declare const supabaseMcpToolSchemas: {
1528
1603
  readonly openWorldHint: false;
1529
1604
  };
1530
1605
  readOnlyBehavior: undefined;
1606
+ hidden: undefined;
1531
1607
  };
1532
1608
  get_cost: {
1533
1609
  inputSchema: z.ZodObject<{
@@ -1556,6 +1632,7 @@ declare const supabaseMcpToolSchemas: {
1556
1632
  readonly openWorldHint: false;
1557
1633
  };
1558
1634
  readOnlyBehavior: undefined;
1635
+ hidden: undefined;
1559
1636
  };
1560
1637
  confirm_cost: {
1561
1638
  inputSchema: z.ZodObject<{
@@ -1580,6 +1657,7 @@ declare const supabaseMcpToolSchemas: {
1580
1657
  readonly openWorldHint: false;
1581
1658
  };
1582
1659
  readOnlyBehavior: undefined;
1660
+ hidden: undefined;
1583
1661
  };
1584
1662
  create_project: {
1585
1663
  inputSchema: z.ZodObject<{
@@ -1623,6 +1701,7 @@ declare const supabaseMcpToolSchemas: {
1623
1701
  readonly openWorldHint: false;
1624
1702
  };
1625
1703
  readOnlyBehavior: undefined;
1704
+ hidden: undefined;
1626
1705
  };
1627
1706
  pause_project: {
1628
1707
  inputSchema: z.ZodObject<{
@@ -1639,6 +1718,7 @@ declare const supabaseMcpToolSchemas: {
1639
1718
  readonly openWorldHint: false;
1640
1719
  };
1641
1720
  readOnlyBehavior: undefined;
1721
+ hidden: undefined;
1642
1722
  };
1643
1723
  restore_project: {
1644
1724
  inputSchema: z.ZodObject<{
@@ -1655,6 +1735,7 @@ declare const supabaseMcpToolSchemas: {
1655
1735
  readonly openWorldHint: false;
1656
1736
  };
1657
1737
  readOnlyBehavior: undefined;
1738
+ hidden: undefined;
1658
1739
  };
1659
1740
  };
1660
1741
  /**
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{a as c,b as l,c as p,d,e as m,f,g as i,h as u,i as y,j}from"./chunk-O4HFTWAB.js";import{a as h}from"./chunk-M64H72M6.js";import"./chunk-VCRYYVOD.js";function o(e){return Object.fromEntries(Object.entries(e).map(([r,{parameters:t,description:S,...s}])=>[r,{inputSchema:t,...s}]))}var n={...o(l),...o(p),...o(d),...o(m),...o(f),...o(i),...o(u),...o(y)},F={docs:Object.keys(i),account:Object.keys(l),database:Object.keys(d),debugging:Object.keys(m),development:Object.keys(f),functions:Object.keys(u),branching:Object.keys(p),storage:Object.keys(y)},O=Object.fromEntries(Object.entries(n).filter(([,{inputSchema:e}])=>"project_id"in e.shape).map(([e,{inputSchema:r,...t}])=>[e,{inputSchema:r.omit({project_id:!0}),...t}])),x=new Set(Object.entries(n).filter(([,e])=>e.annotations.readOnlyHint===!1&&e.readOnlyBehavior!=="adapt").map(([e])=>e));function R(e){let r=new Set(e?.features??c),t=e?.projectScoped??!1,S=e?.readOnly??!1,s={};for(let[T,b]of Object.entries(F))if(r.has(T)&&!(t&&T==="account"))for(let a of b)S&&x.has(a)||(t&&a in O?s[a]=O[a]:s[a]=n[a]);return s}var G=h.version;export{c as CURRENT_FEATURE_GROUPS,j as createSupabaseMcpServer,R as createToolSchemas,n as supabaseMcpToolSchemas,G as version};
1
+ import{a as o,b as p,c as r,d as a}from"./chunk-HJRGMYTR.js";import{a as e}from"./chunk-GBJJYLS2.js";import"./chunk-Q7RZ5JID.js";var s=e.version;export{o as CURRENT_FEATURE_GROUPS,a as createSupabaseMcpServer,r as createToolSchemas,p as supabaseMcpToolSchemas,s as version};
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/tools/tool-schemas.ts","../src/index.ts"],"sourcesContent":["import type { z } from 'zod/v4';\nimport { CURRENT_FEATURE_GROUPS, type FeatureGroup } from '../types.js';\nimport { accountToolDefs } from './account-tools.js';\nimport { branchingToolDefs } from './branching-tools.js';\nimport { databaseToolDefs } from './database-operation-tools.js';\nimport { debuggingToolDefs } from './debugging-tools.js';\nimport { developmentToolDefs } from './development-tools.js';\nimport { docsToolDefs } from './docs-tools.js';\nimport { edgeFunctionToolDefs } from './edge-function-tools.js';\nimport { storageToolDefs } from './storage-tools.js';\nimport type { ToolDefs } from './util.js';\n\ntype DefsToSchemas<T extends ToolDefs> = {\n [K in keyof T]: {\n inputSchema: T[K]['parameters'];\n outputSchema: T[K]['outputSchema'];\n annotations: T[K]['annotations'];\n readOnlyBehavior: T[K] extends {\n readOnlyBehavior: infer R extends 'exclude' | 'adapt';\n }\n ? R\n : undefined;\n };\n};\n\nfunction defsToSchemas<const T extends ToolDefs>(defs: T): DefsToSchemas<T> {\n return Object.fromEntries(\n Object.entries(defs).map(\n ([name, { parameters: inputSchema, description: _, ...rest }]) => [\n name,\n { inputSchema, ...rest },\n ]\n )\n ) as DefsToSchemas<T>;\n}\n\ntype SchemaEntry = {\n inputSchema: z.ZodObject<any>;\n outputSchema: z.ZodObject<any>;\n annotations: ToolDefs[string]['annotations'];\n readOnlyBehavior?: 'exclude' | 'adapt';\n};\n\n/**\n * All Supabase MCP tool schemas (input + output pairs).\n *\n * Pass to AI SDK's `mcpClient.tools()` `schemas` option to get typed tool\n * inputs and outputs:\n * https://ai-sdk.dev/docs/ai-sdk-core/mcp-tools#typed-tool-outputs\n *\n * @example\n * ```typescript\n * import { supabaseMcpToolSchemas } from '@supabase/mcp-server-supabase';\n *\n * const tools = await mcpClient.tools({\n * schemas: supabaseMcpToolSchemas,\n * });\n * ```\n */\nexport const supabaseMcpToolSchemas = {\n ...defsToSchemas(accountToolDefs),\n ...defsToSchemas(branchingToolDefs),\n ...defsToSchemas(databaseToolDefs),\n ...defsToSchemas(debuggingToolDefs),\n ...defsToSchemas(developmentToolDefs),\n ...defsToSchemas(docsToolDefs),\n ...defsToSchemas(edgeFunctionToolDefs),\n ...defsToSchemas(storageToolDefs),\n} satisfies Record<string, SchemaEntry>;\n\n/**\n * Maps each feature group to its tool names.\n * Derived from the per-file tool defs so that adding a tool to a file\n * automatically includes it in the feature group.\n *\n * Used by {@link createToolSchemas} to filter tools by feature.\n */\nconst FEATURE_TOOL_MAP = {\n docs: Object.keys(docsToolDefs) as readonly (keyof typeof docsToolDefs)[],\n account: Object.keys(\n accountToolDefs\n ) as readonly (keyof typeof accountToolDefs)[],\n database: Object.keys(\n databaseToolDefs\n ) as readonly (keyof typeof databaseToolDefs)[],\n debugging: Object.keys(\n debuggingToolDefs\n ) as readonly (keyof typeof debuggingToolDefs)[],\n development: Object.keys(\n developmentToolDefs\n ) as readonly (keyof typeof developmentToolDefs)[],\n functions: Object.keys(\n edgeFunctionToolDefs\n ) as readonly (keyof typeof edgeFunctionToolDefs)[],\n branching: Object.keys(\n branchingToolDefs\n ) as readonly (keyof typeof branchingToolDefs)[],\n storage: Object.keys(\n storageToolDefs\n ) as readonly (keyof typeof storageToolDefs)[],\n} satisfies Record<\n FeatureGroup,\n readonly (keyof typeof supabaseMcpToolSchemas)[]\n>;\n\n/**\n * Schemas with `project_id` omitted from input schemas.\n * Computed dynamically: any tool whose inputSchema has a `project_id`\n * key gets an override with that key omitted.\n *\n * Account tools also appear here but are excluded entirely in\n * project-scoped mode (matching server behavior).\n *\n * Used by {@link createToolSchemas} when `projectScoped` is true.\n */\nconst PROJECT_SCOPED_OVERRIDES: Record<string, SchemaEntry> =\n Object.fromEntries(\n Object.entries(supabaseMcpToolSchemas)\n .filter(([, { inputSchema }]) => 'project_id' in inputSchema.shape)\n .map(([name, { inputSchema, ...rest }]) => [\n name,\n {\n inputSchema: (inputSchema as z.ZodObject<any>).omit({\n project_id: true,\n }),\n ...rest,\n },\n ])\n );\n\n/**\n * Tools excluded entirely in read-only mode.\n * Derived from tool defs: any tool with `readOnlyHint: false` and no\n * `readOnlyBehavior: 'adapt'` annotation.\n */\nconst writeToolSet = new Set(\n Object.entries(supabaseMcpToolSchemas)\n .filter(\n ([, entry]) =>\n entry.annotations.readOnlyHint === false &&\n entry.readOnlyBehavior !== 'adapt'\n )\n .map(([name]) => name)\n);\n\ntype AllSchemas = typeof supabaseMcpToolSchemas;\n\n/** Tool names whose inputSchema contains `project_id`. */\ntype ProjectScopedToolName = {\n [K in keyof AllSchemas]: 'project_id' extends keyof z.infer<\n AllSchemas[K]['inputSchema']\n >\n ? K\n : never;\n}[keyof AllSchemas];\n\ntype ProjectScopedSchemas = {\n [K in ProjectScopedToolName]: {\n inputSchema: AllSchemas[K]['inputSchema'] extends z.ZodObject<infer S>\n ? z.ZodObject<Omit<S, 'project_id'>>\n : never;\n outputSchema: AllSchemas[K]['outputSchema'];\n annotations: AllSchemas[K]['annotations'];\n };\n};\n\ntype ToolNameForFeature<Feature extends FeatureGroup> =\n (typeof FEATURE_TOOL_MAP)[Feature][number];\n\ntype AccountToolName = ToolNameForFeature<'account'>;\ntype WriteToolName = {\n [K in keyof AllSchemas]: AllSchemas[K]['annotations'] extends {\n readOnlyHint: false;\n }\n ? AllSchemas[K] extends { readOnlyBehavior: 'adapt' }\n ? never\n : K\n : never;\n}[keyof AllSchemas];\n\n/**\n * Computes the set of tool names available for a given configuration.\n *\n * - Resolves feature groups to their tool names\n * - Excludes account tools when project-scoped\n * - Excludes write-only tools when read-only\n */\ntype AvailableToolNames<\n Feature extends FeatureGroup,\n ProjectScoped extends boolean,\n ReadOnly extends boolean,\n> = Exclude<\n ToolNameForFeature<Feature>,\n | (ProjectScoped extends true ? AccountToolName : never)\n | (ReadOnly extends true ? WriteToolName : never)\n>;\n\n/**\n * Computes the tool schemas for a given configuration.\n *\n * When `ProjectScoped` is `true`, tools with `project_id` use the\n * project-scoped override (with `project_id` omitted from the input\n * schema). All other tools use their original schemas.\n */\ntype ToolSchemasFor<\n Feature extends FeatureGroup,\n ProjectScoped extends boolean,\n ReadOnly extends boolean,\n> = Pick<\n ProjectScoped extends true\n ? Omit<AllSchemas, ProjectScopedToolName> & ProjectScopedSchemas\n : AllSchemas,\n AvailableToolNames<Feature, ProjectScoped, ReadOnly> & keyof AllSchemas\n>;\n\n/**\n * Creates a dynamically scoped tool schema map for use with AI SDK's\n * `mcpClient.tools()`.\n *\n * Mirrors the server's dynamic tool behavior:\n * - `features` controls which tool groups are included\n * - `projectScoped` omits `project_id` from input schemas and excludes\n * account tools (matching server behavior when `projectId` is set)\n * - `readOnly` excludes mutating tools\n *\n * @example\n * ```typescript\n * import { createToolSchemas } from '@supabase/mcp-server-supabase';\n *\n * // Project-scoped with specific features\n * const schemas = createToolSchemas({\n * features: ['database', 'docs'],\n * projectScoped: true,\n * });\n *\n * const tools = await mcpClient.tools({ schemas });\n * ```\n */\nexport function createToolSchemas<\n const Features extends\n readonly FeatureGroup[] = typeof CURRENT_FEATURE_GROUPS,\n const ProjectScoped extends boolean = false,\n const ReadOnly extends boolean = false,\n>(options?: {\n features?: Features;\n projectScoped?: ProjectScoped;\n readOnly?: ReadOnly;\n}): ToolSchemasFor<Features[number], ProjectScoped, ReadOnly> {\n const enabledFeatures = new Set<string>(\n options?.features ?? CURRENT_FEATURE_GROUPS\n );\n const projectScoped = options?.projectScoped ?? false;\n const readOnly = options?.readOnly ?? false;\n\n const result: Record<string, SchemaEntry> = {};\n\n for (const [feature, toolNames] of Object.entries(FEATURE_TOOL_MAP)) {\n if (!enabledFeatures.has(feature)) continue;\n if (projectScoped && feature === 'account') continue;\n\n for (const toolName of toolNames) {\n if (readOnly && writeToolSet.has(toolName)) continue;\n\n if (projectScoped && toolName in PROJECT_SCOPED_OVERRIDES) {\n result[toolName] = PROJECT_SCOPED_OVERRIDES[toolName]!;\n } else {\n result[toolName] = supabaseMcpToolSchemas[toolName];\n }\n }\n }\n\n return result as ToolSchemasFor<Features[number], ProjectScoped, ReadOnly>;\n}\n","import packageJson from '../package.json' with { type: 'json' };\n\nexport type { ToolCallCallback } from '@supabase/mcp-utils';\nexport type { SupabasePlatform } from './platform/index.js';\nexport {\n createSupabaseMcpServer,\n type SupabaseMcpServerOptions,\n} from './server.js';\nexport {\n CURRENT_FEATURE_GROUPS,\n type FeatureGroup,\n} from './types.js';\nexport const version = packageJson.version;\n\nexport {\n createToolSchemas,\n supabaseMcpToolSchemas,\n} from './tools/tool-schemas.js';\n"],"mappings":"4JAyBA,SAASA,EAAwCC,EAA2B,CAC1E,OAAO,OAAO,YACZ,OAAO,QAAQA,CAAI,EAAE,IACnB,CAAC,CAACC,EAAM,CAAE,WAAYC,EAAa,YAAaC,EAAG,GAAGC,CAAK,CAAC,IAAM,CAChEH,EACA,CAAE,YAAAC,EAAa,GAAGE,CAAK,CACzB,CACF,CACF,CACF,CAyBO,IAAMC,EAAyB,CACpC,GAAGN,EAAcO,CAAe,EAChC,GAAGP,EAAcQ,CAAiB,EAClC,GAAGR,EAAcS,CAAgB,EACjC,GAAGT,EAAcU,CAAiB,EAClC,GAAGV,EAAcW,CAAmB,EACpC,GAAGX,EAAcY,CAAY,EAC7B,GAAGZ,EAAca,CAAoB,EACrC,GAAGb,EAAcc,CAAe,CAClC,EASMC,EAAmB,CACvB,KAAM,OAAO,KAAKH,CAAY,EAC9B,QAAS,OAAO,KACdL,CACF,EACA,SAAU,OAAO,KACfE,CACF,EACA,UAAW,OAAO,KAChBC,CACF,EACA,YAAa,OAAO,KAClBC,CACF,EACA,UAAW,OAAO,KAChBE,CACF,EACA,UAAW,OAAO,KAChBL,CACF,EACA,QAAS,OAAO,KACdM,CACF,CACF,EAeME,EACJ,OAAO,YACL,OAAO,QAAQV,CAAsB,EAClC,OAAO,CAAC,CAAC,CAAE,CAAE,YAAAH,CAAY,CAAC,IAAM,eAAgBA,EAAY,KAAK,EACjE,IAAI,CAAC,CAACD,EAAM,CAAE,YAAAC,EAAa,GAAGE,CAAK,CAAC,IAAM,CACzCH,EACA,CACE,YAAcC,EAAiC,KAAK,CAClD,WAAY,EACd,CAAC,EACD,GAAGE,CACL,CACF,CAAC,CACL,EAOIY,EAAe,IAAI,IACvB,OAAO,QAAQX,CAAsB,EAClC,OACC,CAAC,CAAC,CAAEY,CAAK,IACPA,EAAM,YAAY,eAAiB,IACnCA,EAAM,mBAAqB,OAC/B,EACC,IAAI,CAAC,CAAChB,CAAI,IAAMA,CAAI,CACzB,EA+FO,SAASiB,EAKdC,EAI4D,CAC5D,IAAMC,EAAkB,IAAI,IAC1BD,GAAS,UAAYE,CACvB,EACMC,EAAgBH,GAAS,eAAiB,GAC1CI,EAAWJ,GAAS,UAAY,GAEhCK,EAAsC,CAAC,EAE7C,OAAW,CAACC,EAASC,CAAS,IAAK,OAAO,QAAQZ,CAAgB,EAChE,GAAKM,EAAgB,IAAIK,CAAO,GAC5B,EAAAH,GAAiBG,IAAY,WAEjC,QAAWE,KAAYD,EACjBH,GAAYP,EAAa,IAAIW,CAAQ,IAErCL,GAAiBK,KAAYZ,EAC/BS,EAAOG,CAAQ,EAAIZ,EAAyBY,CAAQ,EAEpDH,EAAOG,CAAQ,EAAItB,EAAuBsB,CAAQ,GAKxD,OAAOH,CACT,CCpQO,IAAMI,EAAUC,EAAY","names":["defsToSchemas","defs","name","inputSchema","_","rest","supabaseMcpToolSchemas","accountToolDefs","branchingToolDefs","databaseToolDefs","debuggingToolDefs","developmentToolDefs","docsToolDefs","edgeFunctionToolDefs","storageToolDefs","FEATURE_TOOL_MAP","PROJECT_SCOPED_OVERRIDES","writeToolSet","entry","createToolSchemas","options","enabledFeatures","CURRENT_FEATURE_GROUPS","projectScoped","readOnly","result","feature","toolNames","toolName","version","package_default"]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import packageJson from '../package.json' with { type: 'json' };\n\nexport type { ToolCallCallback } from '@supabase/mcp-utils';\nexport type { SupabasePlatform } from './platform/index.js';\nexport {\n createSupabaseMcpServer,\n type SupabaseMcpServerOptions,\n} from './server.js';\nexport {\n CURRENT_FEATURE_GROUPS,\n type FeatureGroup,\n} from './types.js';\nexport const version = packageJson.version;\n\nexport {\n createToolSchemas,\n supabaseMcpToolSchemas,\n} from './tools/tool-schemas.js';\n"],"mappings":"iIAYO,IAAMA,EAAUC,EAAY","names":["version","package_default"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOHFANTSWcjs = require('../chunk-OHFANTSW.cjs');require('../chunk-A4DTKSWF.cjs');require('../chunk-PHWSETKC.cjs');require('../chunk-QX2UXNCU.cjs');exports.createSupabaseApiPlatform = _chunkOHFANTSWcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkI2RM7ZJCcjs = require('../chunk-I2RM7ZJC.cjs');require('../chunk-IULV3LEL.cjs');require('../chunk-PHWSETKC.cjs');require('../chunk-TJWN2AAW.cjs');exports.createSupabaseApiPlatform = _chunkI2RM7ZJCcjs.a;
2
2
  //# sourceMappingURL=api-platform.cjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-KFIVWONT.js";import"../chunk-M64H72M6.js";import"../chunk-LU6L7C36.js";import"../chunk-VCRYYVOD.js";export{a as createSupabaseApiPlatform};
1
+ import{a}from"../chunk-6AQ27XVO.js";import"../chunk-GBJJYLS2.js";import"../chunk-LU6L7C36.js";import"../chunk-Q7RZ5JID.js";export{a as createSupabaseApiPlatform};
2
2
  //# sourceMappingURL=api-platform.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-PHWSETKC.cjs');var _chunkQX2UXNCUcjs = require('../chunk-QX2UXNCU.cjs');exports.apiKeyTypeSchema = _chunkQX2UXNCUcjs.s; exports.applyMigrationOptionsSchema = _chunkQX2UXNCUcjs.n; exports.branchSchema = _chunkQX2UXNCUcjs.f; exports.createBranchOptionsSchema = _chunkQX2UXNCUcjs.j; exports.createProjectOptionsSchema = _chunkQX2UXNCUcjs.i; exports.deployEdgeFunctionOptionsSchema = _chunkQX2UXNCUcjs.l; exports.edgeFunctionSchema = _chunkQX2UXNCUcjs.g; exports.edgeFunctionWithBodySchema = _chunkQX2UXNCUcjs.h; exports.executeSqlOptionsSchema = _chunkQX2UXNCUcjs.m; exports.generateTypescriptTypesResultSchema = _chunkQX2UXNCUcjs.r; exports.getLogsOptionsSchema = _chunkQX2UXNCUcjs.q; exports.logsServiceSchema = _chunkQX2UXNCUcjs.p; exports.migrationSchema = _chunkQX2UXNCUcjs.o; exports.organizationSchema = _chunkQX2UXNCUcjs.d; exports.projectSchema = _chunkQX2UXNCUcjs.e; exports.resetBranchOptionsSchema = _chunkQX2UXNCUcjs.k; exports.storageBucketSchema = _chunkQX2UXNCUcjs.b; exports.storageConfigSchema = _chunkQX2UXNCUcjs.c;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-PHWSETKC.cjs');var _chunkTJWN2AAWcjs = require('../chunk-TJWN2AAW.cjs');exports.apiKeyTypeSchema = _chunkTJWN2AAWcjs.t; exports.applyMigrationOptionsSchema = _chunkTJWN2AAWcjs.n; exports.branchSchema = _chunkTJWN2AAWcjs.f; exports.createBranchOptionsSchema = _chunkTJWN2AAWcjs.j; exports.createProjectOptionsSchema = _chunkTJWN2AAWcjs.i; exports.deployEdgeFunctionOptionsSchema = _chunkTJWN2AAWcjs.l; exports.edgeFunctionSchema = _chunkTJWN2AAWcjs.g; exports.edgeFunctionWithBodySchema = _chunkTJWN2AAWcjs.h; exports.executeSqlOptionsSchema = _chunkTJWN2AAWcjs.m; exports.generateTypescriptTypesResultSchema = _chunkTJWN2AAWcjs.s; exports.getLogsOptionsSchema = _chunkTJWN2AAWcjs.q; exports.logsServiceSchema = _chunkTJWN2AAWcjs.p; exports.migrationSchema = _chunkTJWN2AAWcjs.o; exports.organizationSchema = _chunkTJWN2AAWcjs.d; exports.projectSchema = _chunkTJWN2AAWcjs.e; exports.queryLogsOptionsSchema = _chunkTJWN2AAWcjs.r; exports.resetBranchOptionsSchema = _chunkTJWN2AAWcjs.k; exports.storageBucketSchema = _chunkTJWN2AAWcjs.b; exports.storageConfigSchema = _chunkTJWN2AAWcjs.c;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/platform/index.cjs"],"names":[],"mappings":"AAAA,0GAA6B,yDAAiK,+7BAAof","file":"/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/platform/index.cjs"}
1
+ {"version":3,"sources":["/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/platform/index.cjs"],"names":[],"mappings":"AAAA,0GAA6B,yDAAwK,q/BAAghB","file":"/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/platform/index.cjs"}
@@ -148,6 +148,7 @@ declare const logsServiceSchema: z.ZodEnum<{
148
148
  "branch-action": "branch-action";
149
149
  postgres: "postgres";
150
150
  "edge-function": "edge-function";
151
+ "edge-function-runtime": "edge-function-runtime";
151
152
  auth: "auth";
152
153
  storage: "storage";
153
154
  realtime: "realtime";
@@ -158,6 +159,7 @@ declare const getLogsOptionsSchema: z.ZodObject<{
158
159
  "branch-action": "branch-action";
159
160
  postgres: "postgres";
160
161
  "edge-function": "edge-function";
162
+ "edge-function-runtime": "edge-function-runtime";
161
163
  auth: "auth";
162
164
  storage: "storage";
163
165
  realtime: "realtime";
@@ -165,6 +167,11 @@ declare const getLogsOptionsSchema: z.ZodObject<{
165
167
  iso_timestamp_start: z.ZodOptional<z.ZodString>;
166
168
  iso_timestamp_end: z.ZodOptional<z.ZodString>;
167
169
  }, z.core.$strip>;
170
+ declare const queryLogsOptionsSchema: z.ZodObject<{
171
+ sql: z.ZodString;
172
+ iso_timestamp_start: z.ZodOptional<z.ZodString>;
173
+ iso_timestamp_end: z.ZodOptional<z.ZodString>;
174
+ }, z.core.$strip>;
168
175
  declare const generateTypescriptTypesResultSchema: z.ZodObject<{
169
176
  types: z.ZodString;
170
177
  }, z.core.$strip>;
@@ -183,6 +190,7 @@ type Migration = z.infer<typeof migrationSchema>;
183
190
  type ListMigrationsResult = z.infer<typeof migrationSchema>;
184
191
  type LogsService = z.infer<typeof logsServiceSchema>;
185
192
  type GetLogsOptions = z.infer<typeof getLogsOptionsSchema>;
193
+ type QueryLogsOptions = z.infer<typeof queryLogsOptionsSchema>;
186
194
  type GenerateTypescriptTypesResult = z.infer<typeof generateTypescriptTypesResultSchema>;
187
195
  type StorageConfig = z.infer<typeof storageConfigSchema>;
188
196
  type StorageBucket = z.infer<typeof storageBucketSchema>;
@@ -209,8 +217,21 @@ type EdgeFunctionsOperations = {
209
217
  getEdgeFunction(projectId: string, functionSlug: string): Promise<EdgeFunctionWithBody>;
210
218
  deployEdgeFunction(projectId: string, options: DeployEdgeFunctionOptions): Promise<Omit<EdgeFunction, 'files'>>;
211
219
  };
220
+ /**
221
+ * SQL dialect that a platform's logs endpoint speaks. Selects the
222
+ * dialect-appropriate `query_logs` description and `sql` parameter hint so a
223
+ * single tool can roll out across environments that back logs with different
224
+ * engines (hosted ClickHouse vs. self-hosted/CLI BigQuery).
225
+ */
226
+ type LogsDialect = 'clickhouse' | 'bigquery';
212
227
  type DebuggingOperations = {
228
+ /**
229
+ * SQL dialect accepted by `queryLogs`. Defaults to `'clickhouse'` when unset,
230
+ * preserving the behavior of platforms that predate this field.
231
+ */
232
+ logsDialect?: LogsDialect;
213
233
  getLogs(projectId: string, options: GetLogsOptions): Promise<unknown>;
234
+ queryLogs?(projectId: string, options: QueryLogsOptions): Promise<unknown>;
214
235
  getSecurityAdvisors(projectId: string): Promise<unknown>;
215
236
  getPerformanceAdvisors(projectId: string): Promise<unknown>;
216
237
  };
@@ -256,4 +277,4 @@ type SupabasePlatform = {
256
277
  branching?: BranchingOperations;
257
278
  };
258
279
 
259
- export { type AccountOperations, type ApiKey, type ApiKeyType, type ApplyMigrationOptions, type Branch, type BranchingOperations, type CreateBranchOptions, type CreateProjectOptions, type DatabaseOperations, type DebuggingOperations, type DeployEdgeFunctionOptions, type DevelopmentOperations, type EdgeFunction, type EdgeFunctionWithBody, type EdgeFunctionsOperations, type ExecuteSqlOptions, type GenerateTypescriptTypesResult, type GetLogsOptions, type ListMigrationsResult, type LogsService, type Migration, type Organization, type Project, type ResetBranchOptions, type StorageBucket, type StorageConfig, type StorageOperations, type SuccessResponse, type SupabasePlatform, apiKeyTypeSchema, applyMigrationOptionsSchema, branchSchema, createBranchOptionsSchema, createProjectOptionsSchema, deployEdgeFunctionOptionsSchema, edgeFunctionSchema, edgeFunctionWithBodySchema, executeSqlOptionsSchema, generateTypescriptTypesResultSchema, getLogsOptionsSchema, logsServiceSchema, migrationSchema, organizationSchema, projectSchema, resetBranchOptionsSchema, storageBucketSchema, storageConfigSchema };
280
+ export { type AccountOperations, type ApiKey, type ApiKeyType, type ApplyMigrationOptions, type Branch, type BranchingOperations, type CreateBranchOptions, type CreateProjectOptions, type DatabaseOperations, type DebuggingOperations, type DeployEdgeFunctionOptions, type DevelopmentOperations, type EdgeFunction, type EdgeFunctionWithBody, type EdgeFunctionsOperations, type ExecuteSqlOptions, type GenerateTypescriptTypesResult, type GetLogsOptions, type ListMigrationsResult, type LogsDialect, type LogsService, type Migration, type Organization, type Project, type QueryLogsOptions, type ResetBranchOptions, type StorageBucket, type StorageConfig, type StorageOperations, type SuccessResponse, type SupabasePlatform, apiKeyTypeSchema, applyMigrationOptionsSchema, branchSchema, createBranchOptionsSchema, createProjectOptionsSchema, deployEdgeFunctionOptionsSchema, edgeFunctionSchema, edgeFunctionWithBodySchema, executeSqlOptionsSchema, generateTypescriptTypesResultSchema, getLogsOptionsSchema, logsServiceSchema, migrationSchema, organizationSchema, projectSchema, queryLogsOptionsSchema, resetBranchOptionsSchema, storageBucketSchema, storageConfigSchema };
@@ -148,6 +148,7 @@ declare const logsServiceSchema: z.ZodEnum<{
148
148
  "branch-action": "branch-action";
149
149
  postgres: "postgres";
150
150
  "edge-function": "edge-function";
151
+ "edge-function-runtime": "edge-function-runtime";
151
152
  auth: "auth";
152
153
  storage: "storage";
153
154
  realtime: "realtime";
@@ -158,6 +159,7 @@ declare const getLogsOptionsSchema: z.ZodObject<{
158
159
  "branch-action": "branch-action";
159
160
  postgres: "postgres";
160
161
  "edge-function": "edge-function";
162
+ "edge-function-runtime": "edge-function-runtime";
161
163
  auth: "auth";
162
164
  storage: "storage";
163
165
  realtime: "realtime";
@@ -165,6 +167,11 @@ declare const getLogsOptionsSchema: z.ZodObject<{
165
167
  iso_timestamp_start: z.ZodOptional<z.ZodString>;
166
168
  iso_timestamp_end: z.ZodOptional<z.ZodString>;
167
169
  }, z.core.$strip>;
170
+ declare const queryLogsOptionsSchema: z.ZodObject<{
171
+ sql: z.ZodString;
172
+ iso_timestamp_start: z.ZodOptional<z.ZodString>;
173
+ iso_timestamp_end: z.ZodOptional<z.ZodString>;
174
+ }, z.core.$strip>;
168
175
  declare const generateTypescriptTypesResultSchema: z.ZodObject<{
169
176
  types: z.ZodString;
170
177
  }, z.core.$strip>;
@@ -183,6 +190,7 @@ type Migration = z.infer<typeof migrationSchema>;
183
190
  type ListMigrationsResult = z.infer<typeof migrationSchema>;
184
191
  type LogsService = z.infer<typeof logsServiceSchema>;
185
192
  type GetLogsOptions = z.infer<typeof getLogsOptionsSchema>;
193
+ type QueryLogsOptions = z.infer<typeof queryLogsOptionsSchema>;
186
194
  type GenerateTypescriptTypesResult = z.infer<typeof generateTypescriptTypesResultSchema>;
187
195
  type StorageConfig = z.infer<typeof storageConfigSchema>;
188
196
  type StorageBucket = z.infer<typeof storageBucketSchema>;
@@ -209,8 +217,21 @@ type EdgeFunctionsOperations = {
209
217
  getEdgeFunction(projectId: string, functionSlug: string): Promise<EdgeFunctionWithBody>;
210
218
  deployEdgeFunction(projectId: string, options: DeployEdgeFunctionOptions): Promise<Omit<EdgeFunction, 'files'>>;
211
219
  };
220
+ /**
221
+ * SQL dialect that a platform's logs endpoint speaks. Selects the
222
+ * dialect-appropriate `query_logs` description and `sql` parameter hint so a
223
+ * single tool can roll out across environments that back logs with different
224
+ * engines (hosted ClickHouse vs. self-hosted/CLI BigQuery).
225
+ */
226
+ type LogsDialect = 'clickhouse' | 'bigquery';
212
227
  type DebuggingOperations = {
228
+ /**
229
+ * SQL dialect accepted by `queryLogs`. Defaults to `'clickhouse'` when unset,
230
+ * preserving the behavior of platforms that predate this field.
231
+ */
232
+ logsDialect?: LogsDialect;
213
233
  getLogs(projectId: string, options: GetLogsOptions): Promise<unknown>;
234
+ queryLogs?(projectId: string, options: QueryLogsOptions): Promise<unknown>;
214
235
  getSecurityAdvisors(projectId: string): Promise<unknown>;
215
236
  getPerformanceAdvisors(projectId: string): Promise<unknown>;
216
237
  };
@@ -256,4 +277,4 @@ type SupabasePlatform = {
256
277
  branching?: BranchingOperations;
257
278
  };
258
279
 
259
- export { type AccountOperations, type ApiKey, type ApiKeyType, type ApplyMigrationOptions, type Branch, type BranchingOperations, type CreateBranchOptions, type CreateProjectOptions, type DatabaseOperations, type DebuggingOperations, type DeployEdgeFunctionOptions, type DevelopmentOperations, type EdgeFunction, type EdgeFunctionWithBody, type EdgeFunctionsOperations, type ExecuteSqlOptions, type GenerateTypescriptTypesResult, type GetLogsOptions, type ListMigrationsResult, type LogsService, type Migration, type Organization, type Project, type ResetBranchOptions, type StorageBucket, type StorageConfig, type StorageOperations, type SuccessResponse, type SupabasePlatform, apiKeyTypeSchema, applyMigrationOptionsSchema, branchSchema, createBranchOptionsSchema, createProjectOptionsSchema, deployEdgeFunctionOptionsSchema, edgeFunctionSchema, edgeFunctionWithBodySchema, executeSqlOptionsSchema, generateTypescriptTypesResultSchema, getLogsOptionsSchema, logsServiceSchema, migrationSchema, organizationSchema, projectSchema, resetBranchOptionsSchema, storageBucketSchema, storageConfigSchema };
280
+ export { type AccountOperations, type ApiKey, type ApiKeyType, type ApplyMigrationOptions, type Branch, type BranchingOperations, type CreateBranchOptions, type CreateProjectOptions, type DatabaseOperations, type DebuggingOperations, type DeployEdgeFunctionOptions, type DevelopmentOperations, type EdgeFunction, type EdgeFunctionWithBody, type EdgeFunctionsOperations, type ExecuteSqlOptions, type GenerateTypescriptTypesResult, type GetLogsOptions, type ListMigrationsResult, type LogsDialect, type LogsService, type Migration, type Organization, type Project, type QueryLogsOptions, type ResetBranchOptions, type StorageBucket, type StorageConfig, type StorageOperations, type SuccessResponse, type SupabasePlatform, apiKeyTypeSchema, applyMigrationOptionsSchema, branchSchema, createBranchOptionsSchema, createProjectOptionsSchema, deployEdgeFunctionOptionsSchema, edgeFunctionSchema, edgeFunctionWithBodySchema, executeSqlOptionsSchema, generateTypescriptTypesResultSchema, getLogsOptionsSchema, logsServiceSchema, migrationSchema, organizationSchema, projectSchema, queryLogsOptionsSchema, resetBranchOptionsSchema, storageBucketSchema, storageConfigSchema };
@@ -1,2 +1,2 @@
1
- import"../chunk-LU6L7C36.js";import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r}from"../chunk-VCRYYVOD.js";export{r as apiKeyTypeSchema,m as applyMigrationOptionsSchema,e as branchSchema,i as createBranchOptionsSchema,h as createProjectOptionsSchema,k as deployEdgeFunctionOptionsSchema,f as edgeFunctionSchema,g as edgeFunctionWithBodySchema,l as executeSqlOptionsSchema,q as generateTypescriptTypesResultSchema,p as getLogsOptionsSchema,o as logsServiceSchema,n as migrationSchema,c as organizationSchema,d as projectSchema,j as resetBranchOptionsSchema,a as storageBucketSchema,b as storageConfigSchema};
1
+ import"../chunk-LU6L7C36.js";import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i,k as j,l as k,m as l,n as m,o as n,p as o,q as p,r as q,s as r,t as s}from"../chunk-Q7RZ5JID.js";export{s as apiKeyTypeSchema,m as applyMigrationOptionsSchema,e as branchSchema,i as createBranchOptionsSchema,h as createProjectOptionsSchema,k as deployEdgeFunctionOptionsSchema,f as edgeFunctionSchema,g as edgeFunctionWithBodySchema,l as executeSqlOptionsSchema,r as generateTypescriptTypesResultSchema,p as getLogsOptionsSchema,o as logsServiceSchema,n as migrationSchema,c as organizationSchema,d as projectSchema,q as queryLogsOptionsSchema,j as resetBranchOptionsSchema,a as storageBucketSchema,b as storageConfigSchema};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- "use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkTQFJHU7Icjs = require('../chunk-TQFJHU7I.cjs');var _chunkOHFANTSWcjs = require('../chunk-OHFANTSW.cjs');var _chunkA4DTKSWFcjs = require('../chunk-A4DTKSWF.cjs');require('../chunk-PHWSETKC.cjs');require('../chunk-QX2UXNCU.cjs');var _stdiojs = require('@modelcontextprotocol/sdk/server/stdio.js');var _util = require('util');function p(r,o=","){return r.split(o).map(e=>e.trim()).filter(e=>e!=="")}var{version:d}=_chunkA4DTKSWFcjs.a;async function g(){let{values:{["access-token"]:r,["project-ref"]:o,["read-only"]:t,["api-url"]:e,["version"]:l,["features"]:s}}=_util.parseArgs.call(void 0, {options:{"access-token":{type:"string"},"project-ref":{type:"string"},"read-only":{type:"boolean",default:!1},"api-url":{type:"string"},version:{type:"boolean"},features:{type:"string"}}});l&&(console.log(d),process.exit(0));let n=_nullishCoalesce(r, () => (process.env.SUPABASE_ACCESS_TOKEN));n||(console.error("Please provide a personal access token (PAT) with the --access-token flag or set the SUPABASE_ACCESS_TOKEN environment variable"),process.exit(1));let f=s?p(s):void 0,m=_chunkOHFANTSWcjs.a.call(void 0, {accessToken:n,apiUrl:e}),u=_chunkTQFJHU7Icjs.j.call(void 0, {platform:m,projectId:o,readOnly:t,features:f}),S=new _stdiojs.StdioServerTransport;await u.connect(S)}g().catch(console.error);
2
+ "use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkPBHMAKCKcjs = require('../chunk-PBHMAKCK.cjs');var _chunkI2RM7ZJCcjs = require('../chunk-I2RM7ZJC.cjs');var _chunkIULV3LELcjs = require('../chunk-IULV3LEL.cjs');require('../chunk-PHWSETKC.cjs');require('../chunk-TJWN2AAW.cjs');var _stdiojs = require('@modelcontextprotocol/sdk/server/stdio.js');var _util = require('util');function p(r,t=","){return r.split(t).map(e=>e.trim()).filter(e=>e!=="")}var{version:d}=_chunkIULV3LELcjs.a;async function E(){let{values:{["access-token"]:r,["project-ref"]:t,["read-only"]:o,["api-url"]:e,["content-api-url"]:l,["version"]:f,["features"]:s}}=_util.parseArgs.call(void 0, {options:{"access-token":{type:"string"},"project-ref":{type:"string"},"read-only":{type:"boolean",default:!1},"api-url":{type:"string"},"content-api-url":{type:"string"},version:{type:"boolean"},features:{type:"string"}}});f&&(console.log(d),process.exit(0));let n=_nullishCoalesce(r, () => (process.env.SUPABASE_ACCESS_TOKEN));n||(console.error("Please provide a personal access token (PAT) with the --access-token flag or set the SUPABASE_ACCESS_TOKEN environment variable"),process.exit(1));let m=s?p(s):void 0,u=_nullishCoalesce(l, () => (process.env.SUPABASE_CONTENT_API_URL)),A=_chunkI2RM7ZJCcjs.a.call(void 0, {accessToken:n,apiUrl:e}),S=_chunkPBHMAKCKcjs.d.call(void 0, {platform:A,projectId:t,readOnly:o,features:m,contentApiUrl:u}),v=new _stdiojs.StdioServerTransport;await S.connect(v)}E().catch(console.error);
3
3
  //# sourceMappingURL=stdio.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/transports/stdio.cjs","../../src/transports/stdio.ts","../../src/transports/util.ts"],"names":["parseList","list","delimiter","feature","version","package_default","main","cliAccessToken","projectId","readOnly","apiUrl","showVersion","cliFeatures","parseArgs","accessToken","features","platform","createSupabaseApiPlatform","server","createSupabaseMcpServer","transport","StdioServerTransport"],"mappings":"AAAA;AACA,0KAAyC,yDAA0C,yDAAqC,iCAA8B,iCAA8B,oECC/I,4BACX,SCGVA,CAAAA,CAAUC,CAAAA,CAAcC,CAAAA,CAAY,GAAA,CAAe,CAEjE,OADcD,CAAAA,CAAK,KAAA,CAAMC,CAAS,CAAA,CAAE,GAAA,CAAKC,CAAAA,EAAYA,CAAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CACtD,MAAA,CAAQA,CAAAA,EAAYA,CAAAA,GAAY,EAAE,CACjD,CDAA,GAAM,CAAE,OAAA,CAAAC,CAAQ,CAAA,CAAIC,mBAAAA,CAEpB,MAAA,SAAeC,CAAAA,CAAAA,CAAO,CACpB,GAAM,CACJ,MAAA,CAAQ,CACN,CAAC,cAAc,CAAA,CAAGC,CAAAA,CAClB,CAAC,aAAa,CAAA,CAAGC,CAAAA,CACjB,CAAC,WAAW,CAAA,CAAGC,CAAAA,CACf,CAAC,SAAS,CAAA,CAAGC,CAAAA,CACb,CAAC,SAAS,CAAA,CAAGC,CAAAA,CACb,CAAC,UAAU,CAAA,CAAGC,CAChB,CACF,CAAA,CAAIC,6BAAAA,CACF,OAAA,CAAS,CACN,cAAA,CAAiB,CAChB,IAAA,CAAM,QACR,CAAA,CACC,aAAA,CAAgB,CACf,IAAA,CAAM,QACR,CAAA,CACC,WAAA,CAAc,CACb,IAAA,CAAM,SAAA,CACN,OAAA,CAAS,CAAA,CACX,CAAA,CACC,SAAA,CAAY,CACX,IAAA,CAAM,QACR,CAAA,CACC,OAAA,CAAY,CACX,IAAA,CAAM,SACR,CAAA,CACC,QAAA,CAAa,CACZ,IAAA,CAAM,QACR,CACF,CACF,CAAC,CAAA,CAEGF,CAAAA,EAAAA,CACF,OAAA,CAAQ,GAAA,CAAIP,CAAO,CAAA,CACnB,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGhB,IAAMU,CAAAA,kBAAcP,CAAAA,SAAkB,OAAA,CAAQ,GAAA,CAAI,uBAAA,CAE7CO,CAAAA,EAAAA,CACH,OAAA,CAAQ,KAAA,CACN,iIACF,CAAA,CACA,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGhB,IAAMC,CAAAA,CAAWH,CAAAA,CAAcZ,CAAAA,CAAUY,CAAW,CAAA,CAAI,KAAA,CAAA,CAElDI,CAAAA,CAAWC,iCAAAA,CACf,WAAA,CAAAH,CAAAA,CACA,MAAA,CAAAJ,CACF,CAAC,CAAA,CAEKQ,CAAAA,CAASC,iCAAAA,CACb,QAAA,CAAAH,CAAAA,CACA,SAAA,CAAAR,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,QAAA,CAAAM,CACF,CAAC,CAAA,CAEKK,CAAAA,CAAY,IAAIC,6BAAAA,CAEtB,MAAMH,CAAAA,CAAO,OAAA,CAAQE,CAAS,CAChC,CAEAd,CAAAA,CAAK,CAAA,CAAE,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA","file":"/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/transports/stdio.cjs","sourcesContent":[null,"#!/usr/bin/env node\n\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { parseArgs } from 'node:util';\nimport packageJson from '../../package.json' with { type: 'json' };\nimport { createSupabaseApiPlatform } from '../platform/api-platform.js';\nimport { createSupabaseMcpServer } from '../server.js';\nimport { parseList } from './util.js';\n\nconst { version } = packageJson;\n\nasync function main() {\n const {\n values: {\n ['access-token']: cliAccessToken,\n ['project-ref']: projectId,\n ['read-only']: readOnly,\n ['api-url']: apiUrl,\n ['version']: showVersion,\n ['features']: cliFeatures,\n },\n } = parseArgs({\n options: {\n ['access-token']: {\n type: 'string',\n },\n ['project-ref']: {\n type: 'string',\n },\n ['read-only']: {\n type: 'boolean',\n default: false,\n },\n ['api-url']: {\n type: 'string',\n },\n ['version']: {\n type: 'boolean',\n },\n ['features']: {\n type: 'string',\n },\n },\n });\n\n if (showVersion) {\n console.log(version);\n process.exit(0);\n }\n\n const accessToken = cliAccessToken ?? process.env.SUPABASE_ACCESS_TOKEN;\n\n if (!accessToken) {\n console.error(\n 'Please provide a personal access token (PAT) with the --access-token flag or set the SUPABASE_ACCESS_TOKEN environment variable'\n );\n process.exit(1);\n }\n\n const features = cliFeatures ? parseList(cliFeatures) : undefined;\n\n const platform = createSupabaseApiPlatform({\n accessToken,\n apiUrl,\n });\n\n const server = createSupabaseMcpServer({\n platform,\n projectId,\n readOnly,\n features,\n });\n\n const transport = new StdioServerTransport();\n\n await server.connect(transport);\n}\n\nmain().catch(console.error);\n","/**\n * Parses a delimited list of items into an array,\n * trimming whitespace and filtering out empty items.\n *\n * Default delimiter is a comma (`,`).\n */\nexport function parseList(list: string, delimiter = ','): string[] {\n const items = list.split(delimiter).map((feature) => feature.trim());\n return items.filter((feature) => feature !== '');\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/transports/stdio.cjs","../../src/transports/stdio.ts","../../src/transports/util.ts"],"names":["parseList","list","delimiter","feature","version","package_default","main","cliAccessToken","projectId","readOnly","apiUrl","cliContentApiUrl","showVersion","cliFeatures","parseArgs","accessToken","features","contentApiUrl","platform","createSupabaseApiPlatform","server","createSupabaseMcpServer","transport","StdioServerTransport"],"mappings":"AAAA;AACA,0KAAyC,yDAA0C,yDAA0C,iCAA8B,iCAA8B,oECCpJ,4BACX,SCGVA,CAAAA,CAAUC,CAAAA,CAAcC,CAAAA,CAAY,GAAA,CAAe,CAEjE,OADcD,CAAAA,CAAK,KAAA,CAAMC,CAAS,CAAA,CAAE,GAAA,CAAKC,CAAAA,EAAYA,CAAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CACtD,MAAA,CAAQA,CAAAA,EAAYA,CAAAA,GAAY,EAAE,CACjD,CDAA,GAAM,CAAE,OAAA,CAAAC,CAAQ,CAAA,CAAIC,mBAAAA,CAEpB,MAAA,SAAeC,CAAAA,CAAAA,CAAO,CACpB,GAAM,CACJ,MAAA,CAAQ,CACN,CAAC,cAAc,CAAA,CAAGC,CAAAA,CAClB,CAAC,aAAa,CAAA,CAAGC,CAAAA,CACjB,CAAC,WAAW,CAAA,CAAGC,CAAAA,CACf,CAAC,SAAS,CAAA,CAAGC,CAAAA,CACb,CAAC,iBAAiB,CAAA,CAAGC,CAAAA,CACrB,CAAC,SAAS,CAAA,CAAGC,CAAAA,CACb,CAAC,UAAU,CAAA,CAAGC,CAChB,CACF,CAAA,CAAIC,6BAAAA,CACF,OAAA,CAAS,CACN,cAAA,CAAiB,CAChB,IAAA,CAAM,QACR,CAAA,CACC,aAAA,CAAgB,CACf,IAAA,CAAM,QACR,CAAA,CACC,WAAA,CAAc,CACb,IAAA,CAAM,SAAA,CACN,OAAA,CAAS,CAAA,CACX,CAAA,CACC,SAAA,CAAY,CACX,IAAA,CAAM,QACR,CAAA,CACC,iBAAA,CAAoB,CACnB,IAAA,CAAM,QACR,CAAA,CACC,OAAA,CAAY,CACX,IAAA,CAAM,SACR,CAAA,CACC,QAAA,CAAa,CACZ,IAAA,CAAM,QACR,CACF,CACF,CAAC,CAAA,CAEGF,CAAAA,EAAAA,CACF,OAAA,CAAQ,GAAA,CAAIR,CAAO,CAAA,CACnB,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGhB,IAAMW,CAAAA,kBAAcR,CAAAA,SAAkB,OAAA,CAAQ,GAAA,CAAI,uBAAA,CAE7CQ,CAAAA,EAAAA,CACH,OAAA,CAAQ,KAAA,CACN,iIACF,CAAA,CACA,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGhB,IAAMC,CAAAA,CAAWH,CAAAA,CAAcb,CAAAA,CAAUa,CAAW,CAAA,CAAI,KAAA,CAAA,CAElDI,CAAAA,kBACJN,CAAAA,SAAoB,OAAA,CAAQ,GAAA,CAAI,0BAAA,CAE5BO,CAAAA,CAAWC,iCAAAA,CACf,WAAA,CAAAJ,CAAAA,CACA,MAAA,CAAAL,CACF,CAAC,CAAA,CAEKU,CAAAA,CAASC,iCAAAA,CACb,QAAA,CAAAH,CAAAA,CACA,SAAA,CAAAV,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,QAAA,CAAAO,CAAAA,CACA,aAAA,CAAAC,CACF,CAAC,CAAA,CAEKK,CAAAA,CAAY,IAAIC,6BAAAA,CAEtB,MAAMH,CAAAA,CAAO,OAAA,CAAQE,CAAS,CAChC,CAEAhB,CAAAA,CAAK,CAAA,CAAE,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA","file":"/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/transports/stdio.cjs","sourcesContent":[null,"#!/usr/bin/env node\n\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { parseArgs } from 'node:util';\nimport packageJson from '../../package.json' with { type: 'json' };\nimport { createSupabaseApiPlatform } from '../platform/api-platform.js';\nimport { createSupabaseMcpServer } from '../server.js';\nimport { parseList } from './util.js';\n\nconst { version } = packageJson;\n\nasync function main() {\n const {\n values: {\n ['access-token']: cliAccessToken,\n ['project-ref']: projectId,\n ['read-only']: readOnly,\n ['api-url']: apiUrl,\n ['content-api-url']: cliContentApiUrl,\n ['version']: showVersion,\n ['features']: cliFeatures,\n },\n } = parseArgs({\n options: {\n ['access-token']: {\n type: 'string',\n },\n ['project-ref']: {\n type: 'string',\n },\n ['read-only']: {\n type: 'boolean',\n default: false,\n },\n ['api-url']: {\n type: 'string',\n },\n ['content-api-url']: {\n type: 'string',\n },\n ['version']: {\n type: 'boolean',\n },\n ['features']: {\n type: 'string',\n },\n },\n });\n\n if (showVersion) {\n console.log(version);\n process.exit(0);\n }\n\n const accessToken = cliAccessToken ?? process.env.SUPABASE_ACCESS_TOKEN;\n\n if (!accessToken) {\n console.error(\n 'Please provide a personal access token (PAT) with the --access-token flag or set the SUPABASE_ACCESS_TOKEN environment variable'\n );\n process.exit(1);\n }\n\n const features = cliFeatures ? parseList(cliFeatures) : undefined;\n\n const contentApiUrl =\n cliContentApiUrl ?? process.env.SUPABASE_CONTENT_API_URL;\n\n const platform = createSupabaseApiPlatform({\n accessToken,\n apiUrl,\n });\n\n const server = createSupabaseMcpServer({\n platform,\n projectId,\n readOnly,\n features,\n contentApiUrl,\n });\n\n const transport = new StdioServerTransport();\n\n await server.connect(transport);\n}\n\nmain().catch(console.error);\n","/**\n * Parses a delimited list of items into an array,\n * trimming whitespace and filtering out empty items.\n *\n * Default delimiter is a comma (`,`).\n */\nexport function parseList(list: string, delimiter = ','): string[] {\n const items = list.split(delimiter).map((feature) => feature.trim());\n return items.filter((feature) => feature !== '');\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{j as i}from"../chunk-O4HFTWAB.js";import{a as c}from"../chunk-KFIVWONT.js";import{a}from"../chunk-M64H72M6.js";import"../chunk-LU6L7C36.js";import"../chunk-VCRYYVOD.js";import{StdioServerTransport as v}from"@modelcontextprotocol/sdk/server/stdio.js";import{parseArgs as y}from"util";function p(r,o=","){return r.split(o).map(e=>e.trim()).filter(e=>e!=="")}var{version:d}=a;async function g(){let{values:{["access-token"]:r,["project-ref"]:o,["read-only"]:t,["api-url"]:e,["version"]:l,["features"]:s}}=y({options:{"access-token":{type:"string"},"project-ref":{type:"string"},"read-only":{type:"boolean",default:!1},"api-url":{type:"string"},version:{type:"boolean"},features:{type:"string"}}});l&&(console.log(d),process.exit(0));let n=r??process.env.SUPABASE_ACCESS_TOKEN;n||(console.error("Please provide a personal access token (PAT) with the --access-token flag or set the SUPABASE_ACCESS_TOKEN environment variable"),process.exit(1));let f=s?p(s):void 0,m=c({accessToken:n,apiUrl:e}),u=i({platform:m,projectId:o,readOnly:t,features:f}),S=new v;await u.connect(S)}g().catch(console.error);
2
+ import{d as a}from"../chunk-HJRGMYTR.js";import{a as c}from"../chunk-6AQ27XVO.js";import{a as i}from"../chunk-GBJJYLS2.js";import"../chunk-LU6L7C36.js";import"../chunk-Q7RZ5JID.js";import{StdioServerTransport as y}from"@modelcontextprotocol/sdk/server/stdio.js";import{parseArgs as g}from"util";function p(r,t=","){return r.split(t).map(e=>e.trim()).filter(e=>e!=="")}var{version:d}=i;async function E(){let{values:{["access-token"]:r,["project-ref"]:t,["read-only"]:o,["api-url"]:e,["content-api-url"]:l,["version"]:f,["features"]:s}}=g({options:{"access-token":{type:"string"},"project-ref":{type:"string"},"read-only":{type:"boolean",default:!1},"api-url":{type:"string"},"content-api-url":{type:"string"},version:{type:"boolean"},features:{type:"string"}}});f&&(console.log(d),process.exit(0));let n=r??process.env.SUPABASE_ACCESS_TOKEN;n||(console.error("Please provide a personal access token (PAT) with the --access-token flag or set the SUPABASE_ACCESS_TOKEN environment variable"),process.exit(1));let m=s?p(s):void 0,u=l??process.env.SUPABASE_CONTENT_API_URL,A=c({accessToken:n,apiUrl:e}),S=a({platform:A,projectId:t,readOnly:o,features:m,contentApiUrl:u}),v=new y;await S.connect(v)}E().catch(console.error);
3
3
  //# sourceMappingURL=stdio.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/transports/stdio.ts","../../src/transports/util.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { parseArgs } from 'node:util';\nimport packageJson from '../../package.json' with { type: 'json' };\nimport { createSupabaseApiPlatform } from '../platform/api-platform.js';\nimport { createSupabaseMcpServer } from '../server.js';\nimport { parseList } from './util.js';\n\nconst { version } = packageJson;\n\nasync function main() {\n const {\n values: {\n ['access-token']: cliAccessToken,\n ['project-ref']: projectId,\n ['read-only']: readOnly,\n ['api-url']: apiUrl,\n ['version']: showVersion,\n ['features']: cliFeatures,\n },\n } = parseArgs({\n options: {\n ['access-token']: {\n type: 'string',\n },\n ['project-ref']: {\n type: 'string',\n },\n ['read-only']: {\n type: 'boolean',\n default: false,\n },\n ['api-url']: {\n type: 'string',\n },\n ['version']: {\n type: 'boolean',\n },\n ['features']: {\n type: 'string',\n },\n },\n });\n\n if (showVersion) {\n console.log(version);\n process.exit(0);\n }\n\n const accessToken = cliAccessToken ?? process.env.SUPABASE_ACCESS_TOKEN;\n\n if (!accessToken) {\n console.error(\n 'Please provide a personal access token (PAT) with the --access-token flag or set the SUPABASE_ACCESS_TOKEN environment variable'\n );\n process.exit(1);\n }\n\n const features = cliFeatures ? parseList(cliFeatures) : undefined;\n\n const platform = createSupabaseApiPlatform({\n accessToken,\n apiUrl,\n });\n\n const server = createSupabaseMcpServer({\n platform,\n projectId,\n readOnly,\n features,\n });\n\n const transport = new StdioServerTransport();\n\n await server.connect(transport);\n}\n\nmain().catch(console.error);\n","/**\n * Parses a delimited list of items into an array,\n * trimming whitespace and filtering out empty items.\n *\n * Default delimiter is a comma (`,`).\n */\nexport function parseList(list: string, delimiter = ','): string[] {\n const items = list.split(delimiter).map((feature) => feature.trim());\n return items.filter((feature) => feature !== '');\n}\n"],"mappings":";gLAEA,OAAS,wBAAAA,MAA4B,4CACrC,OAAS,aAAAC,MAAiB,OCGnB,SAASC,EAAUC,EAAcC,EAAY,IAAe,CAEjE,OADcD,EAAK,MAAMC,CAAS,EAAE,IAAKC,GAAYA,EAAQ,KAAK,CAAC,EACtD,OAAQA,GAAYA,IAAY,EAAE,CACjD,CDAA,GAAM,CAAE,QAAAC,CAAQ,EAAIC,EAEpB,eAAeC,GAAO,CACpB,GAAM,CACJ,OAAQ,CACN,CAAC,cAAc,EAAGC,EAClB,CAAC,aAAa,EAAGC,EACjB,CAAC,WAAW,EAAGC,EACf,CAAC,SAAS,EAAGC,EACb,CAAC,SAAS,EAAGC,EACb,CAAC,UAAU,EAAGC,CAChB,CACF,EAAIC,EAAU,CACZ,QAAS,CACN,eAAiB,CAChB,KAAM,QACR,EACC,cAAgB,CACf,KAAM,QACR,EACC,YAAc,CACb,KAAM,UACN,QAAS,EACX,EACC,UAAY,CACX,KAAM,QACR,EACC,QAAY,CACX,KAAM,SACR,EACC,SAAa,CACZ,KAAM,QACR,CACF,CACF,CAAC,EAEGF,IACF,QAAQ,IAAIP,CAAO,EACnB,QAAQ,KAAK,CAAC,GAGhB,IAAMU,EAAcP,GAAkB,QAAQ,IAAI,sBAE7CO,IACH,QAAQ,MACN,iIACF,EACA,QAAQ,KAAK,CAAC,GAGhB,IAAMC,EAAWH,EAAcI,EAAUJ,CAAW,EAAI,OAElDK,EAAWC,EAA0B,CACzC,YAAAJ,EACA,OAAAJ,CACF,CAAC,EAEKS,EAASC,EAAwB,CACrC,SAAAH,EACA,UAAAT,EACA,SAAAC,EACA,SAAAM,CACF,CAAC,EAEKM,EAAY,IAAIC,EAEtB,MAAMH,EAAO,QAAQE,CAAS,CAChC,CAEAf,EAAK,EAAE,MAAM,QAAQ,KAAK","names":["StdioServerTransport","parseArgs","parseList","list","delimiter","feature","version","package_default","main","cliAccessToken","projectId","readOnly","apiUrl","showVersion","cliFeatures","parseArgs","accessToken","features","parseList","platform","createSupabaseApiPlatform","server","createSupabaseMcpServer","transport","StdioServerTransport"]}
1
+ {"version":3,"sources":["../../src/transports/stdio.ts","../../src/transports/util.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { parseArgs } from 'node:util';\nimport packageJson from '../../package.json' with { type: 'json' };\nimport { createSupabaseApiPlatform } from '../platform/api-platform.js';\nimport { createSupabaseMcpServer } from '../server.js';\nimport { parseList } from './util.js';\n\nconst { version } = packageJson;\n\nasync function main() {\n const {\n values: {\n ['access-token']: cliAccessToken,\n ['project-ref']: projectId,\n ['read-only']: readOnly,\n ['api-url']: apiUrl,\n ['content-api-url']: cliContentApiUrl,\n ['version']: showVersion,\n ['features']: cliFeatures,\n },\n } = parseArgs({\n options: {\n ['access-token']: {\n type: 'string',\n },\n ['project-ref']: {\n type: 'string',\n },\n ['read-only']: {\n type: 'boolean',\n default: false,\n },\n ['api-url']: {\n type: 'string',\n },\n ['content-api-url']: {\n type: 'string',\n },\n ['version']: {\n type: 'boolean',\n },\n ['features']: {\n type: 'string',\n },\n },\n });\n\n if (showVersion) {\n console.log(version);\n process.exit(0);\n }\n\n const accessToken = cliAccessToken ?? process.env.SUPABASE_ACCESS_TOKEN;\n\n if (!accessToken) {\n console.error(\n 'Please provide a personal access token (PAT) with the --access-token flag or set the SUPABASE_ACCESS_TOKEN environment variable'\n );\n process.exit(1);\n }\n\n const features = cliFeatures ? parseList(cliFeatures) : undefined;\n\n const contentApiUrl =\n cliContentApiUrl ?? process.env.SUPABASE_CONTENT_API_URL;\n\n const platform = createSupabaseApiPlatform({\n accessToken,\n apiUrl,\n });\n\n const server = createSupabaseMcpServer({\n platform,\n projectId,\n readOnly,\n features,\n contentApiUrl,\n });\n\n const transport = new StdioServerTransport();\n\n await server.connect(transport);\n}\n\nmain().catch(console.error);\n","/**\n * Parses a delimited list of items into an array,\n * trimming whitespace and filtering out empty items.\n *\n * Default delimiter is a comma (`,`).\n */\nexport function parseList(list: string, delimiter = ','): string[] {\n const items = list.split(delimiter).map((feature) => feature.trim());\n return items.filter((feature) => feature !== '');\n}\n"],"mappings":";qLAEA,OAAS,wBAAAA,MAA4B,4CACrC,OAAS,aAAAC,MAAiB,OCGnB,SAASC,EAAUC,EAAcC,EAAY,IAAe,CAEjE,OADcD,EAAK,MAAMC,CAAS,EAAE,IAAKC,GAAYA,EAAQ,KAAK,CAAC,EACtD,OAAQA,GAAYA,IAAY,EAAE,CACjD,CDAA,GAAM,CAAE,QAAAC,CAAQ,EAAIC,EAEpB,eAAeC,GAAO,CACpB,GAAM,CACJ,OAAQ,CACN,CAAC,cAAc,EAAGC,EAClB,CAAC,aAAa,EAAGC,EACjB,CAAC,WAAW,EAAGC,EACf,CAAC,SAAS,EAAGC,EACb,CAAC,iBAAiB,EAAGC,EACrB,CAAC,SAAS,EAAGC,EACb,CAAC,UAAU,EAAGC,CAChB,CACF,EAAIC,EAAU,CACZ,QAAS,CACN,eAAiB,CAChB,KAAM,QACR,EACC,cAAgB,CACf,KAAM,QACR,EACC,YAAc,CACb,KAAM,UACN,QAAS,EACX,EACC,UAAY,CACX,KAAM,QACR,EACC,kBAAoB,CACnB,KAAM,QACR,EACC,QAAY,CACX,KAAM,SACR,EACC,SAAa,CACZ,KAAM,QACR,CACF,CACF,CAAC,EAEGF,IACF,QAAQ,IAAIR,CAAO,EACnB,QAAQ,KAAK,CAAC,GAGhB,IAAMW,EAAcR,GAAkB,QAAQ,IAAI,sBAE7CQ,IACH,QAAQ,MACN,iIACF,EACA,QAAQ,KAAK,CAAC,GAGhB,IAAMC,EAAWH,EAAcI,EAAUJ,CAAW,EAAI,OAElDK,EACJP,GAAoB,QAAQ,IAAI,yBAE5BQ,EAAWC,EAA0B,CACzC,YAAAL,EACA,OAAAL,CACF,CAAC,EAEKW,EAASC,EAAwB,CACrC,SAAAH,EACA,UAAAX,EACA,SAAAC,EACA,SAAAO,EACA,cAAAE,CACF,CAAC,EAEKK,EAAY,IAAIC,EAEtB,MAAMH,EAAO,QAAQE,CAAS,CAChC,CAEAjB,EAAK,EAAE,MAAM,QAAQ,KAAK","names":["StdioServerTransport","parseArgs","parseList","list","delimiter","feature","version","package_default","main","cliAccessToken","projectId","readOnly","apiUrl","cliContentApiUrl","showVersion","cliFeatures","parseArgs","accessToken","features","parseList","contentApiUrl","platform","createSupabaseApiPlatform","server","createSupabaseMcpServer","transport","StdioServerTransport"]}