Skip to main content
Glama
HenkDz

Self-Hosted Supabase MCP Server

get_anon_key

Retrieve the configured anonymous access key for secure, read-only database operations in self-hosted Supabase environments.

Instructions

Returns the configured Supabase anon key for this server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async execute function implementing the get_anon_key tool logic: extracts the client from context, calls client.getAnonKey(), and returns the key wrapped in an object.
    execute: async (input: GetAnonKeyInput, context: ToolContext) => { const client = context.selfhostedClient; const key = client.getAnonKey(); // Use getter from client return { anon_key: key }; },
  • Zod input schema (empty object, no parameters) and output schema defining anon_key as string.
    // Input schema (none needed) const GetAnonKeyInputSchema = z.object({}); type GetAnonKeyInput = z.infer<typeof GetAnonKeyInputSchema>; // Output schema const GetAnonKeyOutputSchema = z.object({ anon_key: z.string(), });
  • src/index.ts:108-108 (registration)
    Registers the getAnonKeyTool in the availableTools object by name, cast to AppTool interface.
    [getAnonKeyTool.name]: getAnonKeyTool as AppTool,
  • Public getter method on SelfhostedSupabaseClient that returns the configured supabaseAnonKey.
    public getAnonKey(): string { return this.options.supabaseAnonKey; }

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