@supabase/mcp-server-supabase 0.9.0 → 0.11.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-54OF3SOV.js +17 -0
  2. package/dist/chunk-54OF3SOV.js.map +1 -0
  3. package/dist/chunk-A547ZGK6.cjs +17 -0
  4. package/dist/chunk-A547ZGK6.cjs.map +1 -0
  5. package/dist/chunk-B4JQTSBD.js +50 -0
  6. package/dist/chunk-B4JQTSBD.js.map +1 -0
  7. package/dist/chunk-LVRTD44F.js +259 -0
  8. package/dist/chunk-LVRTD44F.js.map +1 -0
  9. package/dist/{chunk-SAN25LFN.js → chunk-Q7RZ5JID.js} +2 -2
  10. package/dist/chunk-Q7RZ5JID.js.map +1 -0
  11. package/dist/chunk-R42L3CIR.cjs +50 -0
  12. package/dist/chunk-R42L3CIR.cjs.map +1 -0
  13. package/dist/{chunk-AOBG3KWE.cjs → chunk-TJWN2AAW.cjs} +2 -2
  14. package/dist/chunk-TJWN2AAW.cjs.map +1 -0
  15. package/dist/chunk-YOFEI5MG.cjs +259 -0
  16. package/dist/chunk-YOFEI5MG.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 +89 -45
  20. package/dist/index.d.ts +89 -45
  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 +20 -1
  28. package/dist/platform/index.d.ts +20 -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 +6 -5
  35. package/dist/chunk-5ZLDWHAI.js +0 -50
  36. package/dist/chunk-5ZLDWHAI.js.map +0 -1
  37. package/dist/chunk-625WW4FW.js +0 -17
  38. package/dist/chunk-625WW4FW.js.map +0 -1
  39. package/dist/chunk-AOBG3KWE.cjs.map +0 -1
  40. package/dist/chunk-DUTV6OKU.cjs +0 -17
  41. package/dist/chunk-DUTV6OKU.cjs.map +0 -1
  42. package/dist/chunk-JBXRGAGL.cjs +0 -50
  43. package/dist/chunk-JBXRGAGL.cjs.map +0 -1
  44. package/dist/chunk-M3HYJBQV.cjs +0 -258
  45. package/dist/chunk-M3HYJBQV.cjs.map +0 -1
  46. package/dist/chunk-QUNIPP3Q.js +0 -258
  47. package/dist/chunk-QUNIPP3Q.js.map +0 -1
  48. package/dist/chunk-SAN25LFN.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ToolCallCallback } from '@supabase/mcp-utils';
2
2
  export { ToolCallCallback } from '@supabase/mcp-utils';
3
3
  import { SupabasePlatform } from './platform/index.js';
4
- import * as _modelcontextprotocol_sdk_server from '@modelcontextprotocol/sdk/server';
4
+ import * as _modelcontextprotocol_server from '@modelcontextprotocol/server';
5
5
  import { z } from 'zod/v4';
6
6
 
7
7
  declare const CURRENT_FEATURE_GROUPS: readonly ["docs", "account", "database", "debugging", "development", "functions", "branching", "storage"];
