Skip to main content
Glama
HenkDz

Self-Hosted Supabase MCP Server

get_service_key

Retrieve the Supabase service role key to authenticate and manage self-hosted database operations within development environments.

Instructions

Returns the configured Supabase service role key for this server, if available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The execute function implementing the core logic of the 'get_service_key' tool. It fetches the service role key from the client context and returns a status object indicating if it was found and the key itself.
    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) and output structure for the 'get_service_key' tool.
    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 map used by the MCP server.
    [getServiceKeyTool.name]: getServiceKeyTool as AppTool,
  • Supporting getter method in SelfhostedSupabaseClient that provides the configured Supabase service role key, used by the tool handler.
    public getServiceRoleKey(): string | undefined {
        return this.options.supabaseServiceRoleKey;
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool returns a key 'if available,' which adds some context about potential failure modes, but doesn't cover other critical aspects like authentication requirements, rate limits, error handling, or what the return value looks like (e.g., format, structure). For a tool that handles sensitive data (service role key), this is a significant gap in transparency.

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 ('Returns the configured Supabase service role key') and a key condition ('if available'). It is front-loaded with the main action and avoids any redundant or verbose language, making it highly concise and easy to parse.

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

Completeness2/5

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

Given the tool's complexity (handling a sensitive service role key), lack of annotations, and no output schema, the description is insufficiently complete. It doesn't explain the return format, error conditions beyond availability, security implications, or how this tool differs from siblings like 'get_anon_key.' For a tool in this context, more detail is needed to ensure safe and correct usage by an AI agent.

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 the input schema has 100% description coverage (though empty). In such cases, the baseline score is 4, as there are no parameters to document. The description doesn't need to compensate for any parameter gaps, and it appropriately focuses on the tool's purpose without unnecessary parameter 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 tool's purpose with a specific verb ('Returns') and resource ('configured Supabase service role key'), making it immediately understandable. It distinguishes itself from siblings like 'get_anon_key' by specifying the service role key, though it doesn't explicitly contrast with all similar tools. The purpose is not vague or tautological, but could be slightly more specific about what 'this server' refers to.

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 condition, but doesn't explain when the key might be unavailable or what to do in such cases. There are no explicit when/when-not instructions or named alternatives, leaving usage context largely implied.

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

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