@supabase/mcp-server-supabase 0.19.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/chunk-6CWFTRTZ.js +17 -0
  2. package/dist/chunk-6CWFTRTZ.js.map +1 -0
  3. package/dist/{chunk-C4YUF27U.cjs → chunk-A5FTNCK3.cjs} +2 -2
  4. package/dist/{chunk-C4YUF27U.cjs.map → chunk-A5FTNCK3.cjs.map} +1 -1
  5. package/dist/chunk-A64X45AF.cjs +17 -0
  6. package/dist/chunk-A64X45AF.cjs.map +1 -0
  7. package/dist/chunk-FL2XNMHU.cjs +295 -0
  8. package/dist/chunk-FL2XNMHU.cjs.map +1 -0
  9. package/dist/chunk-HNZQTPXQ.cjs +2 -0
  10. package/dist/chunk-HNZQTPXQ.cjs.map +1 -0
  11. package/dist/chunk-JJFVFIBB.js +2 -0
  12. package/dist/chunk-JJFVFIBB.js.map +1 -0
  13. package/dist/chunk-JR6WQZBY.js +295 -0
  14. package/dist/chunk-JR6WQZBY.js.map +1 -0
  15. package/dist/{chunk-6DARTJRP.js → chunk-SS4B4LYS.js} +2 -2
  16. package/dist/{chunk-6DARTJRP.js.map → chunk-SS4B4LYS.js.map} +1 -1
  17. package/dist/cli.cjs +1 -1
  18. package/dist/cli.js +1 -1
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.d.cts +148 -5
  21. package/dist/index.d.ts +148 -5
  22. package/dist/index.js +1 -1
  23. package/dist/platform/api-platform.cjs +1 -1
  24. package/dist/platform/api-platform.d.cts +1 -1
  25. package/dist/platform/api-platform.d.ts +1 -1
  26. package/dist/platform/api-platform.js +1 -1
  27. package/dist/platform/index.cjs +1 -1
  28. package/dist/platform/index.d.cts +4 -3
  29. package/dist/platform/index.d.ts +4 -3
  30. package/dist/platform/index.js +1 -1
  31. package/dist/{types-abfpaWQw.d.ts → types-Ckih0oCv.d.cts} +15 -5
  32. package/dist/{types-abfpaWQw.d.cts → types-Ckih0oCv.d.ts} +15 -5
  33. package/package.json +2 -2
  34. package/dist/chunk-3BFHAE72.js +0 -17
  35. package/dist/chunk-3BFHAE72.js.map +0 -1
  36. package/dist/chunk-6QB2YXYQ.cjs +0 -17
  37. package/dist/chunk-6QB2YXYQ.cjs.map +0 -1
  38. package/dist/chunk-DG3LSIFH.cjs +0 -2
  39. package/dist/chunk-DG3LSIFH.cjs.map +0 -1
  40. package/dist/chunk-OO7IZCN3.cjs +0 -295
  41. package/dist/chunk-OO7IZCN3.cjs.map +0 -1
  42. package/dist/chunk-WAYAYNQY.js +0 -295
  43. package/dist/chunk-WAYAYNQY.js.map +0 -1
  44. package/dist/chunk-YW7R6DLX.js +0 -2
  45. package/dist/chunk-YW7R6DLX.js.map +0 -1
