get_service_key
Retrieve the Supabase service role key to authenticate and manage self-hosted database operations within development environments.
Instructions
Returns the configured Supabase service role key for this server, if available.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/get_service_key.ts:29-36 (handler)The execute function implementing the core logic of the 'get_service_key' tool. It fetches the service role key from the client context and returns a status object indicating if it was found and the key itself.execute: async (input: GetServiceKeyInput, context: ToolContext) => { const client = context.selfhostedClient; const key = client.getServiceRoleKey(); if (key) { return { service_key_status: 'found', service_key: key }; } return { service_key_status: 'not_configured' }; },
- src/tools/get_service_key.ts:6-13 (schema)Zod schemas defining the input (empty) and output structure for the 'get_service_key' tool.const GetServiceKeyInputSchema = z.object({}); type GetServiceKeyInput = z.infer<typeof GetServiceKeyInputSchema>; // Output schema const GetServiceKeyOutputSchema = z.object({ service_key_status: z.enum(['found', 'not_configured']).describe('Whether the service key was provided to the server.'), service_key: z.string().optional().describe('The configured Supabase service role key (if configured).'), });
- src/index.ts:109-109 (registration)Registration of the getServiceKeyTool in the availableTools map used by the MCP server.[getServiceKeyTool.name]: getServiceKeyTool as AppTool,
- src/client/index.ts:351-352 (helper)Supporting getter method in SelfhostedSupabaseClient that provides the configured Supabase service role key, used by the tool handler.public getServiceRoleKey(): string | undefined { return this.options.supabaseServiceRoleKey;