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';
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool returns a key 'if available', implying it may not always succeed, but doesn't specify error conditions, authentication requirements, or rate limits. For a tool that retrieves sensitive configuration data, this lack of detail on permissions or failure modes is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that efficiently conveys the core functionality. It is front-loaded with the main action ('Returns') and includes essential qualifiers ('configured', 'if available') without redundancy. Every word earns its place, making it highly concise and clear.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is adequate but has clear gaps. It explains what the tool does but lacks details on usage context, behavioral traits, or output format. For a tool that retrieves a sensitive key, more information on security implications or error handling would improve completeness, though the minimal nature of the tool keeps it from being severely inadequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so there are no parameters to document. The description doesn't need to add parameter semantics, and it correctly doesn't mention any. Baseline is 4 for zero parameters, as the description appropriately focuses on the tool's purpose without unnecessary param details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Returns') and resource ('configured Supabase service role key for this server'), making the purpose specific and understandable. It distinguishes from siblings like 'get_anon_key' by specifying 'service role key' rather than 'anon key', though it doesn't explicitly contrast them. The description avoids tautology and is not misleading.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_anon_key' or other sibling tools. It mentions 'if available', which hints at a prerequisite but doesn't explain what conditions make it available or when to choose this over other key-related tools. No explicit when/when-not or alternative recommendations are included.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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