list_extensions
Retrieve all installed PostgreSQL extensions in a self-hosted Supabase database. Enables database introspection and management for developers using MCP clients like IDE extensions.
Instructions
Lists all installed PostgreSQL extensions in the database.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/list_extensions.ts:31-56 (handler)The execute handler function for the 'list_extensions' tool. It runs a SQL query against pg_extension to list installed PostgreSQL extensions (excluding plpgsql), uses helper functions to execute and process the response.execute: async (input: ListExtensionsInput, context: ToolContext) => { const client = context.selfhostedClient; // SQL based on pg_extension const listExtensionsSql = ` SELECT pe.extname AS name, pn.nspname AS schema, pe.extversion AS version, pd.description FROM pg_catalog.pg_extension pe LEFT JOIN pg_catalog.pg_namespace pn ON pn.oid = pe.extnamespace LEFT JOIN pg_catalog.pg_description pd ON pd.objoid = pe.oid AND pd.classoid = 'pg_catalog.pg_extension'::regclass WHERE pe.extname != 'plpgsql' -- Exclude the default plpgsql extension ORDER BY pe.extname `; const result = await executeSqlWithFallback(client, listExtensionsSql, true); return handleSqlResponse(result, ListExtensionsOutputSchema); },
- src/tools/list_extensions.ts:7-16 (schema)Zod schemas defining the input (empty) and output structure (array of {name, schema, version, description?}) for the list_extensions tool.const ListExtensionsOutputSchema = z.array(z.object({ name: z.string(), schema: z.string(), version: z.string(), description: z.string().nullable().optional(), })); // Input schema (none needed for this tool) const ListExtensionsInputSchema = z.object({}); type ListExtensionsInput = z.infer<typeof ListExtensionsInputSchema>;
- src/index.ts:12-12 (registration)Import statement for the listExtensionsTool.import { listExtensionsTool } from './tools/list_extensions.js';
- src/index.ts:101-101 (registration)Registration of listExtensionsTool into the availableTools object used by the MCP server.[listExtensionsTool.name]: listExtensionsTool as AppTool,