@supabase/mcp-server-supabase 0.4.1-dev.1 → 0.4.2-alpha.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.
@@ -0,0 +1,3 @@
1
+ import{z as t}from"zod";function d(n){return Object.fromEntries(n.split(`
2
+ `).map(l=>l.split(/=(.*)/)).filter(([l])=>l).map(([l,a])=>[l,a??""]))}async function T(n,l){let a=JSON.stringify(n,(r,g)=>g&&typeof g=="object"&&!Array.isArray(g)?Object.keys(g).sort().reduce((c,p)=>(c[p]=g[p],c),{}):g),e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(a));return btoa(String.fromCharCode(...new Uint8Array(e))).slice(0,l)}var S=6371,u="https://www.cloudflare.com/cdn-cgi/trace",y={AF:{lat:33,lng:65},AX:{lat:60.116667,lng:19.9},AL:{lat:41,lng:20},DZ:{lat:28,lng:3},AS:{lat:-14.3333,lng:-170},AD:{lat:42.5,lng:1.6},AO:{lat:-12.5,lng:18.5},AI:{lat:18.25,lng:-63.1667},AQ:{lat:-90,lng:0},AG:{lat:17.05,lng:-61.8},AR:{lat:-34,lng:-64},AM:{lat:40,lng:45},AW:{lat:12.5,lng:-69.9667},AU:{lat:-27,lng:133},AT:{lat:47.3333,lng:13.3333},AZ:{lat:40.5,lng:47.5},BS:{lat:24.25,lng:-76},BH:{lat:26,lng:50.55},BD:{lat:24,lng:90},BB:{lat:13.1667,lng:-59.5333},BY:{lat:53,lng:28},BE:{lat:50.8333,lng:4},BZ:{lat:17.25,lng:-88.75},BJ:{lat:9.5,lng:2.25},BM:{lat:32.3333,lng:-64.75},BT:{lat:27.5,lng:90.5},BO:{lat:-17,lng:-65},BQ:{lat:12.183333,lng:-68.233333},BA:{lat:44,lng:18},BW:{lat:-22,lng:24},BV:{lat:-54.4333,lng:3.4},BR:{lat:-10,lng:-55},IO:{lat:-6,lng:71.5},BN:{lat:4.5,lng:114.6667},BG:{lat:43,lng:25},BF:{lat:13,lng:-2},MM:{lat:22,lng:98},BI:{lat:-3.5,lng:30},KH:{lat:13,lng:105},CM:{lat:6,lng:12},CA:{lat:60,lng:-95},CV:{lat:16,lng:-24},KY:{lat:19.5,lng:-80.5},CF:{lat:7,lng:21},TD:{lat:15,lng:19},CL:{lat:-30,lng:-71},CN:{lat:35,lng:105},CX:{lat:-10.5,lng:105.6667},CC:{lat:-12.5,lng:96.8333},CO:{lat:4,lng:-72},KM:{lat:-12.1667,lng:44.25},CD:{lat:0,lng:25},CG:{lat:-1,lng:15},CK:{lat:-21.2333,lng:-159.7667},CR:{lat:10,lng:-84},CI:{lat:8,lng:-5},HR:{lat:45.1667,lng:15.5},CU:{lat:21.5,lng:-80},CW:{lat:12.166667,lng:-68.966667},CY:{lat:35,lng:33},CZ:{lat:49.75,lng:15.5},DK:{lat:56,lng:10},DJ:{lat:11.5,lng:43},DM:{lat:15.4167,lng:-61.3333},DO:{lat:19,lng:-70.6667},EC:{lat:-2,lng:-77.5},EG:{lat:27,lng:30},SV:{lat:13.8333,lng:-88.9167},GQ:{lat:2,lng:10},ER:{lat:15,lng:39},EE:{lat:59,lng:26},ET:{lat:8,lng:38},FK:{lat:-51.75,lng:-59},FO:{lat:62,lng:-7},FJ:{lat:-18,lng:175},FI:{lat:64,lng:26},FR:{lat:46,lng:2},GF:{lat:4,lng:-53},PF:{lat:-15,lng:-140},TF:{lat:-43,lng:67},GA:{lat:-1,lng:11.75},GM:{lat:13.4667,lng:-16.5667},GE:{lat:42,lng:43.5},DE:{lat:51,lng:9},GH:{lat:8,lng:-2},GI:{lat:36.1833,lng:-5.3667},GR:{lat:39,lng:22},GL:{lat:72,lng:-40},GD:{lat:12.1167,lng:-61.6667},GP:{lat:16.25,lng:-61.5833},GU:{lat:13.4667,lng:144.7833},GT:{lat:15.5,lng:-90.25},GG:{lat:49.5,lng:-2.56},GW:{lat:12,lng:-15},GN:{lat:11,lng:-10},GY:{lat:5,lng:-59},HT:{lat:19,lng:-72.4167},HM:{lat:-53.1,lng:72.5167},VA:{lat:41.9,lng:12.45},HN:{lat:15,lng:-86.5},HK:{lat:22.25,lng:114.1667},HU:{lat:47,lng:20},IS:{lat:65,lng:-18},IN:{lat:20,lng:77},ID:{lat:-5,lng:120},IR:{lat:32,lng:53},IQ:{lat:33,lng:44},IE:{lat:53,lng:-8},IM:{lat:54.23,lng:-4.55},IL:{lat:31.5,lng:34.75},IT:{lat:42.8333,lng:12.8333},JM:{lat:18.25,lng:-77.5},JP:{lat:36,lng:138},JE:{lat:49.21,lng:-2.13},JO:{lat:31,lng:36},KZ:{lat:48,lng:68},KE:{lat:1,lng:38},KI:{lat:1.4167,lng:173},KP:{lat:40,lng:127},KR:{lat:37,lng:127.5},XK:{lat:42.583333,lng:21},KW:{lat:29.3375,lng:47.6581},KG:{lat:41,lng:75},LA:{lat:18,lng:105},LV:{lat:57,lng:25},LB:{lat:33.8333,lng:35.8333},LS:{lat:-29.5,lng:28.5},LR:{lat:6.5,lng:-9.5},LY:{lat:25,lng:17},LI:{lat:47.1667,lng:9.5333},LT:{lat:56,lng:24},LU:{lat:49.75,lng:6.1667},MO:{lat:22.1667,lng:113.55},MK:{lat:41.8333,lng:22},MG:{lat:-20,lng:47},MW:{lat:-13.5,lng:34},MY:{lat:2.5,lng:112.5},MV:{lat:3.25,lng:73},ML:{lat:17,lng:-4},MT:{lat:35.8333,lng:14.5833},MH:{lat:9,lng:168},MQ:{lat:14.6667,lng:-61},MR:{lat:20,lng:-12},MU:{lat:-20.2833,lng:57.55},YT:{lat:-12.8333,lng:45.1667},MX:{lat:23,lng:-102},FM:{lat:6.9167,lng:158.25},MD:{lat:47,lng:29},MC:{lat:43.7333,lng:7.4},MN:{lat:46,lng:105},ME:{lat:42,lng:19},MS:{lat:16.75,lng:-62.2},MA:{lat:32,lng:-5},MZ:{lat:-18.25,lng:35},NA:{lat:-22,lng:17},NR:{lat:-.5333,lng:166.9167},NP:{lat:28,lng:84},AN:{lat:12.25,lng:-68.75},NL:{lat:52.5,lng:5.75},NC:{lat:-21.5,lng:165.5},NZ:{lat:-41,lng:174},NI:{lat:13,lng:-85},NE:{lat:16,lng:8},NG:{lat:10,lng:8},NU:{lat:-19.0333,lng:-169.8667},NF:{lat:-29.0333,lng:167.95},MP:{lat:15.2,lng:145.75},NO:{lat:62,lng:10},OM:{lat:21,lng:57},PK:{lat:30,lng:70},PW:{lat:7.5,lng:134.5},PS:{lat:32,lng:35.25},PA:{lat:9,lng:-80},PG:{lat:-6,lng:147},PY:{lat:-23,lng:-58},PE:{lat:-10,lng:-76},PH:{lat:13,lng:122},PN:{lat:-24.7,lng:-127.4},PL:{lat:52,lng:20},PT:{lat:39.5,lng:-8},PR:{lat:18.25,lng:-66.5},QA:{lat:25.5,lng:51.25},RE:{lat:-21.1,lng:55.6},RO:{lat:46,lng:25},RU:{lat:60,lng:100},RW:{lat:-2,lng:30},BL:{lat:17.897728,lng:-62.834244},SH:{lat:-15.9333,lng:-5.7},KN:{lat:17.3333,lng:-62.75},LC:{lat:13.8833,lng:-61.1333},MF:{lat:18.075278,lng:-63.06},PM:{lat:46.8333,lng:-56.3333},VC:{lat:13.25,lng:-61.2},WS:{lat:-13.5833,lng:-172.3333},SM:{lat:43.7667,lng:12.4167},ST:{lat:1,lng:7},SA:{lat:25,lng:45},SN:{lat:14,lng:-14},RS:{lat:44,lng:21},SC:{lat:-4.5833,lng:55.6667},SL:{lat:8.5,lng:-11.5},SG:{lat:1.3667,lng:103.8},SX:{lat:18.033333,lng:-63.05},SK:{lat:48.6667,lng:19.5},SI:{lat:46,lng:15},SB:{lat:-8,lng:159},SO:{lat:10,lng:49},ZA:{lat:-29,lng:24},GS:{lat:-54.5,lng:-37},SS:{lat:8,lng:30},ES:{lat:40,lng:-4},LK:{lat:7,lng:81},SD:{lat:15,lng:30},SR:{lat:4,lng:-56},SJ:{lat:78,lng:20},SZ:{lat:-26.5,lng:31.5},SE:{lat:62,lng:15},CH:{lat:47,lng:8},SY:{lat:35,lng:38},TW:{lat:23.5,lng:121},TJ:{lat:39,lng:71},TZ:{lat:-6,lng:35},TH:{lat:15,lng:100},TL:{lat:-8.55,lng:125.5167},TG:{lat:8,lng:1.1667},TK:{lat:-9,lng:-172},TO:{lat:-20,lng:-175},TT:{lat:11,lng:-61},TN:{lat:34,lng:9},TR:{lat:39,lng:35},TM:{lat:40,lng:60},TC:{lat:21.75,lng:-71.5833},TV:{lat:-8,lng:178},UG:{lat:1,lng:32},UA:{lat:49,lng:32},AE:{lat:24,lng:54},GB:{lat:54,lng:-2},UM:{lat:19.2833,lng:166.6},US:{lat:38,lng:-97},UY:{lat:-33,lng:-56},UZ:{lat:41,lng:64},VU:{lat:-16,lng:167},VE:{lat:8,lng:-66},VN:{lat:16,lng:106},VG:{lat:18.5,lng:-64.5},VI:{lat:18.3333,lng:-64.8333},WF:{lat:-13.3,lng:-176.2},EH:{lat:24.5,lng:-13},YE:{lat:15,lng:48},ZM:{lat:-15,lng:30},ZW:{lat:-20,lng:30}},s={WEST_US:{code:"us-west-1",displayName:"West US (North California)",location:{lat:37.774929,lng:-122.419418}},EAST_US:{code:"us-east-1",displayName:"East US (North Virginia)",location:{lat:37.926868,lng:-78.024902}},EAST_US_2:{code:"us-east-2",displayName:"East US (Ohio)",location:{lat:39.9612,lng:-82.9988}},CENTRAL_CANADA:{code:"ca-central-1",displayName:"Canada (Central)",location:{lat:56.130367,lng:-106.346771}},WEST_EU:{code:"eu-west-1",displayName:"West EU (Ireland)",location:{lat:53.3498,lng:-6.2603}},WEST_EU_2:{code:"eu-west-2",displayName:"West Europe (London)",location:{lat:51.507351,lng:-.127758}},WEST_EU_3:{code:"eu-west-3",displayName:"West EU (Paris)",location:{lat:2.352222,lng:48.856613}},CENTRAL_EU:{code:"eu-central-1",displayName:"Central EU (Frankfurt)",location:{lat:50.110924,lng:8.682127}},CENTRAL_EU_2:{code:"eu-central-2",displayName:"Central Europe (Zurich)",location:{lat:47.3744489,lng:8.5410422}},NORTH_EU:{code:"eu-north-1",displayName:"North EU (Stockholm)",location:{lat:59.3251172,lng:18.0710935}},SOUTH_ASIA:{code:"ap-south-1",displayName:"South Asia (Mumbai)",location:{lat:18.9733536,lng:72.8281049}},SOUTHEAST_ASIA:{code:"ap-southeast-1",displayName:"Southeast Asia (Singapore)",location:{lat:1.357107,lng:103.8194992}},NORTHEAST_ASIA:{code:"ap-northeast-1",displayName:"Northeast Asia (Tokyo)",location:{lat:35.6895,lng:139.6917}},NORTHEAST_ASIA_2:{code:"ap-northeast-2",displayName:"Northeast Asia (Seoul)",location:{lat:37.5665,lng:126.978}},OCEANIA:{code:"ap-southeast-2",displayName:"Oceania (Sydney)",location:{lat:-33.8688,lng:151.2093}},SOUTH_AMERICA:{code:"sa-east-1",displayName:"South America (S\xE3o Paulo)",location:{lat:-1.2043218,lng:-47.1583944}}},m=Object.values(s).map(n=>n.code);function O(n){let a=Object.entries(s).map(([o,r])=>[o,h(n,r.location)]).reduce((o,r)=>o===void 0||r[1]<o[1]?r:o,void 0);if(!a)throw new Error("no closest region found");let[e]=a;return s[e]}async function A(){let l=await(await fetch(u)).text(),e=d(l).loc;if(!e)throw new Error("location not found");return e}function I(n){let l=y[n];if(!l)throw new Error(`unknown location code: ${n}`);return l}function h(n,l){let a=i(l.lat-n.lat),e=i(l.lng-n.lng),o=Math.sin(a/2)*Math.sin(a/2)+Math.cos(i(n.lat))*Math.cos(i(l.lat))*Math.sin(e/2)*Math.sin(e/2),r=2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o));return S*r}function i(n){return n*(Math.PI/180)}var M=t.object({id:t.string(),name:t.string(),plan:t.string().optional(),allowed_release_channels:t.array(t.string()),opt_in_tags:t.array(t.string())}),R=t.object({id:t.string(),organization_id:t.string(),name:t.string(),status:t.string(),created_at:t.string(),region:t.string()}),x=t.object({id:t.string(),name:t.string(),project_ref:t.string(),parent_project_ref:t.string(),is_default:t.boolean(),git_branch:t.string().optional(),pr_number:t.number().optional(),latest_check_run_id:t.number().optional(),persistent:t.boolean(),status:t.enum(["CREATING_PROJECT","RUNNING_MIGRATIONS","MIGRATIONS_PASSED","MIGRATIONS_FAILED","FUNCTIONS_DEPLOYED","FUNCTIONS_FAILED"]),created_at:t.string(),updated_at:t.string()}),C=t.object({id:t.string(),slug:t.string(),name:t.string(),status:t.string(),version:t.number(),created_at:t.number().optional(),updated_at:t.number().optional(),verify_jwt:t.boolean().optional(),import_map:t.boolean().optional(),import_map_path:t.string().optional(),entrypoint_path:t.string().optional(),files:t.array(t.object({name:t.string(),content:t.string()}))}),U=t.object({name:t.string(),organization_id:t.string(),region:t.enum(m).optional(),db_pass:t.string().optional()}),b=t.object({name:t.string()}),j=t.object({migration_version:t.string().optional()}),L=t.object({name:t.string(),entrypoint_path:t.string(),import_map_path:t.string().optional(),files:t.array(t.object({name:t.string(),content:t.string()}))}),G=t.object({query:t.string(),read_only:t.boolean().optional()}),B=t.object({name:t.string(),query:t.string()}),F=t.object({version:t.string(),name:t.string().optional()}),D=t.object({sql:t.string(),iso_timestamp_start:t.string().optional(),iso_timestamp_end:t.string().optional()}),w=t.object({types:t.string()});export{T as a,m as b,O as c,A as d,I as e,M as f,R as g,x as h,C as i,U as j,b as k,j as l,L as m,G as n,B as o,F as p,D as q,w as r};
3
+ //# sourceMappingURL=chunk-P4XUQGTL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/platform/types.ts","../src/util.ts","../src/regions.ts"],"sourcesContent":["import { z } from 'zod';\nimport { AWS_REGION_CODES } from '../regions.js';\nimport type { InitData } from '@supabase/mcp-utils';\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 organization_id: 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 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(),\n organization_id: z.string(),\n region: z.enum(AWS_REGION_CODES).optional(),\n db_pass: z.string().optional(),\n});\n\nexport const createBranchOptionsSchema = z.object({\n name: z.string(),\n});\n\nexport const resetBranchOptionsSchema = z.object({\n migration_version: z.string().optional(),\n});\n\nexport const deployEdgeFunctionOptionsSchema = z.object({\n name: z.string(),\n entrypoint_path: z.string(),\n import_map_path: z.string().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(),\n read_only: z.boolean().optional(),\n});\n\nexport const applyMigrationOptionsSchema = z.object({\n name: z.string(),\n query: z.string(),\n});\n\nexport const migrationSchema = z.object({\n version: z.string(),\n name: z.string().optional(),\n});\n\nexport const getLogsOptionsSchema = z.object({\n sql: z.string(),\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>;\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 GetLogsOptions = z.infer<typeof getLogsOptionsSchema>;\nexport type GenerateTypescriptTypesResult = z.infer<\n typeof generateTypescriptTypesResultSchema\n>;\n\nexport type SupabasePlatform = {\n init?(info: InitData): Promise<void>;\n\n // Database operations\n executeSql<T>(projectId: string, options: ExecuteSqlOptions): Promise<T[]>;\n listMigrations(projectId: string): Promise<Migration[]>;\n applyMigration<T>(\n projectId: string,\n options: ApplyMigrationOptions\n ): Promise<T[]>;\n\n // Project management\n listOrganizations(): Promise<Pick<Organization, 'id' | 'name'>[]>;\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 // Edge functions\n listEdgeFunctions(projectId: string): Promise<EdgeFunction[]>;\n getEdgeFunction(\n projectId: string,\n functionSlug: string\n ): Promise<EdgeFunction>;\n deployEdgeFunction(\n projectId: string,\n options: DeployEdgeFunctionOptions\n ): Promise<Omit<EdgeFunction, 'files'>>;\n\n // Debugging\n getLogs(projectId: string, options: GetLogsOptions): Promise<unknown>;\n\n // Development\n getProjectUrl(projectId: string): Promise<string>;\n getAnonKey(projectId: string): Promise<string>;\n generateTypescriptTypes(\n projectId: string\n ): Promise<GenerateTypescriptTypesResult>;\n\n // Branching\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","export type ValueOf<T> = T[keyof T];\n\n// UnionToIntersection<A | B> = A & B\nexport type UnionToIntersection<U> = (\n U extends unknown\n ? (arg: U) => 0\n : never\n) extends (arg: infer I) => 0\n ? I\n : never;\n\n// LastInUnion<A | B> = B\nexport type LastInUnion<U> = UnionToIntersection<\n U extends unknown ? (x: U) => 0 : never\n> extends (x: infer L) => 0\n ? L\n : never;\n\n// UnionToTuple<A, B> = [A, B]\nexport type UnionToTuple<T, Last = LastInUnion<T>> = [T] extends [never]\n ? []\n : [Last, ...UnionToTuple<Exclude<T, Last>>];\n\n/**\n * Parses a key-value string into an object.\n *\n * @returns An object representing the key-value pairs\n *\n * @example\n * const result = parseKeyValueList(\"key1=value1\\nkey2=value2\");\n * console.log(result); // { key1: \"value1\", key2: \"value2\" }\n */\nexport function parseKeyValueList(data: string): { [key: string]: string } {\n return Object.fromEntries(\n data\n .split('\\n')\n .map((item) => item.split(/=(.*)/)) // split only on the first '='\n .filter(([key]) => key) // filter out empty keys\n .map(([key, value]) => [key, value ?? '']) // ensure value is not undefined\n );\n}\n\n/**\n * Creates a unique hash from a JavaScript object.\n * @param obj - The object to hash\n * @param length - Optional length to truncate the hash (default: full length)\n */\nexport async function hashObject(\n obj: Record<string, any>,\n length?: number\n): Promise<string> {\n // Sort object keys to ensure consistent output regardless of original key order\n const str = JSON.stringify(obj, (_, value) => {\n if (value && typeof value === 'object' && !Array.isArray(value)) {\n return Object.keys(value)\n .sort()\n .reduce<Record<string, any>>((result, key) => {\n result[key] = value[key];\n return result;\n }, {});\n }\n return value;\n });\n\n const buffer = await crypto.subtle.digest(\n 'SHA-256',\n new TextEncoder().encode(str)\n );\n\n // Convert to base64\n const base64Hash = btoa(String.fromCharCode(...new Uint8Array(buffer)));\n return base64Hash.slice(0, length);\n}\n","import { parseKeyValueList, type UnionToTuple, type ValueOf } from './util.js';\n\nexport type AwsRegion = {\n code: string;\n displayName: string;\n location: Location;\n};\n\nexport type Location = {\n lat: number;\n lng: number;\n};\n\nexport const EARTH_RADIUS = 6371; // in kilometers\nexport const TRACE_URL = 'https://www.cloudflare.com/cdn-cgi/trace';\n\nexport const COUNTRY_COORDINATES = {\n AF: { lat: 33, lng: 65 },\n AX: { lat: 60.116667, lng: 19.9 },\n AL: { lat: 41, lng: 20 },\n DZ: { lat: 28, lng: 3 },\n AS: { lat: -14.3333, lng: -170 },\n AD: { lat: 42.5, lng: 1.6 },\n AO: { lat: -12.5, lng: 18.5 },\n AI: { lat: 18.25, lng: -63.1667 },\n AQ: { lat: -90, lng: 0 },\n AG: { lat: 17.05, lng: -61.8 },\n AR: { lat: -34, lng: -64 },\n AM: { lat: 40, lng: 45 },\n AW: { lat: 12.5, lng: -69.9667 },\n AU: { lat: -27, lng: 133 },\n AT: { lat: 47.3333, lng: 13.3333 },\n AZ: { lat: 40.5, lng: 47.5 },\n BS: { lat: 24.25, lng: -76 },\n BH: { lat: 26, lng: 50.55 },\n BD: { lat: 24, lng: 90 },\n BB: { lat: 13.1667, lng: -59.5333 },\n BY: { lat: 53, lng: 28 },\n BE: { lat: 50.8333, lng: 4 },\n BZ: { lat: 17.25, lng: -88.75 },\n BJ: { lat: 9.5, lng: 2.25 },\n BM: { lat: 32.3333, lng: -64.75 },\n BT: { lat: 27.5, lng: 90.5 },\n BO: { lat: -17, lng: -65 },\n BQ: { lat: 12.183333, lng: -68.233333 },\n BA: { lat: 44, lng: 18 },\n BW: { lat: -22, lng: 24 },\n BV: { lat: -54.4333, lng: 3.4 },\n BR: { lat: -10, lng: -55 },\n IO: { lat: -6, lng: 71.5 },\n BN: { lat: 4.5, lng: 114.6667 },\n BG: { lat: 43, lng: 25 },\n BF: { lat: 13, lng: -2 },\n MM: { lat: 22, lng: 98 },\n BI: { lat: -3.5, lng: 30 },\n KH: { lat: 13, lng: 105 },\n CM: { lat: 6, lng: 12 },\n CA: { lat: 60, lng: -95 },\n CV: { lat: 16, lng: -24 },\n KY: { lat: 19.5, lng: -80.5 },\n CF: { lat: 7, lng: 21 },\n TD: { lat: 15, lng: 19 },\n CL: { lat: -30, lng: -71 },\n CN: { lat: 35, lng: 105 },\n CX: { lat: -10.5, lng: 105.6667 },\n CC: { lat: -12.5, lng: 96.8333 },\n CO: { lat: 4, lng: -72 },\n KM: { lat: -12.1667, lng: 44.25 },\n CD: { lat: 0, lng: 25 },\n CG: { lat: -1, lng: 15 },\n CK: { lat: -21.2333, lng: -159.7667 },\n CR: { lat: 10, lng: -84 },\n CI: { lat: 8, lng: -5 },\n HR: { lat: 45.1667, lng: 15.5 },\n CU: { lat: 21.5, lng: -80 },\n CW: { lat: 12.166667, lng: -68.966667 },\n CY: { lat: 35, lng: 33 },\n CZ: { lat: 49.75, lng: 15.5 },\n DK: { lat: 56, lng: 10 },\n DJ: { lat: 11.5, lng: 43 },\n DM: { lat: 15.4167, lng: -61.3333 },\n DO: { lat: 19, lng: -70.6667 },\n EC: { lat: -2, lng: -77.5 },\n EG: { lat: 27, lng: 30 },\n SV: { lat: 13.8333, lng: -88.9167 },\n GQ: { lat: 2, lng: 10 },\n ER: { lat: 15, lng: 39 },\n EE: { lat: 59, lng: 26 },\n ET: { lat: 8, lng: 38 },\n FK: { lat: -51.75, lng: -59 },\n FO: { lat: 62, lng: -7 },\n FJ: { lat: -18, lng: 175 },\n FI: { lat: 64, lng: 26 },\n FR: { lat: 46, lng: 2 },\n GF: { lat: 4, lng: -53 },\n PF: { lat: -15, lng: -140 },\n TF: { lat: -43, lng: 67 },\n GA: { lat: -1, lng: 11.75 },\n GM: { lat: 13.4667, lng: -16.5667 },\n GE: { lat: 42, lng: 43.5 },\n DE: { lat: 51, lng: 9 },\n GH: { lat: 8, lng: -2 },\n GI: { lat: 36.1833, lng: -5.3667 },\n GR: { lat: 39, lng: 22 },\n GL: { lat: 72, lng: -40 },\n GD: { lat: 12.1167, lng: -61.6667 },\n GP: { lat: 16.25, lng: -61.5833 },\n GU: { lat: 13.4667, lng: 144.7833 },\n GT: { lat: 15.5, lng: -90.25 },\n GG: { lat: 49.5, lng: -2.56 },\n GW: { lat: 12, lng: -15 },\n GN: { lat: 11, lng: -10 },\n GY: { lat: 5, lng: -59 },\n HT: { lat: 19, lng: -72.4167 },\n HM: { lat: -53.1, lng: 72.5167 },\n VA: { lat: 41.9, lng: 12.45 },\n HN: { lat: 15, lng: -86.5 },\n HK: { lat: 22.25, lng: 114.1667 },\n HU: { lat: 47, lng: 20 },\n IS: { lat: 65, lng: -18 },\n IN: { lat: 20, lng: 77 },\n ID: { lat: -5, lng: 120 },\n IR: { lat: 32, lng: 53 },\n IQ: { lat: 33, lng: 44 },\n IE: { lat: 53, lng: -8 },\n IM: { lat: 54.23, lng: -4.55 },\n IL: { lat: 31.5, lng: 34.75 },\n IT: { lat: 42.8333, lng: 12.8333 },\n JM: { lat: 18.25, lng: -77.5 },\n JP: { lat: 36, lng: 138 },\n JE: { lat: 49.21, lng: -2.13 },\n JO: { lat: 31, lng: 36 },\n KZ: { lat: 48, lng: 68 },\n KE: { lat: 1, lng: 38 },\n KI: { lat: 1.4167, lng: 173 },\n KP: { lat: 40, lng: 127 },\n KR: { lat: 37, lng: 127.5 },\n XK: { lat: 42.583333, lng: 21 },\n KW: { lat: 29.3375, lng: 47.6581 },\n KG: { lat: 41, lng: 75 },\n LA: { lat: 18, lng: 105 },\n LV: { lat: 57, lng: 25 },\n LB: { lat: 33.8333, lng: 35.8333 },\n LS: { lat: -29.5, lng: 28.5 },\n LR: { lat: 6.5, lng: -9.5 },\n LY: { lat: 25, lng: 17 },\n LI: { lat: 47.1667, lng: 9.5333 },\n LT: { lat: 56, lng: 24 },\n LU: { lat: 49.75, lng: 6.1667 },\n MO: { lat: 22.1667, lng: 113.55 },\n MK: { lat: 41.8333, lng: 22 },\n MG: { lat: -20, lng: 47 },\n MW: { lat: -13.5, lng: 34 },\n MY: { lat: 2.5, lng: 112.5 },\n MV: { lat: 3.25, lng: 73 },\n ML: { lat: 17, lng: -4 },\n MT: { lat: 35.8333, lng: 14.5833 },\n MH: { lat: 9, lng: 168 },\n MQ: { lat: 14.6667, lng: -61 },\n MR: { lat: 20, lng: -12 },\n MU: { lat: -20.2833, lng: 57.55 },\n YT: { lat: -12.8333, lng: 45.1667 },\n MX: { lat: 23, lng: -102 },\n FM: { lat: 6.9167, lng: 158.25 },\n MD: { lat: 47, lng: 29 },\n MC: { lat: 43.7333, lng: 7.4 },\n MN: { lat: 46, lng: 105 },\n ME: { lat: 42, lng: 19 },\n MS: { lat: 16.75, lng: -62.2 },\n MA: { lat: 32, lng: -5 },\n MZ: { lat: -18.25, lng: 35 },\n NA: { lat: -22, lng: 17 },\n NR: { lat: -0.5333, lng: 166.9167 },\n NP: { lat: 28, lng: 84 },\n AN: { lat: 12.25, lng: -68.75 },\n NL: { lat: 52.5, lng: 5.75 },\n NC: { lat: -21.5, lng: 165.5 },\n NZ: { lat: -41, lng: 174 },\n NI: { lat: 13, lng: -85 },\n NE: { lat: 16, lng: 8 },\n NG: { lat: 10, lng: 8 },\n NU: { lat: -19.0333, lng: -169.8667 },\n NF: { lat: -29.0333, lng: 167.95 },\n MP: { lat: 15.2, lng: 145.75 },\n NO: { lat: 62, lng: 10 },\n OM: { lat: 21, lng: 57 },\n PK: { lat: 30, lng: 70 },\n PW: { lat: 7.5, lng: 134.5 },\n PS: { lat: 32, lng: 35.25 },\n PA: { lat: 9, lng: -80 },\n PG: { lat: -6, lng: 147 },\n PY: { lat: -23, lng: -58 },\n PE: { lat: -10, lng: -76 },\n PH: { lat: 13, lng: 122 },\n PN: { lat: -24.7, lng: -127.4 },\n PL: { lat: 52, lng: 20 },\n PT: { lat: 39.5, lng: -8 },\n PR: { lat: 18.25, lng: -66.5 },\n QA: { lat: 25.5, lng: 51.25 },\n RE: { lat: -21.1, lng: 55.6 },\n RO: { lat: 46, lng: 25 },\n RU: { lat: 60, lng: 100 },\n RW: { lat: -2, lng: 30 },\n BL: { lat: 17.897728, lng: -62.834244 },\n SH: { lat: -15.9333, lng: -5.7 },\n KN: { lat: 17.3333, lng: -62.75 },\n LC: { lat: 13.8833, lng: -61.1333 },\n MF: { lat: 18.075278, lng: -63.06 },\n PM: { lat: 46.8333, lng: -56.3333 },\n VC: { lat: 13.25, lng: -61.2 },\n WS: { lat: -13.5833, lng: -172.3333 },\n SM: { lat: 43.7667, lng: 12.4167 },\n ST: { lat: 1, lng: 7 },\n SA: { lat: 25, lng: 45 },\n SN: { lat: 14, lng: -14 },\n RS: { lat: 44, lng: 21 },\n SC: { lat: -4.5833, lng: 55.6667 },\n SL: { lat: 8.5, lng: -11.5 },\n SG: { lat: 1.3667, lng: 103.8 },\n SX: { lat: 18.033333, lng: -63.05 },\n SK: { lat: 48.6667, lng: 19.5 },\n SI: { lat: 46, lng: 15 },\n SB: { lat: -8, lng: 159 },\n SO: { lat: 10, lng: 49 },\n ZA: { lat: -29, lng: 24 },\n GS: { lat: -54.5, lng: -37 },\n SS: { lat: 8, lng: 30 },\n ES: { lat: 40, lng: -4 },\n LK: { lat: 7, lng: 81 },\n SD: { lat: 15, lng: 30 },\n SR: { lat: 4, lng: -56 },\n SJ: { lat: 78, lng: 20 },\n SZ: { lat: -26.5, lng: 31.5 },\n SE: { lat: 62, lng: 15 },\n CH: { lat: 47, lng: 8 },\n SY: { lat: 35, lng: 38 },\n TW: { lat: 23.5, lng: 121 },\n TJ: { lat: 39, lng: 71 },\n TZ: { lat: -6, lng: 35 },\n TH: { lat: 15, lng: 100 },\n TL: { lat: -8.55, lng: 125.5167 },\n TG: { lat: 8, lng: 1.1667 },\n TK: { lat: -9, lng: -172 },\n TO: { lat: -20, lng: -175 },\n TT: { lat: 11, lng: -61 },\n TN: { lat: 34, lng: 9 },\n TR: { lat: 39, lng: 35 },\n TM: { lat: 40, lng: 60 },\n TC: { lat: 21.75, lng: -71.5833 },\n TV: { lat: -8, lng: 178 },\n UG: { lat: 1, lng: 32 },\n UA: { lat: 49, lng: 32 },\n AE: { lat: 24, lng: 54 },\n GB: { lat: 54, lng: -2 },\n UM: { lat: 19.2833, lng: 166.6 },\n US: { lat: 38, lng: -97 },\n UY: { lat: -33, lng: -56 },\n UZ: { lat: 41, lng: 64 },\n VU: { lat: -16, lng: 167 },\n VE: { lat: 8, lng: -66 },\n VN: { lat: 16, lng: 106 },\n VG: { lat: 18.5, lng: -64.5 },\n VI: { lat: 18.3333, lng: -64.8333 },\n WF: { lat: -13.3, lng: -176.2 },\n EH: { lat: 24.5, lng: -13 },\n YE: { lat: 15, lng: 48 },\n ZM: { lat: -15, lng: 30 },\n ZW: { lat: -20, lng: 30 },\n} as const satisfies Record<string, Location>;\n\nexport const AWS_REGIONS = {\n WEST_US: {\n code: 'us-west-1',\n displayName: 'West US (North California)',\n location: { lat: 37.774929, lng: -122.419418 },\n },\n EAST_US: {\n code: 'us-east-1',\n displayName: 'East US (North Virginia)',\n location: { lat: 37.926868, lng: -78.024902 },\n },\n EAST_US_2: {\n code: 'us-east-2',\n displayName: 'East US (Ohio)',\n location: { lat: 39.9612, lng: -82.9988 },\n },\n CENTRAL_CANADA: {\n code: 'ca-central-1',\n displayName: 'Canada (Central)',\n location: { lat: 56.130367, lng: -106.346771 },\n },\n WEST_EU: {\n code: 'eu-west-1',\n displayName: 'West EU (Ireland)',\n location: { lat: 53.3498, lng: -6.2603 },\n },\n WEST_EU_2: {\n code: 'eu-west-2',\n displayName: 'West Europe (London)',\n location: { lat: 51.507351, lng: -0.127758 },\n },\n WEST_EU_3: {\n code: 'eu-west-3',\n displayName: 'West EU (Paris)',\n location: { lat: 2.352222, lng: 48.856613 },\n },\n CENTRAL_EU: {\n code: 'eu-central-1',\n displayName: 'Central EU (Frankfurt)',\n location: { lat: 50.110924, lng: 8.682127 },\n },\n CENTRAL_EU_2: {\n code: 'eu-central-2',\n displayName: 'Central Europe (Zurich)',\n location: { lat: 47.3744489, lng: 8.5410422 },\n },\n NORTH_EU: {\n code: 'eu-north-1',\n displayName: 'North EU (Stockholm)',\n location: { lat: 59.3251172, lng: 18.0710935 },\n },\n SOUTH_ASIA: {\n code: 'ap-south-1',\n displayName: 'South Asia (Mumbai)',\n location: { lat: 18.9733536, lng: 72.8281049 },\n },\n SOUTHEAST_ASIA: {\n code: 'ap-southeast-1',\n displayName: 'Southeast Asia (Singapore)',\n location: { lat: 1.357107, lng: 103.8194992 },\n },\n NORTHEAST_ASIA: {\n code: 'ap-northeast-1',\n displayName: 'Northeast Asia (Tokyo)',\n location: { lat: 35.6895, lng: 139.6917 },\n },\n NORTHEAST_ASIA_2: {\n code: 'ap-northeast-2',\n displayName: 'Northeast Asia (Seoul)',\n location: { lat: 37.5665, lng: 126.978 },\n },\n OCEANIA: {\n code: 'ap-southeast-2',\n displayName: 'Oceania (Sydney)',\n location: { lat: -33.8688, lng: 151.2093 },\n },\n SOUTH_AMERICA: {\n code: 'sa-east-1',\n displayName: 'South America (São Paulo)',\n location: { lat: -1.2043218, lng: -47.1583944 },\n },\n} as const satisfies Record<string, AwsRegion>;\n\nexport type RegionCodes = ValueOf<typeof AWS_REGIONS>['code'];\n\nexport const AWS_REGION_CODES = Object.values(AWS_REGIONS).map(\n (region) => region.code\n) as UnionToTuple<RegionCodes>;\n\n/**\n * Calculates the closest AWS region to a given location.\n */\nexport function getClosestAwsRegion(location: Location) {\n const distances = Object.entries(AWS_REGIONS).map<\n [region: string, distance: number]\n >(([name, region]) => {\n return [name, getDistance(location, region.location)] as const;\n });\n\n const closestRegion = distances.reduce<\n [region: string, distance: number] | undefined\n >(\n (min, current) =>\n min === undefined ? current : current[1] < min[1] ? current : min,\n undefined\n );\n\n if (!closestRegion) {\n throw new Error('no closest region found');\n }\n\n const [regionName] = closestRegion;\n\n return AWS_REGIONS[regionName as keyof typeof AWS_REGIONS];\n}\n\n/**\n * Fetches the user's country code based on their IP address.\n */\nexport async function getCountryCode() {\n const response = await fetch(TRACE_URL);\n const data = await response.text();\n const info = parseKeyValueList(data);\n const countryCode = info['loc'];\n\n if (!countryCode) {\n throw new Error('location not found');\n }\n\n return countryCode;\n}\n\n/**\n * Gets the approximate coordinates of a country based on its country code.\n */\nexport function getCountryCoordinates(countryCode: string) {\n const location: Location =\n COUNTRY_COORDINATES[countryCode as keyof typeof COUNTRY_COORDINATES];\n\n if (!location) {\n throw new Error(`unknown location code: ${countryCode}`);\n }\n\n return location;\n}\n\n/**\n * Calculates the distance between two points on Earth using the Haversine formula.\n *\n * @returns Distance between the points in kilometers\n */\nexport function getDistance(a: Location, b: Location): number {\n const lat = degreesToRadians(b.lat - a.lat);\n const lng = degreesToRadians(b.lng - a.lng);\n const a1 =\n Math.sin(lat / 2) * Math.sin(lat / 2) +\n Math.cos(degreesToRadians(a.lat)) *\n Math.cos(degreesToRadians(b.lat)) *\n Math.sin(lng / 2) *\n Math.sin(lng / 2);\n const c = 2 * Math.atan2(Math.sqrt(a1), Math.sqrt(1 - a1));\n return EARTH_RADIUS * c;\n}\n\n/**\n * Converts degrees to radians\n *\n * @returns The angle in radians\n */\nexport function degreesToRadians(deg: number): number {\n return deg * (Math.PI / 180);\n}\n"],"mappings":"AAAA,OAAS,KAAAA,MAAS,MCgCX,SAASC,EAAkBC,EAAyC,CACzE,OAAO,OAAO,YACZA,EACG,MAAM;AAAA,CAAI,EACV,IAAKC,GAASA,EAAK,MAAM,OAAO,CAAC,EACjC,OAAO,CAAC,CAACC,CAAG,IAAMA,CAAG,EACrB,IAAI,CAAC,CAACA,EAAKC,CAAK,IAAM,CAACD,EAAKC,GAAS,EAAE,CAAC,CAC7C,CACF,CAOA,eAAsBC,EACpBC,EACAC,EACiB,CAEjB,IAAMC,EAAM,KAAK,UAAUF,EAAK,CAACG,EAAGL,IAC9BA,GAAS,OAAOA,GAAU,UAAY,CAAC,MAAM,QAAQA,CAAK,EACr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AE,OAAO,EAAE,SAAS,CACzC,CAAC,EAEYa,EAAsCb,EAAE,OAAO,CAC1D,MAAOA,EAAE,OAAO,CAClB,CAAC","names":["z","parseKeyValueList","data","item","key","value","hashObject","obj","length","str","_","result","buffer","EARTH_RADIUS","TRACE_URL","COUNTRY_COORDINATES","AWS_REGIONS","AWS_REGION_CODES","region","getClosestAwsRegion","location","closestRegion","name","getDistance","min","current","regionName","getCountryCode","data","countryCode","parseKeyValueList","getCountryCoordinates","a","b","lat","degreesToRadians","lng","a1","c","deg","organizationSchema","z","projectSchema","branchSchema","edgeFunctionSchema","createProjectOptionsSchema","AWS_REGION_CODES","createBranchOptionsSchema","resetBranchOptionsSchema","deployEdgeFunctionOptionsSchema","executeSqlOptionsSchema","applyMigrationOptionsSchema","migrationSchema","getLogsOptionsSchema","generateTypescriptTypesResultSchema"]}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkB7LGECMIcjs = require('./chunk-B7LGECMI.cjs');exports.createSupabaseMcpServer = _chunkB7LGECMIcjs.b;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHN6SHDQAcjs = require('./chunk-HN6SHDQA.cjs');require('./chunk-ILOQJ4GC.cjs');exports.createSupabaseApiPlatform = _chunkHN6SHDQAcjs.b; exports.createSupabaseMcpServer = _chunkHN6SHDQAcjs.c;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/grichardson/Documents/dev/supabase/mcp-server-supabase/packages/mcp-server-supabase/dist/index.cjs"],"names":[],"mappings":"AAAA,iIAAwC,sDAAqC","file":"/Users/grichardson/Documents/dev/supabase/mcp-server-supabase/packages/mcp-server-supabase/dist/index.cjs"}
1
+ {"version":3,"sources":["/Users/grichardson/Documents/dev/supabase/mcp-server-supabase/packages/mcp-server-supabase/dist/index.cjs"],"names":[],"mappings":"AAAA,iIAA+C,gCAA6B,+GAAoE","file":"/Users/grichardson/Documents/dev/supabase/mcp-server-supabase/packages/mcp-server-supabase/dist/index.cjs"}
package/dist/index.d.cts CHANGED
@@ -1,4 +1,22 @@
1
+ import { SupabasePlatform } from './platform/index.cjs';
1
2
  import * as _modelcontextprotocol_sdk_server_index_js from '@modelcontextprotocol/sdk/server/index.js';
