@supabase/mcp-server-supabase 0.7.0 → 0.8.1
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-EVDY7FB4.cjs +40 -0
- package/dist/chunk-EVDY7FB4.cjs.map +1 -0
- package/dist/chunk-IO3RHCXN.js +40 -0
- package/dist/chunk-IO3RHCXN.js.map +1 -0
- package/dist/chunk-LYI5DEVZ.cjs +258 -0
- package/dist/chunk-LYI5DEVZ.cjs.map +1 -0
- package/dist/chunk-OCWOYE3R.js +258 -0
- package/dist/chunk-OCWOYE3R.js.map +1 -0
- package/dist/chunk-PHWSETKC.cjs.map +1 -1
- package/dist/{chunk-RQ6WLHYN.cjs → chunk-QS6T7DCV.cjs} +2 -2
- package/dist/chunk-QS6T7DCV.cjs.map +1 -0
- package/dist/chunk-QX2UXNCU.cjs +2 -0
- package/dist/chunk-QX2UXNCU.cjs.map +1 -0
- package/dist/{chunk-T5S5YZRQ.js → chunk-STTFHRTS.js} +2 -2
- package/dist/chunk-STTFHRTS.js.map +1 -0
- package/dist/chunk-VCRYYVOD.js +2 -0
- package/dist/chunk-VCRYYVOD.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +1 -1
- package/dist/platform/api-platform.cjs +1 -1
- package/dist/platform/api-platform.cjs.map +1 -1
- package/dist/platform/api-platform.js +1 -1
- package/dist/platform/index.cjs +1 -1
- package/dist/platform/index.cjs.map +1 -1
- package/dist/platform/index.d.cts +7 -1
- package/dist/platform/index.d.ts +7 -1
- package/dist/platform/index.js +1 -1
- package/dist/transports/stdio.cjs +1 -1
- package/dist/transports/stdio.cjs.map +1 -1
- package/dist/transports/stdio.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-2N5IIY2F.cjs +0 -40
- package/dist/chunk-2N5IIY2F.cjs.map +0 -1
- package/dist/chunk-4T7KFO7P.js +0 -257
- package/dist/chunk-4T7KFO7P.js.map +0 -1
- package/dist/chunk-7DC6H4M6.cjs +0 -257
- package/dist/chunk-7DC6H4M6.cjs.map +0 -1
- package/dist/chunk-LH7KKQM2.js +0 -2
- package/dist/chunk-LH7KKQM2.js.map +0 -1
- package/dist/chunk-MRMSXNL7.js +0 -40
- package/dist/chunk-MRMSXNL7.js.map +0 -1
- package/dist/chunk-RQ6WLHYN.cjs.map +0 -1
- package/dist/chunk-SQUGJ45N.cjs +0 -2
- package/dist/chunk-SQUGJ45N.cjs.map +0 -1
- package/dist/chunk-T5S5YZRQ.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/supabase-mcp/supabase-mcp/packages/mcp-server-supabase/dist/chunk-PHWSETKC.cjs"],"names":[],"mappings":"AAAA","file":"/home/runner/work/supabase-mcp/supabase-mcp/packages/mcp-server-supabase/dist/chunk-PHWSETKC.cjs"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var m={name:"@supabase/mcp-server-supabase",mcpName:"com.supabase/mcp",version:"0.
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var m={name:"@supabase/mcp-server-supabase",mcpName:"com.supabase/mcp",version:"0.8.1",description:"MCP server for interacting with Supabase",license:"Apache-2.0",repository:{type:"git",url:"https://github.com/supabase-community/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":"openapi-typescript https://api.supabase.com/api/v1-json -o ./src/management-api/types.ts"},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/sdk":"catalog:",zod:"catalog:"},devDependencies:{"@ai-sdk/anthropic":"catalog:","@ai-sdk/mcp":"catalog:","@electric-sql/pglite":"^0.2.17","@modelcontextprotocol/sdk":"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:"}};var _commontags = require('common-tags');var _path = require('path');function g(t,e,i){return`${t}_${e}_${i}`}function a(t){return`/tmp/user_fn_${t}/`}function p(t,e){return t.startsWith(e)?t.slice(e.length):t}function f({deploymentId:t,filename:e}){let i=a(t),s=_path.resolve.call(void 0, i,e);return s=p(s,i),s=p(s,"source/"),s}var y=_commontags.codeBlock`
|
|
2
2
|
import "jsr:@supabase/functions-js/edge-runtime.d.ts";
|
|
3
3
|
|
|
4
4
|
Deno.serve(async (req: Request) => {
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
});
|
|
15
15
|
});
|
|
16
16
|
`;exports.a = m; exports.b = g; exports.c = f; exports.d = y;
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-QS6T7DCV.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/edge-function.ts","/home/runner/work/supabase-mcp/supabase-mcp/packages/mcp-server-supabase/dist/chunk-QS6T7DCV.cjs"],"names":["package_default","getDeploymentId","projectId","functionId","functionVersion"],"mappings":"AAAA,6EAAAA,CAAAA,CAAA,CACE,IAAA,CAAQ,+BAAA,CACR,OAAA,CAAW,kBAAA,CACX,OAAA,CAAW,OAAA,CACX,WAAA,CAAe,0CAAA,CACf,OAAA,CAAW,YAAA,CACX,UAAA,CAAc,CACZ,IAAA,CAAQ,KAAA,CACR,GAAA,CAAO,wDACT,CAAA,CACA,IAAA,CAAQ,QAAA,CACR,IAAA,CAAQ,gBAAA,CACR,KAAA,CAAS,iBAAA,CACT,WAAA,CAAe,CAAA,CAAA,CACf,OAAA,CAAW,CACT,KAAA,CAAS,cAAA,CACT,GAAA,CAAO,cAAA,CACP,SAAA,CAAa,cAAA,CACb,QAAA,CAAY,gBAAA,CACZ,cAAA,CAAkB,YAAA,CAClB,iBAAA,CAAmB,4EAAA,CACnB,gBAAA,CAAkB,2BAAA,CAClB,kBAAA,CAAoB,uBAAA,CACpB,IAAA,CAAQ,QAAA,CACR,WAAA,CAAa,uBAAA,CACb,UAAA,CAAY,sBAAA,CACZ,kBAAA,CAAoB,8BAAA,CACpB,eAAA,CAAiB,mBAAA,CACjB,+BAAA,CAAiC,0FACnC,CAAA,CACA,KAAA,CAAS,CACP,WACF,CAAA,CACA,GAAA,CAAO,CACL,qBAAA,CAAuB,4BACzB,CAAA,CACA,OAAA,CAAW,CACT,GAAA,CAAK,CACH,KAAA,CAAS,mBAAA,CACT,MAAA,CAAU,iBAAA,CACV,OAAA,CAAW,kBACb,CAAA,CACA,YAAA,CAAc,CACZ,KAAA,CAAS,4BAAA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6T7DCV.cjs","sourcesContent":["{\n \"name\": \"@supabase/mcp-server-supabase\",\n \"mcpName\": \"com.supabase/mcp\",\n \"version\": \"0.8.1\",\n \"description\": \"MCP server for interacting with Supabase\",\n \"license\": \"Apache-2.0\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/supabase-community/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\": \"openapi-typescript https://api.supabase.com/api/v1-json -o ./src/management-api/types.ts\"\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/sdk\": \"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/sdk\": \"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",null]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _v4 = require('zod/v4');var t=["us-west-1","us-east-1","us-east-2","ca-central-1","eu-west-1","eu-west-2","eu-west-3","eu-central-1","eu-central-2","eu-north-1","ap-south-1","ap-southeast-1","ap-northeast-1","ap-northeast-2","ap-southeast-2","sa-east-1"];var a=_v4.z.object({id:_v4.z.string(),name:_v4.z.string(),owner:_v4.z.string(),created_at:_v4.z.string(),updated_at:_v4.z.string(),public:_v4.z.boolean()}),p= exports.c =_v4.z.object({fileSizeLimit:_v4.z.number().int().min(0).max(536870912e3),features:_v4.z.object({imageTransformation:_v4.z.object({enabled:_v4.z.boolean()}),s3Protocol:_v4.z.object({enabled:_v4.z.boolean()})})}),c= exports.d =_v4.z.object({id:_v4.z.string(),name:_v4.z.string(),plan:_v4.z.string().optional(),allowed_release_channels:_v4.z.array(_v4.z.string()),opt_in_tags:_v4.z.array(_v4.z.string())}),g= exports.e =_v4.z.object({id:_v4.z.string(),ref:_v4.z.string(),organization_id:_v4.z.string(),organization_slug:_v4.z.string(),name:_v4.z.string(),status:_v4.z.string(),created_at:_v4.z.string(),region:_v4.z.string()}),m= exports.f =_v4.z.object({id:_v4.z.string(),name:_v4.z.string(),project_ref:_v4.z.string(),parent_project_ref:_v4.z.string(),is_default:_v4.z.boolean(),git_branch:_v4.z.string().optional(),pr_number:_v4.z.number().optional(),latest_check_run_id:_v4.z.number().optional(),persistent:_v4.z.boolean(),status:_v4.z.enum(["CREATING_PROJECT","RUNNING_MIGRATIONS","MIGRATIONS_PASSED","MIGRATIONS_FAILED","FUNCTIONS_DEPLOYED","FUNCTIONS_FAILED"]),created_at:_v4.z.string(),updated_at:_v4.z.string()}),o= exports.g =_v4.z.object({id:_v4.z.string(),slug:_v4.z.string(),name:_v4.z.string(),status:_v4.z.string(),version:_v4.z.number(),created_at:_v4.z.number().optional(),updated_at:_v4.z.number().optional(),verify_jwt:_v4.z.boolean().optional(),import_map:_v4.z.boolean().optional(),import_map_path:_v4.z.string().optional(),entrypoint_path:_v4.z.string().optional()}),y= exports.h =o.extend({files:_v4.z.array(_v4.z.object({name:_v4.z.string(),content:_v4.z.string()}))}),d= exports.i =_v4.z.object({name:_v4.z.string().min(1).max(256),organization_id:_v4.z.string(),region:_v4.z.enum(t),db_pass:_v4.z.string().optional()}),u= exports.j =_v4.z.object({name:_v4.z.string().min(1)}),l= exports.k =_v4.z.object({migration_version:_v4.z.string().optional()}),h= exports.l =_v4.z.object({name:_v4.z.string().regex(/^[A-Za-z][A-Za-z0-9_-]*$/),entrypoint_path:_v4.z.string(),import_map_path:_v4.z.string().optional(),verify_jwt:_v4.z.boolean().optional(),files:_v4.z.array(_v4.z.object({name:_v4.z.string(),content:_v4.z.string()}))}),S= exports.m =_v4.z.object({query:_v4.z.string().min(1),parameters:_v4.z.array(_v4.z.unknown()).optional(),read_only:_v4.z.boolean().optional()}),f= exports.n =_v4.z.object({name:_v4.z.string().min(1),query:_v4.z.string().min(1)}),b= exports.o =_v4.z.object({version:_v4.z.string(),name:_v4.z.string().optional()}),n= exports.p =_v4.z.enum(["api","branch-action","postgres","edge-function","auth","storage","realtime"]),j= exports.q =_v4.z.object({service:n,iso_timestamp_start:_v4.z.string().optional(),iso_timestamp_end:_v4.z.string().optional()}),O= exports.r =_v4.z.object({types:_v4.z.string()}),x= exports.s =_v4.z.enum(["legacy","publishable"]);exports.a = t; exports.b = a; exports.c = p; exports.d = c; exports.e = g; exports.f = m; exports.g = o; exports.h = y; exports.i = d; exports.j = u; exports.k = l; exports.l = h; exports.m = S; exports.n = f; exports.o = b; exports.p = n; exports.q = j; exports.r = O; exports.s = x;
|
|
2
|
+
//# sourceMappingURL=chunk-QX2UXNCU.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/platform/types.ts","../src/regions.ts"],"names":["AWS_REGION_CODES","storageBucketSchema","z","storageConfigSchema","organizationSchema","projectSchema","branchSchema","edgeFunctionSchema","edgeFunctionWithBodySchema","createProjectOptionsSchema","createBranchOptionsSchema","resetBranchOptionsSchema","deployEdgeFunctionOptionsSchema","executeSqlOptionsSchema","applyMigrationOptionsSchema","migrationSchema","logsServiceSchema","getLogsOptionsSchema","generateTypescriptTypesResultSchema","apiKeyTypeSchema"],"mappings":"AACA,qGAAkB,ICDLA,CAAAA,CAAmB,CAC9B,WAAA,CACA,WAAA,CACA,WAAA,CACA,cAAA,CACA,WAAA,CACA,WAAA,CACA,WAAA,CACA,cAAA,CACA,cAAA,CACA,YAAA,CACA,YAAA,CACA,gBAAA,CACA,gBAAA,CACA,gBAAA,CACA,gBAAA,CACA,WACF,CAAA,CDTO,IAAMC,CAAAA,CAAsBC,KAAAA,CAAE,MAAA,CAAO,CAC1C,EAAA,CAAIA,KAAAA,CAAE,MAAA,CAAO,CAAA,CACb,IAAA,CAAMA,KAAAA,CAAE,MAAA,CAAO,CAAA,CACf,KAAA,CAAOA,KAAAA,CAAE,MAAA,CAAO,CAAA,CAChB,UAAA,CAAYA,KAAAA,CAAE,MAAA,CAAO,CAAA,CACrB,UAAA,CAAYA,KAAAA,CAAE,MAAA,CAAO,CAAA,CACrB,MAAA,CAAQA,KAAAA,CAAE,OAAA,CAAQ,CACpB,CAAC,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E,MAAA,CAAO,CACtC,OAAA,CAASA,KAAAA,CAAE,MAAA,CAAO,CAAA,CAClB,IAAA,CAAMA,KAAAA,CAAE,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CAC5B,CAAC,CAAA,CAEYc,CAAAA,aAAoBd,KAAAA,CAAE,IAAA,CAAK,CACtC,KAAA,CACA,eAAA,CACA,UAAA,CACA,eAAA,CACA,MAAA,CACA,SAAA,CACA,UACF,CAAC,CAAA,CAEYe,CAAAA,aAAuBf,KAAAA,CAAE,MAAA,CAAO,CAC3C,OAAA,CAASc,CAAAA,CACT,mBAAA,CAAqBd,KAAAA,CAAE,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CAAA,CACzC,iBAAA,CAAmBA,KAAAA,CAAE,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CACzC,CAAC,CAAA,CAEYgB,CAAAA,aAAsChB,KAAAA,CAAE,MAAA,CAAO,CAC1D,KAAA,CAAOA,KAAAA,CAAE,MAAA,CAAO,CAClB,CAAC,CAAA,CAkEYiB,CAAAA,aAAmBjB,KAAAA,CAAE,IAAA,CAAK,CAAC,QAAA,CAAU,aAAa,CAAC,CAAA,CAAA,4RAAA","file":"/home/runner/work/supabase-mcp/supabase-mcp/packages/mcp-server-supabase/dist/chunk-QX2UXNCU.cjs","sourcesContent":["import type { InitData } from '@supabase/mcp-utils';\nimport { z } from 'zod/v4';\nimport { AWS_REGION_CODES } from '../regions.js';\n\nexport type SuccessResponse = {\n success: true;\n};\n\nexport const storageBucketSchema = z.object({\n id: z.string(),\n name: z.string(),\n owner: z.string(),\n created_at: z.string(),\n updated_at: z.string(),\n public: z.boolean(),\n});\n\nexport const storageConfigSchema = z.object({\n fileSizeLimit: z.number().int().min(0).max(536_870_912_000), // 500GB\n features: z.object({\n imageTransformation: z.object({ enabled: z.boolean() }),\n s3Protocol: z.object({ enabled: z.boolean() }),\n }),\n});\n\nexport const organizationSchema = z.object({\n id: z.string(),\n name: z.string(),\n plan: z.string().optional(),\n allowed_release_channels: z.array(z.string()),\n opt_in_tags: z.array(z.string()),\n});\n\nexport const projectSchema = z.object({\n id: z.string(),\n ref: z.string(),\n organization_id: z.string(),\n organization_slug: z.string(),\n name: z.string(),\n status: z.string(),\n created_at: z.string(),\n region: z.string(),\n});\n\nexport const branchSchema = z.object({\n id: z.string(),\n name: z.string(),\n project_ref: z.string(),\n parent_project_ref: z.string(),\n is_default: z.boolean(),\n git_branch: z.string().optional(),\n pr_number: z.number().optional(),\n latest_check_run_id: z.number().optional(),\n persistent: z.boolean(),\n status: z.enum([\n 'CREATING_PROJECT',\n 'RUNNING_MIGRATIONS',\n 'MIGRATIONS_PASSED',\n 'MIGRATIONS_FAILED',\n 'FUNCTIONS_DEPLOYED',\n 'FUNCTIONS_FAILED',\n ]),\n created_at: z.string(),\n updated_at: z.string(),\n});\n\nexport const edgeFunctionSchema = z.object({\n id: z.string(),\n slug: z.string(),\n name: z.string(),\n status: z.string(),\n version: z.number(),\n created_at: z.number().optional(),\n updated_at: z.number().optional(),\n verify_jwt: z.boolean().optional(),\n import_map: z.boolean().optional(),\n import_map_path: z.string().optional(),\n entrypoint_path: z.string().optional(),\n});\n\nexport const edgeFunctionWithBodySchema = edgeFunctionSchema.extend({\n files: z.array(\n z.object({\n name: z.string(),\n content: z.string(),\n })\n ),\n});\n\nexport const createProjectOptionsSchema = z.object({\n name: z.string().min(1).max(256),\n organization_id: z.string(),\n region: z.enum(AWS_REGION_CODES),\n db_pass: z.string().optional(),\n});\n\nexport const createBranchOptionsSchema = z.object({\n name: z.string().min(1),\n});\n\nexport const resetBranchOptionsSchema = z.object({\n migration_version: z.string().optional(),\n});\n\nexport const deployEdgeFunctionOptionsSchema = z.object({\n name: z.string().regex(/^[A-Za-z][A-Za-z0-9_-]*$/),\n entrypoint_path: z.string(),\n import_map_path: z.string().optional(),\n verify_jwt: z.boolean().optional(),\n files: z.array(\n z.object({\n name: z.string(),\n content: z.string(),\n })\n ),\n});\n\nexport const executeSqlOptionsSchema = z.object({\n query: z.string().min(1),\n parameters: z.array(z.unknown()).optional(),\n read_only: z.boolean().optional(),\n});\n\nexport const applyMigrationOptionsSchema = z.object({\n name: z.string().min(1),\n query: z.string().min(1),\n});\n\nexport const migrationSchema = z.object({\n version: z.string(),\n name: z.string().optional(),\n});\n\nexport const logsServiceSchema = z.enum([\n 'api',\n 'branch-action',\n 'postgres',\n 'edge-function',\n 'auth',\n 'storage',\n 'realtime',\n]);\n\nexport const getLogsOptionsSchema = z.object({\n service: logsServiceSchema,\n iso_timestamp_start: z.string().optional(),\n iso_timestamp_end: z.string().optional(),\n});\n\nexport const generateTypescriptTypesResultSchema = z.object({\n types: z.string(),\n});\n\nexport type Organization = z.infer<typeof organizationSchema>;\nexport type Project = z.infer<typeof projectSchema>;\nexport type Branch = z.infer<typeof branchSchema>;\nexport type EdgeFunction = z.infer<typeof edgeFunctionSchema>;\nexport type EdgeFunctionWithBody = z.infer<typeof edgeFunctionWithBodySchema>;\n\nexport type CreateProjectOptions = z.infer<typeof createProjectOptionsSchema>;\nexport type CreateBranchOptions = z.infer<typeof createBranchOptionsSchema>;\nexport type ResetBranchOptions = z.infer<typeof resetBranchOptionsSchema>;\nexport type DeployEdgeFunctionOptions = z.infer<\n typeof deployEdgeFunctionOptionsSchema\n>;\n\nexport type ExecuteSqlOptions = z.infer<typeof executeSqlOptionsSchema>;\nexport type ApplyMigrationOptions = z.infer<typeof applyMigrationOptionsSchema>;\nexport type Migration = z.infer<typeof migrationSchema>;\nexport type ListMigrationsResult = z.infer<typeof migrationSchema>;\n\nexport type LogsService = z.infer<typeof logsServiceSchema>;\nexport type GetLogsOptions = z.infer<typeof getLogsOptionsSchema>;\nexport type GenerateTypescriptTypesResult = z.infer<\n typeof generateTypescriptTypesResultSchema\n>;\n\nexport type StorageConfig = z.infer<typeof storageConfigSchema>;\nexport type StorageBucket = z.infer<typeof storageBucketSchema>;\n\nexport type DatabaseOperations = {\n executeSql<T>(projectId: string, options: ExecuteSqlOptions): Promise<T[]>;\n listMigrations(projectId: string): Promise<Migration[]>;\n applyMigration(\n projectId: string,\n options: ApplyMigrationOptions\n ): Promise<void>;\n};\n\nexport type AccountOperations = {\n listOrganizations(): Promise<{ id: string; slug: string; name: string }[]>;\n getOrganization(organizationId: string): Promise<Organization>;\n listProjects(): Promise<Project[]>;\n getProject(projectId: string): Promise<Project>;\n createProject(options: CreateProjectOptions): Promise<Project>;\n pauseProject(projectId: string): Promise<void>;\n restoreProject(projectId: string): Promise<void>;\n};\n\nexport type EdgeFunctionsOperations = {\n listEdgeFunctions(projectId: string): Promise<EdgeFunction[]>;\n getEdgeFunction(\n projectId: string,\n functionSlug: string\n ): Promise<EdgeFunctionWithBody>;\n deployEdgeFunction(\n projectId: string,\n options: DeployEdgeFunctionOptions\n ): Promise<Omit<EdgeFunction, 'files'>>;\n};\n\nexport type DebuggingOperations = {\n getLogs(projectId: string, options: GetLogsOptions): Promise<unknown>;\n getSecurityAdvisors(projectId: string): Promise<unknown>;\n getPerformanceAdvisors(projectId: string): Promise<unknown>;\n};\n\nexport const apiKeyTypeSchema = z.enum(['legacy', 'publishable']);\nexport type ApiKeyType = z.infer<typeof apiKeyTypeSchema>;\n\nexport type ApiKey = {\n api_key: string;\n name: string;\n type: ApiKeyType;\n description?: string;\n id?: string;\n disabled?: boolean;\n};\n\nexport type DevelopmentOperations = {\n getProjectUrl(projectId: string): Promise<string>;\n getPublishableKeys(projectId: string): Promise<ApiKey[]>;\n generateTypescriptTypes(\n projectId: string\n ): Promise<GenerateTypescriptTypesResult>;\n};\n\nexport type StorageOperations = {\n getStorageConfig(projectId: string): Promise<StorageConfig>;\n updateStorageConfig(projectId: string, config: StorageConfig): Promise<void>;\n listAllBuckets(projectId: string): Promise<StorageBucket[]>;\n};\n\nexport type BranchingOperations = {\n listBranches(projectId: string): Promise<Branch[]>;\n createBranch(\n projectId: string,\n options: CreateBranchOptions\n ): Promise<Branch>;\n deleteBranch(branchId: string): Promise<void>;\n mergeBranch(branchId: string): Promise<void>;\n resetBranch(branchId: string, options: ResetBranchOptions): Promise<void>;\n rebaseBranch(branchId: string): Promise<void>;\n};\n\nexport type SupabasePlatform = {\n init?(info: InitData): Promise<void>;\n account?: AccountOperations;\n database?: DatabaseOperations;\n functions?: EdgeFunctionsOperations;\n debugging?: DebuggingOperations;\n development?: DevelopmentOperations;\n storage?: StorageOperations;\n branching?: BranchingOperations;\n};\n","export const AWS_REGION_CODES = [\n 'us-west-1',\n 'us-east-1',\n 'us-east-2',\n 'ca-central-1',\n 'eu-west-1',\n 'eu-west-2',\n 'eu-west-3',\n 'eu-central-1',\n 'eu-central-2',\n 'eu-north-1',\n 'ap-south-1',\n 'ap-southeast-1',\n 'ap-northeast-1',\n 'ap-northeast-2',\n 'ap-southeast-2',\n 'sa-east-1',\n] as const;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var m={name:"@supabase/mcp-server-supabase",mcpName:"com.supabase/mcp",version:"0.
|
|
1
|
+
var m={name:"@supabase/mcp-server-supabase",mcpName:"com.supabase/mcp",version:"0.8.1",description:"MCP server for interacting with Supabase",license:"Apache-2.0",repository:{type:"git",url:"https://github.com/supabase-community/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":"openapi-typescript https://api.supabase.com/api/v1-json -o ./src/management-api/types.ts"},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/sdk":"catalog:",zod:"catalog:"},devDependencies:{"@ai-sdk/anthropic":"catalog:","@ai-sdk/mcp":"catalog:","@electric-sql/pglite":"^0.2.17","@modelcontextprotocol/sdk":"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 g(t,e,i){return`${t}_${e}_${i}`}function a(t){return`/tmp/user_fn_${t}/`}function p(t,e){return t.startsWith(e)?t.slice(e.length):t}function f({deploymentId:t,filename:e}){let i=a(t),s=n(i,e);return s=p(s,i),s=p(s,"source/"),s}var y=o`
|
|
2
2
|
import "jsr:@supabase/functions-js/edge-runtime.d.ts";
|
|
3
3
|
|
|
4
4
|
Deno.serve(async (req: Request) => {
|
|
@@ -14,4 +14,4 @@ var m={name:"@supabase/mcp-server-supabase",mcpName:"com.supabase/mcp",version:"
|
|
|
14
14
|
});
|
|
15
15
|
});
|
|
16
16
|
`;export{m as a,g as b,f as c,y as d};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-STTFHRTS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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.8.1\",\n \"description\": \"MCP server for interacting with Supabase\",\n \"license\": \"Apache-2.0\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/supabase-community/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\": \"openapi-typescript https://api.supabase.com/api/v1-json -o ./src/management-api/types.ts\"\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/sdk\": \"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/sdk\": \"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,QACX,YAAe,2CACf,QAAW,aACX,WAAc,CACZ,KAAQ,MACR,IAAO,wDACT,EACA,KAAQ,SACR,KAAQ,iBACR,MAAS,kBACT,YAAe,GACf,QAAW,CACT,MAAS,eACT,IAAO,eACP,UAAa,eACb,SAAY,iBACZ,eAAkB,aAClB,kBAAmB,6EACnB,iBAAkB,4BAClB,mBAAoB,wBACpB,KAAQ,SACR,YAAa,wBACb,WAAY,uBACZ,mBAAoB,+BACpB,gBAAiB,oBACjB,gCAAiC,0FACnC,EACA,MAAS,CACP,WACF,EACA,IAAO,CACL,sBAAuB,4BACzB,EACA,QAAW,CACT,IAAK,CACH,MAAS,oBACT,OAAU,kBACV,QAAW,kBACb,EACA,aAAc,CACZ,MAAS,6BACT,OAAU,2BACV,QAAW,2BACb,EACA,iBAAkB,CAChB,MAAS,oCACT,OAAU,kCACV,QAAW,kCACb,CACF,EACA,aAAgB,CACd,6BAA8B,UAC9B,sBAAuB,cACvB,cAAe,SACf,OAAU,SACV,QAAW,WACX,gBAAiB,SACnB,EACA,iBAAoB,CAClB,4BAA6B,WAC7B,IAAO,UACT,EACA,gBAAmB,CACjB,oBAAqB,WACrB,cAAe,WACf,uBAAwB,UACxB,4BAA6B,WAC7B,6BAA8B,SAC9B,qBAAsB,SACtB,cAAe,UACf,sBAAuB,SACvB,GAAM,WACN,WAAY,SACZ,OAAU,UACV,IAAO,SACP,OAAU,SACV,qBAAsB,SACtB,6BAA8B,UAC9B,SAAY,SACZ,KAAQ,SACR,IAAO,UACP,WAAc,SACd,KAAQ,UACR,OAAU,SACV,IAAO,UACT,CACF,ECzFA,OAAS,aAAAC,MAAiB,cAC1B,OAAS,WAAAC,MAAe,OAKjB,SAASC,EACdC,EACAC,EACAC,EACQ,CACR,MAAO,GAAGF,CAAS,IAAIC,CAAU,IAAIC,CAAe,EACtD,CAKO,SAASC,EAAcC,EAAsB,CAClD,MAAO,gBAAgBA,CAAY,GACrC,CAKA,SAASC,EAAcC,EAAeC,EAAgB,CACpD,OAAOD,EAAM,WAAWC,CAAM,EAAID,EAAM,MAAMC,EAAO,MAAM,EAAID,CACjE,CAKO,SAASE,EAAkB,CAChC,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"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{z as e}from"zod/v4";var t=["us-west-1","us-east-1","us-east-2","ca-central-1","eu-west-1","eu-west-2","eu-west-3","eu-central-1","eu-central-2","eu-north-1","ap-south-1","ap-southeast-1","ap-northeast-1","ap-northeast-2","ap-southeast-2","sa-east-1"];var a=e.object({id:e.string(),name:e.string(),owner:e.string(),created_at:e.string(),updated_at:e.string(),public:e.boolean()}),p=e.object({fileSizeLimit:e.number().int().min(0).max(536870912e3),features:e.object({imageTransformation:e.object({enabled:e.boolean()}),s3Protocol:e.object({enabled:e.boolean()})})}),c=e.object({id:e.string(),name:e.string(),plan:e.string().optional(),allowed_release_channels:e.array(e.string()),opt_in_tags:e.array(e.string())}),g=e.object({id:e.string(),ref:e.string(),organization_id:e.string(),organization_slug:e.string(),name:e.string(),status:e.string(),created_at:e.string(),region:e.string()}),m=e.object({id:e.string(),name:e.string(),project_ref:e.string(),parent_project_ref:e.string(),is_default:e.boolean(),git_branch:e.string().optional(),pr_number:e.number().optional(),latest_check_run_id:e.number().optional(),persistent:e.boolean(),status:e.enum(["CREATING_PROJECT","RUNNING_MIGRATIONS","MIGRATIONS_PASSED","MIGRATIONS_FAILED","FUNCTIONS_DEPLOYED","FUNCTIONS_FAILED"]),created_at:e.string(),updated_at:e.string()}),o=e.object({id:e.string(),slug:e.string(),name:e.string(),status:e.string(),version:e.number(),created_at:e.number().optional(),updated_at:e.number().optional(),verify_jwt:e.boolean().optional(),import_map:e.boolean().optional(),import_map_path:e.string().optional(),entrypoint_path:e.string().optional()}),y=o.extend({files:e.array(e.object({name:e.string(),content:e.string()}))}),d=e.object({name:e.string().min(1).max(256),organization_id:e.string(),region:e.enum(t),db_pass:e.string().optional()}),u=e.object({name:e.string().min(1)}),l=e.object({migration_version:e.string().optional()}),h=e.object({name:e.string().regex(/^[A-Za-z][A-Za-z0-9_-]*$/),entrypoint_path:e.string(),import_map_path:e.string().optional(),verify_jwt:e.boolean().optional(),files:e.array(e.object({name:e.string(),content:e.string()}))}),S=e.object({query:e.string().min(1),parameters:e.array(e.unknown()).optional(),read_only:e.boolean().optional()}),f=e.object({name:e.string().min(1),query:e.string().min(1)}),b=e.object({version:e.string(),name:e.string().optional()}),n=e.enum(["api","branch-action","postgres","edge-function","auth","storage","realtime"]),j=e.object({service:n,iso_timestamp_start:e.string().optional(),iso_timestamp_end:e.string().optional()}),O=e.object({types:e.string()}),x=e.enum(["legacy","publishable"]);export{t as a,a as b,p as c,c as d,g as e,m as f,o as g,y as h,d as i,u as j,l as k,h as l,S as m,f as n,b as o,n as p,j as q,O as r,x as s};
|
|
2
|
+
//# sourceMappingURL=chunk-VCRYYVOD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/platform/types.ts","../src/regions.ts"],"sourcesContent":["import type { InitData } from '@supabase/mcp-utils';\nimport { z } from 'zod/v4';\nimport { AWS_REGION_CODES } from '../regions.js';\n\nexport type SuccessResponse = {\n success: true;\n};\n\nexport const storageBucketSchema = z.object({\n id: z.string(),\n name: z.string(),\n owner: z.string(),\n created_at: z.string(),\n updated_at: z.string(),\n public: z.boolean(),\n});\n\nexport const storageConfigSchema = z.object({\n fileSizeLimit: z.number().int().min(0).max(536_870_912_000), // 500GB\n features: z.object({\n imageTransformation: z.object({ enabled: z.boolean() }),\n s3Protocol: z.object({ enabled: z.boolean() }),\n }),\n});\n\nexport const organizationSchema = z.object({\n id: z.string(),\n name: z.string(),\n plan: z.string().optional(),\n allowed_release_channels: z.array(z.string()),\n opt_in_tags: z.array(z.string()),\n});\n\nexport const projectSchema = z.object({\n id: z.string(),\n ref: z.string(),\n organization_id: z.string(),\n organization_slug: z.string(),\n name: z.string(),\n status: z.string(),\n created_at: z.string(),\n region: z.string(),\n});\n\nexport const branchSchema = z.object({\n id: z.string(),\n name: z.string(),\n project_ref: z.string(),\n parent_project_ref: z.string(),\n is_default: z.boolean(),\n git_branch: z.string().optional(),\n pr_number: z.number().optional(),\n latest_check_run_id: z.number().optional(),\n persistent: z.boolean(),\n status: z.enum([\n 'CREATING_PROJECT',\n 'RUNNING_MIGRATIONS',\n 'MIGRATIONS_PASSED',\n 'MIGRATIONS_FAILED',\n 'FUNCTIONS_DEPLOYED',\n 'FUNCTIONS_FAILED',\n ]),\n created_at: z.string(),\n updated_at: z.string(),\n});\n\nexport const edgeFunctionSchema = z.object({\n id: z.string(),\n slug: z.string(),\n name: z.string(),\n status: z.string(),\n version: z.number(),\n created_at: z.number().optional(),\n updated_at: z.number().optional(),\n verify_jwt: z.boolean().optional(),\n import_map: z.boolean().optional(),\n import_map_path: z.string().optional(),\n entrypoint_path: z.string().optional(),\n});\n\nexport const edgeFunctionWithBodySchema = edgeFunctionSchema.extend({\n files: z.array(\n z.object({\n name: z.string(),\n content: z.string(),\n })\n ),\n});\n\nexport const createProjectOptionsSchema = z.object({\n name: z.string().min(1).max(256),\n organization_id: z.string(),\n region: z.enum(AWS_REGION_CODES),\n db_pass: z.string().optional(),\n});\n\nexport const createBranchOptionsSchema = z.object({\n name: z.string().min(1),\n});\n\nexport const resetBranchOptionsSchema = z.object({\n migration_version: z.string().optional(),\n});\n\nexport const deployEdgeFunctionOptionsSchema = z.object({\n name: z.string().regex(/^[A-Za-z][A-Za-z0-9_-]*$/),\n entrypoint_path: z.string(),\n import_map_path: z.string().optional(),\n verify_jwt: z.boolean().optional(),\n files: z.array(\n z.object({\n name: z.string(),\n content: z.string(),\n })\n ),\n});\n\nexport const executeSqlOptionsSchema = z.object({\n query: z.string().min(1),\n parameters: z.array(z.unknown()).optional(),\n read_only: z.boolean().optional(),\n});\n\nexport const applyMigrationOptionsSchema = z.object({\n name: z.string().min(1),\n query: z.string().min(1),\n});\n\nexport const migrationSchema = z.object({\n version: z.string(),\n name: z.string().optional(),\n});\n\nexport const logsServiceSchema = z.enum([\n 'api',\n 'branch-action',\n 'postgres',\n 'edge-function',\n 'auth',\n 'storage',\n 'realtime',\n]);\n\nexport const getLogsOptionsSchema = z.object({\n service: logsServiceSchema,\n iso_timestamp_start: z.string().optional(),\n iso_timestamp_end: z.string().optional(),\n});\n\nexport const generateTypescriptTypesResultSchema = z.object({\n types: z.string(),\n});\n\nexport type Organization = z.infer<typeof organizationSchema>;\nexport type Project = z.infer<typeof projectSchema>;\nexport type Branch = z.infer<typeof branchSchema>;\nexport type EdgeFunction = z.infer<typeof edgeFunctionSchema>;\nexport type EdgeFunctionWithBody = z.infer<typeof edgeFunctionWithBodySchema>;\n\nexport type CreateProjectOptions = z.infer<typeof createProjectOptionsSchema>;\nexport type CreateBranchOptions = z.infer<typeof createBranchOptionsSchema>;\nexport type ResetBranchOptions = z.infer<typeof resetBranchOptionsSchema>;\nexport type DeployEdgeFunctionOptions = z.infer<\n typeof deployEdgeFunctionOptionsSchema\n>;\n\nexport type ExecuteSqlOptions = z.infer<typeof executeSqlOptionsSchema>;\nexport type ApplyMigrationOptions = z.infer<typeof applyMigrationOptionsSchema>;\nexport type Migration = z.infer<typeof migrationSchema>;\nexport type ListMigrationsResult = z.infer<typeof migrationSchema>;\n\nexport type LogsService = z.infer<typeof logsServiceSchema>;\nexport type GetLogsOptions = z.infer<typeof getLogsOptionsSchema>;\nexport type GenerateTypescriptTypesResult = z.infer<\n typeof generateTypescriptTypesResultSchema\n>;\n\nexport type StorageConfig = z.infer<typeof storageConfigSchema>;\nexport type StorageBucket = z.infer<typeof storageBucketSchema>;\n\nexport type DatabaseOperations = {\n executeSql<T>(projectId: string, options: ExecuteSqlOptions): Promise<T[]>;\n listMigrations(projectId: string): Promise<Migration[]>;\n applyMigration(\n projectId: string,\n options: ApplyMigrationOptions\n ): Promise<void>;\n};\n\nexport type AccountOperations = {\n listOrganizations(): Promise<{ id: string; slug: string; name: string }[]>;\n getOrganization(organizationId: string): Promise<Organization>;\n listProjects(): Promise<Project[]>;\n getProject(projectId: string): Promise<Project>;\n createProject(options: CreateProjectOptions): Promise<Project>;\n pauseProject(projectId: string): Promise<void>;\n restoreProject(projectId: string): Promise<void>;\n};\n\nexport type EdgeFunctionsOperations = {\n listEdgeFunctions(projectId: string): Promise<EdgeFunction[]>;\n getEdgeFunction(\n projectId: string,\n functionSlug: string\n ): Promise<EdgeFunctionWithBody>;\n deployEdgeFunction(\n projectId: string,\n options: DeployEdgeFunctionOptions\n ): Promise<Omit<EdgeFunction, 'files'>>;\n};\n\nexport type DebuggingOperations = {\n getLogs(projectId: string, options: GetLogsOptions): Promise<unknown>;\n getSecurityAdvisors(projectId: string): Promise<unknown>;\n getPerformanceAdvisors(projectId: string): Promise<unknown>;\n};\n\nexport const apiKeyTypeSchema = z.enum(['legacy', 'publishable']);\nexport type ApiKeyType = z.infer<typeof apiKeyTypeSchema>;\n\nexport type ApiKey = {\n api_key: string;\n name: string;\n type: ApiKeyType;\n description?: string;\n id?: string;\n disabled?: boolean;\n};\n\nexport type DevelopmentOperations = {\n getProjectUrl(projectId: string): Promise<string>;\n getPublishableKeys(projectId: string): Promise<ApiKey[]>;\n generateTypescriptTypes(\n projectId: string\n ): Promise<GenerateTypescriptTypesResult>;\n};\n\nexport type StorageOperations = {\n getStorageConfig(projectId: string): Promise<StorageConfig>;\n updateStorageConfig(projectId: string, config: StorageConfig): Promise<void>;\n listAllBuckets(projectId: string): Promise<StorageBucket[]>;\n};\n\nexport type BranchingOperations = {\n listBranches(projectId: string): Promise<Branch[]>;\n createBranch(\n projectId: string,\n options: CreateBranchOptions\n ): Promise<Branch>;\n deleteBranch(branchId: string): Promise<void>;\n mergeBranch(branchId: string): Promise<void>;\n resetBranch(branchId: string, options: ResetBranchOptions): Promise<void>;\n rebaseBranch(branchId: string): Promise<void>;\n};\n\nexport type SupabasePlatform = {\n init?(info: InitData): Promise<void>;\n account?: AccountOperations;\n database?: DatabaseOperations;\n functions?: EdgeFunctionsOperations;\n debugging?: DebuggingOperations;\n development?: DevelopmentOperations;\n storage?: StorageOperations;\n branching?: BranchingOperations;\n};\n","export const AWS_REGION_CODES = [\n 'us-west-1',\n 'us-east-1',\n 'us-east-2',\n 'ca-central-1',\n 'eu-west-1',\n 'eu-west-2',\n 'eu-west-3',\n 'eu-central-1',\n 'eu-central-2',\n 'eu-north-1',\n 'ap-south-1',\n 'ap-southeast-1',\n 'ap-northeast-1',\n 'ap-northeast-2',\n 'ap-southeast-2',\n 'sa-east-1',\n] as const;\n"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OAAO,EAAE,MAAM,0BAA0B,EACjD,gBAAiBA,EAAE,OAAO,EAC1B,gBAAiBA,EAAE,OAAO,EAAE,SAAS,EACrC,WAAYA,EAAE,QAAQ,EAAE,SAAS,EACjC,MAAOA,EAAE,MACPA,EAAE,OAAO,CACP,KAAMA,EAAE,OAAO,EACf,QAASA,EAAE,OAAO,CACpB,CAAC,CACH,CACF,CAAC,EAEYY,EAA0BZ,EAAE,OAAO,CAC9C,MAAOA,EAAE,OAAO,EAAE,IAAI,CAAC,EACvB,WAAYA,EAAE,MAAMA,EAAE,QAAQ,CAAC,EAAE,SAAS,EAC1C,UAAWA,EAAE,QAAQ,EAAE,SAAS,CAClC,CAAC,EAEYa,EAA8Bb,EAAE,OAAO,CAClD,KAAMA,EAAE,OAAO,EAAE,IAAI,CAAC,EACtB,MAAOA,EAAE,OAAO,EAAE,IAAI,CAAC,CACzB,CAAC,EAEYc,EAAkBd,EAAE,OAAO,CACtC,QAASA,EAAE,OAAO,EAClB,KAAMA,EAAE,OAAO,EAAE,SAAS,CAC5B,CAAC,EAEYe,EAAoBf,EAAE,KAAK,CACtC,MACA,gBACA,WACA,gBACA,OACA,UACA,UACF,CAAC,EAEYgB,EAAuBhB,EAAE,OAAO,CAC3C,QAASe,EACT,oBAAqBf,EAAE,OAAO,EAAE,SAAS,EACzC,kBAAmBA,EAAE,OAAO,EAAE,SAAS,CACzC,CAAC,EAEYiB,EAAsCjB,EAAE,OAAO,CAC1D,MAAOA,EAAE,OAAO,CAClB,CAAC,EAkEYkB,EAAmBlB,EAAE,KAAK,CAAC,SAAU,aAAa,CAAC","names":["z","AWS_REGION_CODES","storageBucketSchema","z","storageConfigSchema","organizationSchema","projectSchema","branchSchema","edgeFunctionSchema","edgeFunctionWithBodySchema","createProjectOptionsSchema","AWS_REGION_CODES","createBranchOptionsSchema","resetBranchOptionsSchema","deployEdgeFunctionOptionsSchema","executeSqlOptionsSchema","applyMigrationOptionsSchema","migrationSchema","logsServiceSchema","getLogsOptionsSchema","generateTypescriptTypesResultSchema","apiKeyTypeSchema"]}
|
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkLYI5DEVZcjs = require('./chunk-LYI5DEVZ.cjs');var _chunkQS6T7DCVcjs = require('./chunk-QS6T7DCV.cjs');require('./chunk-QX2UXNCU.cjs');function o(e){return Object.fromEntries(Object.entries(e).map(([r,{parameters:t,description:S,...s}])=>[r,{inputSchema:t,...s}]))}var n={...o(_chunkLYI5DEVZcjs.b),...o(_chunkLYI5DEVZcjs.c),...o(_chunkLYI5DEVZcjs.d),...o(_chunkLYI5DEVZcjs.e),...o(_chunkLYI5DEVZcjs.f),...o(_chunkLYI5DEVZcjs.g),...o(_chunkLYI5DEVZcjs.h),...o(_chunkLYI5DEVZcjs.i)},F={docs:Object.keys(_chunkLYI5DEVZcjs.g),account:Object.keys(_chunkLYI5DEVZcjs.b),database:Object.keys(_chunkLYI5DEVZcjs.d),debugging:Object.keys(_chunkLYI5DEVZcjs.e),development:Object.keys(_chunkLYI5DEVZcjs.f),functions:Object.keys(_chunkLYI5DEVZcjs.h),branching:Object.keys(_chunkLYI5DEVZcjs.c),storage:Object.keys(_chunkLYI5DEVZcjs.i)},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(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _ => _.features]), () => (_chunkLYI5DEVZcjs.a))),t=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _2 => _2.projectScoped]), () => (!1)),S=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _3 => _3.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=_chunkQS6T7DCVcjs.a.version;exports.CURRENT_FEATURE_GROUPS = _chunkLYI5DEVZcjs.a; exports.createSupabaseMcpServer = _chunkLYI5DEVZcjs.j; exports.createToolSchemas = R; exports.supabaseMcpToolSchemas = n; exports.version = G;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/matt/Developer/supabase-org/supabase-mcp/packages/mcp-server-supabase/dist/index.cjs","../src/tools/tool-schemas.ts","../src/index.ts"],"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"],"mappings":"AAAA,yuBAAwF,wDAAyC,gCAA6B,SCyBrJA,CAAAA,CAAwCC,CAAAA,CAA2B,CAC1E,OAAO,MAAA,CAAO,WAAA,CACZ,MAAA,CAAO,OAAA,CAAQA,CAAI,CAAA,CAAE,GAAA,CACnB,CAAC,CAACC,CAAAA,CAAM,CAAE,UAAA,CAAYC,CAAAA,CAAa,WAAA,CAAaC,CAAAA,CAAG,GAAGC,CAAK,CAAC,CAAA,CAAA,EAAM,CAChEH,CAAAA,CACA,CAAE,WAAA,CAAAC,CAAAA,CAAa,GAAGE,CAAK,CACzB,CACF,CACF,CACF,CAyBO,IAAMC,CAAAA,CAAyB,CACpC,GAAGN,CAAAA,CAAcO,mBAAe,CAAA,CAChC,GAAGP,CAAAA,CAAcQ,mBAAiB,CAAA,CAClC,GAAGR,CAAAA,CAAcS,mBAAgB,CAAA,CACjC,GAAGT,CAAAA,CAAcU,mBAAiB,CAAA,CAClC,GAAGV,CAAAA,CAAcW,mBAAmB,CAAA,CACpC,GAAGX,CAAAA,CAAcY,mBAAY,CAAA,CAC7B,GAAGZ,CAAAA,CAAca,mBAAoB,CAAA,CACrC,GAAGb,CAAAA,CAAcc,mBAAe,CAClC,CAAA,CASMC,CAAAA,CAAmB,CACvB,IAAA,CAAM,MAAA,CAAO,IAAA,CAAKH,mBAAY,CAAA,CAC9B,OAAA,CAAS,MAAA,CAAO,IAAA,CACdL,mBACF,CAAA,CACA,QAAA,CAAU,MAAA,CAAO,IAAA,CACfE,mBACF,CAAA,CACA,SAAA,CAAW,MAAA,CAAO,IAAA,CAChBC,mBACF,CAAA,CACA,WAAA,CAAa,MAAA,CAAO,IAAA,CAClBC,mBACF,CAAA,CACA,SAAA,CAAW,MA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,GAAW,CAACC,CAAAA,CAASC,CAAS,CAAA,GAAK,MAAA,CAAO,OAAA,CAAQZ,CAAgB,CAAA,CAChE,EAAA,CAAKM,CAAAA,CAAgB,GAAA,CAAIK,CAAO,CAAA,EAC5B,CAAA,CAAAH,CAAAA,EAAiBG,CAAAA,GAAY,SAAA,CAAA,CAEjC,GAAA,CAAA,IAAWE,EAAAA,GAAYD,CAAAA,CACjBH,CAAAA,EAAYP,CAAAA,CAAa,GAAA,CAAIW,CAAQ,CAAA,EAAA,CAErCL,CAAAA,EAAiBK,EAAAA,GAAYZ,CAAAA,CAC/BS,CAAAA,CAAOG,CAAQ,CAAA,CAAIZ,CAAAA,CAAyBY,CAAQ,CAAA,CAEpDH,CAAAA,CAAOG,CAAQ,CAAA,CAAItB,CAAAA,CAAuBsB,CAAQ,CAAA,CAAA,CAKxD,OAAOH,CACT,CCpQO,IAAMI,CAAAA,CAAUC,mBAAAA,CAAY,OAAA,CAAA,oMAAA","file":"/Users/matt/Developer/supabase-org/supabase-mcp/packages/mcp-server-supabase/dist/index.cjs","sourcesContent":[null,"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"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/supabase-mcp/supabase-mcp/packages/mcp-server-supabase/dist/index.cjs","../src/tools/tool-schemas.ts","../src/index.ts"],"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"],"mappings":"AAAA,yuBAAwF,wDAAyC,gCAA6B,SCyBrJA,CAAAA,CAAwCC,CAAAA,CAA2B,CAC1E,OAAO,MAAA,CAAO,WAAA,CACZ,MAAA,CAAO,OAAA,CAAQA,CAAI,CAAA,CAAE,GAAA,CACnB,CAAC,CAACC,CAAAA,CAAM,CAAE,UAAA,CAAYC,CAAAA,CAAa,WAAA,CAAaC,CAAAA,CAAG,GAAGC,CAAK,CAAC,CAAA,CAAA,EAAM,CAChEH,CAAAA,CACA,CAAE,WAAA,CAAAC,CAAAA,CAAa,GAAGE,CAAK,CACzB,CACF,CACF,CACF,CAyBO,IAAMC,CAAAA,CAAyB,CACpC,GAAGN,CAAAA,CAAcO,mBAAe,CAAA,CAChC,GAAGP,CAAAA,CAAcQ,mBAAiB,CAAA,CAClC,GAAGR,CAAAA,CAAcS,mBAAgB,CAAA,CACjC,GAAGT,CAAAA,CAAcU,mBAAiB,CAAA,CAClC,GAAGV,CAAAA,CAAcW,mBAAmB,CAAA,CACpC,GAAGX,CAAAA,CAAcY,mBAAY,CAAA,CAC7B,GAAGZ,CAAAA,CAAca,mBAAoB,CAAA,CACrC,GAAGb,CAAAA,CAAcc,mBAAe,CAClC,CAAA,CASMC,CAAAA,CAAmB,CACvB,IAAA,CAAM,MAAA,CAAO,IAAA,CAAKH,mBAAY,CAAA,CAC9B,OAAA,CAAS,MAAA,CAAO,IAAA,CACdL,mBACF,CAAA,CACA,QAAA,CAAU,MAAA,CAAO,IAAA,CACfE,mBACF,CAAA,CACA,SAAA,CAAW,MAAA,CAAO,IAAA,CAChBC,mBACF,CAAA,CACA,WAAA,CAAa,MAAA,CAAO,IAAA,CAClBC,mBACF,CAAA,CACA,SAAA,CAAW,MAAA,CAAO,IAAA,CAChBE,mBACF,CAAA,CACA,SAAA,CAAW,MAAA,CAAO,IAAA,CAChBL,mBACF,CAAA,CACA,OAAA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AKM,CAAAA,CAAgB,GAAA,CAAIK,CAAO,CAAA,EAC5B,CAAA,CAAAH,CAAAA,EAAiBG,CAAAA,GAAY,SAAA,CAAA,CAEjC,GAAA,CAAA,IAAWE,EAAAA,GAAYD,CAAAA,CACjBH,CAAAA,EAAYP,CAAAA,CAAa,GAAA,CAAIW,CAAQ,CAAA,EAAA,CAErCL,CAAAA,EAAiBK,EAAAA,GAAYZ,CAAAA,CAC/BS,CAAAA,CAAOG,CAAQ,CAAA,CAAIZ,CAAAA,CAAyBY,CAAQ,CAAA,CAEpDH,CAAAA,CAAOG,CAAQ,CAAA,CAAItB,CAAAA,CAAuBsB,CAAQ,CAAA,CAAA,CAKxD,OAAOH,CACT,CCpQO,IAAMI,CAAAA,CAAUC,mBAAAA,CAAY,OAAA,CAAA,oMAAA","file":"/home/runner/work/supabase-mcp/supabase-mcp/packages/mcp-server-supabase/dist/index.cjs","sourcesContent":[null,"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"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -94,6 +94,7 @@ declare const accountToolDefs: {
|
|
|
94
94
|
readonly outputSchema: z.ZodObject<{
|
|
95
95
|
organizations: z.ZodArray<z.ZodObject<{
|
|
96
96
|
id: z.ZodString;
|
|
97
|
+
slug: z.ZodString;
|
|
97
98
|
name: z.ZodString;
|
|
98
99
|
}, z.core.$strip>>;
|
|
99
100
|
}, z.core.$strip>;
|
|
@@ -131,7 +132,9 @@ declare const accountToolDefs: {
|
|
|
131
132
|
readonly outputSchema: z.ZodObject<{
|
|
132
133
|
projects: z.ZodArray<z.ZodObject<{
|
|
133
134
|
id: z.ZodString;
|
|
135
|
+
ref: z.ZodString;
|
|
134
136
|
organization_id: z.ZodString;
|
|
137
|
+
organization_slug: z.ZodString;
|
|
135
138
|
name: z.ZodString;
|
|
136
139
|
status: z.ZodString;
|
|
137
140
|
created_at: z.ZodString;
|
|
@@ -153,7 +156,9 @@ declare const accountToolDefs: {
|
|
|
153
156
|
}, z.core.$strip>;
|
|
154
157
|
readonly outputSchema: z.ZodObject<{
|
|
155
158
|
id: z.ZodString;
|
|
159
|
+
ref: z.ZodString;
|
|
156
160
|
organization_id: z.ZodString;
|
|
161
|
+
organization_slug: z.ZodString;
|
|
157
162
|
name: z.ZodString;
|
|
158
163
|
status: z.ZodString;
|
|
159
164
|
created_at: z.ZodString;
|
|
@@ -246,7 +251,9 @@ declare const accountToolDefs: {
|
|
|
246
251
|
}, z.core.$strip>;
|
|
247
252
|
readonly outputSchema: z.ZodObject<{
|
|
248
253
|
id: z.ZodString;
|
|
254
|
+
ref: z.ZodString;
|
|
249
255
|
organization_id: z.ZodString;
|
|
256
|
+
organization_slug: z.ZodString;
|
|
250
257
|
name: z.ZodString;
|
|
251
258
|
status: z.ZodString;
|
|
252
259
|
created_at: z.ZodString;
|
|
@@ -466,6 +473,19 @@ declare const databaseToolDefs: {
|
|
|
466
473
|
target: z.ZodString;
|
|
467
474
|
}, z.core.$strip>>>;
|
|
468
475
|
}, z.core.$strip>>;
|
|
476
|
+
advisory: z.ZodOptional<z.ZodObject<{
|
|
477
|
+
id: z.ZodString;
|
|
478
|
+
priority: z.ZodNumber;
|
|
479
|
+
level: z.ZodEnum<{
|
|
480
|
+
critical: "critical";
|
|
481
|
+
warning: "warning";
|
|
482
|
+
info: "info";
|
|
483
|
+
}>;
|
|
484
|
+
title: z.ZodString;
|
|
485
|
+
message: z.ZodString;
|
|
486
|
+
remediation_sql: z.ZodString;
|
|
487
|
+
doc_url: z.ZodString;
|
|
488
|
+
}, z.core.$strip>>;
|
|
469
489
|
}, z.core.$strip>;
|
|
470
490
|
readonly annotations: {
|
|
471
491
|
readonly title: "List tables";
|
|
@@ -1189,6 +1209,19 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1189
1209
|
target: z.ZodString;
|
|
1190
1210
|
}, z.core.$strip>>>;
|
|
1191
1211
|
}, z.core.$strip>>;
|
|
1212
|
+
advisory: z.ZodOptional<z.ZodObject<{
|
|
1213
|
+
id: z.ZodString;
|
|
1214
|
+
priority: z.ZodNumber;
|
|
1215
|
+
level: z.ZodEnum<{
|
|
1216
|
+
critical: "critical";
|
|
1217
|
+
warning: "warning";
|
|
1218
|
+
info: "info";
|
|
1219
|
+
}>;
|
|
1220
|
+
title: z.ZodString;
|
|
1221
|
+
message: z.ZodString;
|
|
1222
|
+
remediation_sql: z.ZodString;
|
|
1223
|
+
doc_url: z.ZodString;
|
|
1224
|
+
}, z.core.$strip>>;
|
|
1192
1225
|
}, z.core.$strip>;
|
|
1193
1226
|
annotations: {
|
|
1194
1227
|
readonly title: "List tables";
|
|
@@ -1417,6 +1450,7 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1417
1450
|
outputSchema: z.ZodObject<{
|
|
1418
1451
|
organizations: z.ZodArray<z.ZodObject<{
|
|
1419
1452
|
id: z.ZodString;
|
|
1453
|
+
slug: z.ZodString;
|
|
1420
1454
|
name: z.ZodString;
|
|
1421
1455
|
}, z.core.$strip>>;
|
|
1422
1456
|
}, z.core.$strip>;
|
|
@@ -1454,7 +1488,9 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1454
1488
|
outputSchema: z.ZodObject<{
|
|
1455
1489
|
projects: z.ZodArray<z.ZodObject<{
|
|
1456
1490
|
id: z.ZodString;
|
|
1491
|
+
ref: z.ZodString;
|
|
1457
1492
|
organization_id: z.ZodString;
|
|
1493
|
+
organization_slug: z.ZodString;
|
|
1458
1494
|
name: z.ZodString;
|
|
1459
1495
|
status: z.ZodString;
|
|
1460
1496
|
created_at: z.ZodString;
|
|
@@ -1476,7 +1512,9 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1476
1512
|
}, z.core.$strip>;
|
|
1477
1513
|
outputSchema: z.ZodObject<{
|
|
1478
1514
|
id: z.ZodString;
|
|
1515
|
+
ref: z.ZodString;
|
|
1479
1516
|
organization_id: z.ZodString;
|
|
1517
|
+
organization_slug: z.ZodString;
|
|
1480
1518
|
name: z.ZodString;
|
|
1481
1519
|
status: z.ZodString;
|
|
1482
1520
|
created_at: z.ZodString;
|
|
@@ -1569,7 +1607,9 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1569
1607
|
}, z.core.$strip>;
|
|
1570
1608
|
outputSchema: z.ZodObject<{
|
|
1571
1609
|
id: z.ZodString;
|
|
1610
|
+
ref: z.ZodString;
|
|
1572
1611
|
organization_id: z.ZodString;
|
|
1612
|
+
organization_slug: z.ZodString;
|
|
1573
1613
|
name: z.ZodString;
|
|
1574
1614
|
status: z.ZodString;
|
|
1575
1615
|
created_at: z.ZodString;
|
package/dist/index.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ declare const accountToolDefs: {
|
|
|
94
94
|
readonly outputSchema: z.ZodObject<{
|
|
95
95
|
organizations: z.ZodArray<z.ZodObject<{
|
|
96
96
|
id: z.ZodString;
|
|
97
|
+
slug: z.ZodString;
|
|
97
98
|
name: z.ZodString;
|
|
98
99
|
}, z.core.$strip>>;
|
|
99
100
|
}, z.core.$strip>;
|
|
@@ -131,7 +132,9 @@ declare const accountToolDefs: {
|
|
|
131
132
|
readonly outputSchema: z.ZodObject<{
|
|
132
133
|
projects: z.ZodArray<z.ZodObject<{
|
|
133
134
|
id: z.ZodString;
|
|
135
|
+
ref: z.ZodString;
|
|
134
136
|
organization_id: z.ZodString;
|
|
137
|
+
organization_slug: z.ZodString;
|
|
135
138
|
name: z.ZodString;
|
|
136
139
|
status: z.ZodString;
|
|
137
140
|
created_at: z.ZodString;
|
|
@@ -153,7 +156,9 @@ declare const accountToolDefs: {
|
|
|
153
156
|
}, z.core.$strip>;
|
|
154
157
|
readonly outputSchema: z.ZodObject<{
|
|
155
158
|
id: z.ZodString;
|
|
159
|
+
ref: z.ZodString;
|
|
156
160
|
organization_id: z.ZodString;
|
|
161
|
+
organization_slug: z.ZodString;
|
|
157
162
|
name: z.ZodString;
|
|
158
163
|
status: z.ZodString;
|
|
159
164
|
created_at: z.ZodString;
|
|
@@ -246,7 +251,9 @@ declare const accountToolDefs: {
|
|
|
246
251
|
}, z.core.$strip>;
|
|
247
252
|
readonly outputSchema: z.ZodObject<{
|
|
248
253
|
id: z.ZodString;
|
|
254
|
+
ref: z.ZodString;
|
|
249
255
|
organization_id: z.ZodString;
|
|
256
|
+
organization_slug: z.ZodString;
|
|
250
257
|
name: z.ZodString;
|
|
251
258
|
status: z.ZodString;
|
|
252
259
|
created_at: z.ZodString;
|
|
@@ -466,6 +473,19 @@ declare const databaseToolDefs: {
|
|
|
466
473
|
target: z.ZodString;
|
|
467
474
|
}, z.core.$strip>>>;
|
|
468
475
|
}, z.core.$strip>>;
|
|
476
|
+
advisory: z.ZodOptional<z.ZodObject<{
|
|
477
|
+
id: z.ZodString;
|
|
478
|
+
priority: z.ZodNumber;
|
|
479
|
+
level: z.ZodEnum<{
|
|
480
|
+
critical: "critical";
|
|
481
|
+
warning: "warning";
|
|
482
|
+
info: "info";
|
|
483
|
+
}>;
|
|
484
|
+
title: z.ZodString;
|
|
485
|
+
message: z.ZodString;
|
|
486
|
+
remediation_sql: z.ZodString;
|
|
487
|
+
doc_url: z.ZodString;
|
|
488
|
+
}, z.core.$strip>>;
|
|
469
489
|
}, z.core.$strip>;
|
|
470
490
|
readonly annotations: {
|
|
471
491
|
readonly title: "List tables";
|
|
@@ -1189,6 +1209,19 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1189
1209
|
target: z.ZodString;
|
|
1190
1210
|
}, z.core.$strip>>>;
|
|
1191
1211
|
}, z.core.$strip>>;
|
|
1212
|
+
advisory: z.ZodOptional<z.ZodObject<{
|
|
1213
|
+
id: z.ZodString;
|
|
1214
|
+
priority: z.ZodNumber;
|
|
1215
|
+
level: z.ZodEnum<{
|
|
1216
|
+
critical: "critical";
|
|
1217
|
+
warning: "warning";
|
|
1218
|
+
info: "info";
|
|
1219
|
+
}>;
|
|
1220
|
+
title: z.ZodString;
|
|
1221
|
+
message: z.ZodString;
|
|
1222
|
+
remediation_sql: z.ZodString;
|
|
1223
|
+
doc_url: z.ZodString;
|
|
1224
|
+
}, z.core.$strip>>;
|
|
1192
1225
|
}, z.core.$strip>;
|
|
1193
1226
|
annotations: {
|
|
1194
1227
|
readonly title: "List tables";
|
|
@@ -1417,6 +1450,7 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1417
1450
|
outputSchema: z.ZodObject<{
|
|
1418
1451
|
organizations: z.ZodArray<z.ZodObject<{
|
|
1419
1452
|
id: z.ZodString;
|
|
1453
|
+
slug: z.ZodString;
|
|
1420
1454
|
name: z.ZodString;
|
|
1421
1455
|
}, z.core.$strip>>;
|
|
1422
1456
|
}, z.core.$strip>;
|
|
@@ -1454,7 +1488,9 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1454
1488
|
outputSchema: z.ZodObject<{
|
|
1455
1489
|
projects: z.ZodArray<z.ZodObject<{
|
|
1456
1490
|
id: z.ZodString;
|
|
1491
|
+
ref: z.ZodString;
|
|
1457
1492
|
organization_id: z.ZodString;
|
|
1493
|
+
organization_slug: z.ZodString;
|
|
1458
1494
|
name: z.ZodString;
|
|
1459
1495
|
status: z.ZodString;
|
|
1460
1496
|
created_at: z.ZodString;
|
|
@@ -1476,7 +1512,9 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1476
1512
|
}, z.core.$strip>;
|
|
1477
1513
|
outputSchema: z.ZodObject<{
|
|
1478
1514
|
id: z.ZodString;
|
|
1515
|
+
ref: z.ZodString;
|
|
1479
1516
|
organization_id: z.ZodString;
|
|
1517
|
+
organization_slug: z.ZodString;
|
|
1480
1518
|
name: z.ZodString;
|
|
1481
1519
|
status: z.ZodString;
|
|
1482
1520
|
created_at: z.ZodString;
|
|
@@ -1569,7 +1607,9 @@ declare const supabaseMcpToolSchemas: {
|
|
|
1569
1607
|
}, z.core.$strip>;
|
|
1570
1608
|
outputSchema: z.ZodObject<{
|
|
1571
1609
|
id: z.ZodString;
|
|
1610
|
+
ref: z.ZodString;
|
|
1572
1611
|
organization_id: z.ZodString;
|
|
1612
|
+
organization_slug: z.ZodString;
|
|
1573
1613
|
name: z.ZodString;
|
|
1574
1614
|
status: z.ZodString;
|
|
1575
1615
|
created_at: z.ZodString;
|
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-
|
|
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-OCWOYE3R.js";import{a as h}from"./chunk-STTFHRTS.js";import"./chunk-VCRYYVOD.js";function o(e){return Object.fromEntries(Object.entries(e).map(([r,{parameters:t,description:S,...s}])=>[r,{inputSchema:t,...s}]))}var n={...o(l),...o(p),...o(d),...o(m),...o(f),...o(i),...o(u),...o(y)},F={docs:Object.keys(i),account:Object.keys(l),database:Object.keys(d),debugging:Object.keys(m),development:Object.keys(f),functions:Object.keys(u),branching:Object.keys(p),storage:Object.keys(y)},O=Object.fromEntries(Object.entries(n).filter(([,{inputSchema:e}])=>"project_id"in e.shape).map(([e,{inputSchema:r,...t}])=>[e,{inputSchema:r.omit({project_id:!0}),...t}])),x=new Set(Object.entries(n).filter(([,e])=>e.annotations.readOnlyHint===!1&&e.readOnlyBehavior!=="adapt").map(([e])=>e));function R(e){let r=new Set(e?.features??c),t=e?.projectScoped??!1,S=e?.readOnly??!1,s={};for(let[T,b]of Object.entries(F))if(r.has(T)&&!(t&&T==="account"))for(let a of b)S&&x.has(a)||(t&&a in O?s[a]=O[a]:s[a]=n[a]);return s}var G=h.version;export{c as CURRENT_FEATURE_GROUPS,j as createSupabaseMcpServer,R as createToolSchemas,n as supabaseMcpToolSchemas,G as version};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEVDY7FB4cjs = require('../chunk-EVDY7FB4.cjs');require('../chunk-QS6T7DCV.cjs');require('../chunk-PHWSETKC.cjs');require('../chunk-QX2UXNCU.cjs');exports.createSupabaseApiPlatform = _chunkEVDY7FB4cjs.a;
|
|
2
2
|
//# sourceMappingURL=api-platform.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/supabase-mcp/supabase-mcp/packages/mcp-server-supabase/dist/platform/api-platform.cjs"],"names":[],"mappings":"AAAA,kIAAoC,iCAA8B,iCAA8B,iCAA8B,wDAAuC","file":"/home/runner/work/supabase-mcp/supabase-mcp/packages/mcp-server-supabase/dist/platform/api-platform.cjs"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-IO3RHCXN.js";import"../chunk-STTFHRTS.js";import"../chunk-LU6L7C36.js";import"../chunk-VCRYYVOD.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 _chunkQX2UXNCUcjs = require('../chunk-QX2UXNCU.cjs');exports.apiKeyTypeSchema = _chunkQX2UXNCUcjs.s; exports.applyMigrationOptionsSchema = _chunkQX2UXNCUcjs.n; exports.branchSchema = _chunkQX2UXNCUcjs.f; exports.createBranchOptionsSchema = _chunkQX2UXNCUcjs.j; exports.createProjectOptionsSchema = _chunkQX2UXNCUcjs.i; exports.deployEdgeFunctionOptionsSchema = _chunkQX2UXNCUcjs.l; exports.edgeFunctionSchema = _chunkQX2UXNCUcjs.g; exports.edgeFunctionWithBodySchema = _chunkQX2UXNCUcjs.h; exports.executeSqlOptionsSchema = _chunkQX2UXNCUcjs.m; exports.generateTypescriptTypesResultSchema = _chunkQX2UXNCUcjs.r; exports.getLogsOptionsSchema = _chunkQX2UXNCUcjs.q; exports.logsServiceSchema = _chunkQX2UXNCUcjs.p; exports.migrationSchema = _chunkQX2UXNCUcjs.o; exports.organizationSchema = _chunkQX2UXNCUcjs.d; exports.projectSchema = _chunkQX2UXNCUcjs.e; exports.resetBranchOptionsSchema = _chunkQX2UXNCUcjs.k; exports.storageBucketSchema = _chunkQX2UXNCUcjs.b; exports.storageConfigSchema = _chunkQX2UXNCUcjs.c;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/supabase-mcp/supabase-mcp/packages/mcp-server-supabase/dist/platform/index.cjs"],"names":[],"mappings":"AAAA,0GAA6B,yDAAiK,+7BAAof","file":"/home/runner/work/supabase-mcp/supabase-mcp/packages/mcp-server-supabase/dist/platform/index.cjs"}
|
|
@@ -32,7 +32,9 @@ declare const organizationSchema: z.ZodObject<{
|
|
|
32
32
|
}, z.core.$strip>;
|
|
33
33
|
declare const projectSchema: z.ZodObject<{
|
|
34
34
|
id: z.ZodString;
|
|
35
|
+
ref: z.ZodString;
|
|
35
36
|
organization_id: z.ZodString;
|
|
37
|
+
organization_slug: z.ZodString;
|
|
36
38
|
name: z.ZodString;
|
|
37
39
|
status: z.ZodString;
|
|
38
40
|
created_at: z.ZodString;
|
|
@@ -190,7 +192,11 @@ type DatabaseOperations = {
|
|
|
190
192
|
applyMigration(projectId: string, options: ApplyMigrationOptions): Promise<void>;
|
|
191
193
|
};
|
|
192
194
|
type AccountOperations = {
|
|
193
|
-
listOrganizations(): Promise<
|
|
195
|
+
listOrganizations(): Promise<{
|
|
196
|
+
id: string;
|
|
197
|
+
slug: string;
|
|
198
|
+
name: string;
|
|
199
|
+
}[]>;
|
|
194
200
|
getOrganization(organizationId: string): Promise<Organization>;
|
|
195
201
|
listProjects(): Promise<Project[]>;
|
|
196
202
|
getProject(projectId: string): Promise<Project>;
|
package/dist/platform/index.d.ts
CHANGED
|
@@ -32,7 +32,9 @@ declare const organizationSchema: z.ZodObject<{
|
|
|
32
32
|
}, z.core.$strip>;
|
|
33
33
|
declare const projectSchema: z.ZodObject<{
|
|
34
34
|
id: z.ZodString;
|
|
35
|
+
ref: z.ZodString;
|
|
35
36
|
organization_id: z.ZodString;
|
|
37
|
+
organization_slug: z.ZodString;
|
|
36
38
|
name: z.ZodString;
|
|
37
39
|
status: z.ZodString;
|
|
38
40
|
created_at: z.ZodString;
|
|
@@ -190,7 +192,11 @@ type DatabaseOperations = {
|
|
|
190
192
|
applyMigration(projectId: string, options: ApplyMigrationOptions): Promise<void>;
|
|
191
193
|
};
|
|
192
194
|
type AccountOperations = {
|
|
193
|
-
listOrganizations(): Promise<
|
|
195
|
+
listOrganizations(): Promise<{
|
|
196
|
+
id: string;
|
|
197
|
+
slug: string;
|
|
198
|
+
name: string;
|
|
199
|
+
}[]>;
|
|
194
200
|
getOrganization(organizationId: string): Promise<Organization>;
|
|
195
201
|
listProjects(): Promise<Project[]>;
|
|
196
202
|
getProject(projectId: string): Promise<Project>;
|
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}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}from"../chunk-VCRYYVOD.js";export{r as apiKeyTypeSchema,m as applyMigrationOptionsSchema,e as branchSchema,i as createBranchOptionsSchema,h as createProjectOptionsSchema,k as deployEdgeFunctionOptionsSchema,f as edgeFunctionSchema,g as edgeFunctionWithBodySchema,l as executeSqlOptionsSchema,q as generateTypescriptTypesResultSchema,p as getLogsOptionsSchema,o as logsServiceSchema,n as migrationSchema,c as organizationSchema,d as projectSchema,j as resetBranchOptionsSchema,a as storageBucketSchema,b as storageConfigSchema};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|