@@ -52,40 +52,9 @@ type SupabaseMcpServerOptions = {
52
52
  /**
53
53
  * Creates an MCP server for interacting with Supabase.
54
54
  */
55
- declare function createSupabaseMcpServer(options: SupabaseMcpServerOptions): _modelcontextprotocol_sdk_server.Server<{
56
- method: string;
57
- params?: {
58
- [x: string]: unknown;
59
- _meta?: {
60
- [x: string]: unknown;
61
- progressToken?: string | number | undefined;
62
- "io.modelcontextprotocol/related-task"?: {
63
- taskId: string;
64
- } | undefined;
65
- } | undefined;
66
- } | undefined;
67
- }, {
68
- method: string;
69
- params?: {
70
- [x: string]: unknown;
71
- _meta?: {
72
- [x: string]: unknown;
73
- progressToken?: string | number | undefined;
74
- "io.modelcontextprotocol/related-task"?: {
75
- taskId: string;
76
- } | undefined;
77
- } | undefined;
78
- } | undefined;
79
- }, {
80
- [x: string]: unknown;
81
- _meta?: {
82
- [x: string]: unknown;
83
- progressToken?: string | number | undefined;
84
- "io.modelcontextprotocol/related-task"?: {
85
- taskId: string;
86
- } | undefined;
87
- } | undefined;
88
- }>;
55
+ declare function createSupabaseMcpServer(options: SupabaseMcpServerOptions): _modelcontextprotocol_server.Server;
56
+
57
+ declare function createSupabaseMcpHandler(options: SupabaseMcpServerOptions): _modelcontextprotocol_server.McpHttpHandler;
89
58
 
90
59
  declare const accountToolDefs: {
91
60
  readonly list_organizations: {
@@ -469,8 +438,10 @@ declare const databaseToolDefs: {
469
438
  primary_keys: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
470
439
  foreign_key_constraints: z.ZodOptional<z.ZodArray<z.ZodObject<{
471
440
  name: z.ZodString;
472
- source: z.ZodString;
473
- target: z.ZodString;
441
+ source_table: z.ZodString;
442
+ source_columns: z.ZodArray<z.ZodString>;
443
+ target_table: z.ZodString;
444
+ target_columns: z.ZodArray<z.ZodString>;
474
445
  }, z.core.$strip>>>;
475
446
  }, z.core.$strip>>;
476
447
  advisory: z.ZodOptional<z.ZodObject<{
@@ -576,7 +547,7 @@ declare const databaseToolDefs: {
576
547
 
577
548
  declare const debuggingToolDefs: {
578
549
  readonly get_logs: {
579
- readonly description: "Gets logs for a Supabase project by service type. Each call returns logs from the last 24 hours by default. Provide a custom iso_timestamp_start/iso_timestamp_end window 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.";
550
+ 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
551
  readonly parameters: z.ZodObject<{
581
552
  project_id: z.ZodString;
582
553
  service: z.ZodEnum<{
@@ -589,8 +560,8 @@ declare const debuggingToolDefs: {
589
560
  storage: "storage";
590
561
  realtime: "realtime";
591
562
  }>;
592
- iso_timestamp_start: z.ZodOptional<z.ZodString>;
593
- iso_timestamp_end: z.ZodOptional<z.ZodString>;
563
+ iso_timestamp_start: z.ZodOptional<z.ZodISODateTime>;
564
+ iso_timestamp_end: z.ZodOptional<z.ZodISODateTime>;
594
565
  }, z.core.$strip>;
595
566
  readonly outputSchema: z.ZodObject<{
596
567
  result: z.ZodUnknown;
@@ -603,6 +574,25 @@ declare const debuggingToolDefs: {
603
574
  readonly openWorldHint: false;
604
575
  };
605
576
  };
577
+ readonly query_logs: {
578
+ readonly description: string;
579
+ readonly parameters: z.ZodObject<{
580
+ project_id: z.ZodString;
581
+ sql: z.ZodString;
582
+ iso_timestamp_start: z.ZodOptional<z.ZodISODateTime>;
583
+ iso_timestamp_end: z.ZodOptional<z.ZodISODateTime>;
584
+ }, z.core.$strip>;
585
+ readonly outputSchema: z.ZodObject<{
586
+ result: z.ZodUnknown;
587
+ }, z.core.$strip>;
588
+ readonly annotations: {
589
+ readonly title: "Query project logs";
590
+ readonly readOnlyHint: true;
591
+ readonly destructiveHint: false;
592
+ readonly idempotentHint: true;
593
+ readonly openWorldHint: false;
594
+ };
595
+ };
606
596
  readonly get_advisors: {
607
597
  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.";
608
598
  readonly parameters: z.ZodObject<{
@@ -918,6 +908,7 @@ declare const supabaseMcpToolSchemas: {
918
908
  readonly openWorldHint: false;
919
909
  };
920
910
  readOnlyBehavior: undefined;
911
+ hidden: undefined;
921
912
  };
922
913
  get_storage_config: {
923
914
  inputSchema: z.ZodObject<{
@@ -942,6 +933,7 @@ declare const supabaseMcpToolSchemas: {
942
933
  readonly openWorldHint: false;
943
934
  };
944
935
  readOnlyBehavior: undefined;
936
+ hidden: undefined;
945
937
  };
946
938
  update_storage_config: {
947
939
  inputSchema: z.ZodObject<{
@@ -969,6 +961,7 @@ declare const supabaseMcpToolSchemas: {
969
961
  readonly openWorldHint: false;
970
962
  };
971
963
  readOnlyBehavior: undefined;
964
+ hidden: undefined;
972
965
  };
973
966
  list_edge_functions: {
974
967
  inputSchema: z.ZodObject<{
@@ -997,6 +990,7 @@ declare const supabaseMcpToolSchemas: {
997
990
  readonly openWorldHint: false;
998
991
  };
999
992
  readOnlyBehavior: undefined;
993
+ hidden: undefined;
1000
994
  };
1001
995
  get_edge_function: {
1002
996
  inputSchema: z.ZodObject<{
@@ -1028,6 +1022,7 @@ declare const supabaseMcpToolSchemas: {
1028
1022
  readonly openWorldHint: false;
1029
1023
  };
1030
1024
  readOnlyBehavior: undefined;
1025
+ hidden: undefined;
1031
1026
  };
1032
1027
  deploy_edge_function: {
1033
1028
  inputSchema: z.ZodObject<{
@@ -1062,6 +1057,7 @@ declare const supabaseMcpToolSchemas: {
1062
1057
  readonly openWorldHint: false;
1063
1058
  };
1064
1059
  readOnlyBehavior: undefined;
1060
+ hidden: undefined;
1065
1061
  };
1066
1062
  search_docs: {
1067
1063
  inputSchema: z.ZodObject<{
@@ -1078,6 +1074,7 @@ declare const supabaseMcpToolSchemas: {
1078
1074
  readonly openWorldHint: false;
1079
1075
  };
1080
1076
  readOnlyBehavior: undefined;
1077
+ hidden: undefined;
1081
1078
  };
1082
1079
  get_project_url: {
1083
1080
  inputSchema: z.ZodObject<{
@@ -1094,6 +1091,7 @@ declare const supabaseMcpToolSchemas: {
1094
1091
  readonly openWorldHint: false;
1095
1092
  };
1096
1093
  readOnlyBehavior: undefined;
1094
+ hidden: undefined;
1097
1095
  };
1098
1096
  get_publishable_keys: {
1099
1097
  inputSchema: z.ZodObject<{
@@ -1120,6 +1118,7 @@ declare const supabaseMcpToolSchemas: {
1120
1118
  readonly openWorldHint: false;
1121
1119
  };
1122
1120
  readOnlyBehavior: undefined;
1121
+ hidden: undefined;
1123
1122
  };
1124
1123
  generate_typescript_types: {
1125
1124
  inputSchema: z.ZodObject<{
@@ -1136,6 +1135,7 @@ declare const supabaseMcpToolSchemas: {
1136
1135
  readonly openWorldHint: false;
1137
1136
  };
1138
1137
  readOnlyBehavior: undefined;
1138
+ hidden: undefined;
1139
1139
  };
1140
1140
  get_logs: {
1141
1141
  inputSchema: z.ZodObject<{
@@ -1150,8 +1150,8 @@ declare const supabaseMcpToolSchemas: {
1150
1150
  storage: "storage";
1151
1151
  realtime: "realtime";
1152
1152
  }>;
1153
- iso_timestamp_start: z.ZodOptional<z.ZodString>;
1154
- iso_timestamp_end: z.ZodOptional<z.ZodString>;
1153
+ iso_timestamp_start: z.ZodOptional<z.ZodISODateTime>;
1154
+ iso_timestamp_end: z.ZodOptional<z.ZodISODateTime>;
1155
1155
  }, z.core.$strip>;
1156
1156
  outputSchema: z.ZodObject<{
1157
1157
  result: z.ZodUnknown;
@@ -1164,6 +1164,27 @@ declare const supabaseMcpToolSchemas: {
1164
1164
  readonly openWorldHint: false;
1165
1165
  };
1166
1166
  readOnlyBehavior: undefined;
1167
+ hidden: undefined;
1168
+ };
1169
+ query_logs: {
1170
+ inputSchema: z.ZodObject<{
1171
+ project_id: z.ZodString;
1172
+ sql: z.ZodString;
1173
+ iso_timestamp_start: z.ZodOptional<z.ZodISODateTime>;
1174
+ iso_timestamp_end: z.ZodOptional<z.ZodISODateTime>;
1175
+ }, z.core.$strip>;
1176
+ outputSchema: z.ZodObject<{
1177
+ result: z.ZodUnknown;
1178
+ }, z.core.$strip>;
1179
+ annotations: {
1180
+ readonly title: "Query project logs";
1181
+ readonly readOnlyHint: true;
1182
+ readonly destructiveHint: false;
1183
+ readonly idempotentHint: true;
1184
+ readonly openWorldHint: false;
1185
+ };
1186
+ readOnlyBehavior: undefined;
1187
+ hidden: undefined;
1167
1188
  };
1168
1189
  get_advisors: {
1169
1190
  inputSchema: z.ZodObject<{
@@ -1184,6 +1205,7 @@ declare const supabaseMcpToolSchemas: {
1184
1205
  readonly openWorldHint: false;
1185
1206
  };
1186
1207
  readOnlyBehavior: undefined;
1208
+ hidden: undefined;
1187
1209
  };
1188
1210
  list_tables: {
1189
1211
  inputSchema: z.ZodObject<{
@@ -1211,8 +1233,10 @@ declare const supabaseMcpToolSchemas: {
1211
1233
  primary_keys: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
1212
1234
  foreign_key_constraints: z.ZodOptional<z.ZodArray<z.ZodObject<{
1213
1235
  name: z.ZodString;
1214
- source: z.ZodString;
1215
- target: z.ZodString;
1236
+ source_table: z.ZodString;
1237
+ source_columns: z.ZodArray<z.ZodString>;
1238
+ target_table: z.ZodString;
1239
+ target_columns: z.ZodArray<z.ZodString>;
1216
1240
  }, z.core.$strip>>>;
1217
1241
  }, z.core.$strip>>;
1218
1242
  advisory: z.ZodOptional<z.ZodObject<{
@@ -1237,6 +1261,7 @@ declare const supabaseMcpToolSchemas: {
1237
1261
  readonly openWorldHint: false;
1238
1262
  };
1239
1263
  readOnlyBehavior: undefined;
1264
+ hidden: undefined;
1240
1265
  };
1241
1266
  list_extensions: {
1242
1267
  inputSchema: z.ZodObject<{
@@ -1259,6 +1284,7 @@ declare const supabaseMcpToolSchemas: {
1259
1284
  readonly openWorldHint: false;
1260
1285
  };
1261
1286
  readOnlyBehavior: undefined;
1287
+ hidden: undefined;
1262
1288
  };
1263
1289
  list_migrations: {
1264
1290
  inputSchema: z.ZodObject<{
@@ -1278,6 +1304,7 @@ declare const supabaseMcpToolSchemas: {
1278
1304
  readonly openWorldHint: false;
1279
1305
  };
1280
1306
  readOnlyBehavior: undefined;
1307
+ hidden: undefined;
1281
1308
  };
1282
1309
  apply_migration: {
1283
1310
  inputSchema: z.ZodObject<{
@@ -1296,6 +1323,7 @@ declare const supabaseMcpToolSchemas: {
1296
1323
  readonly openWorldHint: true;
1297
1324
  };
1298
1325
  readOnlyBehavior: undefined;
1326
+ hidden: undefined;
1299
1327
  };
1300
1328
  execute_sql: {
1301
1329
  inputSchema: z.ZodObject<{
@@ -1313,6 +1341,7 @@ declare const supabaseMcpToolSchemas: {
1313
1341
  readonly openWorldHint: true;
1314
1342
  };
1315
1343
  readOnlyBehavior: "adapt";
1344
+ hidden: undefined;
1316
1345
  };
1317
1346
  create_branch: {
1318
1347
  inputSchema: z.ZodObject<{
@@ -1349,6 +1378,7 @@ declare const supabaseMcpToolSchemas: {
1349
1378
  readonly openWorldHint: false;
1350
1379
  };
1351
1380
  readOnlyBehavior: undefined;
1381
+ hidden: undefined;
1352
1382
  };
1353
1383
  list_branches: {
1354
1384
  inputSchema: z.ZodObject<{
@@ -1385,6 +1415,7 @@ declare const supabaseMcpToolSchemas: {
1385
1415
  readonly openWorldHint: false;
1386
1416
  };
1387
1417
  readOnlyBehavior: undefined;
1418
+ hidden: undefined;
1388
1419
  };
1389
1420
  delete_branch: {
1390
1421
  inputSchema: z.ZodObject<{
@@ -1401,6 +1432,7 @@ declare const supabaseMcpToolSchemas: {
1401
1432
  readonly openWorldHint: false;
1402
1433
  };
1403
1434
  readOnlyBehavior: undefined;
1435
+ hidden: undefined;
1404
1436
  };
1405
1437
  merge_branch: {
1406
1438
  inputSchema: z.ZodObject<{
@@ -1417,6 +1449,7 @@ declare const supabaseMcpToolSchemas: {
1417
1449
  readonly openWorldHint: false;
1418
1450
  };
1419
1451
  readOnlyBehavior: undefined;
1452
+ hidden: undefined;
1420
1453
  };
1421
1454
  reset_branch: {
1422
1455
  inputSchema: z.ZodObject<{
@@ -1434,6 +1467,7 @@ declare const supabaseMcpToolSchemas: {
1434
1467
  readonly openWorldHint: false;
1435
1468
  };
1436
1469
  readOnlyBehavior: undefined;
1470
+ hidden: undefined;
1437
1471
  };
1438
1472
  rebase_branch: {
1439
1473
  inputSchema: z.ZodObject<{
@@ -1450,6 +1484,7 @@ declare const supabaseMcpToolSchemas: {
1450
1484
  readonly openWorldHint: false;
1451
1485
  };
1452
1486
  readOnlyBehavior: undefined;
1487
+ hidden: undefined;
1453
1488
  };
1454
1489
  list_organizations: {
1455
1490
  inputSchema: z.ZodObject<{}, z.core.$strip>;
@@ -1468,6 +1503,7 @@ declare const supabaseMcpToolSchemas: {
1468
1503
  readonly openWorldHint: false;
1469
1504
  };
1470
1505
  readOnlyBehavior: undefined;
1506
+ hidden: undefined;
1471
1507
  };
1472
1508
  get_organization: {
1473
1509
  inputSchema: z.ZodObject<{
@@ -1488,6 +1524,7 @@ declare const supabaseMcpToolSchemas: {
1488
1524
  readonly openWorldHint: false;
1489
1525
  };
1490
1526
  readOnlyBehavior: undefined;
1527
+ hidden: undefined;
1491
1528
  };
1492
1529
  list_projects: {
1493
1530
  inputSchema: z.ZodObject<{}, z.core.$strip>;
@@ -1511,6 +1548,7 @@ declare const supabaseMcpToolSchemas: {
1511
1548
  readonly openWorldHint: false;
1512
1549
  };
1513
1550
  readOnlyBehavior: undefined;
1551
+ hidden: undefined;
1514
1552
  };
1515
1553
  get_project: {
1516
1554
  inputSchema: z.ZodObject<{
@@ -1534,6 +1572,7 @@ declare const supabaseMcpToolSchemas: {
1534
1572
  readonly openWorldHint: false;
1535
1573
  };
1536
1574
  readOnlyBehavior: undefined;
1575
+ hidden: undefined;
1537
1576
  };
1538
1577
  get_cost: {
1539
1578
  inputSchema: z.ZodObject<{
@@ -1562,6 +1601,7 @@ declare const supabaseMcpToolSchemas: {
1562
1601
  readonly openWorldHint: false;
1563
1602
  };
1564
1603
  readOnlyBehavior: undefined;
1604
+ hidden: undefined;
1565
1605
  };
1566
1606
  confirm_cost: {
1567
1607
  inputSchema: z.ZodObject<{
@@ -1586,6 +1626,7 @@ declare const supabaseMcpToolSchemas: {
1586
1626
  readonly openWorldHint: false;
1587
1627
  };
1588
1628
  readOnlyBehavior: undefined;
1629
+ hidden: undefined;
1589
1630
  };
1590
1631
  create_project: {
1591
1632
  inputSchema: z.ZodObject<{
@@ -1629,6 +1670,7 @@ declare const supabaseMcpToolSchemas: {
1629
1670
  readonly openWorldHint: false;
1630
1671
  };
1631
1672
  readOnlyBehavior: undefined;
1673
+ hidden: undefined;
1632
1674
  };
1633
1675
  pause_project: {
1634
1676
  inputSchema: z.ZodObject<{
@@ -1645,6 +1687,7 @@ declare const supabaseMcpToolSchemas: {
1645
1687
  readonly openWorldHint: false;
1646
1688
  };
1647
1689
  readOnlyBehavior: undefined;
1690
+ hidden: undefined;
1648
1691
  };
1649
1692
  restore_project: {
1650
1693
  inputSchema: z.ZodObject<{
@@ -1661,6 +1704,7 @@ declare const supabaseMcpToolSchemas: {
1661
1704
  readonly openWorldHint: false;
1662
1705
  };
1663
1706
  readOnlyBehavior: undefined;
1707
+ hidden: undefined;
1664
1708
  };
1665
1709
  };
1666
1710
  /**
@@ -1748,4 +1792,4 @@ declare function createToolSchemas<const Features extends readonly FeatureGroup[
1748
1792
 
1749
1793
  declare const version: string;
1750
1794
 
1751
- export { CURRENT_FEATURE_GROUPS, type FeatureGroup, type SupabaseMcpServerOptions, SupabasePlatform, createSupabaseMcpServer, createToolSchemas, supabaseMcpToolSchemas, version };
1795
+ export { CURRENT_FEATURE_GROUPS, type FeatureGroup, type SupabaseMcpServerOptions, SupabasePlatform, createSupabaseMcpHandler, createSupabaseMcpServer, createToolSchemas, supabaseMcpToolSchemas, version };
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-QUNIPP3Q.js";import{a as h}from"./chunk-625WW4FW.js";import"./chunk-SAN25LFN.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,c as o,d as t,e}from"./chunk-LVRTD44F.js";import{a as r}from"./chunk-54OF3SOV.js";import"./chunk-Q7RZ5JID.js";import{createMcpHandler as c}from"@modelcontextprotocol/server";function s(p){return c(()=>e(p),{legacy:"reject"})}var l=r.version;export{a as CURRENT_FEATURE_GROUPS,s as createSupabaseMcpHandler,e as createSupabaseMcpServer,t as createToolSchemas,o as supabaseMcpToolSchemas,l 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/transports/http.ts","../src/index.ts"],"sourcesContent":["import { createMcpHandler } from '@modelcontextprotocol/server';\n\nimport {\n createSupabaseMcpServer,\n type SupabaseMcpServerOptions,\n} from '../server.js';\n\n// Modern protocol only: created with `legacy: 'reject'`, so a client that\n// speaks just the 2025-era protocol gets an HTTP 400 instead of being served.\nexport function createSupabaseMcpHandler(options: SupabaseMcpServerOptions) {\n return createMcpHandler(() => createSupabaseMcpServer(options), {\n legacy: 'reject',\n });\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 { createSupabaseMcpHandler } from './transports/http.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":"uHAAA,OAAS,oBAAAA,MAAwB,+BAS1B,SAASC,EAAyBC,EAAmC,CAC1E,OAAOC,EAAiB,IAAMC,EAAwBF,CAAO,EAAG,CAC9D,OAAQ,QACV,CAAC,CACH,CCAO,IAAMG,EAAUC,EAAY","names":["createMcpHandler","createSupabaseMcpHandler","options","createMcpHandler","createSupabaseMcpServer","version","package_default"]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJBXRGAGLcjs = require('../chunk-JBXRGAGL.cjs');require('../chunk-DUTV6OKU.cjs');require('../chunk-PHWSETKC.cjs');require('../chunk-AOBG3KWE.cjs');exports.createSupabaseApiPlatform = _chunkJBXRGAGLcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkR42L3CIRcjs = require('../chunk-R42L3CIR.cjs');require('../chunk-A547ZGK6.cjs');require('../chunk-PHWSETKC.cjs');require('../chunk-TJWN2AAW.cjs');exports.createSupabaseApiPlatform = _chunkR42L3CIRcjs.a;
2
2
  //# sourceMappingURL=api-platform.cjs.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-5ZLDWHAI.js";import"../chunk-625WW4FW.js";import"../chunk-LU6L7C36.js";import"../chunk-SAN25LFN.js";export{a as createSupabaseApiPlatform};
1
+ import{a}from"../chunk-B4JQTSBD.js";import"../chunk-54OF3SOV.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 _chunkAOBG3KWEcjs = require('../chunk-AOBG3KWE.cjs');exports.apiKeyTypeSchema = _chunkAOBG3KWEcjs.s; exports.applyMigrationOptionsSchema = _chunkAOBG3KWEcjs.n; exports.branchSchema = _chunkAOBG3KWEcjs.f; exports.createBranchOptionsSchema = _chunkAOBG3KWEcjs.j; exports.createProjectOptionsSchema = _chunkAOBG3KWEcjs.i; exports.deployEdgeFunctionOptionsSchema = _chunkAOBG3KWEcjs.l; exports.edgeFunctionSchema = _chunkAOBG3KWEcjs.g; exports.edgeFunctionWithBodySchema = _chunkAOBG3KWEcjs.h; exports.executeSqlOptionsSchema = _chunkAOBG3KWEcjs.m; exports.generateTypescriptTypesResultSchema = _chunkAOBG3KWEcjs.r; exports.getLogsOptionsSchema = _chunkAOBG3KWEcjs.q; exports.logsServiceSchema = _chunkAOBG3KWEcjs.p; exports.migrationSchema = _chunkAOBG3KWEcjs.o; exports.organizationSchema = _chunkAOBG3KWEcjs.d; exports.projectSchema = _chunkAOBG3KWEcjs.e; exports.resetBranchOptionsSchema = _chunkAOBG3KWEcjs.k; exports.storageBucketSchema = _chunkAOBG3KWEcjs.b; exports.storageConfigSchema = _chunkAOBG3KWEcjs.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"}
@@ -167,6 +167,11 @@ declare const getLogsOptionsSchema: z.ZodObject<{
167
167
  iso_timestamp_start: z.ZodOptional<z.ZodString>;
168
168
  iso_timestamp_end: z.ZodOptional<z.ZodString>;
169
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>;
170
175
  declare const generateTypescriptTypesResultSchema: z.ZodObject<{
171
176
  types: z.ZodString;
172
177
  }, z.core.$strip>;
@@ -185,6 +190,7 @@ type Migration = z.infer<typeof migrationSchema>;
185
190
  type ListMigrationsResult = z.infer<typeof migrationSchema>;
186
191
  type LogsService = z.infer<typeof logsServiceSchema>;
187
192
  type GetLogsOptions = z.infer<typeof getLogsOptionsSchema>;
193
+ type QueryLogsOptions = z.infer<typeof queryLogsOptionsSchema>;
188
194
  type GenerateTypescriptTypesResult = z.infer<typeof generateTypescriptTypesResultSchema>;
189
195
  type StorageConfig = z.infer<typeof storageConfigSchema>;
190
196
  type StorageBucket = z.infer<typeof storageBucketSchema>;
@@ -211,8 +217,21 @@ type EdgeFunctionsOperations = {
211
217
  getEdgeFunction(projectId: string, functionSlug: string): Promise<EdgeFunctionWithBody>;
212
218
  deployEdgeFunction(projectId: string, options: DeployEdgeFunctionOptions): Promise<Omit<EdgeFunction, 'files'>>;
213
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';
214
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;
215
233
  getLogs(projectId: string, options: GetLogsOptions): Promise<unknown>;
234
+ queryLogs?(projectId: string, options: QueryLogsOptions): Promise<unknown>;
216
235
  getSecurityAdvisors(projectId: string): Promise<unknown>;
217
236
  getPerformanceAdvisors(projectId: string): Promise<unknown>;
218
237
  };
@@ -258,4 +277,4 @@ type SupabasePlatform = {
258
277
  branching?: BranchingOperations;
259
278
  };
260
279
 
261
- 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 };
@@ -167,6 +167,11 @@ declare const getLogsOptionsSchema: z.ZodObject<{
167
167
  iso_timestamp_start: z.ZodOptional<z.ZodString>;
168
168
  iso_timestamp_end: z.ZodOptional<z.ZodString>;
169
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>;
170
175
  declare const generateTypescriptTypesResultSchema: z.ZodObject<{
171
176
  types: z.ZodString;
172
177
  }, z.core.$strip>;
@@ -185,6 +190,7 @@ type Migration = z.infer<typeof migrationSchema>;
185
190
  type ListMigrationsResult = z.infer<typeof migrationSchema>;
186
191
  type LogsService = z.infer<typeof logsServiceSchema>;
187
192
  type GetLogsOptions = z.infer<typeof getLogsOptionsSchema>;
193
+ type QueryLogsOptions = z.infer<typeof queryLogsOptionsSchema>;
188
194
  type GenerateTypescriptTypesResult = z.infer<typeof generateTypescriptTypesResultSchema>;
189
195
  type StorageConfig = z.infer<typeof storageConfigSchema>;
190
196
  type StorageBucket = z.infer<typeof storageBucketSchema>;
@@ -211,8 +217,21 @@ type EdgeFunctionsOperations = {
211
217
  getEdgeFunction(projectId: string, functionSlug: string): Promise<EdgeFunctionWithBody>;
212
218
  deployEdgeFunction(projectId: string, options: DeployEdgeFunctionOptions): Promise<Omit<EdgeFunction, 'files'>>;
213
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';
214
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;
215
233
  getLogs(projectId: string, options: GetLogsOptions): Promise<unknown>;
234
+ queryLogs?(projectId: string, options: QueryLogsOptions): Promise<unknown>;
216
235
  getSecurityAdvisors(projectId: string): Promise<unknown>;
217
236
  getPerformanceAdvisors(projectId: string): Promise<unknown>;
218
237
  };
@@ -258,4 +277,4 @@ type SupabasePlatform = {
258
277
  branching?: BranchingOperations;
259
278
  };
260
279
 
261
- 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-SAN25LFN.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 _chunkM3HYJBQVcjs = require('../chunk-M3HYJBQV.cjs');var _chunkJBXRGAGLcjs = require('../chunk-JBXRGAGL.cjs');var _chunkDUTV6OKUcjs = require('../chunk-DUTV6OKU.cjs');require('../chunk-PHWSETKC.cjs');require('../chunk-AOBG3KWE.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}=_chunkDUTV6OKUcjs.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=_chunkJBXRGAGLcjs.a.call(void 0, {accessToken:n,apiUrl:e}),u=_chunkM3HYJBQVcjs.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 _chunkYOFEI5MGcjs = require('../chunk-YOFEI5MG.cjs');var _chunkR42L3CIRcjs = require('../chunk-R42L3CIR.cjs');var _chunkA547ZGK6cjs = require('../chunk-A547ZGK6.cjs');require('../chunk-PHWSETKC.cjs');require('../chunk-TJWN2AAW.cjs');var _util = require('util');var _stdio = require('@modelcontextprotocol/server/stdio');function m(r,o=","){return r.split(o).map(e=>e.trim()).filter(e=>e!=="")}var{version:g}=_chunkA547ZGK6cjs.a;async function d(){let{values:{["access-token"]:r,["project-ref"]:o,["read-only"]:s,["api-url"]:e,["content-api-url"]:u,["version"]:A,["features"]:n}}=_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"}}});A&&(console.log(g),process.exit(0));let i=_nullishCoalesce(r, () => (process.env.SUPABASE_ACCESS_TOKEN));i||(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 t=n?m(n):void 0,S=_nullishCoalesce(u, () => (process.env.SUPABASE_CONTENT_API_URL)),a=_chunkR42L3CIRcjs.a.call(void 0, {accessToken:i,apiUrl:e});t&&_chunkYOFEI5MGcjs.b.call(void 0, a,t),_stdio.serveStdio.call(void 0, ()=>_chunkYOFEI5MGcjs.e.call(void 0, {platform:a,projectId:o,readOnly:s,features:t,contentApiUrl:S}),{onerror:console.error})}d().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","parseFeatureGroups","serveStdio","createSupabaseMcpServer"],"mappings":"AAAA;AACA,0KAAgD,yDAA0C,yDAA0C,iCAA8B,iCAA8B,4BCAtK,2DACC,SCIXA,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,CDCA,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,CAEGM,CAAAA,EACFI,iCAAAA,CAAmBF,CAAUF,CAAQ,CAAA,CAMvCK,+BAAAA,CACE,CAAA,EACEC,iCAAAA,CACE,QAAA,CAAAJ,CAAAA,CACA,SAAA,CAAAV,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,QAAA,CAAAO,CAAAA,CACA,aAAA,CAAAC,CACF,CAAC,CAAA,CACH,CAAE,OAAA,CAAS,OAAA,CAAQ,KAAM,CAC3B,CACF,CAEAX,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\nimport { parseArgs } from 'node:util';\nimport { serveStdio } from '@modelcontextprotocol/server/stdio';\n\nimport packageJson from '../../package.json' with { type: 'json' };\nimport { createSupabaseApiPlatform } from '../platform/api-platform.js';\nimport { createSupabaseMcpServer } from '../server.js';\nimport { parseFeatureGroups } from '../util.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 if (features) {\n parseFeatureGroups(platform, features);\n }\n\n // `serveStdio` reports transport startup and out-of-band wire errors only\n // through `onerror`, and swallows them otherwise, so this keeps the stderr\n // output the previous awaited `server.connect()` got from `main().catch`.\n serveStdio(\n () =>\n createSupabaseMcpServer({\n platform,\n projectId,\n readOnly,\n features,\n contentApiUrl,\n }),\n { onerror: console.error }\n );\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-QUNIPP3Q.js";import{a as c}from"../chunk-5ZLDWHAI.js";import{a}from"../chunk-625WW4FW.js";import"../chunk-LU6L7C36.js";import"../chunk-SAN25LFN.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{b as c,e as l}from"../chunk-LVRTD44F.js";import{a as f}from"../chunk-B4JQTSBD.js";import{a as p}from"../chunk-54OF3SOV.js";import"../chunk-LU6L7C36.js";import"../chunk-Q7RZ5JID.js";import{parseArgs as v}from"util";import{serveStdio as y}from"@modelcontextprotocol/server/stdio";function m(r,o=","){return r.split(o).map(e=>e.trim()).filter(e=>e!=="")}var{version:g}=p;async function d(){let{values:{["access-token"]:r,["project-ref"]:o,["read-only"]:s,["api-url"]:e,["content-api-url"]:u,["version"]:A,["features"]:n}}=v({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"}}});A&&(console.log(g),process.exit(0));let i=r??process.env.SUPABASE_ACCESS_TOKEN;i||(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 t=n?m(n):void 0,S=u??process.env.SUPABASE_CONTENT_API_URL,a=f({accessToken:i,apiUrl:e});t&&c(a,t),y(()=>l({platform:a,projectId:o,readOnly:s,features:t,contentApiUrl:S}),{onerror:console.error})}d().catch(console.error);
3
3
  //# sourceMappingURL=stdio.js.map