Skip to main content
Glama
abushadab

Self-Hosted Supabase MCP Server

by abushadab

get_service_key

Retrieve the Supabase service role key from the Self-Hosted MCP Server to enable secure access and management of Supabase features and database interactions.

Instructions

Returns the configured Supabase service role key for this server, if available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The execute handler function for the 'get_service_key' tool. It retrieves the Supabase service role key from the SelfhostedSupabaseClient context if available, returning status and key or just 'not_configured'.
    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 object) and output structure for the get_service_key tool, including service_key_status and optional service_key.
    // 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)
    Registration of the getServiceKeyTool in the availableTools object, which is used to populate the MCP server's tool capabilities and request handlers.
    [getServiceKeyTool.name]: getServiceKeyTool as AppTool,
  • src/index.ts:20-20 (registration)
    Import statement for the getServiceKeyTool from its implementation file.
    import { getServiceKeyTool } from './tools/get_service_key.js';

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/abushadab/selfhosted-supabase-mcp-basic-auth'

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