@supabase/mcp-server-supabase 0.18.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 (57) hide show
  1. package/dist/chunk-6CWFTRTZ.js +17 -0
  2. package/dist/chunk-6CWFTRTZ.js.map +1 -0
  3. package/dist/{chunk-TK2UZS5X.cjs → chunk-A5FTNCK3.cjs} +11 -26
  4. package/dist/chunk-A5FTNCK3.cjs.map +1 -0
  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-SS4B4LYS.js +50 -0
  16. package/dist/chunk-SS4B4LYS.js.map +1 -0
  17. package/dist/chunk-VV4YSLRO.cjs +1 -0
  18. package/dist/{chunk-PHWSETKC.cjs.map → chunk-VV4YSLRO.cjs.map} +1 -1
  19. package/dist/chunk-W6H5VMAV.js +1 -0
  20. package/dist/cli.cjs +1 -1
  21. package/dist/cli.js +1 -1
  22. package/dist/index.cjs +1 -1
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +177 -21
  25. package/dist/index.d.ts +177 -21
  26. package/dist/index.js +1 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/platform/api-platform.cjs +1 -1
  29. package/dist/platform/api-platform.d.cts +1 -1
  30. package/dist/platform/api-platform.d.ts +1 -1
  31. package/dist/platform/api-platform.js +1 -1
  32. package/dist/platform/index.cjs +1 -1
  33. package/dist/platform/index.cjs.map +1 -1
  34. package/dist/platform/index.d.cts +14 -576
  35. package/dist/platform/index.d.ts +14 -576
  36. package/dist/platform/index.js +1 -1
  37. package/dist/types-Ckih0oCv.d.cts +592 -0
  38. package/dist/types-Ckih0oCv.d.ts +592 -0
  39. package/package.json +4 -2
  40. package/dist/chunk-6FWRABME.cjs +0 -2
  41. package/dist/chunk-6FWRABME.cjs.map +0 -1
  42. package/dist/chunk-BTGEP5EB.js +0 -65
  43. package/dist/chunk-BTGEP5EB.js.map +0 -1
  44. package/dist/chunk-DIWVSO7X.cjs +0 -2
  45. package/dist/chunk-DIWVSO7X.cjs.map +0 -1
  46. package/dist/chunk-DP5DAOXI.cjs +0 -295
  47. package/dist/chunk-DP5DAOXI.cjs.map +0 -1
  48. package/dist/chunk-JIUJWRLL.js +0 -2
  49. package/dist/chunk-JIUJWRLL.js.map +0 -1
  50. package/dist/chunk-LL3YUIO5.js +0 -2
  51. package/dist/chunk-LL3YUIO5.js.map +0 -1
  52. package/dist/chunk-LU6L7C36.js +0 -1
  53. package/dist/chunk-PHWSETKC.cjs +0 -1
  54. package/dist/chunk-TK2UZS5X.cjs.map +0 -1
  55. package/dist/chunk-WOFMZZMH.js +0 -295
  56. package/dist/chunk-WOFMZZMH.js.map +0 -1
  57. /package/dist/{chunk-LU6L7C36.js.map → chunk-W6H5VMAV.js.map} +0 -0
