get_service_key
Retrieve the Supabase service role key configured for the Self-Hosted Supabase MCP Server to enable secure access and management of database operations, migrations, and storage.
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 retrieves the service role key from the SelfhostedSupabaseClient in the context.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:5-13 (schema)Input (empty object) and output Zod schemas defining the expected inputs and outputs for the tool.// Input schema (none needed) 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)The getServiceKeyTool is registered in the availableTools map, making it available to the MCP server handlers.[getServiceKeyTool.name]: getServiceKeyTool as AppTool,
- src/index.ts:20-20 (registration)Import of the getServiceKeyTool into the main index file for registration.import { getServiceKeyTool } from './tools/get_service_key.js';
- src/tools/get_service_key.ts:16-20 (schema)Static JSON schema for MCP tool capabilities (input schema).const mcpInputSchema = { type: 'object', properties: {}, required: [], };