@@ -1,4 +1,4 @@
1
- var u={name:"@supabase/mcp-server-supabase",mcpName:"com.supabase/mcp",version:"0.19.0",description:"MCP server for interacting with Supabase",license:"Apache-2.0",repository:{type:"git",url:"https://github.com/supabase/mcp.git"},type:"module",main:"dist/index.cjs",types:"dist/index.d.ts",sideEffects:!1,scripts:{build:"tsup --clean",dev:"tsup --watch",typecheck:"tsc --noEmit",prebuild:"pnpm typecheck",prepublishOnly:"pnpm build","registry:update":"tsx scripts/registry/update-version.ts && biome format --write server.json","registry:login":"scripts/registry/login.sh","registry:publish":"mcp-publisher publish",test:"vitest","test:unit":"vitest --project unit","test:e2e":"vitest --project e2e","test:integration":"vitest --project integration","test:coverage":"vitest --coverage","mock-api":"tsx dev/mock-api.ts","typecheck:dev":"tsc --noEmit -p dev/tsconfig.json","generate:management-api-types":"node scripts/generate-management-api-types.mjs"},files:["dist/**/*"],bin:{"mcp-server-supabase":"./dist/cli.js"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",default:"./dist/index.cjs"},"./platform":{types:"./dist/platform/index.d.ts",import:"./dist/platform/index.js",default:"./dist/platform/index.cjs"},"./platform/api":{types:"./dist/platform/api-platform.d.ts",import:"./dist/platform/api-platform.js",default:"./dist/platform/api-platform.cjs"}},dependencies:{"@mjackson/multipart-parser":"^0.10.1","@modelcontextprotocol/node":"catalog:","@supabase/mcp-utils":"workspace:^","common-tags":"^1.8.2",gqlmin:"^0.3.1",graphql:"^16.11.0","openapi-fetch":"^0.13.5"},peerDependencies:{"@modelcontextprotocol/server":"catalog:",zod:"catalog:"},devDependencies:{"@ai-sdk/anthropic":"catalog:","@ai-sdk/mcp":"catalog:","@electric-sql/pglite":"^0.2.17","@modelcontextprotocol/client":"catalog:","@modelcontextprotocol/ext-apps":"^2.0.4","@modelcontextprotocol/server":"catalog:","@supabase/mcp-ui":"workspace:*","@total-typescript/tsconfig":"^1.0.4","@types/common-tags":"^1.8.4","@types/node":"^22.8.6","@vitest/coverage-v8":"^2.1.9",ai:"catalog:","date-fns":"^4.1.0",dotenv:"^16.5.0",msw:"^2.7.3",nanoid:"^5.1.5","openapi-typescript":"^7.5.0","openapi-typescript-helpers":"^0.0.15",prettier:"^3.3.3",tsup:"^8.3.5",tsx:"^4.19.2",typescript:"^5.6.3",vite:"^5.4.19",vitest:"^2.1.9",zod:"catalog:"}};import{stripIndent as r}from"common-tags";import{ToolCallerError as c}from"@supabase/mcp-utils";function k(t,e=100){switch(t){case"api":return r`
1
+ var u={name:"@supabase/mcp-server-supabase",mcpName:"com.supabase/mcp",version:"0.20.0",description:"MCP server for interacting with Supabase",license:"Apache-2.0",repository:{type:"git",url:"https://github.com/supabase/mcp.git"},type:"module",main:"dist/index.cjs",types:"dist/index.d.ts",sideEffects:!1,scripts:{build:"tsup --clean",dev:"tsup --watch",typecheck:"tsc --noEmit",prebuild:"pnpm typecheck",prepublishOnly:"pnpm build","registry:update":"tsx scripts/registry/update-version.ts && biome format --write server.json","registry:login":"scripts/registry/login.sh","registry:publish":"mcp-publisher publish",test:"vitest","test:unit":"vitest --project unit","test:e2e":"vitest --project e2e","test:integration":"vitest --project integration","test:coverage":"vitest --coverage","mock-api":"tsx dev/mock-api.ts","typecheck:dev":"tsc --noEmit -p dev/tsconfig.json","generate:management-api-types":"node scripts/generate-management-api-types.mjs"},files:["dist/**/*"],bin:{"mcp-server-supabase":"./dist/cli.js"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",default:"./dist/index.cjs"},"./platform":{types:"./dist/platform/index.d.ts",import:"./dist/platform/index.js",default:"./dist/platform/index.cjs"},"./platform/api":{types:"./dist/platform/api-platform.d.ts",import:"./dist/platform/api-platform.js",default:"./dist/platform/api-platform.cjs"}},dependencies:{"@mjackson/multipart-parser":"^0.10.1","@modelcontextprotocol/node":"catalog:","@supabase/mcp-utils":"workspace:^","common-tags":"^1.8.2",gqlmin:"^0.3.1",graphql:"^16.11.0","openapi-fetch":"^0.13.5"},peerDependencies:{"@modelcontextprotocol/server":"catalog:",zod:"catalog:"},devDependencies:{"@ai-sdk/anthropic":"catalog:","@ai-sdk/mcp":"catalog:","@electric-sql/pglite":"^0.2.17","@modelcontextprotocol/client":"catalog:","@modelcontextprotocol/ext-apps":"^2.0.4","@modelcontextprotocol/server":"catalog:","@supabase/mcp-ui":"workspace:*","@total-typescript/tsconfig":"^1.0.4","@types/common-tags":"^1.8.4","@types/node":"^22.8.6","@vitest/coverage-v8":"^2.1.9",ai:"catalog:","date-fns":"^4.1.0",dotenv:"^16.5.0",msw:"^2.7.3",nanoid:"^5.1.5","openapi-typescript":"^7.5.0","openapi-typescript-helpers":"^0.0.15",prettier:"^3.3.3",tsup:"^8.3.5",tsx:"^4.19.2",typescript:"^5.6.3",vite:"^5.4.19",vitest:"^2.1.9",zod:"catalog:"}};import{stripIndent as r}from"common-tags";import{ToolCallerError as c}from"@supabase/mcp-utils";function k(t,e=100){switch(t){case"api":return r`
2
2
  select id, log_attributes['identifier'] as identifier, timestamp, event_message, log_attributes['request.method'] as method, log_attributes['request.path'] as path, log_attributes['response.status_code'] as status_code
3
3
  from logs
4
4
  where source = 'edge_logs'
@@ -47,4 +47,4 @@ var u={name:"@supabase/mcp-server-supabase",mcpName:"com.supabase/mcp",version:"
47
47
  order by timestamp desc
48
48
  limit ${e}
49
49
  `;default:throw new Error(`unsupported log service type: ${t}`)}}var g=1440*60*1e3;function E(t,e){let o=e?Date.parse(e):Date.now();if(Number.isNaN(o))throw new c(`Invalid iso_timestamp_end: "${e}". Expected an ISO 8601 timestamp.`);let n=t?Date.parse(t):o-g;if(Number.isNaN(n))throw new c(`Invalid iso_timestamp_start: "${t}". Expected an ISO 8601 timestamp.`);if(n>=o)throw new c("iso_timestamp_start must be before iso_timestamp_end.");if(o-n>g)throw new c("The log window can be at most 24 hours.");return{iso_timestamp_start:new Date(n).toISOString(),iso_timestamp_end:new Date(o).toISOString()}}var y={production:{url:"https://xguihxuzqibwxjnimxev.supabase.co",key:"sb_publishable__4DBgvrDe7ec234wnvCAog_LPzBtkQe"},staging:{url:"https://actixlblmrqglneypada.supabase.co",key:"sb_publishable_wLdx7w89KWFq-39s4emmnA__9XR9r-_"}},h=1e4;function O({environment:t="production",fetch:e=globalThis.fetch,getUserId:o}={}){let{url:n,key:_}=y[t];async function l(){try{return await o?.()}catch{return}}async function m(p,i,s){let a=await e(`${n}/rest/v1/${p}`,{...i,headers:{apikey:_,"Content-Type":"application/json",...i.headers},signal:AbortSignal.timeout(h)});if(!a.ok)throw new Error(`Failed to ${s}: ${a.status} ${await a.text()}`);return a}return{async submit({feedback:p,projectId:i,clientInfo:s}){let a=await l(),d=await(await m("rpc/submit_interfaces_feedback",{method:"POST",body:JSON.stringify({feedback:p,user_agent:`supabase-mcp/${u.version}`,user_id:a,project_ref:i,metadata:{source:"mcp",...s&&{client_name:s.name,client_version:s.version}}})},"submit feedback")).json();if(typeof d!="string"||d.length===0)throw new Error("Failed to submit feedback: no delete token returned");return{deleteToken:d}},async delete({deleteToken:p,projectId:i}){let s=await l();return{deleted:(await m(`interfaces_feedback?delete_token=eq.${encodeURIComponent(p)}`,{method:"DELETE",headers:{Prefer:"count=exact","x-feedback-token":p,...i&&{"x-feedback-project-ref":i},...s&&{"x-feedback-user-id":s}}},"delete feedback")).headers.get("Content-Range")?.split("/")[1]==="1"}}}}export{u as a,k as b,E as c,O as d};
50
- //# sourceMappingURL=chunk-6DARTJRP.js.map
50
+ //# sourceMappingURL=chunk-SS4B4LYS.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../package.json","../src/logs.ts","../src/platform/feedback.ts"],"sourcesContent":["{\n \"name\": \"@supabase/mcp-server-supabase\",\n \"mcpName\": \"com.supabase/mcp\",\n \"version\": \"0.19.0\",\n \"description\": \"MCP server for interacting with Supabase\",\n \"license\": \"Apache-2.0\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/supabase/mcp.git\"\n },\n \"type\": \"module\",\n \"main\": \"dist/index.cjs\",\n \"types\": \"dist/index.d.ts\",\n \"sideEffects\": false,\n \"scripts\": {\n \"build\": \"tsup --clean\",\n \"dev\": \"tsup --watch\",\n \"typecheck\": \"tsc --noEmit\",\n \"prebuild\": \"pnpm typecheck\",\n \"prepublishOnly\": \"pnpm build\",\n \"registry:update\": \"tsx scripts/registry/update-version.ts && biome format --write server.json\",\n \"registry:login\": \"scripts/registry/login.sh\",\n \"registry:publish\": \"mcp-publisher publish\",\n \"test\": \"vitest\",\n \"test:unit\": \"vitest --project unit\",\n \"test:e2e\": \"vitest --project e2e\",\n \"test:integration\": \"vitest --project integration\",\n \"test:coverage\": \"vitest --coverage\",\n \"mock-api\": \"tsx dev/mock-api.ts\",\n \"typecheck:dev\": \"tsc --noEmit -p dev/tsconfig.json\",\n \"generate:management-api-types\": \"node scripts/generate-management-api-types.mjs\"\n },\n \"files\": [\n \"dist/**/*\"\n ],\n \"bin\": {\n \"mcp-server-supabase\": \"./dist/cli.js\"\n },\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\",\n \"default\": \"./dist/index.cjs\"\n },\n \"./platform\": {\n \"types\": \"./dist/platform/index.d.ts\",\n \"import\": \"./dist/platform/index.js\",\n \"default\": \"./dist/platform/index.cjs\"\n },\n \"./platform/api\": {\n \"types\": \"./dist/platform/api-platform.d.ts\",\n \"import\": \"./dist/platform/api-platform.js\",\n \"default\": \"./dist/platform/api-platform.cjs\"\n }\n },\n \"dependencies\": {\n \"@mjackson/multipart-parser\": \"^0.10.1\",\n \"@modelcontextprotocol/node\": \"catalog:\",\n \"@supabase/mcp-utils\": \"workspace:^\",\n \"common-tags\": \"^1.8.2\",\n \"gqlmin\": \"^0.3.1\",\n \"graphql\": \"^16.11.0\",\n \"openapi-fetch\": \"^0.13.5\"\n },\n \"peerDependencies\": {\n \"@modelcontextprotocol/server\": \"catalog:\",\n \"zod\": \"catalog:\"\n },\n \"devDependencies\": {\n \"@ai-sdk/anthropic\": \"catalog:\",\n \"@ai-sdk/mcp\": \"catalog:\",\n \"@electric-sql/pglite\": \"^0.2.17\",\n \"@modelcontextprotocol/client\": \"catalog:\",\n \"@modelcontextprotocol/ext-apps\": \"^2.0.4\",\n \"@modelcontextprotocol/server\": \"catalog:\",\n \"@supabase/mcp-ui\": \"workspace:*\",\n \"@total-typescript/tsconfig\": \"^1.0.4\",\n \"@types/common-tags\": \"^1.8.4\",\n \"@types/node\": \"^22.8.6\",\n \"@vitest/coverage-v8\": \"^2.1.9\",\n \"ai\": \"catalog:\",\n \"date-fns\": \"^4.1.0\",\n \"dotenv\": \"^16.5.0\",\n \"msw\": \"^2.7.3\",\n \"nanoid\": \"^5.1.5\",\n \"openapi-typescript\": \"^7.5.0\",\n \"openapi-typescript-helpers\": \"^0.0.15\",\n \"prettier\": \"^3.3.3\",\n \"tsup\": \"^8.3.5\",\n \"tsx\": \"^4.19.2\",\n \"typescript\": \"^5.6.3\",\n \"vite\": \"^5.4.19\",\n \"vitest\": \"^2.1.9\",\n \"zod\": \"catalog:\"\n }\n}\n","import { stripIndent } from 'common-tags';\nimport { ToolCallerError } from '@supabase/mcp-utils';\nimport type { LogsService } from './platform/types.js';\n\nexport function getClickHouseLogQuery(\n service: LogsService,\n limit: number = 100\n) {\n switch (service) {\n case 'api':\n return stripIndent`\n select id, log_attributes['identifier'] as identifier, timestamp, event_message, log_attributes['request.method'] as method, log_attributes['request.path'] as path, log_attributes['response.status_code'] as status_code\n from logs\n where source = 'edge_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'branch-action':\n return stripIndent`\n select log_attributes['workflow_run'] as workflow_run, timestamp, id, event_message\n from logs\n where source = 'workflow_run_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'postgres':\n return stripIndent`\n select log_attributes['identifier'] as identifier, timestamp, id, event_message, log_attributes['parsed.error_severity'] as error_severity\n from logs\n where source = 'postgres_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'edge-function':\n return stripIndent`\n select id, timestamp, event_message, log_attributes['response.status_code'] as status_code, log_attributes['request.method'] as method, log_attributes['function_id'] as function_id, log_attributes['execution_time_ms'] as execution_time_ms, log_attributes['deployment_id'] as deployment_id, log_attributes['version'] as version\n from logs\n where source = 'function_edge_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'edge-function-runtime':\n return stripIndent`\n select id, timestamp, event_message, severity_text, log_attributes['level'] as level, log_attributes['event_type'] as event_type, log_attributes['function_id'] as function_id, log_attributes['execution_id'] as execution_id, log_attributes['deployment_id'] as deployment_id, log_attributes['version'] as version\n from logs\n where source = 'function_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'auth':\n return stripIndent`\n select id, timestamp, event_message, log_attributes['level'] as level, log_attributes['status'] as status, log_attributes['path'] as path, log_attributes['msg'] as msg, log_attributes['error'] as error\n from logs\n where source = 'auth_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'storage':\n return stripIndent`\n select id, timestamp, event_message\n from logs\n where source = 'storage_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'realtime':\n return stripIndent`\n select id, timestamp, event_message\n from logs\n where source = 'realtime_logs'\n order by timestamp desc\n limit ${limit}\n `;\n default:\n throw new Error(`unsupported log service type: ${service}`);\n }\n}\n\nexport const DAY_MS = 24 * 60 * 60 * 1000;\n\nexport function resolveLogWindow(\n iso_timestamp_start?: string,\n iso_timestamp_end?: string\n) {\n const endMs = iso_timestamp_end ? Date.parse(iso_timestamp_end) : Date.now();\n if (Number.isNaN(endMs)) {\n throw new ToolCallerError(\n `Invalid iso_timestamp_end: \"${iso_timestamp_end}\". Expected an ISO 8601 timestamp.`\n );\n }\n\n const startMs = iso_timestamp_start\n ? Date.parse(iso_timestamp_start)\n : endMs - DAY_MS;\n if (Number.isNaN(startMs)) {\n throw new ToolCallerError(\n `Invalid iso_timestamp_start: \"${iso_timestamp_start}\". Expected an ISO 8601 timestamp.`\n );\n }\n\n if (startMs >= endMs) {\n throw new ToolCallerError(\n 'iso_timestamp_start must be before iso_timestamp_end.'\n );\n }\n\n if (endMs - startMs > DAY_MS) {\n throw new ToolCallerError('The log window can be at most 24 hours.');\n }\n\n return {\n iso_timestamp_start: new Date(startMs).toISOString(),\n iso_timestamp_end: new Date(endMs).toISOString(),\n };\n}\n","import packageJson from '../../package.json' with { type: 'json' };\nimport type { FeedbackOperations } from './types.js';\n\n// Publishable keys copied from the CLI client:\n// https://github.com/supabase/cli/blob/104f1fb14d2e856828292b54c95eda8b8125c07a/apps/cli/src/shared/feedback/feedback-client.layer.ts#L22-L30\nconst FEEDBACK_ENVIRONMENTS = {\n production: {\n url: 'https://xguihxuzqibwxjnimxev.supabase.co',\n key: 'sb_publishable__4DBgvrDe7ec234wnvCAog_LPzBtkQe',\n },\n staging: {\n url: 'https://actixlblmrqglneypada.supabase.co',\n key: 'sb_publishable_wLdx7w89KWFq-39s4emmnA__9XR9r-_',\n },\n};\n\nconst REQUEST_TIMEOUT_MS = 10_000;\n\nexport type FeedbackOperationsOptions = {\n environment?: keyof typeof FEEDBACK_ENVIRONMENTS;\n fetch?: typeof globalThis.fetch;\n /** Failures send feedback without a user. */\n getUserId?: () => Promise<string | undefined>;\n};\n\nexport function createFeedbackOperations({\n environment = 'production',\n fetch = globalThis.fetch,\n getUserId,\n}: FeedbackOperationsOptions = {}): FeedbackOperations {\n const { url, key } = FEEDBACK_ENVIRONMENTS[environment];\n\n async function resolveUserId() {\n try {\n return await getUserId?.();\n } catch {\n return undefined;\n }\n }\n\n async function request(path: string, init: RequestInit, action: string) {\n const response = await fetch(`${url}/rest/v1/${path}`, {\n ...init,\n headers: {\n apikey: key,\n 'Content-Type': 'application/json',\n ...init.headers,\n },\n signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),\n });\n if (!response.ok) {\n throw new Error(\n `Failed to ${action}: ${response.status} ${await response.text()}`\n );\n }\n return response;\n }\n\n return {\n async submit({ feedback, projectId, clientInfo }) {\n const userId = await resolveUserId();\n const response = await request(\n 'rpc/submit_interfaces_feedback',\n {\n method: 'POST',\n body: JSON.stringify({\n feedback,\n user_agent: `supabase-mcp/${packageJson.version}`,\n user_id: userId,\n project_ref: projectId,\n metadata: {\n source: 'mcp',\n ...(clientInfo && {\n client_name: clientInfo.name,\n client_version: clientInfo.version,\n }),\n },\n }),\n },\n 'submit feedback'\n );\n const deleteToken: unknown = await response.json();\n if (typeof deleteToken !== 'string' || deleteToken.length === 0) {\n throw new Error('Failed to submit feedback: no delete token returned');\n }\n return { deleteToken };\n },\n async delete({ deleteToken, projectId }) {\n const userId = await resolveUserId();\n const response = await request(\n `interfaces_feedback?delete_token=eq.${encodeURIComponent(deleteToken)}`,\n {\n method: 'DELETE',\n headers: {\n Prefer: 'count=exact',\n 'x-feedback-token': deleteToken,\n ...(projectId && { 'x-feedback-project-ref': projectId }),\n ...(userId && { 'x-feedback-user-id': userId }),\n },\n },\n 'delete feedback'\n );\n // Content-Range is `*/<deleted row count>`\n const deletedCount = response.headers.get('Content-Range')?.split('/')[1];\n return { deleted: deletedCount === '1' };\n },\n };\n}\n"],"mappings":"AAAA,IAAAA,EAAA,CACE,KAAQ,gCACR,QAAW,mBACX,QAAW,SACX,YAAe,2CACf,QAAW,aACX,WAAc,CACZ,KAAQ,MACR,IAAO,qCACT,EACA,KAAQ,SACR,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EAgBnC,MAAO,CAAE,SAfQ,MAAMC,EACrB,uCAAuC,mBAAmBS,CAAW,CAAC,GACtE,CACE,OAAQ,SACR,QAAS,CACP,OAAQ,cACR,mBAAoBA,EACpB,GAAIH,GAAa,CAAE,yBAA0BA,CAAU,EACvD,GAAIE,GAAU,CAAE,qBAAsBA,CAAO,CAC/C,CACF,EACA,iBACF,GAE8B,QAAQ,IAAI,eAAe,GAAG,MAAM,GAAG,EAAE,CAAC,IACrC,GAAI,CACzC,CACF,CACF","names":["package_default","stripIndent","ToolCallerError","getClickHouseLogQuery","service","limit","DAY_MS","resolveLogWindow","iso_timestamp_start","iso_timestamp_end","endMs","startMs","FEEDBACK_ENVIRONMENTS","REQUEST_TIMEOUT_MS","createFeedbackOperations","environment","fetch","getUserId","url","key","resolveUserId","request","path","init","action","response","feedback","projectId","clientInfo","userId","deleteToken","package_default"]}
1
+ {"version":3,"sources":["../package.json","../src/logs.ts","../src/platform/feedback.ts"],"sourcesContent":["{\n \"name\": \"@supabase/mcp-server-supabase\",\n \"mcpName\": \"com.supabase/mcp\",\n \"version\": \"0.20.0\",\n \"description\": \"MCP server for interacting with Supabase\",\n \"license\": \"Apache-2.0\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/supabase/mcp.git\"\n },\n \"type\": \"module\",\n \"main\": \"dist/index.cjs\",\n \"types\": \"dist/index.d.ts\",\n \"sideEffects\": false,\n \"scripts\": {\n \"build\": \"tsup --clean\",\n \"dev\": \"tsup --watch\",\n \"typecheck\": \"tsc --noEmit\",\n \"prebuild\": \"pnpm typecheck\",\n \"prepublishOnly\": \"pnpm build\",\n \"registry:update\": \"tsx scripts/registry/update-version.ts && biome format --write server.json\",\n \"registry:login\": \"scripts/registry/login.sh\",\n \"registry:publish\": \"mcp-publisher publish\",\n \"test\": \"vitest\",\n \"test:unit\": \"vitest --project unit\",\n \"test:e2e\": \"vitest --project e2e\",\n \"test:integration\": \"vitest --project integration\",\n \"test:coverage\": \"vitest --coverage\",\n \"mock-api\": \"tsx dev/mock-api.ts\",\n \"typecheck:dev\": \"tsc --noEmit -p dev/tsconfig.json\",\n \"generate:management-api-types\": \"node scripts/generate-management-api-types.mjs\"\n },\n \"files\": [\n \"dist/**/*\"\n ],\n \"bin\": {\n \"mcp-server-supabase\": \"./dist/cli.js\"\n },\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.js\",\n \"default\": \"./dist/index.cjs\"\n },\n \"./platform\": {\n \"types\": \"./dist/platform/index.d.ts\",\n \"import\": \"./dist/platform/index.js\",\n \"default\": \"./dist/platform/index.cjs\"\n },\n \"./platform/api\": {\n \"types\": \"./dist/platform/api-platform.d.ts\",\n \"import\": \"./dist/platform/api-platform.js\",\n \"default\": \"./dist/platform/api-platform.cjs\"\n }\n },\n \"dependencies\": {\n \"@mjackson/multipart-parser\": \"^0.10.1\",\n \"@modelcontextprotocol/node\": \"catalog:\",\n \"@supabase/mcp-utils\": \"workspace:^\",\n \"common-tags\": \"^1.8.2\",\n \"gqlmin\": \"^0.3.1\",\n \"graphql\": \"^16.11.0\",\n \"openapi-fetch\": \"^0.13.5\"\n },\n \"peerDependencies\": {\n \"@modelcontextprotocol/server\": \"catalog:\",\n \"zod\": \"catalog:\"\n },\n \"devDependencies\": {\n \"@ai-sdk/anthropic\": \"catalog:\",\n \"@ai-sdk/mcp\": \"catalog:\",\n \"@electric-sql/pglite\": \"^0.2.17\",\n \"@modelcontextprotocol/client\": \"catalog:\",\n \"@modelcontextprotocol/ext-apps\": \"^2.0.4\",\n \"@modelcontextprotocol/server\": \"catalog:\",\n \"@supabase/mcp-ui\": \"workspace:*\",\n \"@total-typescript/tsconfig\": \"^1.0.4\",\n \"@types/common-tags\": \"^1.8.4\",\n \"@types/node\": \"^22.8.6\",\n \"@vitest/coverage-v8\": \"^2.1.9\",\n \"ai\": \"catalog:\",\n \"date-fns\": \"^4.1.0\",\n \"dotenv\": \"^16.5.0\",\n \"msw\": \"^2.7.3\",\n \"nanoid\": \"^5.1.5\",\n \"openapi-typescript\": \"^7.5.0\",\n \"openapi-typescript-helpers\": \"^0.0.15\",\n \"prettier\": \"^3.3.3\",\n \"tsup\": \"^8.3.5\",\n \"tsx\": \"^4.19.2\",\n \"typescript\": \"^5.6.3\",\n \"vite\": \"^5.4.19\",\n \"vitest\": \"^2.1.9\",\n \"zod\": \"catalog:\"\n }\n}\n","import { stripIndent } from 'common-tags';\nimport { ToolCallerError } from '@supabase/mcp-utils';\nimport type { LogsService } from './platform/types.js';\n\nexport function getClickHouseLogQuery(\n service: LogsService,\n limit: number = 100\n) {\n switch (service) {\n case 'api':\n return stripIndent`\n select id, log_attributes['identifier'] as identifier, timestamp, event_message, log_attributes['request.method'] as method, log_attributes['request.path'] as path, log_attributes['response.status_code'] as status_code\n from logs\n where source = 'edge_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'branch-action':\n return stripIndent`\n select log_attributes['workflow_run'] as workflow_run, timestamp, id, event_message\n from logs\n where source = 'workflow_run_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'postgres':\n return stripIndent`\n select log_attributes['identifier'] as identifier, timestamp, id, event_message, log_attributes['parsed.error_severity'] as error_severity\n from logs\n where source = 'postgres_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'edge-function':\n return stripIndent`\n select id, timestamp, event_message, log_attributes['response.status_code'] as status_code, log_attributes['request.method'] as method, log_attributes['function_id'] as function_id, log_attributes['execution_time_ms'] as execution_time_ms, log_attributes['deployment_id'] as deployment_id, log_attributes['version'] as version\n from logs\n where source = 'function_edge_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'edge-function-runtime':\n return stripIndent`\n select id, timestamp, event_message, severity_text, log_attributes['level'] as level, log_attributes['event_type'] as event_type, log_attributes['function_id'] as function_id, log_attributes['execution_id'] as execution_id, log_attributes['deployment_id'] as deployment_id, log_attributes['version'] as version\n from logs\n where source = 'function_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'auth':\n return stripIndent`\n select id, timestamp, event_message, log_attributes['level'] as level, log_attributes['status'] as status, log_attributes['path'] as path, log_attributes['msg'] as msg, log_attributes['error'] as error\n from logs\n where source = 'auth_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'storage':\n return stripIndent`\n select id, timestamp, event_message\n from logs\n where source = 'storage_logs'\n order by timestamp desc\n limit ${limit}\n `;\n case 'realtime':\n return stripIndent`\n select id, timestamp, event_message\n from logs\n where source = 'realtime_logs'\n order by timestamp desc\n limit ${limit}\n `;\n default:\n throw new Error(`unsupported log service type: ${service}`);\n }\n}\n\nexport const DAY_MS = 24 * 60 * 60 * 1000;\n\nexport function resolveLogWindow(\n iso_timestamp_start?: string,\n iso_timestamp_end?: string\n) {\n const endMs = iso_timestamp_end ? Date.parse(iso_timestamp_end) : Date.now();\n if (Number.isNaN(endMs)) {\n throw new ToolCallerError(\n `Invalid iso_timestamp_end: \"${iso_timestamp_end}\". Expected an ISO 8601 timestamp.`\n );\n }\n\n const startMs = iso_timestamp_start\n ? Date.parse(iso_timestamp_start)\n : endMs - DAY_MS;\n if (Number.isNaN(startMs)) {\n throw new ToolCallerError(\n `Invalid iso_timestamp_start: \"${iso_timestamp_start}\". Expected an ISO 8601 timestamp.`\n );\n }\n\n if (startMs >= endMs) {\n throw new ToolCallerError(\n 'iso_timestamp_start must be before iso_timestamp_end.'\n );\n }\n\n if (endMs - startMs > DAY_MS) {\n throw new ToolCallerError('The log window can be at most 24 hours.');\n }\n\n return {\n iso_timestamp_start: new Date(startMs).toISOString(),\n iso_timestamp_end: new Date(endMs).toISOString(),\n };\n}\n","import packageJson from '../../package.json' with { type: 'json' };\nimport type { FeedbackOperations } from './types.js';\n\n// Publishable keys copied from the CLI client:\n// https://github.com/supabase/cli/blob/104f1fb14d2e856828292b54c95eda8b8125c07a/apps/cli/src/shared/feedback/feedback-client.layer.ts#L22-L30\nconst FEEDBACK_ENVIRONMENTS = {\n production: {\n url: 'https://xguihxuzqibwxjnimxev.supabase.co',\n key: 'sb_publishable__4DBgvrDe7ec234wnvCAog_LPzBtkQe',\n },\n staging: {\n url: 'https://actixlblmrqglneypada.supabase.co',\n key: 'sb_publishable_wLdx7w89KWFq-39s4emmnA__9XR9r-_',\n },\n};\n\nconst REQUEST_TIMEOUT_MS = 10_000;\n\nexport type FeedbackOperationsOptions = {\n environment?: keyof typeof FEEDBACK_ENVIRONMENTS;\n fetch?: typeof globalThis.fetch;\n /** Failures send feedback without a user. */\n getUserId?: () => Promise<string | undefined>;\n};\n\nexport function createFeedbackOperations({\n environment = 'production',\n fetch = globalThis.fetch,\n getUserId,\n}: FeedbackOperationsOptions = {}): FeedbackOperations {\n const { url, key } = FEEDBACK_ENVIRONMENTS[environment];\n\n async function resolveUserId() {\n try {\n return await getUserId?.();\n } catch {\n return undefined;\n }\n }\n\n async function request(path: string, init: RequestInit, action: string) {\n const response = await fetch(`${url}/rest/v1/${path}`, {\n ...init,\n headers: {\n apikey: key,\n 'Content-Type': 'application/json',\n ...init.headers,\n },\n signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),\n });\n if (!response.ok) {\n throw new Error(\n `Failed to ${action}: ${response.status} ${await response.text()}`\n );\n }\n return response;\n }\n\n return {\n async submit({ feedback, projectId, clientInfo }) {\n const userId = await resolveUserId();\n const response = await request(\n 'rpc/submit_interfaces_feedback',\n {\n method: 'POST',\n body: JSON.stringify({\n feedback,\n user_agent: `supabase-mcp/${packageJson.version}`,\n user_id: userId,\n project_ref: projectId,\n metadata: {\n source: 'mcp',\n ...(clientInfo && {\n client_name: clientInfo.name,\n client_version: clientInfo.version,\n }),\n },\n }),\n },\n 'submit feedback'\n );\n const deleteToken: unknown = await response.json();\n if (typeof deleteToken !== 'string' || deleteToken.length === 0) {\n throw new Error('Failed to submit feedback: no delete token returned');\n }\n return { deleteToken };\n },\n async delete({ deleteToken, projectId }) {\n const userId = await resolveUserId();\n const response = await request(\n `interfaces_feedback?delete_token=eq.${encodeURIComponent(deleteToken)}`,\n {\n method: 'DELETE',\n headers: {\n Prefer: 'count=exact',\n 'x-feedback-token': deleteToken,\n ...(projectId && { 'x-feedback-project-ref': projectId }),\n ...(userId && { 'x-feedback-user-id': userId }),\n },\n },\n 'delete feedback'\n );\n // Content-Range is `*/<deleted row count>`\n const deletedCount = response.headers.get('Content-Range')?.split('/')[1];\n return { deleted: deletedCount === '1' };\n },\n };\n}\n"],"mappings":"AAAA,IAAAA,EAAA,CACE,KAAQ,gCACR,QAAW,mBACX,QAAW,SACX,YAAe,2CACf,QAAW,aACX,WAAc,CACZ,KAAQ,MACR,IAAO,qCACT,EACA,KAAQ,SACR,KAAQ,iBACR,MAAS,kBACT,YAAe,GACf,QAAW,CACT,MAAS,eACT,IAAO,eACP,UAAa,eACb,SAAY,iBACZ,eAAkB,aAClB,kBAAmB,6EACnB,iBAAkB,4BAClB,mBAAoB,wBACpB,KAAQ,SACR,YAAa,wBACb,WAAY,uBACZ,mBAAoB,+BACpB,gBAAiB,oBACjB,WAAY,sBACZ,gBAAiB,oCACjB,gCAAiC,gDACnC,EACA,MAAS,CACP,WACF,EACA,IAAO,CACL,sBAAuB,eACzB,EACA,QAAW,CACT,IAAK,CACH,MAAS,oBACT,OAAU,kBACV,QAAW,kBACb,EACA,aAAc,CACZ,MAAS,6BACT,OAAU,2BACV,QAAW,2BACb,EACA,iBAAkB,CAChB,MAAS,oCACT,OAAU,kCACV,QAAW,kCACb,CACF,EACA,aAAgB,CACd,6BAA8B,UAC9B,6BAA8B,WAC9B,sBAAuB,cACvB,cAAe,SACf,OAAU,SACV,QAAW,WACX,gBAAiB,SACnB,EACA,iBAAoB,CAClB,+BAAgC,WAChC,IAAO,UACT,EACA,gBAAmB,CACjB,oBAAqB,WACrB,cAAe,WACf,uBAAwB,UACxB,+BAAgC,WAChC,iCAAkC,SAClC,+BAAgC,WAChC,mBAAoB,cACpB,6BAA8B,SAC9B,qBAAsB,SACtB,cAAe,UACf,sBAAuB,SACvB,GAAM,WACN,WAAY,SACZ,OAAU,UACV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AAgBK,EAAY,OAAO,GAC/C,QAASF,EACT,YAAaF,EACb,SAAU,CACR,OAAQ,MACR,GAAIC,GAAc,CAChB,YAAaA,EAAW,KACxB,eAAgBA,EAAW,OAC7B,CACF,CACF,CAAC,CACH,EACA,iBACF,GAC4C,KAAK,EACjD,GAAI,OAAOE,GAAgB,UAAYA,EAAY,SAAW,EAC5D,MAAM,IAAI,MAAM,qDAAqD,EAEvE,MAAO,CAAE,YAAAA,CAAY,CACvB,EACA,MAAM,OAAO,CAAE,YAAAA,EAAa,UAAAH,CAAU,EAAG,CACvC,IAAME,EAAS,MAAMT,EAAc,EAgBnC,MAAO,CAAE,SAfQ,MAAMC,EACrB,uCAAuC,mBAAmBS,CAAW,CAAC,GACtE,CACE,OAAQ,SACR,QAAS,CACP,OAAQ,cACR,mBAAoBA,EACpB,GAAIH,GAAa,CAAE,yBAA0BA,CAAU,EACvD,GAAIE,GAAU,CAAE,qBAAsBA,CAAO,CAC/C,CACF,EACA,iBACF,GAE8B,QAAQ,IAAI,eAAe,GAAG,MAAM,GAAG,EAAE,CAAC,IACrC,GAAI,CACzC,CACF,CACF","names":["package_default","stripIndent","ToolCallerError","getClickHouseLogQuery","service","limit","DAY_MS","resolveLogWindow","iso_timestamp_start","iso_timestamp_end","endMs","startMs","FEEDBACK_ENVIRONMENTS","REQUEST_TIMEOUT_MS","createFeedbackOperations","environment","fetch","getUserId","url","key","resolveUserId","request","path","init","action","response","feedback","projectId","clientInfo","userId","deleteToken","package_default"]}
package/dist/cli.cjs CHANGED
@@ -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(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkOO7IZCN3cjs = require('./chunk-OO7IZCN3.cjs');var _chunkDG3LSIFHcjs = require('./chunk-DG3LSIFH.cjs');var _chunkC4YUF27Ucjs = require('./chunk-C4YUF27U.cjs');require('./chunk-VV4YSLRO.cjs');require('./chunk-6QB2YXYQ.cjs');var _util = require('util');var _stdio = require('@modelcontextprotocol/server/stdio');var _crypto = require('crypto');var _events = require('events');var _http = require('http');var _node = require('@modelcontextprotocol/node');var _server = require('@modelcontextprotocol/server');var _v4 = require('zod/v4');function g(r,c=","){return r.split(c).map(t=>t.trim()).filter(t=>t!=="")}var D=_v4.z.object({project_ref:_v4.z.string().optional(),read_only:_v4.z.stringbool().default(!1),experimental_apps:_v4.z.stringbool().default(!1),features:_v4.z.string().transform(r=>g(r)).optional(),skip_elicitations:_v4.z.string().transform(r=>g(r)).optional().pipe(_v4.z.array(_v4.z.enum(_chunkOO7IZCN3cjs.c)).optional())});function Q(r){let c=Array.isArray(r)?r:[r],i,t,l,o;for(let e of c){if(!_server.isJSONRPCRequest.call(void 0, e)&&!_server.isJSONRPCNotification.call(void 0, e))continue;t??=_server.isSpecType.CallToolRequest(e)?`${e.method} ${e.params.name}`:e.method;let n=_optionalChain([e, 'access', _2 => _2.params, 'optionalAccess', _3 => _3._meta]),a=_optionalChain([n, 'optionalAccess', _4 => _4[_server.CLIENT_INFO_META_KEY]]);_server.isSpecType.Implementation(a)&&(i??=a);let s=_optionalChain([n, 'optionalAccess', _5 => _5[_server.PROTOCOL_VERSION_META_KEY]]);if(typeof s=="string"&&(l??=s),_server.isSpecType.InitializeRequest(e))i??=e.params.clientInfo,l??=e.params.protocolVersion,o??=_nullishCoalesce(JSON.stringify(e.params.capabilities.elicitation), () => ("absent"));else if(_server.isSpecType.CallToolRequest(e)&&(e.params.name==="create_edge_function_secret"||_chunkOO7IZCN3cjs.c.includes(e.params.name))){let f=_optionalChain([n, 'optionalAccess', _6 => _6[_server.CLIENT_CAPABILITIES_META_KEY]]);o??=_nullishCoalesce(JSON.stringify(_optionalChain([f, 'optionalAccess', _7 => _7.elicitation])), () => ("absent"))}}let u=i?[i.name,i.version].filter(Boolean).join("/"):"unknown",m=[(_nullishCoalesce(t, () => ("unknown"))).padEnd(28),u.padEnd(24),`(${_nullishCoalesce(l, () => ("legacy"))})`].join(" ");return o===void 0?m:`${m} elicitation=${o}`}async function P({port:r,apiUrl:c,contentApiUrl:i,secretUrlTemplate:t,log:l=o=>console.error(`[${new Date().toLocaleTimeString("en-GB")}] ${o}`)}){let o=_chunkOO7IZCN3cjs.e.call(void 0, c);if(t===void 0)switch(new URL(_nullishCoalesce(c, () => ("https://api.supabase.com"))).origin){case"https://api.supabase.com":case"https://api.supabase.green":t=`${o}/mcp/secrets?ref={ref}&name={name}`;break;default:throw new Error("A custom --api-url requires an explicit --secret-url-template.")}_chunkOO7IZCN3cjs.g.call(void 0, t);let u={connectUrlTemplate:t},m=_crypto.randomBytes.call(void 0, 32),e=_server.localhostAllowedHostnames.call(void 0, ),n=_http.createServer.call(void 0, _node.toNodeHandler.call(void 0, {fetch:async s=>{let f=_server.hostHeaderValidationResponse.call(void 0, s,e);if(f)return f;let d=_optionalChain([s, 'access', _8 => _8.headers, 'access', _9 => _9.get, 'call', _10 => _10("authorization"), 'optionalAccess', _11 => _11.match, 'call', _12 => _12(/^Bearer (.+)$/i), 'optionalAccess', _13 => _13[1]]);if(!d)return Response.json({error:"missing bearer token"},{status:401});let y=new URL(s.url),w=0;for(let h of y.searchParams.keys())if(h==="skip_elicitations"&&w++,w>1||/^skip_elicitations\[[^[\]]*\]/.test(h))return Response.json({error:"skip_elicitations must be a single CSV string"},{status:400});let T=D.safeParse(Object.fromEntries(y.searchParams));if(!T.success)return Response.json({error:_v4.z.prettifyError(T.error)},{status:400});let{project_ref:N,read_only:U,experimental_apps:j,features:k,skip_elicitations:x}=T.data;l(Q(await s.clone().json().catch(()=>{})));let L=_chunkDG3LSIFHcjs.a.call(void 0, {accessToken:d,apiUrl:c});k&&_chunkOO7IZCN3cjs.f.call(void 0, L,k);let O=_server.createMcpHandler.call(void 0, ()=>_chunkOO7IZCN3cjs.j.call(void 0, {platform:L,projectId:N,readOnly:U,features:k,experimentalApps:j,contentApiUrl:i,dashboardUrl:o,elicitation:{requestState:{key:m,principal:_crypto.createHash.call(void 0, "sha256").update(d).digest("hex")},confirmation:{enabledTools:_chunkOO7IZCN3cjs.c.filter(h=>!_optionalChain([x, 'optionalAccess', _14 => _14.includes, 'call', _15 => _15(h)])),ttlSeconds:600},secretCollection:u&&{...u,ttlSeconds:120}}}),{legacy:"stateless",onerror:console.error});return s.signal.addEventListener("abort",()=>O.close(),{once:!0}),O.fetch(s)}},{onerror:console.error}));n.listen(r,"127.0.0.1"),await _events.once.call(void 0, n,"listening");let a=n.address();if(!a||typeof a=="string")throw new Error("expected a TCP address");return{url:`http://127.0.0.1:${a.port}/mcp`,close:async()=>{n.close(),n.closeAllConnections(),await _events.once.call(void 0, n,"close")}}}var{version:Z}=_chunkC4YUF27Ucjs.a;async function ee(){let{values:{["access-token"]:r,["project-ref"]:c,["read-only"]:i,["api-url"]:t,["content-api-url"]:l,["secret-url-template"]:o,["version"]:u,["features"]:m,["http"]:e,["port"]:n}}=_util.parseArgs.call(void 0, {options:{"access-token":{type:"string"},"project-ref":{type:"string"},"read-only":{type:"boolean",default:!1},"api-url":{type:"string"},"content-api-url":{type:"string"},"secret-url-template":{type:"string"},version:{type:"boolean"},features:{type:"string"},http:{type:"boolean",default:!1},port:{type:"string",default:"3111"}}});if(u&&(console.log(Z),process.exit(0)),o!==void 0&&!e){console.error("--secret-url-template requires --http."),process.exitCode=1;return}let a=m?g(m):void 0,s=_nullishCoalesce(l, () => (process.env.SUPABASE_CONTENT_API_URL));if(e){try{let y=await P({port:Number(n),apiUrl:t,contentApiUrl:s,secretUrlTemplate:o});console.error(`Supabase MCP server listening on ${y.url}`)}catch(y){console.error(y),process.exitCode=1}return}let f=_nullishCoalesce(r, () => (process.env.SUPABASE_ACCESS_TOKEN));f||(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 d=_chunkDG3LSIFHcjs.a.call(void 0, {accessToken:f,apiUrl:t});a&&_chunkOO7IZCN3cjs.f.call(void 0, d,a),_stdio.serveStdio.call(void 0, ()=>_chunkOO7IZCN3cjs.j.call(void 0, {platform:d,projectId:c,readOnly:i,features:a,contentApiUrl:s,dashboardUrl:_chunkOO7IZCN3cjs.e.call(void 0, t)}),{onerror:console.error})}ee().catch(console.error);
2
+ "use strict"; function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkFL2XNMHUcjs = require('./chunk-FL2XNMHU.cjs');var _chunkHNZQTPXQcjs = require('./chunk-HNZQTPXQ.cjs');var _chunkA5FTNCK3cjs = require('./chunk-A5FTNCK3.cjs');require('./chunk-VV4YSLRO.cjs');require('./chunk-A64X45AF.cjs');var _util = require('util');var _stdio = require('@modelcontextprotocol/server/stdio');var _crypto = require('crypto');var _events = require('events');var _http = require('http');var _node = require('@modelcontextprotocol/node');var _server = require('@modelcontextprotocol/server');var _v4 = require('zod/v4');function g(r,c=","){return r.split(c).map(t=>t.trim()).filter(t=>t!=="")}var D=_v4.z.object({project_ref:_v4.z.string().optional(),read_only:_v4.z.stringbool().default(!1),experimental_apps:_v4.z.stringbool().default(!1),features:_v4.z.string().transform(r=>g(r)).optional(),skip_elicitations:_v4.z.string().transform(r=>g(r)).optional().pipe(_v4.z.array(_v4.z.enum(_chunkFL2XNMHUcjs.c)).optional())});function Q(r){let c=Array.isArray(r)?r:[r],i,t,l,o;for(let e of c){if(!_server.isJSONRPCRequest.call(void 0, e)&&!_server.isJSONRPCNotification.call(void 0, e))continue;t??=_server.isSpecType.CallToolRequest(e)?`${e.method} ${e.params.name}`:e.method;let n=_optionalChain([e, 'access', _2 => _2.params, 'optionalAccess', _3 => _3._meta]),a=_optionalChain([n, 'optionalAccess', _4 => _4[_server.CLIENT_INFO_META_KEY]]);_server.isSpecType.Implementation(a)&&(i??=a);let s=_optionalChain([n, 'optionalAccess', _5 => _5[_server.PROTOCOL_VERSION_META_KEY]]);if(typeof s=="string"&&(l??=s),_server.isSpecType.InitializeRequest(e))i??=e.params.clientInfo,l??=e.params.protocolVersion,o??=_nullishCoalesce(JSON.stringify(e.params.capabilities.elicitation), () => ("absent"));else if(_server.isSpecType.CallToolRequest(e)&&(e.params.name==="create_edge_function_secret"||_chunkFL2XNMHUcjs.c.includes(e.params.name))){let f=_optionalChain([n, 'optionalAccess', _6 => _6[_server.CLIENT_CAPABILITIES_META_KEY]]);o??=_nullishCoalesce(JSON.stringify(_optionalChain([f, 'optionalAccess', _7 => _7.elicitation])), () => ("absent"))}}let u=i?[i.name,i.version].filter(Boolean).join("/"):"unknown",m=[(_nullishCoalesce(t, () => ("unknown"))).padEnd(28),u.padEnd(24),`(${_nullishCoalesce(l, () => ("legacy"))})`].join(" ");return o===void 0?m:`${m} elicitation=${o}`}async function P({port:r,apiUrl:c,contentApiUrl:i,secretUrlTemplate:t,log:l=o=>console.error(`[${new Date().toLocaleTimeString("en-GB")}] ${o}`)}){let o=_chunkFL2XNMHUcjs.e.call(void 0, c);if(t===void 0)switch(new URL(_nullishCoalesce(c, () => ("https://api.supabase.com"))).origin){case"https://api.supabase.com":case"https://api.supabase.green":t=`${o}/mcp/secrets?ref={ref}&name={name}`;break;default:throw new Error("A custom --api-url requires an explicit --secret-url-template.")}_chunkFL2XNMHUcjs.g.call(void 0, t);let u={connectUrlTemplate:t},m=_crypto.randomBytes.call(void 0, 32),e=_server.localhostAllowedHostnames.call(void 0, ),n=_http.createServer.call(void 0, _node.toNodeHandler.call(void 0, {fetch:async s=>{let f=_server.hostHeaderValidationResponse.call(void 0, s,e);if(f)return f;let d=_optionalChain([s, 'access', _8 => _8.headers, 'access', _9 => _9.get, 'call', _10 => _10("authorization"), 'optionalAccess', _11 => _11.match, 'call', _12 => _12(/^Bearer (.+)$/i), 'optionalAccess', _13 => _13[1]]);if(!d)return Response.json({error:"missing bearer token"},{status:401});let y=new URL(s.url),w=0;for(let h of y.searchParams.keys())if(h==="skip_elicitations"&&w++,w>1||/^skip_elicitations\[[^[\]]*\]/.test(h))return Response.json({error:"skip_elicitations must be a single CSV string"},{status:400});let T=D.safeParse(Object.fromEntries(y.searchParams));if(!T.success)return Response.json({error:_v4.z.prettifyError(T.error)},{status:400});let{project_ref:N,read_only:U,experimental_apps:j,features:k,skip_elicitations:x}=T.data;l(Q(await s.clone().json().catch(()=>{})));let L=_chunkHNZQTPXQcjs.a.call(void 0, {accessToken:d,apiUrl:c});k&&_chunkFL2XNMHUcjs.f.call(void 0, L,k);let O=_server.createMcpHandler.call(void 0, ()=>_chunkFL2XNMHUcjs.j.call(void 0, {platform:L,projectId:N,readOnly:U,features:k,experimentalApps:j,contentApiUrl:i,dashboardUrl:o,elicitation:{requestState:{key:m,principal:_crypto.createHash.call(void 0, "sha256").update(d).digest("hex")},confirmation:{enabledTools:_chunkFL2XNMHUcjs.c.filter(h=>!_optionalChain([x, 'optionalAccess', _14 => _14.includes, 'call', _15 => _15(h)])),ttlSeconds:600},secretCollection:u&&{...u,ttlSeconds:120}}}),{legacy:"stateless",onerror:console.error});return s.signal.addEventListener("abort",()=>O.close(),{once:!0}),O.fetch(s)}},{onerror:console.error}));n.listen(r,"127.0.0.1"),await _events.once.call(void 0, n,"listening");let a=n.address();if(!a||typeof a=="string")throw new Error("expected a TCP address");return{url:`http://127.0.0.1:${a.port}/mcp`,close:async()=>{n.close(),n.closeAllConnections(),await _events.once.call(void 0, n,"close")}}}var{version:Z}=_chunkA5FTNCK3cjs.a;async function ee(){let{values:{["access-token"]:r,["project-ref"]:c,["read-only"]:i,["api-url"]:t,["content-api-url"]:l,["secret-url-template"]:o,["version"]:u,["features"]:m,["http"]:e,["port"]:n}}=_util.parseArgs.call(void 0, {options:{"access-token":{type:"string"},"project-ref":{type:"string"},"read-only":{type:"boolean",default:!1},"api-url":{type:"string"},"content-api-url":{type:"string"},"secret-url-template":{type:"string"},version:{type:"boolean"},features:{type:"string"},http:{type:"boolean",default:!1},port:{type:"string",default:"3111"}}});if(u&&(console.log(Z),process.exit(0)),o!==void 0&&!e){console.error("--secret-url-template requires --http."),process.exitCode=1;return}let a=m?g(m):void 0,s=_nullishCoalesce(l, () => (process.env.SUPABASE_CONTENT_API_URL));if(e){try{let y=await P({port:Number(n),apiUrl:t,contentApiUrl:s,secretUrlTemplate:o});console.error(`Supabase MCP server listening on ${y.url}`)}catch(y){console.error(y),process.exitCode=1}return}let f=_nullishCoalesce(r, () => (process.env.SUPABASE_ACCESS_TOKEN));f||(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 d=_chunkHNZQTPXQcjs.a.call(void 0, {accessToken:f,apiUrl:t});a&&_chunkFL2XNMHUcjs.f.call(void 0, d,a),_stdio.serveStdio.call(void 0, ()=>_chunkFL2XNMHUcjs.j.call(void 0, {platform:d,projectId:c,readOnly:i,features:a,contentApiUrl:s,dashboardUrl:_chunkFL2XNMHUcjs.e.call(void 0, t)}),{onerror:console.error})}ee().catch(console.error);
3
3
  //# sourceMappingURL=cli.cjs.map
package/dist/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{c as S,e as _,f as A,g as R,j as b}from"./chunk-WAYAYNQY.js";import{a as E}from"./chunk-YW7R6DLX.js";import{a as v}from"./chunk-6DARTJRP.js";import"./chunk-W6H5VMAV.js";import"./chunk-3BFHAE72.js";import{parseArgs as W}from"util";import{serveStdio as X}from"@modelcontextprotocol/server/stdio";import{createHash as H,randomBytes as $}from"crypto";import{once as I}from"events";import{createServer as B}from"http";import{toNodeHandler as V}from"@modelcontextprotocol/node";import{CLIENT_CAPABILITIES_META_KEY as M,CLIENT_INFO_META_KEY as q,createMcpHandler as F,hostHeaderValidationResponse as K,isJSONRPCNotification as J,isJSONRPCRequest as z,isSpecType as C,localhostAllowedHostnames as G,PROTOCOL_VERSION_META_KEY as Y}from"@modelcontextprotocol/server";import{z as p}from"zod/v4";function g(r,c=","){return r.split(c).map(t=>t.trim()).filter(t=>t!=="")}var D=p.object({project_ref:p.string().optional(),read_only:p.stringbool().default(!1),experimental_apps:p.stringbool().default(!1),features:p.string().transform(r=>g(r)).optional(),skip_elicitations:p.string().transform(r=>g(r)).optional().pipe(p.array(p.enum(S)).optional())});function Q(r){let c=Array.isArray(r)?r:[r],i,t,l,o;for(let e of c){if(!z(e)&&!J(e))continue;t??=C.CallToolRequest(e)?`${e.method} ${e.params.name}`:e.method;let n=e.params?._meta,a=n?.[q];C.Implementation(a)&&(i??=a);let s=n?.[Y];if(typeof s=="string"&&(l??=s),C.InitializeRequest(e))i??=e.params.clientInfo,l??=e.params.protocolVersion,o??=JSON.stringify(e.params.capabilities.elicitation)??"absent";else if(C.CallToolRequest(e)&&(e.params.name==="create_edge_function_secret"||S.includes(e.params.name))){let f=n?.[M];o??=JSON.stringify(f?.elicitation)??"absent"}}let u=i?[i.name,i.version].filter(Boolean).join("/"):"unknown",m=[(t??"unknown").padEnd(28),u.padEnd(24),`(${l??"legacy"})`].join(" ");return o===void 0?m:`${m} elicitation=${o}`}async function P({port:r,apiUrl:c,contentApiUrl:i,secretUrlTemplate:t,log:l=o=>console.error(`[${new Date().toLocaleTimeString("en-GB")}] ${o}`)}){let o=_(c);if(t===void 0)switch(new URL(c??"https://api.supabase.com").origin){case"https://api.supabase.com":case"https://api.supabase.green":t=`${o}/mcp/secrets?ref={ref}&name={name}`;break;default:throw new Error("A custom --api-url requires an explicit --secret-url-template.")}R(t);let u={connectUrlTemplate:t},m=$(32),e=G(),n=B(V({fetch:async s=>{let f=K(s,e);if(f)return f;let d=s.headers.get("authorization")?.match(/^Bearer (.+)$/i)?.[1];if(!d)return Response.json({error:"missing bearer token"},{status:401});let y=new URL(s.url),w=0;for(let h of y.searchParams.keys())if(h==="skip_elicitations"&&w++,w>1||/^skip_elicitations\[[^[\]]*\]/.test(h))return Response.json({error:"skip_elicitations must be a single CSV string"},{status:400});let T=D.safeParse(Object.fromEntries(y.searchParams));if(!T.success)return Response.json({error:p.prettifyError(T.error)},{status:400});let{project_ref:N,read_only:U,experimental_apps:j,features:k,skip_elicitations:x}=T.data;l(Q(await s.clone().json().catch(()=>{})));let L=E({accessToken:d,apiUrl:c});k&&A(L,k);let O=F(()=>b({platform:L,projectId:N,readOnly:U,features:k,experimentalApps:j,contentApiUrl:i,dashboardUrl:o,elicitation:{requestState:{key:m,principal:H("sha256").update(d).digest("hex")},confirmation:{enabledTools:S.filter(h=>!x?.includes(h)),ttlSeconds:600},secretCollection:u&&{...u,ttlSeconds:120}}}),{legacy:"stateless",onerror:console.error});return s.signal.addEventListener("abort",()=>O.close(),{once:!0}),O.fetch(s)}},{onerror:console.error}));n.listen(r,"127.0.0.1"),await I(n,"listening");let a=n.address();if(!a||typeof a=="string")throw new Error("expected a TCP address");return{url:`http://127.0.0.1:${a.port}/mcp`,close:async()=>{n.close(),n.closeAllConnections(),await I(n,"close")}}}var{version:Z}=v;async function ee(){let{values:{["access-token"]:r,["project-ref"]:c,["read-only"]:i,["api-url"]:t,["content-api-url"]:l,["secret-url-template"]:o,["version"]:u,["features"]:m,["http"]:e,["port"]:n}}=W({options:{"access-token":{type:"string"},"project-ref":{type:"string"},"read-only":{type:"boolean",default:!1},"api-url":{type:"string"},"content-api-url":{type:"string"},"secret-url-template":{type:"string"},version:{type:"boolean"},features:{type:"string"},http:{type:"boolean",default:!1},port:{type:"string",default:"3111"}}});if(u&&(console.log(Z),process.exit(0)),o!==void 0&&!e){console.error("--secret-url-template requires --http."),process.exitCode=1;return}let a=m?g(m):void 0,s=l??process.env.SUPABASE_CONTENT_API_URL;if(e){try{let y=await P({port:Number(n),apiUrl:t,contentApiUrl:s,secretUrlTemplate:o});console.error(`Supabase MCP server listening on ${y.url}`)}catch(y){console.error(y),process.exitCode=1}return}let f=r??process.env.SUPABASE_ACCESS_TOKEN;f||(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 d=E({accessToken:f,apiUrl:t});a&&A(d,a),X(()=>b({platform:d,projectId:c,readOnly:i,features:a,contentApiUrl:s,dashboardUrl:_(t)}),{onerror:console.error})}ee().catch(console.error);
2
+ import{c as S,e as _,f as A,g as R,j as b}from"./chunk-JR6WQZBY.js";import{a as E}from"./chunk-JJFVFIBB.js";import{a as v}from"./chunk-SS4B4LYS.js";import"./chunk-W6H5VMAV.js";import"./chunk-6CWFTRTZ.js";import{parseArgs as W}from"util";import{serveStdio as X}from"@modelcontextprotocol/server/stdio";import{createHash as H,randomBytes as $}from"crypto";import{once as I}from"events";import{createServer as B}from"http";import{toNodeHandler as V}from"@modelcontextprotocol/node";import{CLIENT_CAPABILITIES_META_KEY as M,CLIENT_INFO_META_KEY as q,createMcpHandler as F,hostHeaderValidationResponse as K,isJSONRPCNotification as J,isJSONRPCRequest as z,isSpecType as C,localhostAllowedHostnames as G,PROTOCOL_VERSION_META_KEY as Y}from"@modelcontextprotocol/server";import{z as p}from"zod/v4";function g(r,c=","){return r.split(c).map(t=>t.trim()).filter(t=>t!=="")}var D=p.object({project_ref:p.string().optional(),read_only:p.stringbool().default(!1),experimental_apps:p.stringbool().default(!1),features:p.string().transform(r=>g(r)).optional(),skip_elicitations:p.string().transform(r=>g(r)).optional().pipe(p.array(p.enum(S)).optional())});function Q(r){let c=Array.isArray(r)?r:[r],i,t,l,o;for(let e of c){if(!z(e)&&!J(e))continue;t??=C.CallToolRequest(e)?`${e.method} ${e.params.name}`:e.method;let n=e.params?._meta,a=n?.[q];C.Implementation(a)&&(i??=a);let s=n?.[Y];if(typeof s=="string"&&(l??=s),C.InitializeRequest(e))i??=e.params.clientInfo,l??=e.params.protocolVersion,o??=JSON.stringify(e.params.capabilities.elicitation)??"absent";else if(C.CallToolRequest(e)&&(e.params.name==="create_edge_function_secret"||S.includes(e.params.name))){let f=n?.[M];o??=JSON.stringify(f?.elicitation)??"absent"}}let u=i?[i.name,i.version].filter(Boolean).join("/"):"unknown",m=[(t??"unknown").padEnd(28),u.padEnd(24),`(${l??"legacy"})`].join(" ");return o===void 0?m:`${m} elicitation=${o}`}async function P({port:r,apiUrl:c,contentApiUrl:i,secretUrlTemplate:t,log:l=o=>console.error(`[${new Date().toLocaleTimeString("en-GB")}] ${o}`)}){let o=_(c);if(t===void 0)switch(new URL(c??"https://api.supabase.com").origin){case"https://api.supabase.com":case"https://api.supabase.green":t=`${o}/mcp/secrets?ref={ref}&name={name}`;break;default:throw new Error("A custom --api-url requires an explicit --secret-url-template.")}R(t);let u={connectUrlTemplate:t},m=$(32),e=G(),n=B(V({fetch:async s=>{let f=K(s,e);if(f)return f;let d=s.headers.get("authorization")?.match(/^Bearer (.+)$/i)?.[1];if(!d)return Response.json({error:"missing bearer token"},{status:401});let y=new URL(s.url),w=0;for(let h of y.searchParams.keys())if(h==="skip_elicitations"&&w++,w>1||/^skip_elicitations\[[^[\]]*\]/.test(h))return Response.json({error:"skip_elicitations must be a single CSV string"},{status:400});let T=D.safeParse(Object.fromEntries(y.searchParams));if(!T.success)return Response.json({error:p.prettifyError(T.error)},{status:400});let{project_ref:N,read_only:U,experimental_apps:j,features:k,skip_elicitations:x}=T.data;l(Q(await s.clone().json().catch(()=>{})));let L=E({accessToken:d,apiUrl:c});k&&A(L,k);let O=F(()=>b({platform:L,projectId:N,readOnly:U,features:k,experimentalApps:j,contentApiUrl:i,dashboardUrl:o,elicitation:{requestState:{key:m,principal:H("sha256").update(d).digest("hex")},confirmation:{enabledTools:S.filter(h=>!x?.includes(h)),ttlSeconds:600},secretCollection:u&&{...u,ttlSeconds:120}}}),{legacy:"stateless",onerror:console.error});return s.signal.addEventListener("abort",()=>O.close(),{once:!0}),O.fetch(s)}},{onerror:console.error}));n.listen(r,"127.0.0.1"),await I(n,"listening");let a=n.address();if(!a||typeof a=="string")throw new Error("expected a TCP address");return{url:`http://127.0.0.1:${a.port}/mcp`,close:async()=>{n.close(),n.closeAllConnections(),await I(n,"close")}}}var{version:Z}=v;async function ee(){let{values:{["access-token"]:r,["project-ref"]:c,["read-only"]:i,["api-url"]:t,["content-api-url"]:l,["secret-url-template"]:o,["version"]:u,["features"]:m,["http"]:e,["port"]:n}}=W({options:{"access-token":{type:"string"},"project-ref":{type:"string"},"read-only":{type:"boolean",default:!1},"api-url":{type:"string"},"content-api-url":{type:"string"},"secret-url-template":{type:"string"},version:{type:"boolean"},features:{type:"string"},http:{type:"boolean",default:!1},port:{type:"string",default:"3111"}}});if(u&&(console.log(Z),process.exit(0)),o!==void 0&&!e){console.error("--secret-url-template requires --http."),process.exitCode=1;return}let a=m?g(m):void 0,s=l??process.env.SUPABASE_CONTENT_API_URL;if(e){try{let y=await P({port:Number(n),apiUrl:t,contentApiUrl:s,secretUrlTemplate:o});console.error(`Supabase MCP server listening on ${y.url}`)}catch(y){console.error(y),process.exitCode=1}return}let f=r??process.env.SUPABASE_ACCESS_TOKEN;f||(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 d=E({accessToken:f,apiUrl:t});a&&A(d,a),X(()=>b({platform:d,projectId:c,readOnly:i,features:a,contentApiUrl:s,dashboardUrl:_(t)}),{onerror:console.error})}ee().catch(console.error);
3
3
  //# sourceMappingURL=cli.js.map
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkOO7IZCN3cjs = require('./chunk-OO7IZCN3.cjs');var _chunkC4YUF27Ucjs = require('./chunk-C4YUF27U.cjs');require('./chunk-6QB2YXYQ.cjs');var _mcputils = require('@supabase/mcp-utils');var _server = require('@modelcontextprotocol/server');function m(o){return _server.createMcpHandler.call(void 0, ()=>_chunkOO7IZCN3cjs.j.call(void 0, o),{legacy:"reject"})}var S=_chunkC4YUF27Ucjs.a.version;exports.CREATE_BRANCH_UI_URI = _chunkOO7IZCN3cjs.b; exports.CREATE_PROJECT_UI_URI = _chunkOO7IZCN3cjs.a; exports.CURRENT_ELICITATION_TOOLS = _chunkOO7IZCN3cjs.c; exports.CURRENT_FEATURE_GROUPS = _chunkOO7IZCN3cjs.d; exports.ToolCallerError = _mcputils.ToolCallerError; exports.createFeedbackOperations = _chunkC4YUF27Ucjs.d; exports.createSupabaseMcpHandler = m; exports.createSupabaseMcpServer = _chunkOO7IZCN3cjs.j; exports.createToolSchemas = _chunkOO7IZCN3cjs.i; exports.isToolCallerError = _mcputils.isToolCallerError; exports.supabaseMcpToolSchemas = _chunkOO7IZCN3cjs.h; exports.version = S;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFL2XNMHUcjs = require('./chunk-FL2XNMHU.cjs');var _chunkA5FTNCK3cjs = require('./chunk-A5FTNCK3.cjs');require('./chunk-A64X45AF.cjs');var _mcputils = require('@supabase/mcp-utils');var _server = require('@modelcontextprotocol/server');function m(o){return _server.createMcpHandler.call(void 0, ()=>_chunkFL2XNMHUcjs.j.call(void 0, o),{legacy:"reject"})}var S=_chunkA5FTNCK3cjs.a.version;exports.CREATE_BRANCH_UI_URI = _chunkFL2XNMHUcjs.b; exports.CREATE_PROJECT_UI_URI = _chunkFL2XNMHUcjs.a; exports.CURRENT_ELICITATION_TOOLS = _chunkFL2XNMHUcjs.c; exports.CURRENT_FEATURE_GROUPS = _chunkFL2XNMHUcjs.d; exports.ToolCallerError = _mcputils.ToolCallerError; exports.createFeedbackOperations = _chunkA5FTNCK3cjs.d; exports.createSupabaseMcpHandler = m; exports.createSupabaseMcpServer = _chunkFL2XNMHUcjs.j; exports.createToolSchemas = _chunkFL2XNMHUcjs.i; exports.isToolCallerError = _mcputils.isToolCallerError; exports.supabaseMcpToolSchemas = _chunkFL2XNMHUcjs.h; exports.version = S;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ObservationContext as ObservationContext$1, RequestObservation as RequestObservation$1, RequestObserver as RequestObserver$1, ToolCallCallback } from '@supabase/mcp-utils';
2
2
  export { ObservationEnd, ObservedMethod, ToolCallCallback, ToolCallerError, ToolCallerErrorKind, isToolCallerError } from '@supabase/mcp-utils';
3
3
  import { z } from 'zod/v4';
4
- import { a7 as FeedbackOperations, S as SupabasePlatform } from './types-abfpaWQw.cjs';
4
+ import { a8 as FeedbackOperations, S as SupabasePlatform } from './types-Ckih0oCv.cjs';
5
5
  import * as _modelcontextprotocol_server from '@modelcontextprotocol/server';
6
6
  import { Implementation } from '@modelcontextprotocol/server';
7
7
 
@@ -13,15 +13,15 @@ declare const featureGroupSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
13
13
  }>, z.ZodEnum<{
14
14
  storage: "storage";
15
15
  database: "database";
16
+ development: "development";
16
17
  feedback: "feedback";
17
18
  docs: "docs";
18
19
  account: "account";
19
20
  debugging: "debugging";
20
- development: "development";
21
21
  functions: "functions";
22
22
  branching: "branching";
23
23
  notebooks: "notebooks";
24
- }>]>, z.ZodTransform<"storage" | "database" | "feedback" | "docs" | "account" | "debugging" | "development" | "functions" | "branching" | "notebooks", "storage" | "database" | "feedback" | "docs" | "account" | "debugging" | "development" | "functions" | "branching" | "notebooks" | "debug">>;
24
+ }>]>, z.ZodTransform<"storage" | "database" | "development" | "feedback" | "docs" | "account" | "debugging" | "functions" | "branching" | "notebooks", "storage" | "database" | "development" | "feedback" | "docs" | "account" | "debugging" | "functions" | "branching" | "notebooks" | "debug">>;
25
25
  type FeatureGroup = z.infer<typeof featureGroupSchema>;
26
26
 
27
27
  type ObservedTool = ElicitationToolName | 'other';
@@ -103,7 +103,7 @@ type SupabaseMcpServerOptions = {
103
103
  * The API URL for the Supabase Content API.
104
104
  */
105
105
  contentApiUrl?: string;
106
- /** Dashboard base URL for notebook links. Defaults to the production dashboard. */
106
+ /** Dashboard base URL for notebook and MCP Apps view links. Defaults to the production dashboard. */
107
107
  dashboardUrl?: string;
108
108
  /**
109
109
  * The project ID to scope the server to.
@@ -689,6 +689,76 @@ declare const databaseToolDefs: {
689
689
  };
690
690
 
691
691
  declare const debuggingToolDefs: {
692
+ readonly get_issues: {
693
+ readonly description: "Gets current project issues grouped by check, with security, performance, and health check coverage. Start here when debugging or after DDL changes. IDs identify checks within this project, not persistent incidents. An unavailable check is not a clean assessment. Include docs_url as a clickable remediation link.";
694
+ readonly parameters: z.ZodObject<{
695
+ project_id: z.ZodString;
696
+ type: z.ZodDefault<z.ZodEnum<{
697
+ health: "health";
698
+ all: "all";
699
+ security: "security";
700
+ performance: "performance";
701
+ }>>;
702
+ severity: z.ZodDefault<z.ZodEnum<{
703
+ critical: "critical";
704
+ warning: "warning";
705
+ info: "info";
706
+ }>>;
707
+ }, z.core.$strip>;
708
+ readonly outputSchema: z.ZodObject<{
709
+ issues: z.ZodArray<z.ZodObject<{
710
+ id: z.ZodString;
711
+ title: z.ZodString;
712
+ description: z.ZodString;
713
+ severity: z.ZodEnum<{
714
+ critical: "critical";
715
+ warning: "warning";
716
+ info: "info";
717
+ }>;
718
+ category: z.ZodEnum<{
719
+ health: "health";
720
+ security: "security";
721
+ performance: "performance";
722
+ }>;
723
+ source: z.ZodLiteral<"lint">;
724
+ docs_url: z.ZodString;
725
+ affected_count: z.ZodNumber;
726
+ affected: z.ZodArray<z.ZodObject<{
727
+ id: z.ZodString;
728
+ resource: z.ZodObject<{
729
+ type: z.ZodString;
730
+ name: z.ZodString;
731
+ schema: z.ZodNullable<z.ZodString>;
732
+ }, z.core.$strip>;
733
+ detail: z.ZodString;
734
+ severity: z.ZodEnum<{
735
+ critical: "critical";
736
+ warning: "warning";
737
+ info: "info";
738
+ }>;
739
+ }, z.core.$strip>>;
740
+ }, z.core.$strip>>;
741
+ checks: z.ZodArray<z.ZodObject<{
742
+ type: z.ZodEnum<{
743
+ health: "health";
744
+ security: "security";
745
+ performance: "performance";
746
+ }>;
747
+ status: z.ZodEnum<{
748
+ unavailable: "unavailable";
749
+ complete: "complete";
750
+ }>;
751
+ reason: z.ZodOptional<z.ZodString>;
752
+ }, z.core.$strip>>;
753
+ }, z.core.$strip>;
754
+ readonly annotations: {
755
+ readonly title: "Get project issues";
756
+ readonly readOnlyHint: true;
757
+ readonly destructiveHint: false;
758
+ readonly idempotentHint: true;
759
+ readonly openWorldHint: false;
760
+ };
761
+ };
692
762
  readonly get_logs: {
693
763
  readonly description: "Gets logs for a Supabase project by service type. When the user asks about a specific time range, always pass iso_timestamp_start and iso_timestamp_end to match it; otherwise each call defaults to the last 24 hours and will return logs from a wider window than intended. The window must be 24 hours or less and iso_timestamp_start must be before iso_timestamp_end; other windows are rejected. If you pass only iso_timestamp_start, the end defaults to now, so for a past time range pass both timestamps. For a longer range, make one call per 24-hour slice. Edge Function logs are split by kind: `edge-function` returns invocation/request logs, while `edge-function-runtime` returns console output from inside the function. Query one service first, then correlate with other services by timestamp or error anchors. Do not poll get_logs in a loop.";
694
764
  readonly parameters: z.ZodObject<{
@@ -737,7 +807,7 @@ declare const debuggingToolDefs: {
737
807
  };
738
808
  };
739
809
  readonly get_advisors: {
740
- readonly description: "Gets a list of advisory notices for the Supabase project. Use this to check for security vulnerabilities, performance improvements, or health issues. Include the remediation URL as a clickable link so that the user can reference the issue themselves. It's recommended to run this tool regularly, especially after making DDL changes to the database since it will catch things like missing RLS policies.";
810
+ readonly description: "Planned for future deprecation in favor of get_issues; remains available. Gets a list of advisory notices for the Supabase project. Use this to check for security vulnerabilities, performance improvements, or health issues. Include the remediation URL as a clickable link so that the user can reference the issue themselves.";
741
811
  readonly parameters: z.ZodObject<{
742
812
  project_id: z.ZodString;
743
813
  type: z.ZodEnum<{
@@ -806,6 +876,7 @@ declare const developmentToolDefs: {
806
876
  readonly description: "Generates TypeScript types for a project.";
807
877
  readonly parameters: z.ZodObject<{
808
878
  project_id: z.ZodString;
879
+ schemas: z.ZodOptional<z.ZodArray<z.ZodString>>;
809
880
  }, z.core.$strip>;
810
881
  readonly outputSchema: z.ZodObject<{
811
882
  types: z.ZodString;
@@ -1795,6 +1866,7 @@ declare const supabaseMcpToolSchemas: {
1795
1866
  generate_typescript_types: {
1796
1867
  inputSchema: z.ZodObject<{
1797
1868
  project_id: z.ZodString;
1869
+ schemas: z.ZodOptional<z.ZodArray<z.ZodString>>;
1798
1870
  }, z.core.$strip>;
1799
1871
  outputSchema: z.ZodObject<{
1800
1872
  types: z.ZodString;
@@ -1809,6 +1881,77 @@ declare const supabaseMcpToolSchemas: {
1809
1881
  readOnlyBehavior: undefined;
1810
1882
  hidden: undefined;
1811
1883
  };
1884
+ get_issues: {
1885
+ inputSchema: z.ZodObject<{
1886
+ project_id: z.ZodString;
1887
+ type: z.ZodDefault<z.ZodEnum<{
1888
+ health: "health";
1889
+ all: "all";
1890
+ security: "security";
1891
+ performance: "performance";
1892
+ }>>;
1893
+ severity: z.ZodDefault<z.ZodEnum<{
1894
+ critical: "critical";
1895
+ warning: "warning";
1896
+ info: "info";
1897
+ }>>;
1898
+ }, z.core.$strip>;
1899
+ outputSchema: z.ZodObject<{
1900
+ issues: z.ZodArray<z.ZodObject<{
1901
+ id: z.ZodString;
1902
+ title: z.ZodString;
1903
+ description: z.ZodString;
1904
+ severity: z.ZodEnum<{
1905
+ critical: "critical";
1906
+ warning: "warning";
1907
+ info: "info";
1908
+ }>;
1909
+ category: z.ZodEnum<{
1910
+ health: "health";
1911
+ security: "security";
1912
+ performance: "performance";
1913
+ }>;
1914
+ source: z.ZodLiteral<"lint">;
1915
+ docs_url: z.ZodString;
1916
+ affected_count: z.ZodNumber;
1917
+ affected: z.ZodArray<z.ZodObject<{
1918
+ id: z.ZodString;
1919
+ resource: z.ZodObject<{
1920
+ type: z.ZodString;
1921
+ name: z.ZodString;
1922
+ schema: z.ZodNullable<z.ZodString>;
1923
+ }, z.core.$strip>;
1924
+ detail: z.ZodString;
1925
+ severity: z.ZodEnum<{
1926
+ critical: "critical";
1927
+ warning: "warning";
1928
+ info: "info";
1929
+ }>;
1930
+ }, z.core.$strip>>;
1931
+ }, z.core.$strip>>;
1932
+ checks: z.ZodArray<z.ZodObject<{
1933
+ type: z.ZodEnum<{
1934
+ health: "health";
1935
+ security: "security";
1936
+ performance: "performance";
1937
+ }>;
1938
+ status: z.ZodEnum<{
1939
+ unavailable: "unavailable";
1940
+ complete: "complete";
1941
+ }>;
1942
+ reason: z.ZodOptional<z.ZodString>;
1943
+ }, z.core.$strip>>;
1944
+ }, z.core.$strip>;
1945
+ annotations: {
1946
+ readonly title: "Get project issues";
1947
+ readonly readOnlyHint: true;
1948
+ readonly destructiveHint: false;
1949
+ readonly idempotentHint: true;
1950
+ readonly openWorldHint: false;
1951
+ };
1952
+ readOnlyBehavior: undefined;
1953
+ hidden: undefined;
1954
+ };
1812
1955
  get_logs: {
1813
1956
  inputSchema: z.ZodObject<{
1814
1957
  project_id: z.ZodString;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ObservationContext as ObservationContext$1, RequestObservation as RequestObservation$1, RequestObserver as RequestObserver$1, ToolCallCallback } from '@supabase/mcp-utils';
2
2
  export { ObservationEnd, ObservedMethod, ToolCallCallback, ToolCallerError, ToolCallerErrorKind, isToolCallerError } from '@supabase/mcp-utils';
3
3
  import { z } from 'zod/v4';
4
- import { a7 as FeedbackOperations, S as SupabasePlatform } from './types-abfpaWQw.js';
4
+ import { a8 as FeedbackOperations, S as SupabasePlatform } from './types-Ckih0oCv.js';
5
5
  import * as _modelcontextprotocol_server from '@modelcontextprotocol/server';
6
6
  import { Implementation } from '@modelcontextprotocol/server';
7
7
 
@@ -13,15 +13,15 @@ declare const featureGroupSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
13
13
  }>, z.ZodEnum<{
14
14
  storage: "storage";
15
15
  database: "database";
16
+ development: "development";
16
17
  feedback: "feedback";
17
18
  docs: "docs";
18
19
  account: "account";
19
20
  debugging: "debugging";
20
- development: "development";
21
21
  functions: "functions";
22
22
  branching: "branching";
23
23
  notebooks: "notebooks";
24
- }>]>, z.ZodTransform<"storage" | "database" | "feedback" | "docs" | "account" | "debugging" | "development" | "functions" | "branching" | "notebooks", "storage" | "database" | "feedback" | "docs" | "account" | "debugging" | "development" | "functions" | "branching" | "notebooks" | "debug">>;
24
+ }>]>, z.ZodTransform<"storage" | "database" | "development" | "feedback" | "docs" | "account" | "debugging" | "functions" | "branching" | "notebooks", "storage" | "database" | "development" | "feedback" | "docs" | "account" | "debugging" | "functions" | "branching" | "notebooks" | "debug">>;
25
25
  type FeatureGroup = z.infer<typeof featureGroupSchema>;
26
26
 
27
27
  type ObservedTool = ElicitationToolName | 'other';
@@ -103,7 +103,7 @@ type SupabaseMcpServerOptions = {
103
103
  * The API URL for the Supabase Content API.
104
104
  */
105
105
  contentApiUrl?: string;
106
- /** Dashboard base URL for notebook links. Defaults to the production dashboard. */
106
+ /** Dashboard base URL for notebook and MCP Apps view links. Defaults to the production dashboard. */
107
107
  dashboardUrl?: string;
108
108
  /**
109
109
  * The project ID to scope the server to.
@@ -689,6 +689,76 @@ declare const databaseToolDefs: {
689
689
  };
690
690
 
691
691
  declare const debuggingToolDefs: {
692
+ readonly get_issues: {
693
+ readonly description: "Gets current project issues grouped by check, with security, performance, and health check coverage. Start here when debugging or after DDL changes. IDs identify checks within this project, not persistent incidents. An unavailable check is not a clean assessment. Include docs_url as a clickable remediation link.";
694
+ readonly parameters: z.ZodObject<{
695
+ project_id: z.ZodString;
696
+ type: z.ZodDefault<z.ZodEnum<{
697
+ health: "health";
698
+ all: "all";
699
+ security: "security";
700
+ performance: "performance";
701
+ }>>;
702
+ severity: z.ZodDefault<z.ZodEnum<{
703
+ critical: "critical";
704
+ warning: "warning";
705
+ info: "info";
706
+ }>>;
707
+ }, z.core.$strip>;
708
+ readonly outputSchema: z.ZodObject<{
709
+ issues: z.ZodArray<z.ZodObject<{
710
+ id: z.ZodString;
711
+ title: z.ZodString;
712
+ description: z.ZodString;
713
+ severity: z.ZodEnum<{
714
+ critical: "critical";
715
+ warning: "warning";
716
+ info: "info";
717
+ }>;
718
+ category: z.ZodEnum<{
719
+ health: "health";
720
+ security: "security";
721
+ performance: "performance";
722
+ }>;
723
+ source: z.ZodLiteral<"lint">;
724
+ docs_url: z.ZodString;
725
+ affected_count: z.ZodNumber;
726
+ affected: z.ZodArray<z.ZodObject<{
727
+ id: z.ZodString;
728
+ resource: z.ZodObject<{
729
+ type: z.ZodString;
730
+ name: z.ZodString;
731
+ schema: z.ZodNullable<z.ZodString>;
732
+ }, z.core.$strip>;
733
+ detail: z.ZodString;
734
+ severity: z.ZodEnum<{
735
+ critical: "critical";
736
+ warning: "warning";
737
+ info: "info";
738
+ }>;
739
+ }, z.core.$strip>>;
740
+ }, z.core.$strip>>;
741
+ checks: z.ZodArray<z.ZodObject<{
742
+ type: z.ZodEnum<{
743
+ health: "health";
744
+ security: "security";
745
+ performance: "performance";
746
+ }>;
747
+ status: z.ZodEnum<{
748
+ unavailable: "unavailable";
749
+ complete: "complete";
750
+ }>;
751
+ reason: z.ZodOptional<z.ZodString>;
752
+ }, z.core.$strip>>;
753
+ }, z.core.$strip>;
754
+ readonly annotations: {
755
+ readonly title: "Get project issues";
756
+ readonly readOnlyHint: true;
757
+ readonly destructiveHint: false;
758
+ readonly idempotentHint: true;
759
+ readonly openWorldHint: false;
760
+ };
761
+ };
692
762
  readonly get_logs: {
693
763
  readonly description: "Gets logs for a Supabase project by service type. When the user asks about a specific time range, always pass iso_timestamp_start and iso_timestamp_end to match it; otherwise each call defaults to the last 24 hours and will return logs from a wider window than intended. The window must be 24 hours or less and iso_timestamp_start must be before iso_timestamp_end; other windows are rejected. If you pass only iso_timestamp_start, the end defaults to now, so for a past time range pass both timestamps. For a longer range, make one call per 24-hour slice. Edge Function logs are split by kind: `edge-function` returns invocation/request logs, while `edge-function-runtime` returns console output from inside the function. Query one service first, then correlate with other services by timestamp or error anchors. Do not poll get_logs in a loop.";
694
764
  readonly parameters: z.ZodObject<{
@@ -737,7 +807,7 @@ declare const debuggingToolDefs: {
737
807
  };
738
808
  };
739
809
  readonly get_advisors: {
740
- readonly description: "Gets a list of advisory notices for the Supabase project. Use this to check for security vulnerabilities, performance improvements, or health issues. Include the remediation URL as a clickable link so that the user can reference the issue themselves. It's recommended to run this tool regularly, especially after making DDL changes to the database since it will catch things like missing RLS policies.";
810
+ readonly description: "Planned for future deprecation in favor of get_issues; remains available. Gets a list of advisory notices for the Supabase project. Use this to check for security vulnerabilities, performance improvements, or health issues. Include the remediation URL as a clickable link so that the user can reference the issue themselves.";
741
811
  readonly parameters: z.ZodObject<{
742
812
  project_id: z.ZodString;
743
813
  type: z.ZodEnum<{
@@ -806,6 +876,7 @@ declare const developmentToolDefs: {
806
876
  readonly description: "Generates TypeScript types for a project.";
807
877
  readonly parameters: z.ZodObject<{
808
878
  project_id: z.ZodString;
879
+ schemas: z.ZodOptional<z.ZodArray<z.ZodString>>;
809
880
  }, z.core.$strip>;
810
881
  readonly outputSchema: z.ZodObject<{
811
882
  types: z.ZodString;
@@ -1795,6 +1866,7 @@ declare const supabaseMcpToolSchemas: {
1795
1866
  generate_typescript_types: {
1796
1867
  inputSchema: z.ZodObject<{
1797
1868
  project_id: z.ZodString;
1869
+ schemas: z.ZodOptional<z.ZodArray<z.ZodString>>;
1798
1870
  }, z.core.$strip>;
1799
1871
  outputSchema: z.ZodObject<{
1800
1872
  types: z.ZodString;
@@ -1809,6 +1881,77 @@ declare const supabaseMcpToolSchemas: {
1809
1881
  readOnlyBehavior: undefined;
1810
1882
  hidden: undefined;
1811
1883
  };
1884
+ get_issues: {
1885
+ inputSchema: z.ZodObject<{
1886
+ project_id: z.ZodString;
1887
+ type: z.ZodDefault<z.ZodEnum<{
1888
+ health: "health";
1889
+ all: "all";
1890
+ security: "security";
1891
+ performance: "performance";
1892
+ }>>;
1893
+ severity: z.ZodDefault<z.ZodEnum<{
1894
+ critical: "critical";
1895
+ warning: "warning";
1896
+ info: "info";
1897
+ }>>;
1898
+ }, z.core.$strip>;
1899
+ outputSchema: z.ZodObject<{
1900
+ issues: z.ZodArray<z.ZodObject<{
1901
+ id: z.ZodString;
1902
+ title: z.ZodString;
1903
+ description: z.ZodString;
1904
+ severity: z.ZodEnum<{
1905
+ critical: "critical";
1906
+ warning: "warning";
1907
+ info: "info";
1908
+ }>;
1909
+ category: z.ZodEnum<{
1910
+ health: "health";
1911
+ security: "security";
1912
+ performance: "performance";
1913
+ }>;
1914
+ source: z.ZodLiteral<"lint">;
1915
+ docs_url: z.ZodString;
1916
+ affected_count: z.ZodNumber;
1917
+ affected: z.ZodArray<z.ZodObject<{
1918
+ id: z.ZodString;
1919
+ resource: z.ZodObject<{
1920
+ type: z.ZodString;
1921
+ name: z.ZodString;
1922
+ schema: z.ZodNullable<z.ZodString>;
1923
+ }, z.core.$strip>;
1924
+ detail: z.ZodString;
1925
+ severity: z.ZodEnum<{
1926
+ critical: "critical";
1927
+ warning: "warning";
1928
+ info: "info";
1929
+ }>;
1930
+ }, z.core.$strip>>;
1931
+ }, z.core.$strip>>;
1932
+ checks: z.ZodArray<z.ZodObject<{
1933
+ type: z.ZodEnum<{
1934
+ health: "health";
1935
+ security: "security";
1936
+ performance: "performance";
1937
+ }>;
1938
+ status: z.ZodEnum<{
1939
+ unavailable: "unavailable";
1940
+ complete: "complete";
1941
+ }>;
1942
+ reason: z.ZodOptional<z.ZodString>;
1943
+ }, z.core.$strip>>;
1944
+ }, z.core.$strip>;
1945
+ annotations: {
1946
+ readonly title: "Get project issues";
1947
+ readonly readOnlyHint: true;
1948
+ readonly destructiveHint: false;
1949
+ readonly idempotentHint: true;
1950
+ readonly openWorldHint: false;
1951
+ };
1952
+ readOnlyBehavior: undefined;
1953
+ hidden: undefined;
1954
+ };
1812
1955
  get_logs: {
1813
1956
  inputSchema: z.ZodObject<{
1814
1957
  project_id: z.ZodString;