3
+ import 'zod';
4
+ import '@supabase/mcp-utils';
5
+
6
+ type SupabaseApiPlatformOptions = {
7
+ /**
8
+ * The access token for the Supabase Management API.
9
+ */
10
+ accessToken: string;
11
+ /**
12
+ * The API URL for the Supabase Management API.
13
+ */
14
+ apiUrl?: string;
15
+ };
16
+ /**
17
+ * Creates a Supabase platform implementation using the Supabase Management API.
18
+ */
19
+ declare function createSupabaseApiPlatform(options: SupabaseApiPlatformOptions): SupabasePlatform;
2
20
 
3
21
  type SupabasePlatformOptions = {
4
22
  /**
@@ -12,9 +30,13 @@ type SupabasePlatformOptions = {
12
30
  };
13
31
  type SupabaseMcpServerOptions = {
14
32
  /**
15
- * Platform options for Supabase.
33
+ * Platform implementation for Supabase.
34
+ */
35
+ platform: SupabasePlatform;
36
+ /**
37
+ * The API URL for the Supabase Content API.
16
38
  */
17
- platform: SupabasePlatformOptions;
39
+ contentApiUrl?: string;
18
40
  /**
19
41
  * The project ID to scope the server to.
20
42
  *
@@ -54,4 +76,4 @@ declare function createSupabaseMcpServer(options: SupabaseMcpServerOptions): _mo
54
76
  } | undefined;
55
77
  }>;
56
78
 
57
- export { type SupabaseMcpServerOptions, type SupabasePlatformOptions, createSupabaseMcpServer };
79
+ export { type SupabaseApiPlatformOptions, type SupabaseMcpServerOptions, SupabasePlatform, type SupabasePlatformOptions, createSupabaseApiPlatform, createSupabaseMcpServer };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,22 @@
1
+ import { SupabasePlatform } from './platform/index.js';
1
2
  import * as _modelcontextprotocol_sdk_server_index_js from '@modelcontextprotocol/sdk/server/index.js';
3
+ import 'zod';
4
+ import '@supabase/mcp-utils';
5
+
6
+ type SupabaseApiPlatformOptions = {
7
+ /**
8
+ * The access token for the Supabase Management API.
9
+ */
10
+ accessToken: string;
11
+ /**
12
+ * The API URL for the Supabase Management API.
13
+ */
14
+ apiUrl?: string;
15
+ };
16
+ /**
17
+ * Creates a Supabase platform implementation using the Supabase Management API.
18
+ */
19
+ declare function createSupabaseApiPlatform(options: SupabaseApiPlatformOptions): SupabasePlatform;
2
20
 
