Skip to main content
Glama
HenkDz

Self-Hosted Supabase MCP Server

get_anon_key

Retrieve the configured Supabase anon key to enable secure interactions with a self-hosted Supabase instance via MCP clients for database management and development tasks.

Instructions

Returns the configured Supabase anon key for this server.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The execute function implementing the core logic of the 'get_anon_key' tool, which extracts the anon key from the provided client context.
    execute: async (input: GetAnonKeyInput, context: ToolContext) => { const client = context.selfhostedClient; const key = client.getAnonKey(); // Use getter from client return { anon_key: key }; },
  • Zod schemas defining the empty input and output structure (anon_key string) for the get_anon_key tool.
    // 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:107-109 (registration)
    Registration of the getAnonKeyTool in the availableTools object used by the MCP server.
    [getProjectUrlTool.name]: getProjectUrlTool as AppTool, [getAnonKeyTool.name]: getAnonKeyTool as AppTool, [getServiceKeyTool.name]: getServiceKeyTool as AppTool,
  • Helper method on SelfhostedSupabaseClient that provides the anon key, used by the tool handler.
    public getAnonKey(): string { return this.options.supabaseAnonKey; }
  • src/index.ts:19-19 (registration)
    Import statement for the getAnonKeyTool in the main index file.
    import { getAnonKeyTool } from './tools/get_anon_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/HenkDz/selfhosted-supabase-mcp'

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