Skip to main content
Glama

Self-Hosted Supabase MCP Server

by abushadab
get_service_key.ts1.4 kB
import { z } from 'zod'; import type { SelfhostedSupabaseClient } from '../client/index.js'; import type { ToolContext } from './types.js'; // 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).'), }); // Static JSON Schema for MCP capabilities const mcpInputSchema = { type: 'object', properties: {}, required: [], }; // The tool definition export const getServiceKeyTool = { name: 'get_service_key', description: 'Returns the configured Supabase service role key for this server, if available.', inputSchema: GetServiceKeyInputSchema, mcpInputSchema: mcpInputSchema, outputSchema: GetServiceKeyOutputSchema, 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' }; }, };

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