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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/get_anon_key.ts:28-32 (handler)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 }; },
- src/tools/get_anon_key.ts:5-12 (schema)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,
- src/client/index.ts:347-349 (helper)Public getter method on SelfhostedSupabaseClient that returns the configured supabaseAnonKey.public getAnonKey(): string { return this.options.supabaseAnonKey; }