
Heroku MCP Server
OfficialManage Heroku apps, dynos, add-ons, pipelines, and Postgres from your AI agent via the official Heroku CLI.
Add to your client
Copy the config for your MCP client and paste it into its config file.
npx -y @heroku/mcp-serverPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"heroku-mcp-server": {
"command": "npx",
"args": [
"-y",
"@heroku/mcp-server"
],
"env": {
"HEROKU_API_KEY": "<your-heroku-auth-token>"
}
}
}
}Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Heroku CLI v10.8.1 or higher installed globally (required for heroku mcp:start; verify with heroku --version)
- A Heroku account; for the npx mode, an auth token from heroku authorizations:create set as HEROKU_API_KEY
- Node.js with npx for the @heroku/mcp-server launch mode
About Heroku MCP Server
Heroku's MCP server is built and maintained by Heroku itself (repo under the heroku GitHub org, Apache-2.0) and leans on the Heroku CLI rather than reimplementing platform APIs. That is why the CLI v10.8.1+ is a hard prerequisite: the recommended launch command is literally heroku mcp:start, which inherits your current CLI login so no API key ever lands in a config file.
The tool surface maps closely to day-2 operations. Application management covers list/info/create/rename/transfer plus deploy_to_heroku (app.json-driven, team and private-space aware) and deploy_one_off_dyno, which executes code or commands in a sandboxed one-off dyno with file creation, network access, and automatic cleanup. Process tools handle dyno listing, scaling, resizing, and restarts; separate groups cover add-ons, maintenance mode, logs, pipelines (create/promote/list/info), teams, and private spaces.
The Postgres group is the differentiator versus generic cloud MCP servers: pg_psql for arbitrary SQL, pg_locks for blocking transactions, pg_outliers for resource-hungry queries, plus credentials, backups, kill, maintenance, and upgrade tools. For an agent doing incident triage — 'why is the app slow, show me blocking queries, restart the worker dynos' — the whole loop happens over MCP.
Heroku labels the project early-development, and the tool list may evolve. A MCP_SERVER_REQUEST_TIMEOUT env var (default 15s) guards long commands. The practical trade-off: everything executes with your full CLI identity, so permissioning is all-or-nothing per token.
Tools & capabilities (32)
list_appsList Heroku apps, filterable by personal, collaborator, team, or space.
get_app_infoDetailed app info including configuration, dynos, and add-ons.
create_appCreate an app with region, team, and space settings.
rename_appRename an existing app.
transfer_appTransfer app ownership to another user or team.
deploy_to_herokuDeploy projects with app.json configuration, supporting teams, private spaces, and environment setup.
deploy_one_off_dynoRun code or commands in a sandboxed one-off dyno with file creation, network access, env vars, and auto cleanup.
ps_listList all dynos for an app.
ps_scaleScale dyno counts up/down or resize dynos.
ps_restartRestart specific dynos, process types, or all dynos.
list_addonsList add-ons across apps or for one app.
get_addon_infoDetailed information about a specific add-on.
create_addonProvision a new add-on for an app.
maintenance_onEnable maintenance mode for an app.
maintenance_offDisable maintenance mode for an app.
get_app_logsView application logs.
pipelines_createCreate a new pipeline.
pipelines_promotePromote apps to the next pipeline stage.
pipelines_listList available pipelines.
pipelines_infoDetailed pipeline information.
list_teamsList teams you belong to.
list_private_spacesList available private spaces.
pg_psqlExecute SQL queries against Heroku PostgreSQL.
pg_infoDetailed database information.
pg_psView active queries and execution details.
pg_locksView locks and identify blocking transactions.
pg_outliersIdentify resource-intensive queries.
pg_credentialsManage database credentials and access.
pg_killTerminate specific database processes.
pg_maintenanceShow database maintenance information.
pg_backupsManage database backups and schedules.
pg_upgradeUpgrade PostgreSQL to a newer version.
What this server can do
Heroku MCP Server provides tools for these capabilities — tap one to see every MCP server that does the same:
When to use it
- Incident triage in chat: check logs, find blocking Postgres queries, restart dynos
- Deploy a project to Heroku from an agent using app.json configuration
- Run one-off scripts or tests in a disposable dyno sandbox
- Scale dynos and provision add-ons as part of an agent-driven release workflow
Quick setup
- 1Install or upgrade the Heroku CLI to v10.8.1+ and run heroku login
- 2Recommended: add {"command": "heroku mcp:start"} under mcpServers — no API key needed
- 3Alternative: generate a token with heroku authorizations:create
- 4Add {"command": "npx", "args": ["-y", "@heroku/mcp-server"], "env": {"HEROKU_API_KEY": "<token>"}} to your MCP config
- 5Optionally set MCP_SERVER_REQUEST_TIMEOUT (ms, default 15000) for slow commands
Security notes
Tools can create, scale, transfer, and deploy real apps and run SQL against production Postgres — an agent mistake costs money or data, so review tool calls before approving. Prefer heroku mcp:start (no token in config); if you use HEROKU_API_KEY, scope it via heroku authorizations:create rather than pasting your account's long-lived token.
Heroku MCP Server FAQ
Is the Heroku MCP server safe to connect to production?
It executes with the full privileges of your CLI session or auth token — including app deletion-adjacent operations like transfers, scaling, and live SQL via pg_psql. Use heroku mcp:start to avoid storing tokens, keep human approval on write operations, and consider a dedicated authorization token you can revoke.
Do I need the Heroku CLI even when using npx?
Yes. The server is built around the Heroku CLI and requires v10.8.1+ installed globally. The npx package handles the MCP wiring, while heroku mcp:start additionally reuses your CLI authentication.
How do I get a HEROKU_API_KEY?
Run heroku authorizations:create (or heroku auth:token for the current session token), or create an authorization under Account Settings → Applications in the dashboard. Put the value in the env block of your MCP config.
Alternatives to Heroku MCP Server
Compare all alternatives →GitHub's official server for repos, issues, PRs, and Actions — local Docker or hosted remote.
Official AWS Labs server that lets agents call any AWS API via the AWS CLI surface.
Bulk Kubernetes port forwarding with an MCP server that lets AI assistants forward services, inspect pods, and monitor traffic.
Compare Heroku MCP Server with: