@supabase/mcp-server-supabase 0.4.4-alpha.4 → 0.4.5-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.
- package/dist/{chunk-CZ7BSFIW.cjs → chunk-42U7HZZC.cjs} +2 -2
- package/dist/chunk-42U7HZZC.cjs.map +1 -0
- package/dist/chunk-HBGPPQOZ.js +310 -0
- package/dist/chunk-HBGPPQOZ.js.map +1 -0
- package/dist/chunk-J5OV62WS.cjs +310 -0
- package/dist/chunk-J5OV62WS.cjs.map +1 -0
- package/dist/{chunk-V755O7BY.js → chunk-TSIYIWSV.js} +2 -2
- package/dist/chunk-TSIYIWSV.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +1 -1
- package/dist/platform/index.cjs +1 -1
- package/dist/platform/index.cjs.map +1 -1
- package/dist/platform/index.d.cts +86 -6
- package/dist/platform/index.d.ts +86 -6
- 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/dist/transports/stdio.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-CDSVUTHT.js +0 -310
- package/dist/chunk-CDSVUTHT.js.map +0 -1
- package/dist/chunk-CZ7BSFIW.cjs.map +0 -1
- package/dist/chunk-V755O7BY.js.map +0 -1
- package/dist/chunk-ZCKP3QCK.cjs +0 -310
- package/dist/chunk-ZCKP3QCK.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/platform/types.ts","../src/util.ts","../src/regions.ts"],"sourcesContent":["import type { InitData } from '@supabase/mcp-utils';\nimport { z } from 'zod';\nimport { AWS_REGION_CODES } from '../regions.js';\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(),\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 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 StorageConfig = z.infer<typeof storageConfigSchema>;\nexport type StorageBucket = z.infer<typeof storageBucketSchema>;\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(\n projectId: string,\n options: ApplyMigrationOptions\n ): Promise<void>;\n\n // Account\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 getSecurityAdvisors(projectId: string): Promise<unknown>;\n getPerformanceAdvisors(projectId: string): 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 // Storage\n getStorageConfig(projectId: string): Promise<StorageConfig>;\n updateStorageConfig(projectId: string, config: StorageConfig): Promise<void>;\n listAllBuckets(projectId: string): Promise<StorageBucket[]>;\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":"AACA,OAAS,KAAAA,MAAS,MC+BX,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,EACrD,OAAO,KAAKA,CAAK,EACrB,KAAK,EACL,OAA4B,CAACM,EAAQP,KACpCO,EAAOP,CAAG,EAAIC,EAAMD,CAAG,EAChBO,GACN,CAAC,CAAC,EAEFN,CACR,EAEKO,EAAS,MAAM,OAAO,OAAO,OACjC,UACA,IAAI,YAAY,EAAE,OAAOH,CAAG,CAC9B,EAIA,OADmB,KAAK,OAAO,aAAa,GAAG,IAAI,WAAWG,CAAM,CAAC,CAAC,EACpD,MAAM,EAAGJ,CAAM,CACnC,CC3DO,IAAMK,EAAe,KACfC,EAAY,2CAEZC,EAAsB,CACjC,GAAI,CAAE,IAAK,GAAI,IAAK,EAAG,EACvB,GAAI,CAAE,IAAK,UAAW,IAAK,IAAK,EAChC,GAAI,CAAE,IAAK,GAAI,IAAK,EAAG,EACvB,GAAI,CAAE,IAAK,GAAI,IAAK,CAAE,EACtB,GAAI,CAA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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","storageBucketSchema","z","storageConfigSchema","organizationSchema","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
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJ5OV62WScjs = require('./chunk-J5OV62WS.cjs');require('./chunk-42U7HZZC.cjs');exports.createSupabaseApiPlatform = _chunkJ5OV62WScjs.b; exports.createSupabaseMcpServer = _chunkJ5OV62WScjs.c;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SupabasePlatform } from './platform/index.cjs';
|
|
2
2
|
import * as _modelcontextprotocol_sdk_server_index_js from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
-
import 'zod';
|
|
3
|
+
import { z } from 'zod';
|
|
4
4
|
import '@supabase/mcp-utils';
|
|
5
5
|
|
|
6
6
|
type SupabaseApiPlatformOptions = {
|
|
@@ -48,7 +48,14 @@ type SupabaseMcpServerOptions = {
|
|
|
48
48
|
* Executes database queries in read-only mode if true.
|
|
49
49
|
*/
|
|
50
50
|
readOnly?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Features to enable.
|
|
53
|
+
* Options: 'account', 'branching', 'database', 'debug', 'development', 'docs', 'functions', 'storage'
|
|
54
|
+
*/
|
|
55
|
+
features?: string[];
|
|
51
56
|
};
|
|
57
|
+
declare const featureGroupSchema: z.ZodEnum<["docs", "account", "database", "debug", "development", "functions", "branching", "storage"]>;
|
|
58
|
+
type FeatureGroup = z.infer<typeof featureGroupSchema>;
|
|
52
59
|
/**
|
|
53
60
|
* Creates an MCP server for interacting with Supabase.
|
|
54
61
|
*/
|
|
@@ -76,4 +83,4 @@ declare function createSupabaseMcpServer(options: SupabaseMcpServerOptions): _mo
|
|
|
76
83
|
} | undefined;
|
|
77
84
|
}>;
|
|
78
85
|
|
|
79
|
-
export { type SupabaseApiPlatformOptions, type SupabaseMcpServerOptions, SupabasePlatform, type SupabasePlatformOptions, createSupabaseApiPlatform, createSupabaseMcpServer };
|
|
86
|
+
export { type FeatureGroup, type SupabaseApiPlatformOptions, type SupabaseMcpServerOptions, SupabasePlatform, type SupabasePlatformOptions, createSupabaseApiPlatform, createSupabaseMcpServer };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SupabasePlatform } from './platform/index.js';
|
|
2
2
|
import * as _modelcontextprotocol_sdk_server_index_js from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
-
import 'zod';
|
|
3
|
+
import { z } from 'zod';
|
|
4
4
|
import '@supabase/mcp-utils';
|
|
5
5
|
|
|
6
6
|
type SupabaseApiPlatformOptions = {
|
|
@@ -48,7 +48,14 @@ type SupabaseMcpServerOptions = {
|
|
|
48
48
|
* Executes database queries in read-only mode if true.
|
|
49
49
|
*/
|
|
50
50
|
readOnly?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Features to enable.
|
|
53
|
+
* Options: 'account', 'branching', 'database', 'debug', 'development', 'docs', 'functions', 'storage'
|
|
54
|
+
*/
|
|
55
|
+
features?: string[];
|
|
51
56
|
};
|
|
57
|
+
declare const featureGroupSchema: z.ZodEnum<["docs", "account", "database", "debug", "development", "functions", "branching", "storage"]>;
|
|
58
|
+
type FeatureGroup = z.infer<typeof featureGroupSchema>;
|
|
52
59
|
/**
|
|
53
60
|
* Creates an MCP server for interacting with Supabase.
|
|
54
61
|
*/
|
|
@@ -76,4 +83,4 @@ declare function createSupabaseMcpServer(options: SupabaseMcpServerOptions): _mo
|
|
|
76
83
|
} | undefined;
|
|
77
84
|
}>;
|
|
78
85
|
|
|
79
|
-
export { type SupabaseApiPlatformOptions, type SupabaseMcpServerOptions, SupabasePlatform, type SupabasePlatformOptions, createSupabaseApiPlatform, createSupabaseMcpServer };
|
|
86
|
+
export { type FeatureGroup, type SupabaseApiPlatformOptions, type SupabaseMcpServerOptions, SupabasePlatform, type SupabasePlatformOptions, createSupabaseApiPlatform, createSupabaseMcpServer };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as o,c as r}from"./chunk-
|
|
1
|
+
import{b as o,c as r}from"./chunk-HBGPPQOZ.js";import"./chunk-TSIYIWSV.js";export{o as createSupabaseApiPlatform,r as createSupabaseMcpServer};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/platform/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk42U7HZZCcjs = require('../chunk-42U7HZZC.cjs');exports.applyMigrationOptionsSchema = _chunk42U7HZZCcjs.q; exports.branchSchema = _chunk42U7HZZCcjs.j; exports.createBranchOptionsSchema = _chunk42U7HZZCcjs.m; exports.createProjectOptionsSchema = _chunk42U7HZZCcjs.l; exports.deployEdgeFunctionOptionsSchema = _chunk42U7HZZCcjs.o; exports.edgeFunctionSchema = _chunk42U7HZZCcjs.k; exports.executeSqlOptionsSchema = _chunk42U7HZZCcjs.p; exports.generateTypescriptTypesResultSchema = _chunk42U7HZZCcjs.t; exports.getLogsOptionsSchema = _chunk42U7HZZCcjs.s; exports.migrationSchema = _chunk42U7HZZCcjs.r; exports.organizationSchema = _chunk42U7HZZCcjs.h; exports.projectSchema = _chunk42U7HZZCcjs.i; exports.resetBranchOptionsSchema = _chunk42U7HZZCcjs.n; exports.storageBucketSchema = _chunk42U7HZZCcjs.f; exports.storageConfigSchema = _chunk42U7HZZCcjs.g;
|
|
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/platform/index.cjs"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"sources":["/Users/grichardson/Documents/dev/supabase/mcp-server-supabase/packages/mcp-server-supabase/dist/platform/index.cjs"],"names":[],"mappings":"AAAA,kIAA2I,oyBAAua","file":"/Users/grichardson/Documents/dev/supabase/mcp-server-supabase/packages/mcp-server-supabase/dist/platform/index.cjs"}
|
|
@@ -1,6 +1,81 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import { InitData } from '@supabase/mcp-utils';
|
|
2
|
+
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
+
declare const storageBucketSchema: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
owner: z.ZodString;
|
|
8
|
+
created_at: z.ZodString;
|
|
9
|
+
updated_at: z.ZodString;
|
|
10
|
+
public: z.ZodBoolean;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
public: boolean;
|
|
13
|
+
name: string;
|
|
14
|
+
id: string;
|
|
15
|
+
owner: string;
|
|
16
|
+
created_at: string;
|
|
17
|
+
updated_at: string;
|
|
18
|
+
}, {
|
|
19
|
+
public: boolean;
|
|
20
|
+
name: string;
|
|
21
|
+
id: string;
|
|
22
|
+
owner: string;
|
|
23
|
+
created_at: string;
|
|
24
|
+
updated_at: string;
|
|
25
|
+
}>;
|
|
26
|
+
declare const storageConfigSchema: z.ZodObject<{
|
|
27
|
+
fileSizeLimit: z.ZodNumber;
|
|
28
|
+
features: z.ZodObject<{
|
|
29
|
+
imageTransformation: z.ZodObject<{
|
|
30
|
+
enabled: z.ZodBoolean;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
}, {
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
s3Protocol: z.ZodObject<{
|
|
37
|
+
enabled: z.ZodBoolean;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
enabled: boolean;
|
|
40
|
+
}, {
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
}>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
imageTransformation: {
|
|
45
|
+
enabled: boolean;
|
|
46
|
+
};
|
|
47
|
+
s3Protocol: {
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
};
|
|
50
|
+
}, {
|
|
51
|
+
imageTransformation: {
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
};
|
|
54
|
+
s3Protocol: {
|
|
55
|
+
enabled: boolean;
|
|
56
|
+
};
|
|
57
|
+
}>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
fileSizeLimit: number;
|
|
60
|
+
features: {
|
|
61
|
+
imageTransformation: {
|
|
62
|
+
enabled: boolean;
|
|
63
|
+
};
|
|
64
|
+
s3Protocol: {
|
|
65
|
+
enabled: boolean;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}, {
|
|
69
|
+
fileSizeLimit: number;
|
|
70
|
+
features: {
|
|
71
|
+
imageTransformation: {
|
|
72
|
+
enabled: boolean;
|
|
73
|
+
};
|
|
74
|
+
s3Protocol: {
|
|
75
|
+
enabled: boolean;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
}>;
|
|
4
79
|
declare const organizationSchema: z.ZodObject<{
|
|
5
80
|
id: z.ZodString;
|
|
6
81
|
name: z.ZodString;
|
|
@@ -32,15 +107,15 @@ declare const projectSchema: z.ZodObject<{
|
|
|
32
107
|
name: string;
|
|
33
108
|
region: string;
|
|
34
109
|
id: string;
|
|
35
|
-
organization_id: string;
|
|
36
110
|
created_at: string;
|
|
111
|
+
organization_id: string;
|
|
37
112
|
}, {
|
|
38
113
|
status: string;
|
|
39
114
|
name: string;
|
|
40
115
|
region: string;
|
|
41
116
|
id: string;
|
|
42
|
-
organization_id: string;
|
|
43
117
|
created_at: string;
|
|
118
|
+
organization_id: string;
|
|
44
119
|
}>;
|
|
45
120
|
declare const branchSchema: z.ZodObject<{
|
|
46
121
|
id: z.ZodString;
|
|
@@ -60,11 +135,11 @@ declare const branchSchema: z.ZodObject<{
|
|
|
60
135
|
name: string;
|
|
61
136
|
id: string;
|
|
62
137
|
created_at: string;
|
|
138
|
+
updated_at: string;
|
|
63
139
|
project_ref: string;
|
|
64
140
|
parent_project_ref: string;
|
|
65
141
|
is_default: boolean;
|
|
66
142
|
persistent: boolean;
|
|
67
|
-
updated_at: string;
|
|
68
143
|
git_branch?: string | undefined;
|
|
69
144
|
pr_number?: number | undefined;
|
|
70
145
|
latest_check_run_id?: number | undefined;
|
|
@@ -73,11 +148,11 @@ declare const branchSchema: z.ZodObject<{
|
|
|
73
148
|
name: string;
|
|
74
149
|
id: string;
|
|
75
150
|
created_at: string;
|
|
151
|
+
updated_at: string;
|
|
76
152
|
project_ref: string;
|
|
77
153
|
parent_project_ref: string;
|
|
78
154
|
is_default: boolean;
|
|
79
155
|
persistent: boolean;
|
|
80
|
-
updated_at: string;
|
|
81
156
|
git_branch?: string | undefined;
|
|
82
157
|
pr_number?: number | undefined;
|
|
83
158
|
latest_check_run_id?: number | undefined;
|
|
@@ -262,6 +337,8 @@ type Migration = z.infer<typeof migrationSchema>;
|
|
|
262
337
|
type ListMigrationsResult = z.infer<typeof migrationSchema>;
|
|
263
338
|
type GetLogsOptions = z.infer<typeof getLogsOptionsSchema>;
|
|
264
339
|
type GenerateTypescriptTypesResult = z.infer<typeof generateTypescriptTypesResultSchema>;
|
|
340
|
+
type StorageConfig = z.infer<typeof storageConfigSchema>;
|
|
341
|
+
type StorageBucket = z.infer<typeof storageBucketSchema>;
|
|
265
342
|
type SupabasePlatform = {
|
|
266
343
|
init?(info: InitData): Promise<void>;
|
|
267
344
|
executeSql<T>(projectId: string, options: ExecuteSqlOptions): Promise<T[]>;
|
|
@@ -289,6 +366,9 @@ type SupabasePlatform = {
|
|
|
289
366
|
mergeBranch(branchId: string): Promise<void>;
|
|
290
367
|
resetBranch(branchId: string, options: ResetBranchOptions): Promise<void>;
|
|
291
368
|
rebaseBranch(branchId: string): Promise<void>;
|
|
369
|
+
getStorageConfig(projectId: string): Promise<StorageConfig>;
|
|
370
|
+
updateStorageConfig(projectId: string, config: StorageConfig): Promise<void>;
|
|
371
|
+
listAllBuckets(projectId: string): Promise<StorageBucket[]>;
|
|
292
372
|
};
|
|
293
373
|
|
|
294
|
-
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 };
|
|
374
|
+
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 StorageBucket, type StorageConfig, type SupabasePlatform, applyMigrationOptionsSchema, branchSchema, createBranchOptionsSchema, createProjectOptionsSchema, deployEdgeFunctionOptionsSchema, edgeFunctionSchema, executeSqlOptionsSchema, generateTypescriptTypesResultSchema, getLogsOptionsSchema, migrationSchema, organizationSchema, projectSchema, resetBranchOptionsSchema, storageBucketSchema, storageConfigSchema };
|
package/dist/platform/index.d.ts
CHANGED
|
@@ -1,6 +1,81 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
1
|
import { InitData } from '@supabase/mcp-utils';
|
|
2
|
+
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
+
declare const storageBucketSchema: z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
owner: z.ZodString;
|
|
8
|
+
created_at: z.ZodString;
|
|
9
|
+
updated_at: z.ZodString;
|
|
10
|
+
public: z.ZodBoolean;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
public: boolean;
|
|
13
|
+
name: string;
|
|
14
|
+
id: string;
|
|
15
|
+
owner: string;
|
|
16
|
+
created_at: string;
|
|
17
|
+
updated_at: string;
|
|
18
|
+
}, {
|
|
19
|
+
public: boolean;
|
|
20
|
+
name: string;
|
|
21
|
+
id: string;
|
|
22
|
+
owner: string;
|
|
23
|
+
created_at: string;
|
|
24
|
+
updated_at: string;
|
|
25
|
+
}>;
|
|
26
|
+
declare const storageConfigSchema: z.ZodObject<{
|
|
27
|
+
fileSizeLimit: z.ZodNumber;
|
|
28
|
+
features: z.ZodObject<{
|
|
29
|
+
imageTransformation: z.ZodObject<{
|
|
30
|
+
enabled: z.ZodBoolean;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
}, {
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
s3Protocol: z.ZodObject<{
|
|
37
|
+
enabled: z.ZodBoolean;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
enabled: boolean;
|
|
40
|
+
}, {
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
}>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
imageTransformation: {
|
|
45
|
+
enabled: boolean;
|
|
46
|
+
};
|
|
47
|
+
s3Protocol: {
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
};
|
|
50
|
+
}, {
|
|
51
|
+
imageTransformation: {
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
};
|
|
54
|
+
s3Protocol: {
|
|
55
|
+
enabled: boolean;
|
|
56
|
+
};
|
|
57
|
+
}>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
fileSizeLimit: number;
|
|
60
|
+
features: {
|
|
61
|
+
imageTransformation: {
|
|
62
|
+
enabled: boolean;
|
|
63
|
+
};
|
|
64
|
+
s3Protocol: {
|
|
65
|
+
enabled: boolean;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}, {
|
|
69
|
+
fileSizeLimit: number;
|
|
70
|
+
features: {
|
|
71
|
+
imageTransformation: {
|
|
72
|
+
enabled: boolean;
|
|
73
|
+
};
|
|
74
|
+
s3Protocol: {
|
|
75
|
+
enabled: boolean;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
}>;
|
|
4
79
|
declare const organizationSchema: z.ZodObject<{
|
|
5
80
|
id: z.ZodString;
|
|
6
81
|
name: z.ZodString;
|
|
@@ -32,15 +107,15 @@ declare const projectSchema: z.ZodObject<{
|
|
|
32
107
|
name: string;
|
|
33
108
|
region: string;
|
|
34
109
|
id: string;
|
|
35
|
-
organization_id: string;
|
|
36
110
|
created_at: string;
|
|
111
|
+
organization_id: string;
|
|
37
112
|
}, {
|
|
38
113
|
status: string;
|
|
39
114
|
name: string;
|
|
40
115
|
region: string;
|
|
41
116
|
id: string;
|
|
42
|
-
organization_id: string;
|
|
43
117
|
created_at: string;
|
|
118
|
+
organization_id: string;
|
|
44
119
|
}>;
|
|
45
120
|
declare const branchSchema: z.ZodObject<{
|
|
46
121
|
id: z.ZodString;
|
|
@@ -60,11 +135,11 @@ declare const branchSchema: z.ZodObject<{
|
|
|
60
135
|
name: string;
|
|
61
136
|
id: string;
|
|
62
137
|
created_at: string;
|
|
138
|
+
updated_at: string;
|
|
63
139
|
project_ref: string;
|
|
64
140
|
parent_project_ref: string;
|
|
65
141
|
is_default: boolean;
|
|
66
142
|
persistent: boolean;
|
|
67
|
-
updated_at: string;
|
|
68
143
|
git_branch?: string | undefined;
|
|
69
144
|
pr_number?: number | undefined;
|
|
70
145
|
latest_check_run_id?: number | undefined;
|
|
@@ -73,11 +148,11 @@ declare const branchSchema: z.ZodObject<{
|
|
|
73
148
|
name: string;
|
|
74
149
|
id: string;
|
|
75
150
|
created_at: string;
|
|
151
|
+
updated_at: string;
|
|
76
152
|
project_ref: string;
|
|
77
153
|
parent_project_ref: string;
|
|
78
154
|
is_default: boolean;
|
|
79
155
|
persistent: boolean;
|
|
80
|
-
updated_at: string;
|
|
81
156
|
git_branch?: string | undefined;
|
|
82
157
|
pr_number?: number | undefined;
|
|
83
158
|
latest_check_run_id?: number | undefined;
|
|
@@ -262,6 +337,8 @@ type Migration = z.infer<typeof migrationSchema>;
|
|
|
262
337
|
type ListMigrationsResult = z.infer<typeof migrationSchema>;
|
|
263
338
|
type GetLogsOptions = z.infer<typeof getLogsOptionsSchema>;
|
|
264
339
|
type GenerateTypescriptTypesResult = z.infer<typeof generateTypescriptTypesResultSchema>;
|
|
340
|
+
type StorageConfig = z.infer<typeof storageConfigSchema>;
|
|
341
|
+
type StorageBucket = z.infer<typeof storageBucketSchema>;
|
|
265
342
|
type SupabasePlatform = {
|
|
266
343
|
init?(info: InitData): Promise<void>;
|
|
267
344
|
executeSql<T>(projectId: string, options: ExecuteSqlOptions): Promise<T[]>;
|
|
@@ -289,6 +366,9 @@ type SupabasePlatform = {
|
|
|
289
366
|
mergeBranch(branchId: string): Promise<void>;
|
|
290
367
|
resetBranch(branchId: string, options: ResetBranchOptions): Promise<void>;
|
|
291
368
|
rebaseBranch(branchId: string): Promise<void>;
|
|
369
|
+
getStorageConfig(projectId: string): Promise<StorageConfig>;
|
|
370
|
+
updateStorageConfig(projectId: string, config: StorageConfig): Promise<void>;
|
|
371
|
+
listAllBuckets(projectId: string): Promise<StorageBucket[]>;
|
|
292
372
|
};
|
|
293
373
|
|
|
294
|
-
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 };
|
|
374
|
+
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 StorageBucket, type StorageConfig, type SupabasePlatform, applyMigrationOptionsSchema, branchSchema, createBranchOptionsSchema, createProjectOptionsSchema, deployEdgeFunctionOptionsSchema, edgeFunctionSchema, executeSqlOptionsSchema, generateTypescriptTypesResultSchema, getLogsOptionsSchema, migrationSchema, organizationSchema, projectSchema, resetBranchOptionsSchema, storageBucketSchema, storageConfigSchema };
|
package/dist/platform/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i,o as j,p as k,q as l,r as m}from"../chunk-
|
|
1
|
+
import{f as a,g as b,h as c,i as d,j as e,k as f,l as g,m as h,n as i,o as j,p as k,q as l,r as m,s as n,t as o}from"../chunk-TSIYIWSV.js";export{l as applyMigrationOptionsSchema,e as branchSchema,h as createBranchOptionsSchema,g as createProjectOptionsSchema,j as deployEdgeFunctionOptionsSchema,f as edgeFunctionSchema,k as executeSqlOptionsSchema,o as generateTypescriptTypesResultSchema,n as getLogsOptionsSchema,m as migrationSchema,c as organizationSchema,d as projectSchema,i as resetBranchOptionsSchema,a as storageBucketSchema,b as storageConfigSchema};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var
|
|
2
|
+
"use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _chunkJ5OV62WScjs = require('../chunk-J5OV62WS.cjs');require('../chunk-42U7HZZC.cjs');var _stdiojs = require('@modelcontextprotocol/sdk/server/stdio.js');var _util = require('util');function p(r,o=","){return r.split(o).map(e=>e.trim()).filter(e=>e!=="")}var{version:d}=_chunkJ5OV62WScjs.a;async function g(){let{values:{["access-token"]:r,["project-ref"]:o,["read-only"]:t,["api-url"]:e,["version"]:l,["features"]:s}}=_util.parseArgs.call(void 0, {options:{"access-token":{type:"string"},"project-ref":{type:"string"},"read-only":{type:"boolean",default:!1},"api-url":{type:"string"},version:{type:"boolean"},features:{type:"string"}}});l&&(console.log(d),process.exit(0));let n=_nullishCoalesce(r, () => (process.env.SUPABASE_ACCESS_TOKEN));n||(console.error("Please provide a personal access token (PAT) with the --access-token flag or set the SUPABASE_ACCESS_TOKEN environment variable"),process.exit(1));let f=s?p(s):void 0,m=_chunkJ5OV62WScjs.b.call(void 0, {accessToken:n,apiUrl:e}),u=_chunkJ5OV62WScjs.c.call(void 0, {platform:m,projectId:o,readOnly:t,features:f}),S=new _stdiojs.StdioServerTransport;await u.connect(S)}g().catch(console.error);
|
|
3
3
|
//# sourceMappingURL=stdio.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/grichardson/Documents/dev/supabase/mcp-server-supabase/packages/mcp-server-supabase/dist/transports/stdio.cjs","../../src/transports/stdio.ts"],"names":["version","package_default","main","cliAccessToken","projectId","readOnly","apiUrl","showVersion","parseArgs","accessToken","platform","createSupabaseApiPlatform","server","createSupabaseMcpServer","transport","StdioServerTransport"],"mappings":"AAAA;AACA,
|
|
1
|
+
{"version":3,"sources":["/Users/grichardson/Documents/dev/supabase/mcp-server-supabase/packages/mcp-server-supabase/dist/transports/stdio.cjs","../../src/transports/stdio.ts","../../src/transports/util.ts"],"names":["parseList","list","delimiter","feature","version","package_default","main","cliAccessToken","projectId","readOnly","apiUrl","showVersion","cliFeatures","parseArgs","accessToken","features","platform","createSupabaseApiPlatform","server","createSupabaseMcpServer","transport","StdioServerTransport"],"mappings":"AAAA;AACA,0KAA6C,iCAA8B,oECCtC,4BACX,SCGVA,CAAAA,CAAUC,CAAAA,CAAcC,CAAAA,CAAY,GAAA,CAAe,CAEjE,OADcD,CAAAA,CAAK,KAAA,CAAMC,CAAS,CAAA,CAAE,GAAA,CAAKC,CAAAA,EAAYA,CAAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CACtD,MAAA,CAAQA,CAAAA,EAAYA,CAAAA,GAAY,EAAE,CACjD,CDAA,GAAM,CAAE,OAAA,CAAAC,CAAQ,CAAA,CAAIC,mBAAAA,CAEpB,MAAA,SAAeC,CAAAA,CAAAA,CAAO,CACpB,GAAM,CACJ,MAAA,CAAQ,CACN,CAAC,cAAc,CAAA,CAAGC,CAAAA,CAClB,CAAC,aAAa,CAAA,CAAGC,CAAAA,CACjB,CAAC,WAAW,CAAA,CAAGC,CAAAA,CACf,CAAC,SAAS,CAAA,CAAGC,CAAAA,CACb,CAAC,SAAS,CAAA,CAAGC,CAAAA,CACb,CAAC,UAAU,CAAA,CAAGC,CAChB,CACF,CAAA,CAAIC,6BAAAA,CACF,OAAA,CAAS,CACN,cAAA,CAAiB,CAChB,IAAA,CAAM,QACR,CAAA,CACC,aAAA,CAAgB,CACf,IAAA,CAAM,QACR,CAAA,CACC,WAAA,CAAc,CACb,IAAA,CAAM,SAAA,CACN,OAAA,CAAS,CAAA,CACX,CAAA,CACC,SAAA,CAAY,CACX,IAAA,CAAM,QACR,CAAA,CACC,OAAA,CAAY,CACX,IAAA,CAAM,SACR,CAAA,CACC,QAAA,CAAa,CACZ,IAAA,CAAM,QACR,CACF,CACF,CAAC,CAAA,CAEGF,CAAAA,EAAAA,CACF,OAAA,CAAQ,GAAA,CAAIP,CAAO,CAAA,CACnB,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGhB,IAAMU,CAAAA,kBAAcP,CAAAA,SAAkB,OAAA,CAAQ,GAAA,CAAI,uBAAA,CAE7CO,CAAAA,EAAAA,CACH,OAAA,CAAQ,KAAA,CACN,iIACF,CAAA,CACA,OAAA,CAAQ,IAAA,CAAK,CAAC,CAAA,CAAA,CAGhB,IAAMC,CAAAA,CAAWH,CAAAA,CAAcZ,CAAAA,CAAUY,CAAW,CAAA,CAAI,KAAA,CAAA,CAElDI,CAAAA,CAAWC,iCAAAA,CACf,WAAA,CAAAH,CAAAA,CACA,MAAA,CAAAJ,CACF,CAAC,CAAA,CAEKQ,CAAAA,CAASC,iCAAAA,CACb,QAAA,CAAAH,CAAAA,CACA,SAAA,CAAAR,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,QAAA,CAAAM,CACF,CAAC,CAAA,CAEKK,CAAAA,CAAY,IAAIC,6BAAAA,CAEtB,MAAMH,CAAAA,CAAO,OAAA,CAAQE,CAAS,CAChC,CAEAd,CAAAA,CAAK,CAAA,CAAE,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA","file":"/Users/grichardson/Documents/dev/supabase/mcp-server-supabase/packages/mcp-server-supabase/dist/transports/stdio.cjs","sourcesContent":[null,"#!/usr/bin/env node\n\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { parseArgs } from 'node:util';\nimport packageJson from '../../package.json' with { type: 'json' };\nimport { createSupabaseApiPlatform } from '../platform/api-platform.js';\nimport { createSupabaseMcpServer } from '../server.js';\nimport { parseList } from './util.js';\n\nconst { version } = packageJson;\n\nasync function main() {\n const {\n values: {\n ['access-token']: cliAccessToken,\n ['project-ref']: projectId,\n ['read-only']: readOnly,\n ['api-url']: apiUrl,\n ['version']: showVersion,\n ['features']: cliFeatures,\n },\n } = parseArgs({\n options: {\n ['access-token']: {\n type: 'string',\n },\n ['project-ref']: {\n type: 'string',\n },\n ['read-only']: {\n type: 'boolean',\n default: false,\n },\n ['api-url']: {\n type: 'string',\n },\n ['version']: {\n type: 'boolean',\n },\n ['features']: {\n type: 'string',\n },\n },\n });\n\n if (showVersion) {\n console.log(version);\n process.exit(0);\n }\n\n const accessToken = cliAccessToken ?? process.env.SUPABASE_ACCESS_TOKEN;\n\n if (!accessToken) {\n console.error(\n 'Please provide a personal access token (PAT) with the --access-token flag or set the SUPABASE_ACCESS_TOKEN environment variable'\n );\n process.exit(1);\n }\n\n const features = cliFeatures ? parseList(cliFeatures) : undefined;\n\n const platform = createSupabaseApiPlatform({\n accessToken,\n apiUrl,\n });\n\n const server = createSupabaseMcpServer({\n platform,\n projectId,\n readOnly,\n features,\n });\n\n const transport = new StdioServerTransport();\n\n await server.connect(transport);\n}\n\nmain().catch(console.error);\n","/**\n * Parses a delimited list of items into an array,\n * trimming whitespace and filtering out empty items.\n *\n * Default delimiter is a comma (`,`).\n */\nexport function parseList(list: string, delimiter = ','): string[] {\n const items = list.split(delimiter).map((feature) => feature.trim());\n return items.filter((feature) => feature !== '');\n}\n"]}
|
package/dist/transports/stdio.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a
|
|
2
|
+
import{a,b as i,c}from"../chunk-HBGPPQOZ.js";import"../chunk-TSIYIWSV.js";import{StdioServerTransport as v}from"@modelcontextprotocol/sdk/server/stdio.js";import{parseArgs as y}from"node:util";function p(r,o=","){return r.split(o).map(e=>e.trim()).filter(e=>e!=="")}var{version:d}=a;async function g(){let{values:{["access-token"]:r,["project-ref"]:o,["read-only"]:t,["api-url"]:e,["version"]:l,["features"]:s}}=y({options:{"access-token":{type:"string"},"project-ref":{type:"string"},"read-only":{type:"boolean",default:!1},"api-url":{type:"string"},version:{type:"boolean"},features:{type:"string"}}});l&&(console.log(d),process.exit(0));let n=r??process.env.SUPABASE_ACCESS_TOKEN;n||(console.error("Please provide a personal access token (PAT) with the --access-token flag or set the SUPABASE_ACCESS_TOKEN environment variable"),process.exit(1));let f=s?p(s):void 0,m=i({accessToken:n,apiUrl:e}),u=c({platform:m,projectId:o,readOnly:t,features:f}),S=new v;await u.connect(S)}g().catch(console.error);
|
|
3
3
|
//# sourceMappingURL=stdio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/transports/stdio.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { parseArgs } from 'node:util';\nimport packageJson from '../../package.json' with { type: 'json' };\nimport { createSupabaseApiPlatform } from '../platform/api-platform.js';\nimport { createSupabaseMcpServer } from '../server.js';\n\nconst { version } = packageJson;\n\nasync function main() {\n const {\n values: {\n ['access-token']: cliAccessToken,\n ['project-ref']: projectId,\n ['read-only']: readOnly,\n ['api-url']: apiUrl,\n ['version']: showVersion,\n },\n } = parseArgs({\n options: {\n ['access-token']: {\n type: 'string',\n },\n ['project-ref']: {\n type: 'string',\n },\n ['read-only']: {\n type: 'boolean',\n default: false,\n },\n ['api-url']: {\n type: 'string',\n },\n ['version']: {\n type: 'boolean',\n },\n },\n });\n\n if (showVersion) {\n console.log(version);\n process.exit(0);\n }\n\n
|
|
1
|
+
{"version":3,"sources":["../../src/transports/stdio.ts","../../src/transports/util.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport { parseArgs } from 'node:util';\nimport packageJson from '../../package.json' with { type: 'json' };\nimport { createSupabaseApiPlatform } from '../platform/api-platform.js';\nimport { createSupabaseMcpServer } from '../server.js';\nimport { parseList } from './util.js';\n\nconst { version } = packageJson;\n\nasync function main() {\n const {\n values: {\n ['access-token']: cliAccessToken,\n ['project-ref']: projectId,\n ['read-only']: readOnly,\n ['api-url']: apiUrl,\n ['version']: showVersion,\n ['features']: cliFeatures,\n },\n } = parseArgs({\n options: {\n ['access-token']: {\n type: 'string',\n },\n ['project-ref']: {\n type: 'string',\n },\n ['read-only']: {\n type: 'boolean',\n default: false,\n },\n ['api-url']: {\n type: 'string',\n },\n ['version']: {\n type: 'boolean',\n },\n ['features']: {\n type: 'string',\n },\n },\n });\n\n if (showVersion) {\n console.log(version);\n process.exit(0);\n }\n\n const accessToken = cliAccessToken ?? process.env.SUPABASE_ACCESS_TOKEN;\n\n if (!accessToken) {\n console.error(\n 'Please provide a personal access token (PAT) with the --access-token flag or set the SUPABASE_ACCESS_TOKEN environment variable'\n );\n process.exit(1);\n }\n\n const features = cliFeatures ? parseList(cliFeatures) : undefined;\n\n const platform = createSupabaseApiPlatform({\n accessToken,\n apiUrl,\n });\n\n const server = createSupabaseMcpServer({\n platform,\n projectId,\n readOnly,\n features,\n });\n\n const transport = new StdioServerTransport();\n\n await server.connect(transport);\n}\n\nmain().catch(console.error);\n","/**\n * Parses a delimited list of items into an array,\n * trimming whitespace and filtering out empty items.\n *\n * Default delimiter is a comma (`,`).\n */\nexport function parseList(list: string, delimiter = ','): string[] {\n const items = list.split(delimiter).map((feature) => feature.trim());\n return items.filter((feature) => feature !== '');\n}\n"],"mappings":";0EAEA,OAAS,wBAAAA,MAA4B,4CACrC,OAAS,aAAAC,MAAiB,YCGnB,SAASC,EAAUC,EAAcC,EAAY,IAAe,CAEjE,OADcD,EAAK,MAAMC,CAAS,EAAE,IAAKC,GAAYA,EAAQ,KAAK,CAAC,EACtD,OAAQA,GAAYA,IAAY,EAAE,CACjD,CDAA,GAAM,CAAE,QAAAC,CAAQ,EAAIC,EAEpB,eAAeC,GAAO,CACpB,GAAM,CACJ,OAAQ,CACN,CAAC,cAAc,EAAGC,EAClB,CAAC,aAAa,EAAGC,EACjB,CAAC,WAAW,EAAGC,EACf,CAAC,SAAS,EAAGC,EACb,CAAC,SAAS,EAAGC,EACb,CAAC,UAAU,EAAGC,CAChB,CACF,EAAIC,EAAU,CACZ,QAAS,CACN,eAAiB,CAChB,KAAM,QACR,EACC,cAAgB,CACf,KAAM,QACR,EACC,YAAc,CACb,KAAM,UACN,QAAS,EACX,EACC,UAAY,CACX,KAAM,QACR,EACC,QAAY,CACX,KAAM,SACR,EACC,SAAa,CACZ,KAAM,QACR,CACF,CACF,CAAC,EAEGF,IACF,QAAQ,IAAIP,CAAO,EACnB,QAAQ,KAAK,CAAC,GAGhB,IAAMU,EAAcP,GAAkB,QAAQ,IAAI,sBAE7CO,IACH,QAAQ,MACN,iIACF,EACA,QAAQ,KAAK,CAAC,GAGhB,IAAMC,EAAWH,EAAcI,EAAUJ,CAAW,EAAI,OAElDK,EAAWC,EAA0B,CACzC,YAAAJ,EACA,OAAAJ,CACF,CAAC,EAEKS,EAASC,EAAwB,CACrC,SAAAH,EACA,UAAAT,EACA,SAAAC,EACA,SAAAM,CACF,CAAC,EAEKM,EAAY,IAAIC,EAEtB,MAAMH,EAAO,QAAQE,CAAS,CAChC,CAEAf,EAAK,EAAE,MAAM,QAAQ,KAAK","names":["StdioServerTransport","parseArgs","parseList","list","delimiter","feature","version","package_default","main","cliAccessToken","projectId","readOnly","apiUrl","showVersion","cliFeatures","parseArgs","accessToken","features","parseList","platform","createSupabaseApiPlatform","server","createSupabaseMcpServer","transport","StdioServerTransport"]}
|