Heroku MCP server

Official

pg_psql

Run SQL queries to analyze, modify, or troubleshoot Heroku PostgreSQL databases. Execute commands or file-based queries with credential management for direct database access.

Instructions

Execute SQL queries against Heroku PostgreSQL databases. Use this tool when you need to: 1) Run SQL queries for database analysis, 2) Investigate database locks and performance, 3) Make schema modifications or updates, 4) Execute complex database operations. The tool provides direct SQL access with support for file-based queries and credential management.

Input Schema

NameRequiredDescriptionDefault
appYesapp to run command against
commandNoSQL command to run; file is ignored if provided; must be single line; must supply either command or file
credentialNocredential to use
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.
fileNoSQL file to run; command is ignored if provided; must be an absolute path; must supply either command or file

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "app": { "description": "app to run command against", "type": "string" }, "command": { "description": "SQL command to run; file is ignored if provided; must be single line; must supply either command or file", "type": "string" }, "credential": { "description": "credential to use", "type": "string" }, "database": { "description": "Config 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.", "type": "string" }, "file": { "description": "SQL file to run; command is ignored if provided; must be an absolute path; must supply either command or file", "type": "string" } }, "required": [ "app" ], "type": "object" }
ID: c1gtn2x5d2