Skip to main content
Glama
HenkDz

Self-Hosted Supabase MCP Server

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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' }; },
  • 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,
  • 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;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/HenkDz/selfhosted-supabase-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server