@@ -0,0 +1,50 @@
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
+ 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
+ from logs
4
+ where source = 'edge_logs'
5
+ order by timestamp desc
6
+ limit ${e}
7
+ `;case"branch-action":return r`
8
+ select log_attributes['workflow_run'] as workflow_run, timestamp, id, event_message
9
+ from logs
10
+ where source = 'workflow_run_logs'
11
+ order by timestamp desc
12
+ limit ${e}
13
+ `;case"postgres":return r`
14
+ select log_attributes['identifier'] as identifier, timestamp, id, event_message, log_attributes['parsed.error_severity'] as error_severity
15
+ from logs
16
+ where source = 'postgres_logs'
17
+ order by timestamp desc
18
+ limit ${e}
19
+ `;case"edge-function":return r`
20
+ 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
21
+ from logs
22
+ where source = 'function_edge_logs'
23
+ order by timestamp desc
24
+ limit ${e}
25
+ `;case"edge-function-runtime":return r`
26
+ 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
27
+ from logs
28
+ where source = 'function_logs'
29
+ order by timestamp desc
30
+ limit ${e}
31
+ `;case"auth":return r`
32
+ 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
33
+ from logs
34
+ where source = 'auth_logs'
35
+ order by timestamp desc
36
+ limit ${e}
37
+ `;case"storage":return r`
38
+ select id, timestamp, event_message
39
+ from logs
40
+ where source = 'storage_logs'
41
+ order by timestamp desc
42
+ limit ${e}
43
+ `;case"realtime":return r`
44
+ select id, timestamp, event_message
45
+ from logs
46
+ where source = 'realtime_logs'
47
+ order by timestamp desc
48
+ limit ${e}
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-SS4B4LYS.js.map
@@ -0,0 +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.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":"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","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"]}
@@ -0,0 +1 @@
1
+ "use strict";//# sourceMappingURL=chunk-VV4YSLRO.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/chunk-PHWSETKC.cjs"],"names":[],"mappings":"AAAA","file":"/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/chunk-PHWSETKC.cjs"}
1
+ {"version":3,"sources":["/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/chunk-VV4YSLRO.cjs"],"names":[],"mappings":"AAAA","file":"/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/chunk-VV4YSLRO.cjs"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=chunk-W6H5VMAV.js.map
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 _chunkDP5DAOXIcjs = require('./chunk-DP5DAOXI.cjs');var _chunkDIWVSO7Xcjs = require('./chunk-DIWVSO7X.cjs');var _chunkTK2UZS5Xcjs = require('./chunk-TK2UZS5X.cjs');require('./chunk-PHWSETKC.cjs');require('./chunk-6FWRABME.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(_chunkDP5DAOXIcjs.a)).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"||_chunkDP5DAOXIcjs.a.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=_chunkDP5DAOXIcjs.c.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.")}_chunkDP5DAOXIcjs.e.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=_chunkDIWVSO7Xcjs.a.call(void 0, {accessToken:d,apiUrl:c});k&&_chunkDP5DAOXIcjs.d.call(void 0, L,k);let O=_server.createMcpHandler.call(void 0, ()=>_chunkDP5DAOXIcjs.h.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:_chunkDP5DAOXIcjs.a.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}=_chunkTK2UZS5Xcjs.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=_chunkDIWVSO7Xcjs.a.call(void 0, {accessToken:f,apiUrl:t});a&&_chunkDP5DAOXIcjs.d.call(void 0, d,a),_stdio.serveStdio.call(void 0, ()=>_chunkDP5DAOXIcjs.h.call(void 0, {platform:d,projectId:c,readOnly:i,features:a,contentApiUrl:s,dashboardUrl:_chunkDP5DAOXIcjs.c.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{a as S,c as _,d as A,e as R,h as b}from"./chunk-WOFMZZMH.js";import{a as E}from"./chunk-JIUJWRLL.js";import{a as v}from"./chunk-BTGEP5EB.js";import"./chunk-LU6L7C36.js";import"./chunk-LL3YUIO5.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 _chunkDP5DAOXIcjs = require('./chunk-DP5DAOXI.cjs');var _chunkTK2UZS5Xcjs = require('./chunk-TK2UZS5X.cjs');require('./chunk-6FWRABME.cjs');var _mcputils = require('@supabase/mcp-utils');var _server = require('@modelcontextprotocol/server');function i(o){return _server.createMcpHandler.call(void 0, ()=>_chunkDP5DAOXIcjs.h.call(void 0, o),{legacy:"reject"})}var O=_chunkTK2UZS5Xcjs.a.version;exports.CURRENT_ELICITATION_TOOLS = _chunkDP5DAOXIcjs.a; exports.CURRENT_FEATURE_GROUPS = _chunkDP5DAOXIcjs.b; exports.ToolCallerError = _mcputils.ToolCallerError; exports.createFeedbackOperations = _chunkTK2UZS5Xcjs.h; exports.createSupabaseMcpHandler = i; exports.createSupabaseMcpServer = _chunkDP5DAOXIcjs.h; exports.createToolSchemas = _chunkDP5DAOXIcjs.g; exports.isToolCallerError = _mcputils.isToolCallerError; exports.supabaseMcpToolSchemas = _chunkDP5DAOXIcjs.f; exports.version = O;
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
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/index.cjs","../src/index.ts","../src/transports/http.ts"],"names":["createSupabaseMcpHandler","options","createMcpHandler","createSupabaseMcpServer","version","package_default"],"mappings":"AAAA,iIAA+D,wDAAgD,gCAA6B,+CCgBrI,sDChB0B,SASjBA,CAAAA,CAAyBC,CAAAA,CAAmC,CAC1E,OAAOC,sCAAAA,CAAiB,CAAA,EAAMC,iCAAAA,CAA+B,CAAA,CAAG,CAC9D,MAAA,CAAQ,QACV,CAAC,CACH,CDqBO,IAAMC,CAAAA,CAAUC,mBAAAA,CAAY,OAAA,CAAA,6eAAA","file":"/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/index.cjs","sourcesContent":[null,"import packageJson from '../package.json' with { type: 'json' };\n\nexport type {\n ObservationContext,\n ObservationEnd,\n ObservationFact,\n ObservedMethod,\n ObservedTool,\n ConfirmationFeature,\n RequestObservation,\n RequestObserver,\n} from './observation.js';\nexport {\n isToolCallerError,\n ToolCallerError,\n type ToolCallerErrorKind,\n} from '@supabase/mcp-utils';\nexport type { ToolCallCallback } from '@supabase/mcp-utils';\nexport {\n createFeedbackOperations,\n type FeedbackOperationsOptions,\n} from './platform/feedback.js';\nexport type { FeedbackOperations, SupabasePlatform } from './platform/index.js';\nexport {\n createSupabaseMcpServer,\n type SupabaseMcpServerOptions,\n} from './server.js';\nexport { createSupabaseMcpHandler } from './transports/http.js';\nexport {\n CURRENT_ELICITATION_TOOLS,\n CURRENT_FEATURE_GROUPS,\n type ElicitationToolName,\n type FeatureGroup,\n} from './types.js';\nexport const version = packageJson.version;\n\nexport {\n createToolSchemas,\n supabaseMcpToolSchemas,\n} from './tools/tool-schemas.js';\n","import { createMcpHandler } from '@modelcontextprotocol/server';\n\nimport {\n createSupabaseMcpServer,\n type SupabaseMcpServerOptions,\n} from '../server.js';\n\n// Modern protocol only: created with `legacy: 'reject'`, so a client that\n// speaks just the 2025-era protocol gets an HTTP 400 instead of being served.\nexport function createSupabaseMcpHandler(options: SupabaseMcpServerOptions) {\n return createMcpHandler(() => createSupabaseMcpServer(options), {\n legacy: 'reject',\n });\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/index.cjs","../src/index.ts","../src/transports/http.ts"],"names":["createSupabaseMcpHandler","options","createMcpHandler","createSupabaseMcpServer","version","package_default"],"mappings":"AAAA,iIAAwE,wDAAgD,gCAA6B,+CCgB9I,sDChB0B,SASjBA,CAAAA,CAAyBC,CAAAA,CAAmC,CAC1E,OAAOC,sCAAAA,CAAiB,CAAA,EAAMC,iCAAAA,CAA+B,CAAA,CAAG,CAC9D,MAAA,CAAQ,QACV,CAAC,CACH,CDqBO,IAAMC,CAAAA,CAAUC,mBAAAA,CAAY,OAAA,CAAA,slBAAA","file":"/home/runner/work/mcp/mcp/packages/mcp-server-supabase/dist/index.cjs","sourcesContent":[null,"import packageJson from '../package.json' with { type: 'json' };\n\nexport type {\n ObservationContext,\n ObservationEnd,\n ObservationFact,\n ObservedMethod,\n ObservedTool,\n ConfirmationFeature,\n RequestObservation,\n RequestObserver,\n} from './observation.js';\nexport {\n isToolCallerError,\n ToolCallerError,\n type ToolCallerErrorKind,\n} from '@supabase/mcp-utils';\nexport type { ToolCallCallback } from '@supabase/mcp-utils';\nexport {\n createFeedbackOperations,\n type FeedbackOperationsOptions,\n} from './platform/feedback.js';\nexport type { FeedbackOperations, SupabasePlatform } from './platform/index.js';\nexport {\n createSupabaseMcpServer,\n type SupabaseMcpServerOptions,\n} from './server.js';\nexport { createSupabaseMcpHandler } from './transports/http.js';\nexport {\n CURRENT_ELICITATION_TOOLS,\n CURRENT_FEATURE_GROUPS,\n type ElicitationToolName,\n type FeatureGroup,\n} from './types.js';\nexport const version = packageJson.version;\n\nexport {\n createToolSchemas,\n supabaseMcpToolSchemas,\n} from './tools/tool-schemas.js';\nexport {\n CREATE_BRANCH_UI_URI,\n CREATE_PROJECT_UI_URI,\n} from './resources/app-resources.js';\n","import { createMcpHandler } from '@modelcontextprotocol/server';\n\nimport {\n createSupabaseMcpServer,\n type SupabaseMcpServerOptions,\n} from '../server.js';\n\n// Modern protocol only: created with `legacy: 'reject'`, so a client that\n// speaks just the 2025-era protocol gets an HTTP 400 instead of being served.\nexport function createSupabaseMcpHandler(options: SupabaseMcpServerOptions) {\n return createMcpHandler(() => createSupabaseMcpServer(options), {\n legacy: 'reject',\n });\n}\n"]}
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 { FeedbackOperations, SupabasePlatform } from './platform/index.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
 
@@ -11,17 +11,17 @@ declare const CURRENT_FEATURE_GROUPS: readonly ["docs", "account", "database", "
11
11
  declare const featureGroupSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
12
12
  debug: "debug";
13
13
  }>, z.ZodEnum<{
14
+ storage: "storage";
15
+ database: "database";
16
+ development: "development";
17
+ feedback: "feedback";
14
18
  docs: "docs";
15
19
  account: "account";
16
- database: "database";
17
20
  debugging: "debugging";
18
- development: "development";
19
21
  functions: "functions";
20
22
  branching: "branching";
21
- storage: "storage";
22
23
  notebooks: "notebooks";
23
- feedback: "feedback";
24
- }>]>, z.ZodTransform<"docs" | "account" | "database" | "debugging" | "development" | "functions" | "branching" | "storage" | "notebooks" | "feedback", "debug" | "docs" | "account" | "database" | "debugging" | "development" | "functions" | "branching" | "storage" | "notebooks" | "feedback">>;
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.
@@ -360,6 +360,11 @@ declare const accountToolDefs: {
360
360
  created_at: z.ZodString;
361
361
  region: z.ZodString;
362
362
  }, z.core.$strip>;
363
+ readonly _meta: {
364
+ readonly ui: {
365
+ readonly resourceUri: "ui://supabase/create-project";
366
+ };
367
+ };
363
368
  readonly annotations: {
364
369
  readonly title: "Create project";
365
370
  readonly readOnlyHint: false;
@@ -431,6 +436,11 @@ declare const branchingToolDefs: {
431
436
  created_at: z.ZodString;
432
437
  updated_at: z.ZodString;
433
438
  }, z.core.$strip>;
439
+ readonly _meta: {
440
+ readonly ui: {
441
+ readonly resourceUri: "ui://supabase/create-branch";
442
+ };
443
+ };
434
444
  readonly annotations: {
435
445
  readonly title: "Create branch";
436
446
  readonly readOnlyHint: false;
@@ -679,19 +689,89 @@ declare const databaseToolDefs: {
679
689
  };
680
690
 
681
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
+ };
682
762
  readonly get_logs: {
683
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.";
684
764
  readonly parameters: z.ZodObject<{
685
765
  project_id: z.ZodString;
686
766
  service: z.ZodEnum<{
767
+ auth: "auth";
768
+ realtime: "realtime";
687
769
  storage: "storage";
688
770
  api: "api";
689
771
  "branch-action": "branch-action";
690
772
  postgres: "postgres";
691
773
  "edge-function": "edge-function";
692
774
  "edge-function-runtime": "edge-function-runtime";
693
- auth: "auth";
694
- realtime: "realtime";
695
775
  }>;
696
776
  iso_timestamp_start: z.ZodOptional<z.ZodISODateTime>;
697
777
  iso_timestamp_end: z.ZodOptional<z.ZodISODateTime>;
@@ -727,7 +807,7 @@ declare const debuggingToolDefs: {
727
807
  };
728
808
  };
729
809
  readonly get_advisors: {
730
- 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.";
731
811
  readonly parameters: z.ZodObject<{
732
812
  project_id: z.ZodString;
733
813
  type: z.ZodEnum<{
@@ -796,6 +876,7 @@ declare const developmentToolDefs: {
796
876
  readonly description: "Generates TypeScript types for a project.";
797
877
  readonly parameters: z.ZodObject<{
798
878
  project_id: z.ZodString;
879
+ schemas: z.ZodOptional<z.ZodArray<z.ZodString>>;
799
880
  }, z.core.$strip>;
800
881
  readonly outputSchema: z.ZodObject<{
801
882
  types: z.ZodString;
@@ -976,11 +1057,11 @@ declare const notebookToolDefs: {
976
1057
  text: z.ZodString;
977
1058
  }, z.core.$strict>, z.ZodObject<{
978
1059
  type: z.ZodLiteral<"database">;
979
- title: z.ZodOptional<z.ZodString>;
980
1060
  view: z.ZodOptional<z.ZodEnum<{
981
1061
  table: "table";
982
1062
  chart: "chart";
983
1063
  }>>;
1064
+ title: z.ZodOptional<z.ZodString>;
984
1065
  sql: z.ZodString;
985
1066
  row_limit: z.ZodNumber;
986
1067
  database_identifier: z.ZodOptional<z.ZodString>;
@@ -1002,11 +1083,11 @@ declare const notebookToolDefs: {
1002
1083
  }, z.core.$strict>>;
1003
1084
  }, z.core.$strict>, z.ZodObject<{
1004
1085
  type: z.ZodLiteral<"log">;
1005
- title: z.ZodOptional<z.ZodString>;
1006
1086
  view: z.ZodOptional<z.ZodEnum<{
1007
1087
  table: "table";
1008
1088
  chart: "chart";
1009
1089
  }>>;
1090
+ title: z.ZodOptional<z.ZodString>;
1010
1091
  sql: z.ZodString;
1011
1092
  time_range: z.ZodDiscriminatedUnion<[z.ZodObject<{
1012
1093
  type: z.ZodLiteral<"absolute">;
@@ -1044,8 +1125,8 @@ declare const notebookToolDefs: {
1044
1125
  }, z.core.$strip>;
1045
1126
  }, z.core.$strip>;
1046
1127
  readonly outputSchema: z.ZodObject<{
1047
- id: z.ZodString;
1048
1128
  name: z.ZodString;
1129
+ id: z.ZodString;
1049
1130
  updated_at: z.ZodString;
1050
1131
  url: z.ZodString;
1051
1132
  }, z.core.$strip>;
@@ -1154,8 +1235,8 @@ declare const notebookToolDefs: {
1154
1235
  notebook_id: z.ZodString;
1155
1236
  }, z.core.$strip>;
1156
1237
  readonly outputSchema: z.ZodObject<{
1157
- id: z.ZodString;
1158
1238
  name: z.ZodString;
1239
+ id: z.ZodString;
1159
1240
  }, z.core.$strip>;
1160
1241
  readonly annotations: {
1161
1242
  readonly title: "Delete notebook";
@@ -1332,11 +1413,11 @@ declare const supabaseMcpToolSchemas: {
1332
1413
  text: z.ZodString;
1333
1414
  }, z.core.$strict>, z.ZodObject<{
1334
1415
  type: z.ZodLiteral<"database">;
1335
- title: z.ZodOptional<z.ZodString>;
1336
1416
  view: z.ZodOptional<z.ZodEnum<{
1337
1417
  table: "table";
1338
1418
  chart: "chart";
1339
1419
  }>>;
1420
+ title: z.ZodOptional<z.ZodString>;
1340
1421
  sql: z.ZodString;
1341
1422
  row_limit: z.ZodNumber;
1342
1423
  database_identifier: z.ZodOptional<z.ZodString>;
@@ -1358,11 +1439,11 @@ declare const supabaseMcpToolSchemas: {
1358
1439
  }, z.core.$strict>>;
1359
1440
  }, z.core.$strict>, z.ZodObject<{
1360
1441
  type: z.ZodLiteral<"log">;
1361
- title: z.ZodOptional<z.ZodString>;
1362
1442
  view: z.ZodOptional<z.ZodEnum<{
1363
1443
  table: "table";
1364
1444
  chart: "chart";
1365
1445
  }>>;
1446
+ title: z.ZodOptional<z.ZodString>;
1366
1447
  sql: z.ZodString;
1367
1448
  time_range: z.ZodDiscriminatedUnion<[z.ZodObject<{
1368
1449
  type: z.ZodLiteral<"absolute">;
@@ -1400,8 +1481,8 @@ declare const supabaseMcpToolSchemas: {
1400
1481
  }, z.core.$strip>;
1401
1482
  }, z.core.$strip>;
1402
1483
  outputSchema: z.ZodObject<{
1403
- id: z.ZodString;
1404
1484
  name: z.ZodString;
1485
+ id: z.ZodString;
1405
1486
  updated_at: z.ZodString;
1406
1487
  url: z.ZodString;
1407
1488
  }, z.core.$strip>;
@@ -1513,8 +1594,8 @@ declare const supabaseMcpToolSchemas: {
1513
1594
  notebook_id: z.ZodString;
1514
1595
  }, z.core.$strip>;
1515
1596
  outputSchema: z.ZodObject<{
1516
- id: z.ZodString;
1517
1597
  name: z.ZodString;
1598
+ id: z.ZodString;
1518
1599
  }, z.core.$strip>;
1519
1600
  annotations: {
1520
1601
  readonly title: "Delete notebook";
@@ -1785,6 +1866,7 @@ declare const supabaseMcpToolSchemas: {
1785
1866
  generate_typescript_types: {
1786
1867
  inputSchema: z.ZodObject<{
1787
1868
  project_id: z.ZodString;
1869
+ schemas: z.ZodOptional<z.ZodArray<z.ZodString>>;
1788
1870
  }, z.core.$strip>;
1789
1871
  outputSchema: z.ZodObject<{
1790
1872
  types: z.ZodString;
@@ -1799,18 +1881,89 @@ declare const supabaseMcpToolSchemas: {
1799
1881
  readOnlyBehavior: undefined;
1800
1882
  hidden: undefined;
1801
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
+ };
1802
1955
  get_logs: {
1803
1956
  inputSchema: z.ZodObject<{
1804
1957
  project_id: z.ZodString;
1805
1958
  service: z.ZodEnum<{
1959
+ auth: "auth";
1960
+ realtime: "realtime";
1806
1961
  storage: "storage";
1807
1962
  api: "api";
1808
1963
  "branch-action": "branch-action";
1809
1964
  postgres: "postgres";
1810
1965
  "edge-function": "edge-function";
1811
1966
  "edge-function-runtime": "edge-function-runtime";
1812
- auth: "auth";
1813
- realtime: "realtime";
1814
1967
  }>;
1815
1968
  iso_timestamp_start: z.ZodOptional<z.ZodISODateTime>;
1816
1969
  iso_timestamp_end: z.ZodOptional<z.ZodISODateTime>;
@@ -2456,6 +2609,9 @@ declare function createToolSchemas<const Features extends readonly FeatureGroup[
2456
2609
  readOnly?: ReadOnly;
2457
2610
  }): ToolSchemasFor<Features[number], ProjectScoped, ReadOnly>;
2458
2611
 
2612
+ declare const CREATE_PROJECT_UI_URI = "ui://supabase/create-project";
2613
+ declare const CREATE_BRANCH_UI_URI = "ui://supabase/create-branch";
2614
+
2459
2615
  declare const version: string;
2460
2616
 
2461
- export { CURRENT_ELICITATION_TOOLS, CURRENT_FEATURE_GROUPS, type ConfirmationFeature, type ElicitationToolName, type FeatureGroup, FeedbackOperations, type FeedbackOperationsOptions, type ObservationContext, type ObservationFact, type ObservedTool, type RequestObservation, type RequestObserver, type SupabaseMcpServerOptions, SupabasePlatform, createFeedbackOperations, createSupabaseMcpHandler, createSupabaseMcpServer, createToolSchemas, supabaseMcpToolSchemas, version };
2617
+ export { CREATE_BRANCH_UI_URI, CREATE_PROJECT_UI_URI, CURRENT_ELICITATION_TOOLS, CURRENT_FEATURE_GROUPS, type ConfirmationFeature, type ElicitationToolName, type FeatureGroup, FeedbackOperations, type FeedbackOperationsOptions, type ObservationContext, type ObservationFact, type ObservedTool, type RequestObservation, type RequestObserver, type SupabaseMcpServerOptions, SupabasePlatform, createFeedbackOperations, createSupabaseMcpHandler, createSupabaseMcpServer, createToolSchemas, supabaseMcpToolSchemas, version };