@supabase/mcp-server-supabase 0.12.0 → 0.13.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.
- package/dist/{chunk-TJWN2AAW.cjs → chunk-536WYGSZ.cjs} +2 -2
- package/dist/{chunk-TJWN2AAW.cjs.map → chunk-536WYGSZ.cjs.map} +1 -1
- package/dist/chunk-BAHK6DOT.js +280 -0
- package/dist/chunk-BAHK6DOT.js.map +1 -0
- package/dist/{chunk-GUZGRQIX.cjs → chunk-ETDG2YWQ.cjs} +3 -3
- package/dist/chunk-ETDG2YWQ.cjs.map +1 -0
- package/dist/chunk-HJCSISZG.cjs +280 -0
- package/dist/chunk-HJCSISZG.cjs.map +1 -0
- package/dist/{chunk-Q7RZ5JID.js → chunk-LGYQEOKZ.js} +2 -2
- package/dist/{chunk-Q7RZ5JID.js.map → chunk-LGYQEOKZ.js.map} +1 -1
- package/dist/chunk-MGV6E7CY.js +17 -0
- package/dist/chunk-MGV6E7CY.js.map +1 -0
- package/dist/chunk-UY7NVUDB.cjs +17 -0
- package/dist/chunk-UY7NVUDB.cjs.map +1 -0
- package/dist/{chunk-KKEOJLGM.js → chunk-ZKX2YAIQ.js} +3 -3
- package/dist/chunk-ZKX2YAIQ.js.map +1 -0
- package/dist/cli.cjs +3 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.js +3 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +91 -22
- package/dist/index.d.ts +91 -22
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/platform/api-platform.cjs +1 -1
- package/dist/platform/api-platform.js +1 -1
- package/dist/platform/index.cjs +1 -1
- package/dist/platform/index.d.cts +11 -3
- package/dist/platform/index.d.ts +11 -3
- package/dist/platform/index.js +1 -1
- package/package.json +3 -2
- package/dist/chunk-GUZGRQIX.cjs.map +0 -1
- package/dist/chunk-GZNCDKYI.js +0 -17
- package/dist/chunk-GZNCDKYI.js.map +0 -1
- package/dist/chunk-KKEOJLGM.js.map +0 -1
- package/dist/chunk-OZNSUBGX.cjs +0 -276
- package/dist/chunk-OZNSUBGX.cjs.map +0 -1
- package/dist/chunk-UXVELPWK.js +0 -276
- package/dist/chunk-UXVELPWK.js.map +0 -1
- package/dist/chunk-WXQAW6FS.cjs +0 -17
- package/dist/chunk-WXQAW6FS.cjs.map +0 -1
- package/dist/transports/stdio.cjs +0 -3
- package/dist/transports/stdio.cjs.map +0 -1
- package/dist/transports/stdio.js +0 -3
- package/dist/transports/stdio.js.map +0 -1
- /package/dist/{transports/stdio.d.cts → cli.d.cts} +0 -0
- /package/dist/{transports/stdio.d.ts → cli.d.ts} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -4,11 +4,12 @@ import { SupabasePlatform } from './platform/index.js';
|
|
|
4
4
|
import * as _modelcontextprotocol_server from '@modelcontextprotocol/server';
|
|
5
5
|
import { z } from 'zod/v4';
|
|
6
6
|
|
|
7
|
+
declare const CURRENT_ELICITATION_TOOLS: readonly ["create_project", "create_branch", "execute_sql", "apply_migration"];
|
|
8
|
+
type ElicitationToolName = (typeof CURRENT_ELICITATION_TOOLS)[number];
|
|
7
9
|
declare const CURRENT_FEATURE_GROUPS: readonly ["docs", "account", "database", "debugging", "development", "functions", "branching", "storage"];
|
|
8
10
|
declare const featureGroupSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
|
|
9
11
|
debug: "debug";
|
|
10
12
|
}>, z.ZodEnum<{
|
|
11
|
-
storage: "storage";
|
|
12
13
|
docs: "docs";
|
|
13
14
|
account: "account";
|
|
14
15
|
database: "database";
|
|
@@ -16,7 +17,8 @@ declare const featureGroupSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
|
|
|
16
17
|
development: "development";
|
|
17
18
|
functions: "functions";
|
|
18
19
|
branching: "branching";
|
|
19
|
-
|
|
20
|
+
storage: "storage";
|
|
21
|
+
}>]>, z.ZodTransform<"docs" | "account" | "database" | "debugging" | "development" | "functions" | "branching" | "storage", "debug" | "docs" | "account" | "database" | "debugging" | "development" | "functions" | "branching" | "storage">>;
|
|
20
22
|
type FeatureGroup = z.infer<typeof featureGroupSchema>;
|
|
21
23
|
|
|
22
24
|
type SupabaseMcpServerOptions = {
|
|
@@ -49,21 +51,42 @@ type SupabaseMcpServerOptions = {
|
|
|
49
51
|
*/
|
|
50
52
|
onToolCall?: ToolCallCallback;
|
|
51
53
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* project or branch `confirm_cost_id` flow (`create_project` or
|
|
56
|
-
* `create_branch`).
|
|
54
|
+
* Signed multi-round-trip elicitation config. `requestState` is the shared
|
|
55
|
+
* HMAC codec config used by every elicitation feature this server issues;
|
|
56
|
+
* enable features by setting their sub-options.
|
|
57
57
|
*/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
elicitation?: {
|
|
59
|
+
requestState: {
|
|
60
|
+
/** HMAC key for the `requestState` codec. MUST be at least 32 bytes. */
|
|
61
|
+
key: string | Uint8Array;
|
|
62
|
+
/** The authenticated principal `requestState` is bound to. */
|
|
63
|
+
principal: string;
|
|
64
|
+
/** How long a minted `requestState` stays valid, in seconds. */
|
|
65
|
+
ttlSeconds?: number;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Form confirmation for the listed cost and destructive SQL tools. Clients
|
|
69
|
+
* without form capability keep the existing SQL behavior and legacy
|
|
70
|
+
* `get_cost` -> `confirm_cost` -> `confirm_cost_id` flow.
|
|
71
|
+
*/
|
|
72
|
+
confirmation?: {
|
|
73
|
+
/** Tools that accept a confirmation elicitation. Empty disables all forms. */
|
|
74
|
+
enabledTools: readonly ElicitationToolName[];
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* URL-mode secret collection for `create_edge_function_secret`. Requires
|
|
78
|
+
* `platform.secrets` and the functions feature group. Only URL-capable
|
|
79
|
+
* clients get the tool.
|
|
80
|
+
*/
|
|
81
|
+
secretCollection?: {
|
|
82
|
+
/**
|
|
83
|
+
* URL template of the dashboard page that collects the secret value.
|
|
84
|
+
* MUST contain the `{ref}` and `{name}` placeholders; each is replaced
|
|
85
|
+
* with the percent-encoded project ref and secret name.
|
|
86
|
+
* Example: `https://supabase.com/dashboard/mcp/secrets?ref={ref}&name={name}`.
|
|
87
|
+
*/
|
|
88
|
+
connectUrlTemplate: string;
|
|
89
|
+
};
|
|
67
90
|
};
|
|
68
91
|
};
|
|
69
92
|
/**
|
|
@@ -525,7 +548,7 @@ declare const databaseToolDefs: {
|
|
|
525
548
|
};
|
|
526
549
|
};
|
|
527
550
|
readonly apply_migration: {
|
|
528
|
-
readonly description:
|
|
551
|
+
readonly description: string;
|
|
529
552
|
readonly parameters: z.ZodObject<{
|
|
530
553
|
project_id: z.ZodString;
|
|
531
554
|
name: z.ZodString;
|
|
@@ -543,7 +566,7 @@ declare const databaseToolDefs: {
|
|
|
543
566
|
};
|
|
544
567
|
};
|
|
545
568
|
readonly execute_sql: {
|
|
546
|
-
readonly description:
|
|
569
|
+
readonly description: string;
|
|
547
570
|
readonly parameters: z.ZodObject<{
|
|
548
571
|
project_id: z.ZodString;
|
|
549
572
|
query: z.ZodString;
|
|
@@ -568,13 +591,13 @@ declare const debuggingToolDefs: {
|
|
|
568
591
|
readonly parameters: z.ZodObject<{
|
|
569
592
|
project_id: z.ZodString;
|
|
570
593
|
service: z.ZodEnum<{
|
|
594
|
+
storage: "storage";
|
|
571
595
|
api: "api";
|
|
572
596
|
"branch-action": "branch-action";
|
|
573
597
|
postgres: "postgres";
|
|
574
598
|
"edge-function": "edge-function";
|
|
575
599
|
"edge-function-runtime": "edge-function-runtime";
|
|
576
600
|
auth: "auth";
|
|
577
|
-
storage: "storage";
|
|
578
601
|
realtime: "realtime";
|
|
579
602
|
}>;
|
|
580
603
|
iso_timestamp_start: z.ZodOptional<z.ZodISODateTime>;
|
|
@@ -809,6 +832,30 @@ ${string}`;
|
|
|
809
832
|
};
|
|
810
833
|
};
|
|
811
834
|
|
|
835
|
+
declare const secretToolDefs: {
|
|
836
|
+
readonly create_edge_function_secret: {
|
|
837
|
+
readonly description: "Creates or updates an Edge Function secret for the project. The user enters the value in the Supabase dashboard; it never passes through the AI client.";
|
|
838
|
+
readonly parameters: z.ZodObject<{
|
|
839
|
+
project_id: z.ZodString;
|
|
840
|
+
name: z.ZodString;
|
|
841
|
+
replace: z.ZodOptional<z.ZodBoolean>;
|
|
842
|
+
}, z.core.$strip>;
|
|
843
|
+
readonly outputSchema: z.ZodObject<{
|
|
844
|
+
name: z.ZodOptional<z.ZodString>;
|
|
845
|
+
stored: z.ZodOptional<z.ZodBoolean>;
|
|
846
|
+
updated_seconds_ago: z.ZodOptional<z.ZodNumber>;
|
|
847
|
+
status: z.ZodOptional<z.ZodString>;
|
|
848
|
+
}, z.core.$strip>;
|
|
849
|
+
readonly annotations: {
|
|
850
|
+
readonly title: "Create Edge Function secret";
|
|
851
|
+
readonly readOnlyHint: false;
|
|
852
|
+
readonly destructiveHint: false;
|
|
853
|
+
readonly idempotentHint: true;
|
|
854
|
+
readonly openWorldHint: false;
|
|
855
|
+
};
|
|
856
|
+
};
|
|
857
|
+
};
|
|
858
|
+
|
|
812
859
|
declare const storageToolDefs: {
|
|
813
860
|
readonly list_storage_buckets: {
|
|
814
861
|
readonly description: "Lists all storage buckets in a Supabase project.";
|
|
@@ -980,6 +1027,28 @@ declare const supabaseMcpToolSchemas: {
|
|
|
980
1027
|
readOnlyBehavior: undefined;
|
|
981
1028
|
hidden: undefined;
|
|
982
1029
|
};
|
|
1030
|
+
create_edge_function_secret: {
|
|
1031
|
+
inputSchema: z.ZodObject<{
|
|
1032
|
+
project_id: z.ZodString;
|
|
1033
|
+
name: z.ZodString;
|
|
1034
|
+
replace: z.ZodOptional<z.ZodBoolean>;
|
|
1035
|
+
}, z.core.$strip>;
|
|
1036
|
+
outputSchema: z.ZodObject<{
|
|
1037
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1038
|
+
stored: z.ZodOptional<z.ZodBoolean>;
|
|
1039
|
+
updated_seconds_ago: z.ZodOptional<z.ZodNumber>;
|
|
1040
|
+
status: z.ZodOptional<z.ZodString>;
|
|
1041
|
+
}, z.core.$strip>;
|
|
1042
|
+
annotations: {
|
|
1043
|
+
readonly title: "Create Edge Function secret";
|
|
1044
|
+
readonly readOnlyHint: false;
|
|
1045
|
+
readonly destructiveHint: false;
|
|
1046
|
+
readonly idempotentHint: true;
|
|
1047
|
+
readonly openWorldHint: false;
|
|
1048
|
+
};
|
|
1049
|
+
readOnlyBehavior: undefined;
|
|
1050
|
+
hidden: undefined;
|
|
1051
|
+
};
|
|
983
1052
|
list_edge_functions: {
|
|
984
1053
|
inputSchema: z.ZodObject<{
|
|
985
1054
|
project_id: z.ZodString;
|
|
@@ -1158,13 +1227,13 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1158
1227
|
inputSchema: z.ZodObject<{
|
|
1159
1228
|
project_id: z.ZodString;
|
|
1160
1229
|
service: z.ZodEnum<{
|
|
1230
|
+
storage: "storage";
|
|
1161
1231
|
api: "api";
|
|
1162
1232
|
"branch-action": "branch-action";
|
|
1163
1233
|
postgres: "postgres";
|
|
1164
1234
|
"edge-function": "edge-function";
|
|
1165
1235
|
"edge-function-runtime": "edge-function-runtime";
|
|
1166
1236
|
auth: "auth";
|
|
1167
|
-
storage: "storage";
|
|
1168
1237
|
realtime: "realtime";
|
|
1169
1238
|
}>;
|
|
1170
1239
|
iso_timestamp_start: z.ZodOptional<z.ZodISODateTime>;
|
|
@@ -1737,7 +1806,7 @@ declare const FEATURE_TOOL_MAP: {
|
|
|
1737
1806
|
database: readonly (keyof typeof databaseToolDefs)[];
|
|
1738
1807
|
debugging: readonly (keyof typeof debuggingToolDefs)[];
|
|
1739
1808
|
development: readonly (keyof typeof developmentToolDefs)[];
|
|
1740
|
-
functions: readonly (keyof typeof edgeFunctionToolDefs)[];
|
|
1809
|
+
functions: readonly (keyof typeof edgeFunctionToolDefs | keyof typeof secretToolDefs)[];
|
|
1741
1810
|
branching: readonly (keyof typeof branchingToolDefs)[];
|
|
1742
1811
|
storage: readonly (keyof typeof storageToolDefs)[];
|
|
1743
1812
|
};
|
|
@@ -1809,4 +1878,4 @@ declare function createToolSchemas<const Features extends readonly FeatureGroup[
|
|
|
1809
1878
|
|
|
1810
1879
|
declare const version: string;
|
|
1811
1880
|
|
|
1812
|
-
export { CURRENT_FEATURE_GROUPS, type FeatureGroup, type SupabaseMcpServerOptions, SupabasePlatform, createSupabaseMcpHandler, createSupabaseMcpServer, createToolSchemas, supabaseMcpToolSchemas, version };
|
|
1881
|
+
export { CURRENT_ELICITATION_TOOLS, CURRENT_FEATURE_GROUPS, type ElicitationToolName, type FeatureGroup, type SupabaseMcpServerOptions, SupabasePlatform, createSupabaseMcpHandler, createSupabaseMcpServer, createToolSchemas, supabaseMcpToolSchemas, version };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a,
|
|
1
|
+
import{a,b as o,e as t,f as c,g as e}from"./chunk-BAHK6DOT.js";import{a as r}from"./chunk-MGV6E7CY.js";import"./chunk-LGYQEOKZ.js";import{createMcpHandler as s}from"@modelcontextprotocol/server";function m(p){return s(()=>e(p),{legacy:"reject"})}var u=r.version;export{a as CURRENT_ELICITATION_TOOLS,o as CURRENT_FEATURE_GROUPS,m as createSupabaseMcpHandler,e as createSupabaseMcpServer,c as createToolSchemas,t as supabaseMcpToolSchemas,u as version};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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":"
|
|
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_ELICITATION_TOOLS,\n CURRENT_FEATURE_GROUPS,\n type ElicitationToolName,\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":"mIAAA,OAAS,oBAAAA,MAAwB,+BAS1B,SAASC,EAAyBC,EAAmC,CAC1E,OAAOC,EAAiB,IAAMC,EAAwBF,CAAO,EAAG,CAC9D,OAAQ,QACV,CAAC,CACH,CCEO,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
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkETDG2YWQcjs = require('../chunk-ETDG2YWQ.cjs');require('../chunk-UY7NVUDB.cjs');require('../chunk-PHWSETKC.cjs');require('../chunk-536WYGSZ.cjs');exports.createSupabaseApiPlatform = _chunkETDG2YWQcjs.a;
|
|
2
2
|
//# sourceMappingURL=api-platform.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-ZKX2YAIQ.js";import"../chunk-MGV6E7CY.js";import"../chunk-LU6L7C36.js";import"../chunk-LGYQEOKZ.js";export{a as createSupabaseApiPlatform};
|
|
2
2
|
//# sourceMappingURL=api-platform.js.map
|
package/dist/platform/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-PHWSETKC.cjs');var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-PHWSETKC.cjs');var _chunk536WYGSZcjs = require('../chunk-536WYGSZ.cjs');exports.apiKeyTypeSchema = _chunk536WYGSZcjs.t; exports.applyMigrationOptionsSchema = _chunk536WYGSZcjs.n; exports.branchSchema = _chunk536WYGSZcjs.f; exports.createBranchOptionsSchema = _chunk536WYGSZcjs.j; exports.createProjectOptionsSchema = _chunk536WYGSZcjs.i; exports.deployEdgeFunctionOptionsSchema = _chunk536WYGSZcjs.l; exports.edgeFunctionSchema = _chunk536WYGSZcjs.g; exports.edgeFunctionWithBodySchema = _chunk536WYGSZcjs.h; exports.executeSqlOptionsSchema = _chunk536WYGSZcjs.m; exports.generateTypescriptTypesResultSchema = _chunk536WYGSZcjs.s; exports.getLogsOptionsSchema = _chunk536WYGSZcjs.q; exports.logsServiceSchema = _chunk536WYGSZcjs.p; exports.migrationSchema = _chunk536WYGSZcjs.o; exports.organizationSchema = _chunk536WYGSZcjs.d; exports.projectSchema = _chunk536WYGSZcjs.e; exports.queryLogsOptionsSchema = _chunk536WYGSZcjs.r; exports.resetBranchOptionsSchema = _chunk536WYGSZcjs.k; exports.storageBucketSchema = _chunk536WYGSZcjs.b; exports.storageConfigSchema = _chunk536WYGSZcjs.c;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -144,24 +144,24 @@ declare const migrationSchema: z.ZodObject<{
|
|
|
144
144
|
name: z.ZodOptional<z.ZodString>;
|
|
145
145
|
}, z.core.$strip>;
|
|
146
146
|
declare const logsServiceSchema: z.ZodEnum<{
|
|
147
|
+
storage: "storage";
|
|
147
148
|
api: "api";
|
|
148
149
|
"branch-action": "branch-action";
|
|
149
150
|
postgres: "postgres";
|
|
150
151
|
"edge-function": "edge-function";
|
|
151
152
|
"edge-function-runtime": "edge-function-runtime";
|
|
152
153
|
auth: "auth";
|
|
153
|
-
storage: "storage";
|
|
154
154
|
realtime: "realtime";
|
|
155
155
|
}>;
|
|
156
156
|
declare const getLogsOptionsSchema: z.ZodObject<{
|
|
157
157
|
service: z.ZodEnum<{
|
|
158
|
+
storage: "storage";
|
|
158
159
|
api: "api";
|
|
159
160
|
"branch-action": "branch-action";
|
|
160
161
|
postgres: "postgres";
|
|
161
162
|
"edge-function": "edge-function";
|
|
162
163
|
"edge-function-runtime": "edge-function-runtime";
|
|
163
164
|
auth: "auth";
|
|
164
|
-
storage: "storage";
|
|
165
165
|
realtime: "realtime";
|
|
166
166
|
}>;
|
|
167
167
|
iso_timestamp_start: z.ZodOptional<z.ZodString>;
|
|
@@ -266,6 +266,13 @@ type BranchingOperations = {
|
|
|
266
266
|
resetBranch(branchId: string, options: ResetBranchOptions): Promise<void>;
|
|
267
267
|
rebaseBranch(branchId: string): Promise<void>;
|
|
268
268
|
};
|
|
269
|
+
/**
|
|
270
|
+
* Returns only the `updated_at` timestamp of the named secret, never its
|
|
271
|
+
* value or digest.
|
|
272
|
+
*/
|
|
273
|
+
type SecretOperations = {
|
|
274
|
+
getUpdatedAt(projectId: string, name: string): Promise<Date | undefined>;
|
|
275
|
+
};
|
|
269
276
|
type SupabasePlatform = {
|
|
270
277
|
init?(info: InitData): Promise<void>;
|
|
271
278
|
account?: AccountOperations;
|
|
@@ -275,6 +282,7 @@ type SupabasePlatform = {
|
|
|
275
282
|
development?: DevelopmentOperations;
|
|
276
283
|
storage?: StorageOperations;
|
|
277
284
|
branching?: BranchingOperations;
|
|
285
|
+
secrets?: SecretOperations;
|
|
278
286
|
};
|
|
279
287
|
|
|
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 };
|
|
288
|
+
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 SecretOperations, 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 };
|
package/dist/platform/index.d.ts
CHANGED
|
@@ -144,24 +144,24 @@ declare const migrationSchema: z.ZodObject<{
|
|
|
144
144
|
name: z.ZodOptional<z.ZodString>;
|
|
145
145
|
}, z.core.$strip>;
|
|
146
146
|
declare const logsServiceSchema: z.ZodEnum<{
|
|
147
|
+
storage: "storage";
|
|
147
148
|
api: "api";
|
|
148
149
|
"branch-action": "branch-action";
|
|
149
150
|
postgres: "postgres";
|
|
150
151
|
"edge-function": "edge-function";
|
|
151
152
|
"edge-function-runtime": "edge-function-runtime";
|
|
152
153
|
auth: "auth";
|
|
153
|
-
storage: "storage";
|
|
154
154
|
realtime: "realtime";
|
|
155
155
|
}>;
|
|
156
156
|
declare const getLogsOptionsSchema: z.ZodObject<{
|
|
157
157
|
service: z.ZodEnum<{
|
|
158
|
+
storage: "storage";
|
|
158
159
|
api: "api";
|
|
159
160
|
"branch-action": "branch-action";
|
|
160
161
|
postgres: "postgres";
|
|
161
162
|
"edge-function": "edge-function";
|
|
162
163
|
"edge-function-runtime": "edge-function-runtime";
|
|
163
164
|
auth: "auth";
|
|
164
|
-
storage: "storage";
|
|
165
165
|
realtime: "realtime";
|
|
166
166
|
}>;
|
|
167
167
|
iso_timestamp_start: z.ZodOptional<z.ZodString>;
|
|
@@ -266,6 +266,13 @@ type BranchingOperations = {
|
|
|
266
266
|
resetBranch(branchId: string, options: ResetBranchOptions): Promise<void>;
|
|
267
267
|
rebaseBranch(branchId: string): Promise<void>;
|
|
268
268
|
};
|
|
269
|
+
/**
|
|
270
|
+
* Returns only the `updated_at` timestamp of the named secret, never its
|
|
271
|
+
* value or digest.
|
|
272
|
+
*/
|
|
273
|
+
type SecretOperations = {
|
|
274
|
+
getUpdatedAt(projectId: string, name: string): Promise<Date | undefined>;
|
|
275
|
+
};
|
|
269
276
|
type SupabasePlatform = {
|
|
270
277
|
init?(info: InitData): Promise<void>;
|
|
271
278
|
account?: AccountOperations;
|
|
@@ -275,6 +282,7 @@ type SupabasePlatform = {
|
|
|
275
282
|
development?: DevelopmentOperations;
|
|
276
283
|
storage?: StorageOperations;
|
|
277
284
|
branching?: BranchingOperations;
|
|
285
|
+
secrets?: SecretOperations;
|
|
278
286
|
};
|
|
279
287
|
|
|
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 };
|
|
288
|
+
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 SecretOperations, 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 };
|
package/dist/platform/index.js
CHANGED
|
@@ -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,t as s}from"../chunk-
|
|
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-LGYQEOKZ.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
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supabase/mcp-server-supabase",
|
|
3
3
|
"mcpName": "com.supabase/mcp",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.13.0",
|
|
5
5
|
"description": "MCP server for interacting with Supabase",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dist/**/*"
|
|
17
17
|
],
|
|
18
18
|
"bin": {
|
|
19
|
-
"mcp-server-supabase": "./dist/
|
|
19
|
+
"mcp-server-supabase": "./dist/cli.js"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@mjackson/multipart-parser": "^0.10.1",
|
|
40
|
+
"@modelcontextprotocol/node": "^2.0.0",
|
|
40
41
|
"common-tags": "^1.8.2",
|
|
41
42
|
"gqlmin": "^0.3.1",
|
|
42
43
|
"graphql": "^16.11.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/chunk-GUZGRQIX.cjs","../src/platform/api-platform.ts","../src/logs.ts"],"names":["getClickHouseLogQuery","service","limit","stripIndent"],"mappings":"AAAA,y0BAAsD,wDAA0F,6DCGzI,0BAEuB,yCCLF,SAGZA,CAAAA,CACdC,CAAAA,CACAC,CAAAA,CAAgB,GAAA,CAChB,CACA,MAAA,CAAQD,CAAAA,CAAS,CACf,IAAK,KAAA,CACH,OAAOE,uBAAAA,CAAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA,EAKGD,CAAK,CAAA;AAAA,MAAA,CAAA,CAEjB,IAAK,eAAA,CACH,OAAOC,uBAAAA,CAAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA,EAKGD,CAAK,CAAA;AAAA,MAAA,CAAA,CAEjB,IAAK,UAAA,CACH,OAAOC,uBAAAA,CAAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA,EAKGD,CAAK,CAAA;AAAA,MAAA,CAAA,CAEjB,IAAK,eAAA,CACH,OAAOC,uBAAAA,CAAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA,EAKGD,CAAK,CAAA;AAAA,MAAA,CAAA,CAEjB,IAAK,uBAAA,CACH,OAAOC,uBAAAA,CAAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA,EAKGD,CAAK,CAAA;AAAA,MAAA,CAAA,CAEjB,IAAK,MAAA,CACH,OAAOC,uBAAAA,CAAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA,EAKGD,CAAK,CAAA;AAAA,MAAA,CAAA,CAEjB,IAAK,SAAA,CACH,OAAOC,uBAAAA,CAAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA,EAKGD,CAAK,CAAA;AAAA,MAAA,CAAA,CAEjB,IAAK,UAAA,CACH,OAAOC,uBAAAA,CAAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA,EAKGD,CAAK,CAAA;AAAA,MAAA,CAAA,CAEjB,OAAA,CACE,MAAM,IAAI,KAAA,CAAM,CAAA,8BAAA,EAAiCD,CAAO,CAAA,CAAA","file":"/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/chunk-GUZGRQIX.cjs","sourcesContent":[null,"import {\n getMultipartBoundary,\n parseMultipartStream,\n} from '@mjackson/multipart-parser';\nimport type { InitData } from '@supabase/mcp-utils';\nimport { fileURLToPath } from 'node:url';\nimport packageJson from '../../package.json' with { type: 'json' };\nimport { getDeploymentId, normalizeFilename } from '../edge-function.js';\nimport { getClickHouseLogQuery } from '../logs.js';\nimport {\n assertProjectScopedSuccess,\n assertSuccess,\n createManagementApiClient,\n} from '../management-api/index.js';\nimport { generatePassword } from '../password.js';\nimport {\n applyMigrationOptionsSchema,\n createBranchOptionsSchema,\n createProjectOptionsSchema,\n deployEdgeFunctionOptionsSchema,\n executeSqlOptionsSchema,\n getLogsOptionsSchema,\n queryLogsOptionsSchema,\n resetBranchOptionsSchema,\n type AccountOperations,\n type ApiKey,\n type ApiKeyType,\n type ApplyMigrationOptions,\n type BranchingOperations,\n type CreateBranchOptions,\n type CreateProjectOptions,\n type DatabaseOperations,\n type DebuggingOperations,\n type DeployEdgeFunctionOptions,\n type DevelopmentOperations,\n type SuccessResponse,\n type EdgeFunction,\n type EdgeFunctionsOperations,\n type EdgeFunctionWithBody,\n type ExecuteSqlOptions,\n type GetLogsOptions,\n type QueryLogsOptions,\n type ResetBranchOptions,\n type StorageConfig,\n type StorageOperations,\n type SupabasePlatform,\n} from './index.js';\n\nconst { version } = packageJson;\n\nconst SUCCESS_RESPONSE: SuccessResponse = { success: true };\n\nexport type SupabaseApiPlatformOptions = {\n /**\n * The access token for the Supabase Management API.\n */\n accessToken: string;\n\n /**\n * The API URL for the Supabase Management API.\n */\n apiUrl?: string;\n};\n\n/**\n * Creates a Supabase platform implementation using the Supabase Management API.\n */\nexport function createSupabaseApiPlatform(\n options: SupabaseApiPlatformOptions\n): SupabasePlatform {\n const { accessToken, apiUrl } = options;\n\n const managementApiUrl = apiUrl ?? 'https://api.supabase.com';\n\n let managementApiClient = createManagementApiClient(\n managementApiUrl,\n accessToken\n );\n\n const account: AccountOperations = {\n async listOrganizations() {\n const response = await managementApiClient.GET('/v1/organizations');\n\n assertSuccess(response, 'Failed to fetch organizations');\n\n return response.data;\n },\n async getOrganization(organizationId: string) {\n const response = await managementApiClient.GET(\n '/v1/organizations/{slug}',\n {\n params: {\n path: {\n slug: organizationId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to fetch organization');\n\n return response.data;\n },\n async listProjects() {\n const response = await managementApiClient.GET('/v1/projects');\n\n assertSuccess(response, 'Failed to fetch projects');\n\n return response.data;\n },\n async getProject(projectId: string) {\n const response = await managementApiClient.GET('/v1/projects/{ref}', {\n params: {\n path: {\n ref: projectId,\n },\n },\n });\n assertSuccess(response, 'Failed to fetch project');\n return response.data;\n },\n async createProject(options: CreateProjectOptions) {\n const { name, organization_id, region, db_pass } =\n createProjectOptionsSchema.parse(options);\n\n const response = await managementApiClient.POST('/v1/projects', {\n body: {\n name,\n region,\n organization_slug: organization_id,\n db_pass:\n db_pass ??\n generatePassword({\n length: 16,\n numbers: true,\n uppercase: true,\n lowercase: true,\n }),\n },\n });\n\n assertSuccess(response, 'Failed to create project');\n\n return response.data;\n },\n async pauseProject(projectId: string) {\n const response = await managementApiClient.POST(\n '/v1/projects/{ref}/pause',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to pause project');\n },\n async restoreProject(projectId: string) {\n const response = await managementApiClient.POST(\n '/v1/projects/{ref}/restore',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to restore project');\n },\n };\n\n const database: DatabaseOperations = {\n async executeSql<T>(projectId: string, options: ExecuteSqlOptions) {\n const { query, parameters, read_only } =\n executeSqlOptionsSchema.parse(options);\n\n const response = await managementApiClient.POST(\n '/v1/projects/{ref}/database/query',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n body: {\n query,\n parameters,\n read_only,\n },\n }\n );\n\n assertProjectScopedSuccess(\n response,\n 'Failed to execute SQL query',\n projectId\n );\n\n return response.data as unknown as T[];\n },\n async listMigrations(projectId: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/database/migrations',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n assertProjectScopedSuccess(\n response,\n 'Failed to fetch migrations',\n projectId\n );\n\n return response.data;\n },\n async applyMigration(projectId: string, options: ApplyMigrationOptions) {\n const { name, query } = applyMigrationOptionsSchema.parse(options);\n\n const response = await managementApiClient.POST(\n '/v1/projects/{ref}/database/migrations',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n body: {\n name,\n query,\n },\n }\n );\n\n assertProjectScopedSuccess(\n response,\n 'Failed to apply migration',\n projectId\n );\n\n // Intentionally don't return the result of the migration\n // to avoid prompt injection attacks. If the migration failed,\n // it will throw an error.\n },\n };\n\n const debugging: DebuggingOperations = {\n logsDialect: 'clickhouse',\n async getLogs(projectId: string, options: GetLogsOptions) {\n const { service, iso_timestamp_start, iso_timestamp_end } =\n getLogsOptionsSchema.parse(options);\n\n const sql = getClickHouseLogQuery(service);\n\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/analytics/endpoints/logs',\n {\n params: {\n path: {\n ref: projectId,\n },\n query: {\n sql,\n iso_timestamp_start,\n iso_timestamp_end,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to fetch logs');\n\n return response.data;\n },\n async queryLogs(projectId: string, options: QueryLogsOptions) {\n const { sql, iso_timestamp_start, iso_timestamp_end } =\n queryLogsOptionsSchema.parse(options);\n\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/analytics/endpoints/logs',\n {\n params: {\n path: {\n ref: projectId,\n },\n query: {\n sql,\n iso_timestamp_start,\n iso_timestamp_end,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to query logs');\n\n return response.data;\n },\n async getSecurityAdvisors(projectId: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/advisors/security',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to fetch security advisors');\n\n return response.data;\n },\n async getPerformanceAdvisors(projectId: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/advisors/performance',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to fetch performance advisors');\n\n return response.data;\n },\n };\n\n const development: DevelopmentOperations = {\n async getProjectUrl(projectId: string): Promise<string> {\n const apiUrl = new URL(managementApiUrl);\n return `https://${projectId}.${getProjectDomain(apiUrl.hostname)}`;\n },\n async getPublishableKeys(projectId: string): Promise<ApiKey[]> {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/api-keys',\n {\n params: {\n path: {\n ref: projectId,\n },\n query: {\n reveal: 'false',\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to fetch API keys');\n\n // Try to check if legacy JWT-based keys are enabled\n // If this fails, we'll continue without the disabled field\n let legacyKeysEnabled: boolean | undefined = undefined;\n try {\n const legacyKeysResponse = await managementApiClient.GET(\n '/v1/projects/{ref}/api-keys/legacy',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n if (legacyKeysResponse.response.ok) {\n legacyKeysEnabled = legacyKeysResponse.data?.enabled ?? true;\n }\n } catch (error) {\n // If we can't fetch legacy key status, continue without it\n legacyKeysEnabled = undefined;\n }\n\n // Filter for client-safe keys: legacy 'anon' or publishable type\n const clientKeys =\n response.data?.filter(\n (key) => key.name === 'anon' || key.type === 'publishable'\n ) ?? [];\n\n if (clientKeys.length === 0) {\n throw new Error(\n 'No client-safe API keys (anon or publishable) found. Please create a publishable key in your project settings.'\n );\n }\n\n return clientKeys.map((key) => ({\n api_key: key.api_key!,\n name: key.name,\n type: (key.type === 'publishable'\n ? 'publishable'\n : 'legacy') satisfies ApiKeyType,\n // Only include disabled field if we successfully fetched legacy key status\n ...(legacyKeysEnabled !== undefined && {\n disabled: key.type === 'legacy' && !legacyKeysEnabled,\n }),\n description: key.description ?? undefined,\n id: key.id ?? undefined,\n }));\n },\n async generateTypescriptTypes(projectId: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/types/typescript',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to fetch TypeScript types');\n\n return response.data;\n },\n };\n\n const functions: EdgeFunctionsOperations = {\n async listEdgeFunctions(projectId: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/functions',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to fetch Edge Functions');\n\n return response.data.map((edgeFunction) => {\n const deploymentId = getDeploymentId(\n projectId,\n edgeFunction.id,\n edgeFunction.version\n );\n\n const entrypoint_path = edgeFunction.entrypoint_path\n ? normalizeFilename({\n deploymentId,\n filename: fileURLToPath(edgeFunction.entrypoint_path, {\n windows: false,\n }),\n })\n : undefined;\n\n const import_map_path = edgeFunction.import_map_path\n ? normalizeFilename({\n deploymentId,\n filename: fileURLToPath(edgeFunction.import_map_path, {\n windows: false,\n }),\n })\n : undefined;\n\n return {\n ...edgeFunction,\n entrypoint_path,\n import_map_path,\n };\n });\n },\n async getEdgeFunction(projectId: string, functionSlug: string) {\n const functionResponse = await managementApiClient.GET(\n '/v1/projects/{ref}/functions/{function_slug}',\n {\n params: {\n path: {\n ref: projectId,\n function_slug: functionSlug,\n },\n },\n }\n );\n\n if (functionResponse.error) {\n throw functionResponse.error;\n }\n\n assertSuccess(functionResponse, 'Failed to fetch Edge Function');\n\n const edgeFunction = functionResponse.data;\n\n const deploymentId = getDeploymentId(\n projectId,\n edgeFunction.id,\n edgeFunction.version\n );\n\n const entrypoint_path = edgeFunction.entrypoint_path\n ? normalizeFilename({\n deploymentId,\n filename: fileURLToPath(edgeFunction.entrypoint_path, {\n windows: false,\n }),\n })\n : undefined;\n\n const import_map_path = edgeFunction.import_map_path\n ? normalizeFilename({\n deploymentId,\n filename: fileURLToPath(edgeFunction.import_map_path, {\n windows: false,\n }),\n })\n : undefined;\n\n const bodyResponse = await managementApiClient.GET(\n '/v1/projects/{ref}/functions/{function_slug}/body',\n {\n params: {\n path: {\n ref: projectId,\n function_slug: functionSlug,\n },\n },\n headers: {\n Accept: 'multipart/form-data',\n },\n parseAs: 'stream',\n }\n );\n\n assertSuccess(bodyResponse, 'Failed to fetch Edge Function files');\n\n const contentType = bodyResponse.response.headers.get('content-type');\n\n if (!contentType || !contentType.startsWith('multipart/form-data')) {\n throw new Error(\n `Unexpected content type: ${contentType}. Expected multipart/form-data.`\n );\n }\n\n const boundary = getMultipartBoundary(contentType);\n\n if (!boundary) {\n throw new Error('No multipart boundary found in response headers');\n }\n\n if (!bodyResponse.data) {\n throw new Error('No data received from Edge Function body');\n }\n\n const files: EdgeFunctionWithBody['files'] = [];\n const parts = parseMultipartStream(bodyResponse.data, { boundary });\n\n for await (const part of parts) {\n if (part.isFile && part.filename) {\n files.push({\n name: normalizeFilename({\n deploymentId,\n filename: part.filename,\n }),\n content: part.text,\n });\n }\n }\n\n return {\n ...edgeFunction,\n entrypoint_path,\n import_map_path,\n files,\n };\n },\n async deployEdgeFunction(\n projectId: string,\n options: DeployEdgeFunctionOptions\n ) {\n let {\n name,\n entrypoint_path,\n import_map_path,\n verify_jwt,\n files: inputFiles,\n } = deployEdgeFunctionOptionsSchema.parse(options);\n\n let existingEdgeFunction: EdgeFunction | undefined;\n try {\n existingEdgeFunction = await functions.getEdgeFunction(projectId, name);\n } catch (error) {}\n\n const import_map_file = inputFiles.find((file) =>\n ['deno.json', 'import_map.json'].includes(file.name)\n );\n\n // Use existing import map path or file name heuristic if not provided\n import_map_path ??=\n existingEdgeFunction?.import_map_path ?? import_map_file?.name;\n\n const response = await managementApiClient.POST(\n '/v1/projects/{ref}/functions/deploy',\n {\n params: {\n path: {\n ref: projectId,\n },\n query: { slug: name },\n },\n body: {\n metadata: {\n name,\n entrypoint_path,\n import_map_path,\n verify_jwt,\n },\n file: inputFiles as any, // We need to pass file name and content to our serializer\n },\n bodySerializer(body) {\n const formData = new FormData();\n\n const blob = new Blob([JSON.stringify(body.metadata)], {\n type: 'application/json',\n });\n formData.append('metadata', blob);\n\n body.file?.forEach((f: any) => {\n const file: { name: string; content: string } = f;\n const blob = new Blob([file.content], {\n type: 'application/typescript',\n });\n formData.append('file', blob, file.name);\n });\n\n return formData;\n },\n }\n );\n\n assertSuccess(response, 'Failed to deploy Edge Function');\n\n return response.data;\n },\n };\n\n const branching: BranchingOperations = {\n async listBranches(projectId: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/branches',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n // There are no branches if branching is disabled\n if (response.response.status === 422) return [];\n assertSuccess(response, 'Failed to list branches');\n\n return response.data;\n },\n async createBranch(projectId: string, options: CreateBranchOptions) {\n const { name } = createBranchOptionsSchema.parse(options);\n\n const createBranchResponse = await managementApiClient.POST(\n '/v1/projects/{ref}/branches',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n body: {\n branch_name: name,\n },\n }\n );\n\n assertSuccess(createBranchResponse, 'Failed to create branch');\n\n return createBranchResponse.data;\n },\n async deleteBranch(branchId: string) {\n const response = await managementApiClient.DELETE(\n '/v1/branches/{branch_id_or_ref}',\n {\n params: {\n path: {\n branch_id_or_ref: branchId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to delete branch');\n },\n async mergeBranch(branchId: string) {\n const response = await managementApiClient.POST(\n '/v1/branches/{branch_id_or_ref}/merge',\n {\n params: {\n path: {\n branch_id_or_ref: branchId,\n },\n },\n body: {},\n }\n );\n\n assertSuccess(response, 'Failed to merge branch');\n },\n async resetBranch(branchId: string, options: ResetBranchOptions) {\n const { migration_version } = resetBranchOptionsSchema.parse(options);\n\n const response = await managementApiClient.POST(\n '/v1/branches/{branch_id_or_ref}/reset',\n {\n params: {\n path: {\n branch_id_or_ref: branchId,\n },\n },\n body: {\n migration_version,\n },\n }\n );\n\n assertSuccess(response, 'Failed to reset branch');\n },\n async rebaseBranch(branchId: string) {\n const response = await managementApiClient.POST(\n '/v1/branches/{branch_id_or_ref}/push',\n {\n params: {\n path: {\n branch_id_or_ref: branchId,\n },\n },\n body: {},\n }\n );\n\n assertSuccess(response, 'Failed to rebase branch');\n },\n };\n\n const storage: StorageOperations = {\n // Storage methods\n async listAllBuckets(project_id: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/storage/buckets',\n {\n params: {\n path: {\n ref: project_id,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to list storage buckets');\n\n return response.data;\n },\n\n async getStorageConfig(project_id: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/config/storage',\n {\n params: {\n path: {\n ref: project_id,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to get storage config');\n\n return response.data;\n },\n\n async updateStorageConfig(projectId: string, config: StorageConfig) {\n const response = await managementApiClient.PATCH(\n '/v1/projects/{ref}/config/storage',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n body: {\n fileSizeLimit: config.fileSizeLimit,\n features: {\n imageTransformation: {\n enabled: config.features.imageTransformation.enabled,\n },\n s3Protocol: {\n enabled: config.features.s3Protocol.enabled,\n },\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to update storage config');\n },\n };\n\n const platform: SupabasePlatform = {\n async init(info: InitData) {\n const { clientInfo } = info;\n if (!clientInfo) {\n throw new Error('Client info is required');\n }\n\n // Re-initialize the management API client with the user agent\n managementApiClient = createManagementApiClient(\n managementApiUrl,\n accessToken,\n {\n 'User-Agent': `supabase-mcp/${version} (${clientInfo.name}/${clientInfo.version})`,\n }\n );\n },\n account,\n database,\n debugging,\n development,\n functions,\n branching,\n storage,\n };\n\n return platform;\n}\n\nfunction getProjectDomain(apiHostname: string) {\n switch (apiHostname) {\n case 'api.supabase.com':\n return 'supabase.co';\n case 'api.supabase.green':\n return 'supabase.green';\n default:\n return 'supabase.red';\n }\n}\n","import { stripIndent } from 'common-tags';\nimport type { LogsService } from './platform/types.js';\n\nexport function getClickHouseLogQuery(\n service: LogsService,\n limit: number = 100\n) {\n switch (service) {\n case 'api':\n return stripIndent`\n select id, log_attributes['identifier'] as identifier, timestamp, event_message, log_attributes['request.method'] as method, log_attributes['request.path'] as path, log_attributes['response.status_code'] as status_code\n from logs\n where source = 'edge_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'branch-action':\n return stripIndent`\n select log_attributes['workflow_run'] as workflow_run, timestamp, id, event_message\n from logs\n where source = 'workflow_run_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'postgres':\n return stripIndent`\n select log_attributes['identifier'] as identifier, timestamp, id, event_message, log_attributes['parsed.error_severity'] as error_severity\n from logs\n where source = 'postgres_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'edge-function':\n return stripIndent`\n select id, timestamp, event_message, log_attributes['response.status_code'] as status_code, log_attributes['request.method'] as method, log_attributes['function_id'] as function_id, log_attributes['execution_time_ms'] as execution_time_ms, log_attributes['deployment_id'] as deployment_id, log_attributes['version'] as version\n from logs\n where source = 'function_edge_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'edge-function-runtime':\n return stripIndent`\n select id, timestamp, event_message, severity_text, log_attributes['level'] as level, log_attributes['event_type'] as event_type, log_attributes['function_id'] as function_id, log_attributes['execution_id'] as execution_id, log_attributes['deployment_id'] as deployment_id, log_attributes['version'] as version\n from logs\n where source = 'function_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'auth':\n return stripIndent`\n select id, timestamp, event_message, log_attributes['level'] as level, log_attributes['status'] as status, log_attributes['path'] as path, log_attributes['msg'] as msg, log_attributes['error'] as error\n from logs\n where source = 'auth_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'storage':\n return stripIndent`\n select id, timestamp, event_message\n from logs\n where source = 'storage_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'realtime':\n return stripIndent`\n select id, timestamp, event_message\n from logs\n where source = 'realtime_logs'\n order by timestamp desc\n limit ${limit}\n `;\n default:\n throw new Error(`unsupported log service type: ${service}`);\n }\n}\n"]}
|
package/dist/chunk-GZNCDKYI.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
var m={name:"@supabase/mcp-server-supabase",mcpName:"com.supabase/mcp",version:"0.12.0",description:"MCP server for interacting with Supabase",license:"Apache-2.0",repository:{type:"git",url:"https://github.com/supabase/mcp.git"},type:"module",main:"dist/index.cjs",types:"dist/index.d.ts",sideEffects:!1,scripts:{build:"tsup --clean",dev:"tsup --watch",typecheck:"tsc --noEmit",prebuild:"pnpm typecheck",prepublishOnly:"pnpm build","registry:update":"tsx scripts/registry/update-version.ts && biome format --write server.json","registry:login":"scripts/registry/login.sh","registry:publish":"mcp-publisher publish",test:"vitest","test:unit":"vitest --project unit","test:e2e":"vitest --project e2e","test:integration":"vitest --project integration","test:coverage":"vitest --coverage","generate:management-api-types":"node scripts/generate-management-api-types.mjs"},files:["dist/**/*"],bin:{"mcp-server-supabase":"./dist/transports/stdio.js"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",default:"./dist/index.cjs"},"./platform":{types:"./dist/platform/index.d.ts",import:"./dist/platform/index.js",default:"./dist/platform/index.cjs"},"./platform/api":{types:"./dist/platform/api-platform.d.ts",import:"./dist/platform/api-platform.js",default:"./dist/platform/api-platform.cjs"}},dependencies:{"@mjackson/multipart-parser":"^0.10.1","@supabase/mcp-utils":"workspace:^","common-tags":"^1.8.2",gqlmin:"^0.3.1",graphql:"^16.11.0","openapi-fetch":"^0.13.5"},peerDependencies:{"@modelcontextprotocol/server":"catalog:",zod:"catalog:"},devDependencies:{"@ai-sdk/anthropic":"catalog:","@ai-sdk/mcp":"catalog:","@electric-sql/pglite":"^0.2.17","@modelcontextprotocol/client":"catalog:","@modelcontextprotocol/server":"catalog:","@total-typescript/tsconfig":"^1.0.4","@types/common-tags":"^1.8.4","@types/node":"^22.8.6","@vitest/coverage-v8":"^2.1.9",ai:"catalog:","date-fns":"^4.1.0",dotenv:"^16.5.0",msw:"^2.7.3",nanoid:"^5.1.5","openapi-typescript":"^7.5.0","openapi-typescript-helpers":"^0.0.15",prettier:"^3.3.3",tsup:"^8.3.5",tsx:"^4.19.2",typescript:"^5.6.3",vite:"^5.4.19",vitest:"^2.1.9",zod:"catalog:"}};import{codeBlock as o}from"common-tags";import{resolve as n}from"path";function u(e,t,i){return`${e}_${t}_${i}`}function a(e){return`/tmp/user_fn_${e}/`}function r(e,t){return e.startsWith(t)?e.slice(t.length):e}function f({deploymentId:e,filename:t}){let i=a(e),s=n(i,t);return s=r(s,i),s=r(s,"source/"),s}var y=o`
|
|
2
|
-
import "jsr:@supabase/functions-js/edge-runtime.d.ts";
|
|
3
|
-
|
|
4
|
-
Deno.serve(async (req: Request) => {
|
|
5
|
-
const data = {
|
|
6
|
-
message: "Hello there!"
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
return new Response(JSON.stringify(data), {
|
|
10
|
-
headers: {
|
|
11
|
-
'Content-Type': 'application/json',
|
|
12
|
-
'Connection': 'keep-alive'
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
`;export{m as a,u as b,f as c,y as d};
|
|
17
|
-
//# sourceMappingURL=chunk-GZNCDKYI.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json","../src/edge-function.ts"],"sourcesContent":["{\n \"name\": \"@supabase/mcp-server-supabase\",\n \"mcpName\": \"com.supabase/mcp\",\n \"version\": \"0.12.0\",\n \"description\": \"MCP server for interacting with Supabase\",\n \"license\": \"Apache-2.0\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/supabase/mcp.git\"\n },\n \"type\": \"module\",\n \"main\": \"dist/index.cjs\",\n \"types\": \"dist/index.d.ts\",\n \"sideEffects\": false,\n \"scripts\": {\n \"build\": \"tsup --clean\",\n \"dev\": \"tsup --watch\",\n \"typecheck\": \"tsc --noEmit\",\n \"prebuild\": \"pnpm typecheck\",\n \"prepublishOnly\": \"pnpm build\",\n \"registry:update\": \"tsx scripts/registry/update-version.ts && biome format --write server.json\",\n \"registry:login\": \"scripts/registry/login.sh\",\n \"registry:publish\": \"mcp-publisher publish\",\n \"test\": \"vitest\",\n \"test:unit\": \"vitest --project unit\",\n \"test:e2e\": \"vitest --project e2e\",\n \"test:integration\": \"vitest --project integration\",\n \"test:coverage\": \"vitest --coverage\",\n \"generate:management-api-types\": \"node scripts/generate-management-api-types.mjs\"\n },\n \"files\": [\n \"dist/**/*\"\n ],\n \"bin\": {\n \"mcp-server-supabase\": \"./dist/transports/stdio.js\"\n },\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\",\n \"default\": \"./dist/index.cjs\"\n },\n \"./platform\": {\n \"types\": \"./dist/platform/index.d.ts\",\n \"import\": \"./dist/platform/index.js\",\n \"default\": \"./dist/platform/index.cjs\"\n },\n \"./platform/api\": {\n \"types\": \"./dist/platform/api-platform.d.ts\",\n \"import\": \"./dist/platform/api-platform.js\",\n \"default\": \"./dist/platform/api-platform.cjs\"\n }\n },\n \"dependencies\": {\n \"@mjackson/multipart-parser\": \"^0.10.1\",\n \"@supabase/mcp-utils\": \"workspace:^\",\n \"common-tags\": \"^1.8.2\",\n \"gqlmin\": \"^0.3.1\",\n \"graphql\": \"^16.11.0\",\n \"openapi-fetch\": \"^0.13.5\"\n },\n \"peerDependencies\": {\n \"@modelcontextprotocol/server\": \"catalog:\",\n \"zod\": \"catalog:\"\n },\n \"devDependencies\": {\n \"@ai-sdk/anthropic\": \"catalog:\",\n \"@ai-sdk/mcp\": \"catalog:\",\n \"@electric-sql/pglite\": \"^0.2.17\",\n \"@modelcontextprotocol/client\": \"catalog:\",\n \"@modelcontextprotocol/server\": \"catalog:\",\n \"@total-typescript/tsconfig\": \"^1.0.4\",\n \"@types/common-tags\": \"^1.8.4\",\n \"@types/node\": \"^22.8.6\",\n \"@vitest/coverage-v8\": \"^2.1.9\",\n \"ai\": \"catalog:\",\n \"date-fns\": \"^4.1.0\",\n \"dotenv\": \"^16.5.0\",\n \"msw\": \"^2.7.3\",\n \"nanoid\": \"^5.1.5\",\n \"openapi-typescript\": \"^7.5.0\",\n \"openapi-typescript-helpers\": \"^0.0.15\",\n \"prettier\": \"^3.3.3\",\n \"tsup\": \"^8.3.5\",\n \"tsx\": \"^4.19.2\",\n \"typescript\": \"^5.6.3\",\n \"vite\": \"^5.4.19\",\n \"vitest\": \"^2.1.9\",\n \"zod\": \"catalog:\"\n }\n}\n","import { codeBlock } from 'common-tags';\nimport { resolve } from 'node:path';\n\n/**\n * Gets the deployment ID for an Edge Function.\n */\nexport function getDeploymentId(\n projectId: string,\n functionId: string,\n functionVersion: number\n): string {\n return `${projectId}_${functionId}_${functionVersion}`;\n}\n\n/**\n * Gets the path prefix applied to each file in an Edge Function.\n */\nexport function getPathPrefix(deploymentId: string) {\n return `/tmp/user_fn_${deploymentId}/`;\n}\n\n/**\n * Strips a prefix from a string.\n */\nfunction withoutPrefix(value: string, prefix: string) {\n return value.startsWith(prefix) ? value.slice(prefix.length) : value;\n}\n\n/**\n * Strips prefix from edge function file names, accounting for Deno 1 and 2.\n */\nexport function normalizeFilename({\n deploymentId,\n filename,\n}: { deploymentId: string; filename: string }) {\n const pathPrefix = getPathPrefix(deploymentId);\n\n // Deno 2 uses relative filenames, Deno 1 uses absolute. Resolve both to absolute first.\n const filenameAbsolute = resolve(pathPrefix, filename);\n\n // Strip prefix(es)\n let filenameWithoutPrefix = filenameAbsolute;\n filenameWithoutPrefix = withoutPrefix(filenameWithoutPrefix, pathPrefix);\n filenameWithoutPrefix = withoutPrefix(filenameWithoutPrefix, 'source/');\n\n return filenameWithoutPrefix;\n}\n\nexport const edgeFunctionExample = codeBlock`\n import \"jsr:@supabase/functions-js/edge-runtime.d.ts\";\n\n Deno.serve(async (req: Request) => {\n const data = {\n message: \"Hello there!\"\n };\n \n return new Response(JSON.stringify(data), {\n headers: {\n 'Content-Type': 'application/json',\n 'Connection': 'keep-alive'\n }\n });\n });\n`;\n"],"mappings":"AAAA,IAAAA,EAAA,CACE,KAAQ,gCACR,QAAW,mBACX,QAAW,SACX,YAAe,2CACf,QAAW,aACX,WAAc,CACZ,KAAQ,MACR,IAAO,qCACT,EACA,KAAQ,SACR,KAAQ,iBACR,MAAS,kBACT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C,aAAAJ,EACA,SAAAK,CACF,EAA+C,CAC7C,IAAMC,EAAaP,EAAcC,CAAY,EAMzCO,EAHqBb,EAAQY,EAAYD,CAAQ,EAIrD,OAAAE,EAAwBN,EAAcM,EAAuBD,CAAU,EACvEC,EAAwBN,EAAcM,EAAuB,SAAS,EAE/DA,CACT,CAEO,IAAMC,EAAsBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;","names":["package_default","codeBlock","resolve","getDeploymentId","projectId","functionId","functionVersion","getPathPrefix","deploymentId","withoutPrefix","value","prefix","normalizeFilename","filename","pathPrefix","filenameWithoutPrefix","edgeFunctionExample"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/platform/api-platform.ts","../src/logs.ts","../src/management-api/index.ts","../src/password.ts"],"sourcesContent":["import {\n getMultipartBoundary,\n parseMultipartStream,\n} from '@mjackson/multipart-parser';\nimport type { InitData } from '@supabase/mcp-utils';\nimport { fileURLToPath } from 'node:url';\nimport packageJson from '../../package.json' with { type: 'json' };\nimport { getDeploymentId, normalizeFilename } from '../edge-function.js';\nimport { getClickHouseLogQuery } from '../logs.js';\nimport {\n assertProjectScopedSuccess,\n assertSuccess,\n createManagementApiClient,\n} from '../management-api/index.js';\nimport { generatePassword } from '../password.js';\nimport {\n applyMigrationOptionsSchema,\n createBranchOptionsSchema,\n createProjectOptionsSchema,\n deployEdgeFunctionOptionsSchema,\n executeSqlOptionsSchema,\n getLogsOptionsSchema,\n queryLogsOptionsSchema,\n resetBranchOptionsSchema,\n type AccountOperations,\n type ApiKey,\n type ApiKeyType,\n type ApplyMigrationOptions,\n type BranchingOperations,\n type CreateBranchOptions,\n type CreateProjectOptions,\n type DatabaseOperations,\n type DebuggingOperations,\n type DeployEdgeFunctionOptions,\n type DevelopmentOperations,\n type SuccessResponse,\n type EdgeFunction,\n type EdgeFunctionsOperations,\n type EdgeFunctionWithBody,\n type ExecuteSqlOptions,\n type GetLogsOptions,\n type QueryLogsOptions,\n type ResetBranchOptions,\n type StorageConfig,\n type StorageOperations,\n type SupabasePlatform,\n} from './index.js';\n\nconst { version } = packageJson;\n\nconst SUCCESS_RESPONSE: SuccessResponse = { success: true };\n\nexport type SupabaseApiPlatformOptions = {\n /**\n * The access token for the Supabase Management API.\n */\n accessToken: string;\n\n /**\n * The API URL for the Supabase Management API.\n */\n apiUrl?: string;\n};\n\n/**\n * Creates a Supabase platform implementation using the Supabase Management API.\n */\nexport function createSupabaseApiPlatform(\n options: SupabaseApiPlatformOptions\n): SupabasePlatform {\n const { accessToken, apiUrl } = options;\n\n const managementApiUrl = apiUrl ?? 'https://api.supabase.com';\n\n let managementApiClient = createManagementApiClient(\n managementApiUrl,\n accessToken\n );\n\n const account: AccountOperations = {\n async listOrganizations() {\n const response = await managementApiClient.GET('/v1/organizations');\n\n assertSuccess(response, 'Failed to fetch organizations');\n\n return response.data;\n },\n async getOrganization(organizationId: string) {\n const response = await managementApiClient.GET(\n '/v1/organizations/{slug}',\n {\n params: {\n path: {\n slug: organizationId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to fetch organization');\n\n return response.data;\n },\n async listProjects() {\n const response = await managementApiClient.GET('/v1/projects');\n\n assertSuccess(response, 'Failed to fetch projects');\n\n return response.data;\n },\n async getProject(projectId: string) {\n const response = await managementApiClient.GET('/v1/projects/{ref}', {\n params: {\n path: {\n ref: projectId,\n },\n },\n });\n assertSuccess(response, 'Failed to fetch project');\n return response.data;\n },\n async createProject(options: CreateProjectOptions) {\n const { name, organization_id, region, db_pass } =\n createProjectOptionsSchema.parse(options);\n\n const response = await managementApiClient.POST('/v1/projects', {\n body: {\n name,\n region,\n organization_slug: organization_id,\n db_pass:\n db_pass ??\n generatePassword({\n length: 16,\n numbers: true,\n uppercase: true,\n lowercase: true,\n }),\n },\n });\n\n assertSuccess(response, 'Failed to create project');\n\n return response.data;\n },\n async pauseProject(projectId: string) {\n const response = await managementApiClient.POST(\n '/v1/projects/{ref}/pause',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to pause project');\n },\n async restoreProject(projectId: string) {\n const response = await managementApiClient.POST(\n '/v1/projects/{ref}/restore',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to restore project');\n },\n };\n\n const database: DatabaseOperations = {\n async executeSql<T>(projectId: string, options: ExecuteSqlOptions) {\n const { query, parameters, read_only } =\n executeSqlOptionsSchema.parse(options);\n\n const response = await managementApiClient.POST(\n '/v1/projects/{ref}/database/query',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n body: {\n query,\n parameters,\n read_only,\n },\n }\n );\n\n assertProjectScopedSuccess(\n response,\n 'Failed to execute SQL query',\n projectId\n );\n\n return response.data as unknown as T[];\n },\n async listMigrations(projectId: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/database/migrations',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n assertProjectScopedSuccess(\n response,\n 'Failed to fetch migrations',\n projectId\n );\n\n return response.data;\n },\n async applyMigration(projectId: string, options: ApplyMigrationOptions) {\n const { name, query } = applyMigrationOptionsSchema.parse(options);\n\n const response = await managementApiClient.POST(\n '/v1/projects/{ref}/database/migrations',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n body: {\n name,\n query,\n },\n }\n );\n\n assertProjectScopedSuccess(\n response,\n 'Failed to apply migration',\n projectId\n );\n\n // Intentionally don't return the result of the migration\n // to avoid prompt injection attacks. If the migration failed,\n // it will throw an error.\n },\n };\n\n const debugging: DebuggingOperations = {\n logsDialect: 'clickhouse',\n async getLogs(projectId: string, options: GetLogsOptions) {\n const { service, iso_timestamp_start, iso_timestamp_end } =\n getLogsOptionsSchema.parse(options);\n\n const sql = getClickHouseLogQuery(service);\n\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/analytics/endpoints/logs',\n {\n params: {\n path: {\n ref: projectId,\n },\n query: {\n sql,\n iso_timestamp_start,\n iso_timestamp_end,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to fetch logs');\n\n return response.data;\n },\n async queryLogs(projectId: string, options: QueryLogsOptions) {\n const { sql, iso_timestamp_start, iso_timestamp_end } =\n queryLogsOptionsSchema.parse(options);\n\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/analytics/endpoints/logs',\n {\n params: {\n path: {\n ref: projectId,\n },\n query: {\n sql,\n iso_timestamp_start,\n iso_timestamp_end,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to query logs');\n\n return response.data;\n },\n async getSecurityAdvisors(projectId: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/advisors/security',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to fetch security advisors');\n\n return response.data;\n },\n async getPerformanceAdvisors(projectId: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/advisors/performance',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to fetch performance advisors');\n\n return response.data;\n },\n };\n\n const development: DevelopmentOperations = {\n async getProjectUrl(projectId: string): Promise<string> {\n const apiUrl = new URL(managementApiUrl);\n return `https://${projectId}.${getProjectDomain(apiUrl.hostname)}`;\n },\n async getPublishableKeys(projectId: string): Promise<ApiKey[]> {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/api-keys',\n {\n params: {\n path: {\n ref: projectId,\n },\n query: {\n reveal: 'false',\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to fetch API keys');\n\n // Try to check if legacy JWT-based keys are enabled\n // If this fails, we'll continue without the disabled field\n let legacyKeysEnabled: boolean | undefined = undefined;\n try {\n const legacyKeysResponse = await managementApiClient.GET(\n '/v1/projects/{ref}/api-keys/legacy',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n if (legacyKeysResponse.response.ok) {\n legacyKeysEnabled = legacyKeysResponse.data?.enabled ?? true;\n }\n } catch (error) {\n // If we can't fetch legacy key status, continue without it\n legacyKeysEnabled = undefined;\n }\n\n // Filter for client-safe keys: legacy 'anon' or publishable type\n const clientKeys =\n response.data?.filter(\n (key) => key.name === 'anon' || key.type === 'publishable'\n ) ?? [];\n\n if (clientKeys.length === 0) {\n throw new Error(\n 'No client-safe API keys (anon or publishable) found. Please create a publishable key in your project settings.'\n );\n }\n\n return clientKeys.map((key) => ({\n api_key: key.api_key!,\n name: key.name,\n type: (key.type === 'publishable'\n ? 'publishable'\n : 'legacy') satisfies ApiKeyType,\n // Only include disabled field if we successfully fetched legacy key status\n ...(legacyKeysEnabled !== undefined && {\n disabled: key.type === 'legacy' && !legacyKeysEnabled,\n }),\n description: key.description ?? undefined,\n id: key.id ?? undefined,\n }));\n },\n async generateTypescriptTypes(projectId: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/types/typescript',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to fetch TypeScript types');\n\n return response.data;\n },\n };\n\n const functions: EdgeFunctionsOperations = {\n async listEdgeFunctions(projectId: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/functions',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to fetch Edge Functions');\n\n return response.data.map((edgeFunction) => {\n const deploymentId = getDeploymentId(\n projectId,\n edgeFunction.id,\n edgeFunction.version\n );\n\n const entrypoint_path = edgeFunction.entrypoint_path\n ? normalizeFilename({\n deploymentId,\n filename: fileURLToPath(edgeFunction.entrypoint_path, {\n windows: false,\n }),\n })\n : undefined;\n\n const import_map_path = edgeFunction.import_map_path\n ? normalizeFilename({\n deploymentId,\n filename: fileURLToPath(edgeFunction.import_map_path, {\n windows: false,\n }),\n })\n : undefined;\n\n return {\n ...edgeFunction,\n entrypoint_path,\n import_map_path,\n };\n });\n },\n async getEdgeFunction(projectId: string, functionSlug: string) {\n const functionResponse = await managementApiClient.GET(\n '/v1/projects/{ref}/functions/{function_slug}',\n {\n params: {\n path: {\n ref: projectId,\n function_slug: functionSlug,\n },\n },\n }\n );\n\n if (functionResponse.error) {\n throw functionResponse.error;\n }\n\n assertSuccess(functionResponse, 'Failed to fetch Edge Function');\n\n const edgeFunction = functionResponse.data;\n\n const deploymentId = getDeploymentId(\n projectId,\n edgeFunction.id,\n edgeFunction.version\n );\n\n const entrypoint_path = edgeFunction.entrypoint_path\n ? normalizeFilename({\n deploymentId,\n filename: fileURLToPath(edgeFunction.entrypoint_path, {\n windows: false,\n }),\n })\n : undefined;\n\n const import_map_path = edgeFunction.import_map_path\n ? normalizeFilename({\n deploymentId,\n filename: fileURLToPath(edgeFunction.import_map_path, {\n windows: false,\n }),\n })\n : undefined;\n\n const bodyResponse = await managementApiClient.GET(\n '/v1/projects/{ref}/functions/{function_slug}/body',\n {\n params: {\n path: {\n ref: projectId,\n function_slug: functionSlug,\n },\n },\n headers: {\n Accept: 'multipart/form-data',\n },\n parseAs: 'stream',\n }\n );\n\n assertSuccess(bodyResponse, 'Failed to fetch Edge Function files');\n\n const contentType = bodyResponse.response.headers.get('content-type');\n\n if (!contentType || !contentType.startsWith('multipart/form-data')) {\n throw new Error(\n `Unexpected content type: ${contentType}. Expected multipart/form-data.`\n );\n }\n\n const boundary = getMultipartBoundary(contentType);\n\n if (!boundary) {\n throw new Error('No multipart boundary found in response headers');\n }\n\n if (!bodyResponse.data) {\n throw new Error('No data received from Edge Function body');\n }\n\n const files: EdgeFunctionWithBody['files'] = [];\n const parts = parseMultipartStream(bodyResponse.data, { boundary });\n\n for await (const part of parts) {\n if (part.isFile && part.filename) {\n files.push({\n name: normalizeFilename({\n deploymentId,\n filename: part.filename,\n }),\n content: part.text,\n });\n }\n }\n\n return {\n ...edgeFunction,\n entrypoint_path,\n import_map_path,\n files,\n };\n },\n async deployEdgeFunction(\n projectId: string,\n options: DeployEdgeFunctionOptions\n ) {\n let {\n name,\n entrypoint_path,\n import_map_path,\n verify_jwt,\n files: inputFiles,\n } = deployEdgeFunctionOptionsSchema.parse(options);\n\n let existingEdgeFunction: EdgeFunction | undefined;\n try {\n existingEdgeFunction = await functions.getEdgeFunction(projectId, name);\n } catch (error) {}\n\n const import_map_file = inputFiles.find((file) =>\n ['deno.json', 'import_map.json'].includes(file.name)\n );\n\n // Use existing import map path or file name heuristic if not provided\n import_map_path ??=\n existingEdgeFunction?.import_map_path ?? import_map_file?.name;\n\n const response = await managementApiClient.POST(\n '/v1/projects/{ref}/functions/deploy',\n {\n params: {\n path: {\n ref: projectId,\n },\n query: { slug: name },\n },\n body: {\n metadata: {\n name,\n entrypoint_path,\n import_map_path,\n verify_jwt,\n },\n file: inputFiles as any, // We need to pass file name and content to our serializer\n },\n bodySerializer(body) {\n const formData = new FormData();\n\n const blob = new Blob([JSON.stringify(body.metadata)], {\n type: 'application/json',\n });\n formData.append('metadata', blob);\n\n body.file?.forEach((f: any) => {\n const file: { name: string; content: string } = f;\n const blob = new Blob([file.content], {\n type: 'application/typescript',\n });\n formData.append('file', blob, file.name);\n });\n\n return formData;\n },\n }\n );\n\n assertSuccess(response, 'Failed to deploy Edge Function');\n\n return response.data;\n },\n };\n\n const branching: BranchingOperations = {\n async listBranches(projectId: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/branches',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n }\n );\n\n // There are no branches if branching is disabled\n if (response.response.status === 422) return [];\n assertSuccess(response, 'Failed to list branches');\n\n return response.data;\n },\n async createBranch(projectId: string, options: CreateBranchOptions) {\n const { name } = createBranchOptionsSchema.parse(options);\n\n const createBranchResponse = await managementApiClient.POST(\n '/v1/projects/{ref}/branches',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n body: {\n branch_name: name,\n },\n }\n );\n\n assertSuccess(createBranchResponse, 'Failed to create branch');\n\n return createBranchResponse.data;\n },\n async deleteBranch(branchId: string) {\n const response = await managementApiClient.DELETE(\n '/v1/branches/{branch_id_or_ref}',\n {\n params: {\n path: {\n branch_id_or_ref: branchId,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to delete branch');\n },\n async mergeBranch(branchId: string) {\n const response = await managementApiClient.POST(\n '/v1/branches/{branch_id_or_ref}/merge',\n {\n params: {\n path: {\n branch_id_or_ref: branchId,\n },\n },\n body: {},\n }\n );\n\n assertSuccess(response, 'Failed to merge branch');\n },\n async resetBranch(branchId: string, options: ResetBranchOptions) {\n const { migration_version } = resetBranchOptionsSchema.parse(options);\n\n const response = await managementApiClient.POST(\n '/v1/branches/{branch_id_or_ref}/reset',\n {\n params: {\n path: {\n branch_id_or_ref: branchId,\n },\n },\n body: {\n migration_version,\n },\n }\n );\n\n assertSuccess(response, 'Failed to reset branch');\n },\n async rebaseBranch(branchId: string) {\n const response = await managementApiClient.POST(\n '/v1/branches/{branch_id_or_ref}/push',\n {\n params: {\n path: {\n branch_id_or_ref: branchId,\n },\n },\n body: {},\n }\n );\n\n assertSuccess(response, 'Failed to rebase branch');\n },\n };\n\n const storage: StorageOperations = {\n // Storage methods\n async listAllBuckets(project_id: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/storage/buckets',\n {\n params: {\n path: {\n ref: project_id,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to list storage buckets');\n\n return response.data;\n },\n\n async getStorageConfig(project_id: string) {\n const response = await managementApiClient.GET(\n '/v1/projects/{ref}/config/storage',\n {\n params: {\n path: {\n ref: project_id,\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to get storage config');\n\n return response.data;\n },\n\n async updateStorageConfig(projectId: string, config: StorageConfig) {\n const response = await managementApiClient.PATCH(\n '/v1/projects/{ref}/config/storage',\n {\n params: {\n path: {\n ref: projectId,\n },\n },\n body: {\n fileSizeLimit: config.fileSizeLimit,\n features: {\n imageTransformation: {\n enabled: config.features.imageTransformation.enabled,\n },\n s3Protocol: {\n enabled: config.features.s3Protocol.enabled,\n },\n },\n },\n }\n );\n\n assertSuccess(response, 'Failed to update storage config');\n },\n };\n\n const platform: SupabasePlatform = {\n async init(info: InitData) {\n const { clientInfo } = info;\n if (!clientInfo) {\n throw new Error('Client info is required');\n }\n\n // Re-initialize the management API client with the user agent\n managementApiClient = createManagementApiClient(\n managementApiUrl,\n accessToken,\n {\n 'User-Agent': `supabase-mcp/${version} (${clientInfo.name}/${clientInfo.version})`,\n }\n );\n },\n account,\n database,\n debugging,\n development,\n functions,\n branching,\n storage,\n };\n\n return platform;\n}\n\nfunction getProjectDomain(apiHostname: string) {\n switch (apiHostname) {\n case 'api.supabase.com':\n return 'supabase.co';\n case 'api.supabase.green':\n return 'supabase.green';\n default:\n return 'supabase.red';\n }\n}\n","import { stripIndent } from 'common-tags';\nimport type { LogsService } from './platform/types.js';\n\nexport function getClickHouseLogQuery(\n service: LogsService,\n limit: number = 100\n) {\n switch (service) {\n case 'api':\n return stripIndent`\n select id, log_attributes['identifier'] as identifier, timestamp, event_message, log_attributes['request.method'] as method, log_attributes['request.path'] as path, log_attributes['response.status_code'] as status_code\n from logs\n where source = 'edge_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'branch-action':\n return stripIndent`\n select log_attributes['workflow_run'] as workflow_run, timestamp, id, event_message\n from logs\n where source = 'workflow_run_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'postgres':\n return stripIndent`\n select log_attributes['identifier'] as identifier, timestamp, id, event_message, log_attributes['parsed.error_severity'] as error_severity\n from logs\n where source = 'postgres_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'edge-function':\n return stripIndent`\n select id, timestamp, event_message, log_attributes['response.status_code'] as status_code, log_attributes['request.method'] as method, log_attributes['function_id'] as function_id, log_attributes['execution_time_ms'] as execution_time_ms, log_attributes['deployment_id'] as deployment_id, log_attributes['version'] as version\n from logs\n where source = 'function_edge_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'edge-function-runtime':\n return stripIndent`\n select id, timestamp, event_message, severity_text, log_attributes['level'] as level, log_attributes['event_type'] as event_type, log_attributes['function_id'] as function_id, log_attributes['execution_id'] as execution_id, log_attributes['deployment_id'] as deployment_id, log_attributes['version'] as version\n from logs\n where source = 'function_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'auth':\n return stripIndent`\n select id, timestamp, event_message, log_attributes['level'] as level, log_attributes['status'] as status, log_attributes['path'] as path, log_attributes['msg'] as msg, log_attributes['error'] as error\n from logs\n where source = 'auth_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'storage':\n return stripIndent`\n select id, timestamp, event_message\n from logs\n where source = 'storage_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'realtime':\n return stripIndent`\n select id, timestamp, event_message\n from logs\n where source = 'realtime_logs'\n order by timestamp desc\n limit ${limit}\n `;\n default:\n throw new Error(`unsupported log service type: ${service}`);\n }\n}\n","import createClient, {\n type Client,\n type FetchResponse,\n type ParseAsResponse,\n} from 'openapi-fetch';\nimport type {\n MediaType,\n ResponseObjectMap,\n SuccessResponse,\n} from 'openapi-typescript-helpers';\nimport { z } from 'zod/v4';\nimport type { paths } from './types.js';\n\nexport function createManagementApiClient(\n baseUrl: string,\n accessToken: string,\n headers: Record<string, string> = {}\n) {\n return createClient<paths>({\n baseUrl,\n headers: {\n Authorization: `Bearer ${accessToken}`,\n ...headers,\n },\n });\n}\n\nexport type ManagementApiClient = Client<paths>;\n\nexport type SuccessResponseType<\n T extends Record<string | number, any>,\n Options,\n Media extends MediaType,\n> = {\n data: ParseAsResponse<SuccessResponse<ResponseObjectMap<T>, Media>, Options>;\n error?: never;\n response: Response;\n};\n\nconst errorSchema = z.object({\n message: z.string(),\n});\n\nexport function assertSuccess<\n T extends Record<string | number, any>,\n Options,\n Media extends MediaType,\n>(\n response: FetchResponse<T, Options, Media>,\n fallbackMessage: string\n): asserts response is SuccessResponseType<T, Options, Media> {\n if ('error' in response) {\n if (response.response.status === 401) {\n throw new Error(\n 'Unauthorized. Please provide a valid access token to the MCP server via the --access-token flag or SUPABASE_ACCESS_TOKEN.'\n );\n }\n\n const { data: errorContent } = errorSchema.safeParse(response.error);\n\n if (errorContent) {\n throw new Error(errorContent.message);\n }\n\n throw new Error(fallbackMessage);\n }\n}\n\n/**\n * Asserts success for project-scoped endpoints, mapping 403 responses to an\n * actionable message. A permission error on a specific project most commonly\n * means the access token is scoped to an organization that doesn't own the\n * project (e.g. the wrong organization was selected during OAuth login).\n *\n * Currently applied only to database operations (see AI-178). Before adopting\n * for other endpoints, check that a 403 there isn't better explained by plan\n * or role restrictions, where org-selection advice would mislead.\n */\nexport function assertProjectScopedSuccess<\n T extends Record<string | number, any>,\n Options,\n Media extends MediaType,\n>(\n response: FetchResponse<T, Options, Media>,\n fallbackMessage: string,\n projectId: string\n): asserts response is SuccessResponseType<T, Options, Media> {\n if ('error' in response && response.response.status === 403) {\n const { data: errorContent } = errorSchema.safeParse(response.error);\n const apiMessage = (errorContent?.message ?? fallbackMessage).replace(\n /\\.$/,\n ''\n );\n\n throw new Error(\n `${apiMessage}. Access to project '${projectId}' was denied. If this project exists, your access token may be scoped to a different organization: re-authenticate with the MCP server and select the organization that owns this project.`\n );\n }\n\n assertSuccess(response, fallbackMessage);\n}\n","const UPPERCASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst LOWERCASE_CHARS = 'abcdefghijklmnopqrstuvwxyz';\nconst NUMBER_CHARS = '0123456789';\nconst SYMBOL_CHARS = '!@#$%^&*()_+~`|}{[]:;?><,./-=';\n\nexport type GeneratePasswordOptions = {\n length?: number;\n numbers?: boolean;\n uppercase?: boolean;\n lowercase?: boolean;\n symbols?: boolean;\n};\n\n/**\n * Generates a cryptographically secure random password.\n *\n * @returns The generated password\n */\nexport const generatePassword = ({\n length = 10,\n numbers = false,\n symbols = false,\n uppercase = true,\n lowercase = true,\n} = {}) => {\n // Build the character set based on options\n let chars = '';\n if (uppercase) {\n chars += UPPERCASE_CHARS;\n }\n if (lowercase) {\n chars += LOWERCASE_CHARS;\n }\n if (numbers) {\n chars += NUMBER_CHARS;\n }\n if (symbols) {\n chars += SYMBOL_CHARS;\n }\n\n if (chars.length === 0) {\n throw new Error('at least one character set must be selected');\n }\n\n const randomValues = new Uint32Array(length);\n crypto.getRandomValues(randomValues);\n\n // Map random values to our character set\n let password = '';\n for (let i = 0; i < length; i++) {\n const randomIndex = randomValues[i]! % chars.length;\n password += chars.charAt(randomIndex);\n }\n\n return password;\n};\n"],"mappings":"+IAAA,OACE,wBAAAA,EACA,wBAAAC,MACK,6BAEP,OAAS,iBAAAC,MAAqB,MCL9B,OAAS,eAAAC,MAAmB,cAGrB,SAASC,EACdC,EACAC,EAAgB,IAChB,CACA,OAAQD,EAAS,CACf,IAAK,MACH,OAAOF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKGG,CAAK;AAAA,QAEjB,IAAK,gBACH,OAAOH;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKGG,CAAK;AAAA,QAEjB,IAAK,WACH,OAAOH;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKGG,CAAK;AAAA,QAEjB,IAAK,gBACH,OAAOH;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKGG,CAAK;AAAA,QAEjB,IAAK,wBACH,OAAOH;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKGG,CAAK;AAAA,QAEjB,IAAK,OACH,OAAOH;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKGG,CAAK;AAAA,QAEjB,IAAK,UACH,OAAOH;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKGG,CAAK;AAAA,QAEjB,IAAK,WACH,OAAOH;AAAA;AAAA;AAAA;AAAA;AAAA,gBAKGG,CAAK;AAAA,QAEjB,QACE,MAAM,IAAI,MAAM,iCAAiCD,CAAO,EAAE,CAC9D,CACF,CC3EA,OAAOE,MAIA,gBAMP,OAAS,KAAAC,MAAS,SAGX,SAASC,EACdC,EACAC,EACAC,EAAkC,CAAC,EACnC,CACA,OAAOL,EAAoB,CACzB,QAAAG,EACA,QAAS,CACP,cAAe,UAA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C/C,EACA,WAAY,CACV,QAASA,EAAO,SAAS,WAAW,OACtC,CACF,CACF,CACF,CACF,EAEAnE,EAAcD,EAAU,iCAAiC,CAC3D,CACF,CAyBA,CAGF,CAEA,SAAS0B,GAAiB2C,EAAqB,CAC7C,OAAQA,EAAa,CACnB,IAAK,mBACH,MAAO,cACT,IAAK,qBACH,MAAO,iBACT,QACE,MAAO,cACX,CACF","names":["getMultipartBoundary","parseMultipartStream","fileURLToPath","stripIndent","getClickHouseLogQuery","service","limit","createClient","z","createManagementApiClient","baseUrl","accessToken","headers","errorSchema","assertSuccess","response","fallbackMessage","errorContent","assertProjectScopedSuccess","projectId","apiMessage","UPPERCASE_CHARS","LOWERCASE_CHARS","NUMBER_CHARS","SYMBOL_CHARS","generatePassword","length","numbers","symbols","uppercase","lowercase","chars","randomValues","password","i","randomIndex","version","package_default","createSupabaseApiPlatform","options","accessToken","apiUrl","managementApiUrl","managementApiClient","createManagementApiClient","account","response","assertSuccess","organizationId","projectId","name","organization_id","region","db_pass","createProjectOptionsSchema","generatePassword","database","query","parameters","read_only","executeSqlOptionsSchema","assertProjectScopedSuccess","applyMigrationOptionsSchema","debugging","service","iso_timestamp_start","iso_timestamp_end","getLogsOptionsSchema","sql","getClickHouseLogQuery","queryLogsOptionsSchema","development","getProjectDomain","legacyKeysEnabled","legacyKeysResponse","clientKeys","key","functions","edgeFunction","deploymentId","getDeploymentId","entrypoint_path","normalizeFilename","fileURLToPath","import_map_path","functionSlug","functionResponse","bodyResponse","contentType","boundary","getMultipartBoundary","files","parts","parseMultipartStream","part","verify_jwt","inputFiles","deployEdgeFunctionOptionsSchema","existingEdgeFunction","import_map_file","file","body","formData","blob","f","info","clientInfo","version","createBranchOptionsSchema","createBranchResponse","branchId","migration_version","resetBranchOptionsSchema","project_id","config","apiHostname"]}
|