Skip to main content
Glama
heroku

Heroku MCP server

Official
by heroku

pg_credentials

View, configure, rotate, and monitor database credentials for Heroku apps to ensure secure access and compliance with security policies. Simplify credential management for database connections.

Instructions

Manage database access credentials and security. Use this tool when you need to: 1) View current database credentials, 2) Configure database access permissions, 3) Rotate credentials for security compliance, 4) Set up monitoring access. The tool helps maintain secure database access and credential management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appYesThe name of the Heroku app whose database credentials to view.
databaseNoConfig var containing the connection string, unique name, ID, or alias of the database. To access another app's database, prepend the app name to the config var or alias with `APP_NAME::`. If omitted, DATABASE_URL is used.

Implementation Reference

  • The handler function that constructs and executes the 'pg:credentials' Heroku CLI command via CommandBuilder and HerokuREPL, then processes the output.
    async (options: PgCredentialsOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.PG_CREDENTIALS) .addFlags({ app: options.app }) .addPositionalArguments({ database: options.database }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); }
  • Zod schema and TypeScript type definition for the input options of the pg_credentials tool.
    export const pgCredentialsOptionsSchema = z.object({ app: z.string().describe('Target app name'), database: z .string() .optional() .describe('Database identifier. Format: APP_NAME::DB for other apps. Default: DATABASE_URL') }); export type PgCredentialsOptions = z.infer<typeof pgCredentialsOptionsSchema>;
  • The registration function that registers the 'pg_credentials' tool with the MCP server, including name, description, schema, and handler.
    export const registerPgCredentialsTool = (server: McpServer, herokuRepl: HerokuREPL): void => { server.tool( 'pg_credentials', 'Manage access: credentials, permissions, security, monitoring', pgCredentialsOptionsSchema.shape, async (options: PgCredentialsOptions): Promise<McpToolResponse> => { const command = new CommandBuilder(TOOL_COMMAND_MAP.PG_CREDENTIALS) .addFlags({ app: options.app }) .addPositionalArguments({ database: options.database }) .build(); const output = await herokuRepl.executeCommand(command); return handleCliOutput(output); } ); };
  • src/index.ts:81-81 (registration)
    Call to register the pg_credentials tool during MCP server setup.
    data.registerPgCredentialsTool(server, herokuRepl);
  • Constant defining the Heroku CLI command string for PG_CREDENTIALS used in the handler.
    PG_CREDENTIALS: 'pg:credentials',

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/heroku/heroku-mcp-server'

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