3
21
  type SupabasePlatformOptions = {
4
22
  /**
@@ -12,9 +30,13 @@ type SupabasePlatformOptions = {
12
30
  };
13
31
  type SupabaseMcpServerOptions = {
14
32
  /**
15
- * Platform options for Supabase.
33
+ * Platform implementation for Supabase.
34
+ */
35
+ platform: SupabasePlatform;
36
+ /**
37
+ * The API URL for the Supabase Content API.
16
38
  */
17
- platform: SupabasePlatformOptions;
39
+ contentApiUrl?: string;
18
40
  /**
19
41
  * The project ID to scope the server to.
20
42
  *
@@ -54,4 +76,4 @@ declare function createSupabaseMcpServer(options: SupabaseMcpServerOptions): _mo
54
76
  } | undefined;
55
77
  }>;
56
78
 
57
- export { type SupabaseMcpServerOptions, type SupabasePlatformOptions, createSupabaseMcpServer };
79
+ export { type SupabaseApiPlatformOptions, type SupabaseMcpServerOptions, SupabasePlatform, type SupabasePlatformOptions, createSupabaseApiPlatform, createSupabaseMcpServer };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import{b as o}from"./chunk-6X2DT2BL.js";export{o as createSupabaseMcpServer};
1
+ import{b as o,c as r}from"./chunk-EZSQZZQT.js";import"./chunk-P4XUQGTL.js";export{o as createSupabaseApiPlatform,r as createSupabaseMcpServer};
2
2
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkILOQJ4GCcjs = require('../chunk-ILOQJ4GC.cjs');exports.applyMigrationOptionsSchema = _chunkILOQJ4GCcjs.o; exports.branchSchema = _chunkILOQJ4GCcjs.h; exports.createBranchOptionsSchema = _chunkILOQJ4GCcjs.k; exports.createProjectOptionsSchema = _chunkILOQJ4GCcjs.j; exports.deployEdgeFunctionOptionsSchema = _chunkILOQJ4GCcjs.m; exports.edgeFunctionSchema = _chunkILOQJ4GCcjs.i; exports.executeSqlOptionsSchema = _chunkILOQJ4GCcjs.n; exports.generateTypescriptTypesResultSchema = _chunkILOQJ4GCcjs.r; exports.getLogsOptionsSchema = _chunkILOQJ4GCcjs.q; exports.migrationSchema = _chunkILOQJ4GCcjs.p; exports.organizationSchema = _chunkILOQJ4GCcjs.f; exports.projectSchema = _chunkILOQJ4GCcjs.g; exports.resetBranchOptionsSchema = _chunkILOQJ4GCcjs.l;
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/grichardson/Documents/dev/supabase/mcp-server-supabase/packages/mcp-server-supabase/dist/platform/index.cjs"],"names":[],"mappings":"AAAA,kIAA6H,8rBAAqX","file":"/Users/grichardson/Documents/dev/supabase/mcp-server-supabase/packages/mcp-server-supabase/dist/platform/index.cjs"}
@@ -0,0 +1,292 @@
1
+ import { z } from 'zod';
2
+ import { InitData } from '@supabase/mcp-utils';
3
+
4
+ declare const organizationSchema: z.ZodObject<{
5
+ id: z.ZodString;
6
+ name: z.ZodString;
7
+ plan: z.ZodOptional<z.ZodString>;
8
+ allowed_release_channels: z.ZodArray<z.ZodString, "many">;
9
+ opt_in_tags: z.ZodArray<z.ZodString, "many">;
10
+ }, "strip", z.ZodTypeAny, {
11
+ name: string;
12
+ id: string;
13
+ allowed_release_channels: string[];
14
+ opt_in_tags: string[];
15
+ plan?: string | undefined;
16
+ }, {
17
+ name: string;
18
+ id: string;
19
+ allowed_release_channels: string[];
20
+ opt_in_tags: string[];
21
+ plan?: string | undefined;
22
+ }>;
23
+ declare const projectSchema: z.ZodObject<{
24
+ id: z.ZodString;
25
+ organization_id: z.ZodString;
26
+ name: z.ZodString;
27
+ status: z.ZodString;
28
+ created_at: z.ZodString;
29
+ region: z.ZodString;
30
+ }, "strip", z.ZodTypeAny, {
31
+ status: string;
32
+ name: string;
33
+ region: string;
34
+ id: string;
35
+ organization_id: string;
36
+ created_at: string;
37
+ }, {
38
+ status: string;
39
+ name: string;
40
+ region: string;
41
+ id: string;
42
+ organization_id: string;
43
+ created_at: string;
44
+ }>;
45
+ declare const branchSchema: z.ZodObject<{
46
+ id: z.ZodString;
47
+ name: z.ZodString;
48
+ project_ref: z.ZodString;
49
+ parent_project_ref: z.ZodString;
50
+ is_default: z.ZodBoolean;
51
+ git_branch: z.ZodOptional<z.ZodString>;
52
+ pr_number: z.ZodOptional<z.ZodNumber>;
53
+ latest_check_run_id: z.ZodOptional<z.ZodNumber>;
54
+ persistent: z.ZodBoolean;
55
+ status: z.ZodEnum<["CREATING_PROJECT", "RUNNING_MIGRATIONS", "MIGRATIONS_PASSED", "MIGRATIONS_FAILED", "FUNCTIONS_DEPLOYED", "FUNCTIONS_FAILED"]>;
56
+ created_at: z.ZodString;
57
+ updated_at: z.ZodString;
58
+ }, "strip", z.ZodTypeAny, {
59
+ status: "CREATING_PROJECT" | "RUNNING_MIGRATIONS" | "MIGRATIONS_PASSED" | "MIGRATIONS_FAILED" | "FUNCTIONS_DEPLOYED" | "FUNCTIONS_FAILED";
60
+ name: string;
61
+ id: string;
62
+ created_at: string;
63
+ project_ref: string;
64
+ parent_project_ref: string;
65
+ is_default: boolean;
66
+ persistent: boolean;
67
+ updated_at: string;
68
+ git_branch?: string | undefined;
69
+ pr_number?: number | undefined;
70
+ latest_check_run_id?: number | undefined;
71
+ }, {
72
+ status: "CREATING_PROJECT" | "RUNNING_MIGRATIONS" | "MIGRATIONS_PASSED" | "MIGRATIONS_FAILED" | "FUNCTIONS_DEPLOYED" | "FUNCTIONS_FAILED";
73
+ name: string;
74
+ id: string;
75
+ created_at: string;
76
+ project_ref: string;
77
+ parent_project_ref: string;
78
+ is_default: boolean;
79
+ persistent: boolean;
80
+ updated_at: string;
81
+ git_branch?: string | undefined;
82
+ pr_number?: number | undefined;
83
+ latest_check_run_id?: number | undefined;
84
+ }>;
85
+ declare const edgeFunctionSchema: z.ZodObject<{
86
+ id: z.ZodString;
87
+ slug: z.ZodString;
88
+ name: z.ZodString;
89
+ status: z.ZodString;
90
+ version: z.ZodNumber;
91
+ created_at: z.ZodOptional<z.ZodNumber>;
92
+ updated_at: z.ZodOptional<z.ZodNumber>;
93
+ verify_jwt: z.ZodOptional<z.ZodBoolean>;
94
+ import_map: z.ZodOptional<z.ZodBoolean>;
95
+ import_map_path: z.ZodOptional<z.ZodString>;
96
+ entrypoint_path: z.ZodOptional<z.ZodString>;
97
+ files: z.ZodArray<z.ZodObject<{
98
+ name: z.ZodString;
99
+ content: z.ZodString;
100
+ }, "strip", z.ZodTypeAny, {
101
+ content: string;
102
+ name: string;
103
+ }, {
104
+ content: string;
105
+ name: string;
106
+ }>, "many">;
107
+ }, "strip", z.ZodTypeAny, {
108
+ version: number;
109
+ status: string;
110
+ name: string;
111
+ id: string;
112
+ slug: string;
113
+ files: {
114
+ content: string;
115
+ name: string;
116
+ }[];
117
+ created_at?: number | undefined;
118
+ updated_at?: number | undefined;
119
+ verify_jwt?: boolean | undefined;
120
+ import_map?: boolean | undefined;
121
+ import_map_path?: string | undefined;
122
+ entrypoint_path?: string | undefined;
123
+ }, {
124
+ version: number;
125
+ status: string;
126
+ name: string;
127
+ id: string;
128
+ slug: string;
129
+ files: {
130
+ content: string;
131
+ name: string;
132
+ }[];
133
+ created_at?: number | undefined;
134
+ updated_at?: number | undefined;
135
+ verify_jwt?: boolean | undefined;
136
+ import_map?: boolean | undefined;
137
+ import_map_path?: string | undefined;
138
+ entrypoint_path?: string | undefined;
139
+ }>;
140
+ declare const createProjectOptionsSchema: z.ZodObject<{
141
+ name: z.ZodString;
142
+ organization_id: z.ZodString;
143
+ region: z.ZodOptional<z.ZodEnum<["sa-east-1", "ap-south-1", "ca-central-1", "eu-central-2", "eu-central-1", "eu-north-1", "eu-west-3", "eu-west-2", "eu-west-1", "ap-southeast-2", "ap-northeast-2", "ap-northeast-1", "ap-southeast-1", "us-west-1", "us-east-2", "us-east-1"]>>;
144
+ db_pass: z.ZodOptional<z.ZodString>;
145
+ }, "strip", z.ZodTypeAny, {
146
+ name: string;
147
+ organization_id: string;
148
+ region?: "us-east-1" | "us-east-2" | "us-west-1" | "ap-southeast-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-southeast-2" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "eu-central-1" | "eu-central-2" | "ca-central-1" | "ap-south-1" | "sa-east-1" | undefined;
149
+ db_pass?: string | undefined;
150
+ }, {
151
+ name: string;
152
+ organization_id: string;
153
+ region?: "us-east-1" | "us-east-2" | "us-west-1" | "ap-southeast-1" | "ap-northeast-1" | "ap-northeast-2" | "ap-southeast-2" | "eu-west-1" | "eu-west-2" | "eu-west-3" | "eu-north-1" | "eu-central-1" | "eu-central-2" | "ca-central-1" | "ap-south-1" | "sa-east-1" | undefined;
154
+ db_pass?: string | undefined;
155
+ }>;
156
+ declare const createBranchOptionsSchema: z.ZodObject<{
157
+ name: z.ZodString;
158
+ }, "strip", z.ZodTypeAny, {
159
+ name: string;
160
+ }, {
161
+ name: string;
162
+ }>;
163
+ declare const resetBranchOptionsSchema: z.ZodObject<{
164
+ migration_version: z.ZodOptional<z.ZodString>;
165
+ }, "strip", z.ZodTypeAny, {
166
+ migration_version?: string | undefined;
167
+ }, {
168
+ migration_version?: string | undefined;
169
+ }>;
170
+ declare const deployEdgeFunctionOptionsSchema: z.ZodObject<{
171
+ name: z.ZodString;
172
+ entrypoint_path: z.ZodString;
173
+ import_map_path: z.ZodOptional<z.ZodString>;
174
+ files: z.ZodArray<z.ZodObject<{
175
+ name: z.ZodString;
176
+ content: z.ZodString;
177
+ }, "strip", z.ZodTypeAny, {
178
+ content: string;
179
+ name: string;
180
+ }, {
181
+ content: string;
182
+ name: string;
183
+ }>, "many">;
184
+ }, "strip", z.ZodTypeAny, {
185
+ name: string;
186
+ entrypoint_path: string;
187
+ files: {
188
+ content: string;
189
+ name: string;
190
+ }[];
191
+ import_map_path?: string | undefined;
192
+ }, {
193
+ name: string;
194
+ entrypoint_path: string;
195
+ files: {
196
+ content: string;
197
+ name: string;
198
+ }[];
199
+ import_map_path?: string | undefined;
200
+ }>;
201
+ declare const executeSqlOptionsSchema: z.ZodObject<{
202
+ query: z.ZodString;
203
+ read_only: z.ZodOptional<z.ZodBoolean>;
204
+ }, "strip", z.ZodTypeAny, {
205
+ query: string;
206
+ read_only?: boolean | undefined;
207
+ }, {
208
+ query: string;
209
+ read_only?: boolean | undefined;
210
+ }>;
211
+ declare const applyMigrationOptionsSchema: z.ZodObject<{
212
+ name: z.ZodString;
213
+ query: z.ZodString;
214
+ }, "strip", z.ZodTypeAny, {
215
+ name: string;
216
+ query: string;
217
+ }, {
218
+ name: string;
219
+ query: string;
220
+ }>;
221
+ declare const migrationSchema: z.ZodObject<{
222
+ version: z.ZodString;
223
+ name: z.ZodOptional<z.ZodString>;
224
+ }, "strip", z.ZodTypeAny, {
225
+ version: string;
226
+ name?: string | undefined;
227
+ }, {
228
+ version: string;
229
+ name?: string | undefined;
230
+ }>;
231
+ declare const getLogsOptionsSchema: z.ZodObject<{
232
+ sql: z.ZodString;
233
+ iso_timestamp_start: z.ZodOptional<z.ZodString>;
234
+ iso_timestamp_end: z.ZodOptional<z.ZodString>;
235
+ }, "strip", z.ZodTypeAny, {
236
+ sql: string;
237
+ iso_timestamp_start?: string | undefined;
238
+ iso_timestamp_end?: string | undefined;
239
+ }, {
240
+ sql: string;
241
+ iso_timestamp_start?: string | undefined;
242
+ iso_timestamp_end?: string | undefined;
243
+ }>;
244
+ declare const generateTypescriptTypesResultSchema: z.ZodObject<{
245
+ types: z.ZodString;
246
+ }, "strip", z.ZodTypeAny, {
247
+ types: string;
248
+ }, {
249
+ types: string;
250
+ }>;
251
+ type Organization = z.infer<typeof organizationSchema>;
252
+ type Project = z.infer<typeof projectSchema>;
253
+ type Branch = z.infer<typeof branchSchema>;
254
+ type EdgeFunction = z.infer<typeof edgeFunctionSchema>;
255
+ type CreateProjectOptions = z.infer<typeof createProjectOptionsSchema>;
256
+ type CreateBranchOptions = z.infer<typeof createBranchOptionsSchema>;
257
+ type ResetBranchOptions = z.infer<typeof resetBranchOptionsSchema>;
258
+ type DeployEdgeFunctionOptions = z.infer<typeof deployEdgeFunctionOptionsSchema>;
259
+ type ExecuteSqlOptions = z.infer<typeof executeSqlOptionsSchema>;
260
+ type ApplyMigrationOptions = z.infer<typeof applyMigrationOptionsSchema>;
261
+ type Migration = z.infer<typeof migrationSchema>;
262
+ type ListMigrationsResult = z.infer<typeof migrationSchema>;
263
+ type GetLogsOptions = z.infer<typeof getLogsOptionsSchema>;
264
+ type GenerateTypescriptTypesResult = z.infer<typeof generateTypescriptTypesResultSchema>;
265
+ type SupabasePlatform = {
266
+ init?(info: InitData): Promise<void>;
267
+ executeSql<T>(projectId: string, options: ExecuteSqlOptions): Promise<T[]>;
268
+ listMigrations(projectId: string): Promise<Migration[]>;
269
+ applyMigration<T>(projectId: string, options: ApplyMigrationOptions): Promise<T[]>;
270
+ listOrganizations(): Promise<Pick<Organization, 'id' | 'name'>[]>;
271
+ getOrganization(organizationId: string): Promise<Organization>;
272
+ listProjects(): Promise<Project[]>;
273
+ getProject(projectId: string): Promise<Project>;
274
+ createProject(options: CreateProjectOptions): Promise<Project>;
275
+ pauseProject(projectId: string): Promise<void>;
276
+ restoreProject(projectId: string): Promise<void>;
277
+ listEdgeFunctions(projectId: string): Promise<EdgeFunction[]>;
278
+ getEdgeFunction(projectId: string, functionSlug: string): Promise<EdgeFunction>;
279
+ deployEdgeFunction(projectId: string, options: DeployEdgeFunctionOptions): Promise<Omit<EdgeFunction, 'files'>>;
280
+ getLogs(projectId: string, options: GetLogsOptions): Promise<unknown>;
281
+ getProjectUrl(projectId: string): Promise<string>;
282
+ getAnonKey(projectId: string): Promise<string>;
283
+ generateTypescriptTypes(projectId: string): Promise<GenerateTypescriptTypesResult>;
284
+ listBranches(projectId: string): Promise<Branch[]>;
285
+ createBranch(projectId: string, options: CreateBranchOptions): Promise<Branch>;
286
+ deleteBranch(branchId: string): Promise<void>;
287
+ mergeBranch(branchId: string): Promise<void>;
288
+ resetBranch(branchId: string, options: ResetBranchOptions): Promise<void>;
289
+ rebaseBranch(branchId: string): Promise<void>;
290
+ };
291
+
292
+ export { type ApplyMigrationOptions, type Branch, type CreateBranchOptions, type CreateProjectOptions, type DeployEdgeFunctionOptions, type EdgeFunction, type ExecuteSqlOptions, type GenerateTypescriptTypesResult, type GetLogsOptions, type ListMigrationsResult, type Migration, type Organization, type Project, type ResetBranchOptions, type SupabasePlatform, applyMigrationOptionsSchema, branchSchema, createBranchOptionsSchema, createProjectOptionsSchema, deployEdgeFunctionOptionsSchema, edgeFunctionSchema, executeSqlOptionsSchema, generateTypescriptTypesResultSchema, getLogsOptionsSchema, migrationSchema, organizationSchema, projectSchema, resetBranchOptionsSchema };