Skip to main content
Glama
Heroku MCP server

Heroku MCP server

Official
by heroku

heroku-mcp-服务器

铁匠徽章

Heroku 平台 MCP 服务器可在 Common Runtime、Cedar Private 和 Shield Spaces 以及 Fir Private Spaces 上运行。

在 Heroku 上部署

部署

Related MCP server: ChatGPT Gateway MCP Nyan

概述

Heroku 平台 MCP 服务器是一个专门的模型上下文协议 (MCP) 实现,旨在促进大型语言模型 (LLM) 与 Heroku 平台之间的无缝交互。该服务器提供了一套强大的工具和功能,使 LLM 能够读取、管理和操作 Heroku 平台资源。

主要特点:

  • 通过 LLM 驱动的工具与 Heroku 平台资源直接交互

  • 利用 Heroku CLI 安全且经过身份验证地访问 Heroku 平台 API

  • Heroku 平台交互的自然语言界面

注意:Heroku 平台 MCP 服务器目前处于早期开发阶段。随着我们不断增强和完善其实现,可用的功能和工具可能会不断演变。我们欢迎您提供反馈和贡献,共同塑造该项目的未来。

验证

使用以下方法之一生成 Heroku 授权令牌:

  • 使用 Heroku CLI 命令:

      heroku authorizations:create
  • 在 CLI 中使用现有令牌

      heroku auth:token

    复制令牌并在以下步骤中将其用作您的HEROKU_API_KEY 。

  • 在您的Heroku 仪表板中:

    1. 选择您的头像,然后选择**“帐户设置”** 。

    2. 打开应用程序选项卡。

    3. 在**“授权”旁边,单击“创建授权”** 。

配置 Heroku 平台 MCP 服务器

您可以配置 Claude Desktop、Zed、Cursor、Windsurf 和其他程序与 Heroku Platform MCP Server 协同工作。

克劳德桌面

将此代码片段添加到您的claude_desktop_config.json中:

{
  "mcpServers": {
    "heroku": {
      "command": "npx",
      "args": ["-y", "@heroku/mcp-server"],
      "env": {
        "HEROKU_API_KEY": "<YOUR_HEROKU_AUTH_TOKEN>"
      }
    }
  }
}

泽德

将此代码片段添加到您的 Zed settings.json中:

{
  "context_servers": {
    "heroku": {
      "command": {
        "path": "npx",
        "args": ["-y", "@heroku/mcp-server"],
        "env": {
          "HEROKU_API_KEY": "<YOUR_HEROKU_AUTH_TOKEN>"
        }
      }
    }
  }
}

光标

**注意:**简单形式和显式形式均可用,但为了最大程度地兼容代理工具,密钥应该是"heroku" (而不是"heroku-mcp-server" )。

将此代码片段添加到您的 Cursor mcp.json中:

简单形式:

{
  "mcpServers": {
    "heroku": {
      "command": "npx -y @heroku/mcp-server",
      "env": {
        "HEROKU_API_KEY": "<YOUR_HEROKU_AUTH_TOKEN>"
      }
    }
  }
}

显式形式:

{
  "mcpServers": {
    "heroku": {
      "command": "npx",
      "args": ["-y", "@heroku/mcp-server"],
      "env": {
        "HEROKU_API_KEY": "<YOUR_HEROKU_AUTH_TOKEN>"
      }
    }
  }
}

风帆冲浪

将此代码片段添加到您的 Windsurf mcp_config.json中:

{
  "mcpServers": {
    "heroku": {
      "command": "npx",
      "args": ["-y", "@heroku/mcp-server"],
      "env": {
        "HEROKU_API_KEY": "<YOUR_HEROKU_AUTH_TOKEN>"
      }
    }
  }
}

克莱恩

将此代码片段添加到您的 Cline config.json :

{
  "mcpServers": {
    "heroku": {
      "command": "npx",
      "args": ["-y", "@heroku/mcp-server"],
      "env": {
        "HEROKU_API_KEY": "<YOUR_HEROKU_AUTH_TOKEN>"
      }
    }
  }
}

VSCode

将此代码片段添加到您的 VSCode settings.json或.vscode/mcp.json :

{
  "mcp": {
    "servers": {
      "heroku": {
        "type": "stdio",
        "command": "npx",
        "args": ["-y", "@heroku/mcp-server"],
        "env": {
          "HEROKU_API_KEY": "<YOUR_HEROKU_AUTH_TOKEN>"
        }
      }
    }
  }
}

特雷

将此代码片段添加到您的 Trae mcp_settings.json :

{
  "mcpServers": {
    "heroku": {
      "command": "npx",
      "args": ["-y", "@heroku/mcp-server"],
      "env": {
        "HEROKU_API_KEY": "<YOUR_HEROKU_AUTH_TOKEN>"
      }
    }
  }
}

可用工具

应用程序管理

  • list_apps - 列出所有 Heroku 应用。您可以按个人、合作者、团队或空间筛选应用。

  • get_app_info - 获取有关应用程序的详细信息,包括其配置、测功机和附加组件。

  • create_app - 创建一个具有可自定义区域、团队和空间设置的新应用程序。

  • rename_app - 重命名现有应用程序。

  • transfer_app - 将应用程序的所有权转移给另一个用户或团队。

  • deploy_to_heroku - 使用app.json配置将项目部署到 Heroku,支持团队部署、私人空间和环境设置。

  • deploy_one_off_dyno - 在 Heroku 一次性测功机的沙盒环境中执行代码或命令。支持文件创建、网络访问、环境变量和自动清理。非常适合运行脚本、测试或临时工作负载。

流程与测功机管理

  • ps_list - 列出应用程序的所有测功机。

  • ps_scale - 增加或减少测功机的数量,或者调整测功机的大小。

  • ps_restart - 重新启动特定的测功机、进程类型或所有测功机。

附加组件

  • list_addons - 列出所有应用程序或特定应用程序的所有附加组件。

  • get_addon_info - 获取有关特定附加组件的详细信息。

  • create_addon - 为应用程序提供新的附加组件。

维护和日志

  • maintenance_on - 为应用程序启用维护模式。

  • maintenance_off - 禁用应用程序的维护模式。

  • get_app_logs - 查看应用程序日志。

管道管理

  • pipelines_create创建一个新的管道。

  • pipelines_promote - 将应用程序提升到管道的下一阶段。

  • pipelines_list - 列出可用的管道。

  • pipelines_info - 获取详细的管道信息。

团队与空间管理

  • list_teams列出您所属的团队。

  • list_private_spaces - 列出可用空间。

PostgreSQL 数据库管理

  • pg_psql - 对 Heroku PostgreSQL 数据库执行 SQL 查询。

  • pg_info显示详细的数据库信息。

  • pg_ps - 查看活动查询和执行详细信息。

  • pg_locks - 查看数据库锁并识别阻塞事务。

  • pg_outliers - 识别资源密集型查询。

  • pg_credentials - 管理数据库凭证和访问权限。

  • pg_kill — 终止特定的数据库进程。

  • pg_maintenance显示数据库维护信息。

  • pg_backups - 管理数据库备份和计划。

  • pg_upgrade - 将 PostgreSQL 升级到较新的版本。

调试

您可以使用MCP 检查器或VS Code 运行和调试功能来运行和调试服务器。

  1. 使用项目根目录中的npm link将项目链接为全局 CLI。

  2. 使用npm run build:dev进行构建或监视文件更改并使用npm run build:watch自动构建。

使用 MCP 检查器

使用代码中没有断点的 MCP 检查器:

# Breakpoints are not available
npx @modelcontextprotocol/inspector heroku-mcp-server

或者,如果您将包安装在特定目录中或正在 Heroku MCP 服务器上积极开发:

cd /path/to/servers
npx @modelcontextprotocol/inspector dist/index.js

使用 VS Code 运行和调试功能

使用 VS Code Run 和 Debug 启动器,并在代码中设置功能齐全的断点:

  1. 找到并选择运行调试。

  2. 在下拉菜单中选择标有“ MCP Server Launcher ”的配置。

  3. 选择运行/调试按钮。

VS Code/光标调试设置

要设置带断点的本地调试:

  1. 将您的 Heroku 身份验证令牌存储在 VS Code 用户设置中:

    • 打开命令面板(Cmd/Ctrl + Shift + P)。

    • 类型Preferences: Open User Settings (JSON) 。

    • 添加以下代码片段:

    {
      "heroku.mcp.authToken": "your-token-here"
    }
  2. 创建或更新.vscode/launch.json :

    {
      "version": "0.2.0",
      "configurations": [
        {
          "type": "node",
          "request": "launch",
          "name": "MCP Server Launcher",
          "skipFiles": ["<node_internals>/**"],
          "program": "${workspaceFolder}/node_modules/@modelcontextprotocol/inspector/bin/cli.js",
          "outFiles": ["${workspaceFolder}/**/dist/**/*.js"],
          "env": {
            "HEROKU_API_KEY": "${config:heroku.mcp.authToken}",
            "DEBUG": "true"
          },
          "args": ["heroku-mcp-server"],
          "sourceMaps": true,
          "console": "integratedTerminal",
          "internalConsoleOptions": "neverOpen",
          "preLaunchTask": "npm: build:watch"
        },
        {
          "type": "node",
          "request": "attach",
          "name": "Attach to Debug Hook Process",
          "port": 9332,
          "skipFiles": ["<node_internals>/**"],
          "sourceMaps": true,
          "outFiles": ["${workspaceFolder}/dist/**/*.js"]
        },
        {
          "type": "node",
          "request": "attach",
          "name": "Attach to REPL Process",
          "port": 9333,
          "skipFiles": ["<node_internals>/**"],
          "sourceMaps": true,
          "outFiles": ["${workspaceFolder}/dist/**/*.js"]
        }
      ],
      "compounds": [
        {
          "name": "Attach to MCP Server",
          "configurations": ["Attach to Debug Hook Process", "Attach to REPL Process"]
        }
      ]
    }
  3. 创建.vscode/tasks.json :

    {
      "version": "2.0.0",
      "tasks": [
        {
          "type": "npm",
          "script": "build:watch",
          "group": {
            "kind": "build",
            "isDefault": true
          },
          "problemMatcher": ["$tsc"]
        }
      ]
    }
  4. (可选)在 TypeScript 文件中设置断点。

  5. 按 F5 或使用**Run and Debug**侧栏。

注意:调试器在启动之前会自动构建您的 TypeScript 文件。

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Heroku Platform MCP Server:

npx -y @smithery/cli install @heroku/heroku-mcp-server --client claude

Available Tools

33 tools
create_addonA

Create a new Heroku add-on for an application. Use this tool when you need to: 1) Provision a new add-on for your app, 2) Specify a particular service and plan, 3) Set a custom name for the add-on or attachment. The tool handles the provisioning process and returns the new add-on's details.

Inputs: app (required), serviceAndPlan (required), as, name.

create_appA

Create a new Heroku application with customizable settings. Use this tool when a user wants to: 1) Create a new app with a specific name, 2) Create an app in a particular region (US/EU), 3) Create an app within a team, or 4) Create an app in a private space. The tool handles name generation if not specified and returns the new app's details.

Inputs: app, region, space, team.

deploy_to_herokuA

Deploy projects to Heroku, replaces manual git push workflows. Use this tool when you need to: 1) Deploy a new application with specific app.json configuration, 2) Update an existing application with new code, 3) Configure team or private space deployments, or 4) Set up environment-specific configurations. The tool handles app creation, source code deployment, and environment setup. Requires valid app.json in workspace or provided via configuration. Supports team deployments, private spaces, and custom environment variables.Use apps_list tool with the "all" param to get a list of apps for the user to choose from when deploying to an existing app and the app name was not provided.

Inputs: name (required), rootUri (required), appJson, env, +4 more.

get_addon_infoA

Get comprehensive information about a Heroku add-on. Use this tool when you need to: 1) View add-on details, 2) Check plan details and state, 3) View billing information. Accepts add-on ID, name, or attachment name.

Inputs: addon (required), app.

get_app_infoA

Get comprehensive information about a Heroku application. Use this tool when you need to: 1) View app configuration and settings, 2) Check dyno formation and scaling, 3) List add-ons and buildpacks, 4) View collaborators and access details, 5) Check domains and certificates. Accepts app name and optional JSON format. Returns detailed app status and configuration.

Inputs: app (required), json.

get_app_logsA

View application logs with flexible filtering options. Use this tool when you need to: 1) Monitor application activity in real-time, 2) Debug issues by viewing recent logs, 3) Filter logs by dyno, process type, or source.

Inputs: app (required), dynoName, processType, source.

list_addon_plansA

List available plans for a specific Heroku add-on service. Use this tool when you need to: 1) View all plans for a service, 2) Compare plan pricing, 3) Check plan availability. Requires add-on service slug and returns detailed plan information.

Inputs: service (required), json.

list_addonsA

List Heroku add-ons with flexible filtering options. Use this tool when you need to: 1) View all add-ons across your apps, 2) List add-ons for a specific app, 3) Get detailed add-on metadata in JSON format.

Inputs: all, app, json.

list_addon_servicesA

List available Heroku add-on services. Use this tool when you need to view all available add-on services. Returns a list of add-on services with their basic information.

Inputs: json.

list_appsA

List Heroku applications with flexible filtering options. Use this tool when you need to: 1) Show all apps owned by the user, 2) Show apps where the user is a collaborator (use all=true), 3) Filter apps by team or private space. Note: For checking app name availability, prefer using get_app_info as it returns a more focused dataset. The response includes app names, regions, and ownership information.

Inputs: all, json, personal, space, +1 more.

list_private_spacesA

List Heroku Private Spaces available to the user. Use this tool when you need to: 1) View all private spaces, 2) Get space details like CIDR blocks and regions, 3) Check space compliance features, or 4) View space capacity information. Supports JSON output for detailed metadata. Essential for enterprise space management.

Inputs: json.

list_teamsA

List Heroku Teams the user belongs to. Use this tool when you need to: 1) View all accessible teams, 2) Check team membership, 3) Get team metadata and enterprise relationships, or 4) Verify team access for app operations. Supports JSON output for detailed team information.

Inputs: json.

maintenance_offA

Disable maintenance mode for Heroku applications. Use this tool when you need to: 1) Restore normal application traffic routing, 2) Resume dyno operations after maintenance, 3) Complete deployment processes, 4) Verify application health after maintenance. The tool handles service restoration and process resumption.

Inputs: app (required).

maintenance_onA

Enable maintenance mode for Heroku applications. Use this tool when you need to: 1) Redirect traffic to a maintenance page, 2) Prepare for system updates or deployments, 3) Schedule planned maintenance windows, 4) Gracefully handle service interruptions. The tool manages traffic routing and process states while preserving running operations.

Inputs: app (required).

pg_backupsB

Manage database backup operations and schedules. Use this tool when you need to: 1) View existing database backups, 2) Monitor backup schedules and status, 3) Track backup operation progress, 4) Verify backup availability. The tool helps maintain database backup operations and disaster recovery readiness.

Inputs: app (required).

pg_credentialsA

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.

Inputs: app (required), database.

pg_infoA

Display detailed information about Heroku PostgreSQL databases. Use this tool when you need to: 1) View comprehensive database configuration and status, 2) Monitor database performance metrics, 3) Check connection and resource utilization, 4) Assess database health and capacity. The tool provides detailed insights into database operations and configuration.

Inputs: app (required), database.

pg_killA

Terminate specific database processes. Use this tool when you need to: 1) Stop problematic or stuck queries, 2) Clear blocking transactions, 3) Manage resource-intensive operations, 4) Handle runaway processes safely. The tool provides controlled process termination with optional force mode.

Inputs: app (required), pid (required), database, force.

pg_locksA

Analyze database locks and blocking transactions. Use this tool when you need to: 1) Identify blocked queries and lock chains, 2) Investigate deadlock situations, 3) Monitor transaction lock states, 4) Resolve blocking issues affecting performance. The tool helps diagnose and resolve database concurrency problems.

Inputs: app (required), database, truncate.

pg_maintenanceA

Monitor database maintenance status and operations. Use this tool when you need to: 1) Check current maintenance windows, 2) View scheduled maintenance activities, 3) Track maintenance operation progress, 4) Plan database maintenance tasks. The tool provides visibility into database maintenance state and scheduling.

Inputs: app (required), database.

pg_outliersB

Identify resource-intensive database operations. Use this tool when you need to: 1) Find slow or expensive queries, 2) Analyze query performance patterns, 3) Optimize database workload, 4) Track query statistics over time. The tool helps identify opportunities for performance optimization.

Inputs: app (required), database, num, reset, +1 more.

pg_psA

Monitor active database queries and processes. Use this tool when you need to: 1) View currently executing queries, 2) Track query progress and resource usage, 3) Identify long-running or blocked queries, 4) Debug performance issues in real-time. The tool provides detailed visibility into database activity with optional verbose output.

Inputs: app (required), database, verbose.

pg_psqlA

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.

Inputs: app (required), command, credential, database, +1 more.

pg_upgradeA

Upgrade PostgreSQL database version. Use this tool when you need to: 1) Migrate to a newer PostgreSQL version, 2) Plan version upgrade paths, 3) Execute controlled version migrations, 4) Verify upgrade compatibility. The tool manages safe database version upgrades with confirmation protection.

Inputs: app (required), confirm, database, version.

pipelines_createA

Create new Heroku deployment pipelines. Use this tool when you need to: 1) Set up new deployment workflows, 2) Create staged application environments, 3) Organize apps by development stages, 4) Configure team-based pipeline structures. The tool manages pipeline creation with optional team and initial app configuration.

Inputs: name (required), stage (required), app, team.

pipelines_infoA

Display detailed pipeline configuration. Use this tool when you need to: 1) View pipeline stage configuration, 2) Check connected applications, 3) Verify pipeline settings, 4) Monitor pipeline status. The tool provides comprehensive pipeline information and structure details.

Inputs: pipeline (required), json.

pipelines_listA

View available Heroku pipelines. Use this tool when you need to: 1) List accessible pipelines, 2) Check pipeline ownership and access, 3) View pipeline organization, 4) Find specific pipeline configurations. The tool provides pipeline visibility with optional JSON output format.

Inputs: json.

pipelines_promoteA

Promote applications through pipeline stages. Use this tool when you need to: 1) Deploy code to staging or production environments, 2) Manage staged releases, 3) Coordinate multi-app promotions, 4) Control deployment workflows. The tool handles safe promotion of apps between pipeline stages.

Inputs: app (required), to.

ps_listA

List and monitor Heroku application dynos. Use this tool when you need to: 1) View all running dynos for an app, 2) Check dyno status and health, 3) Monitor application process states, 4) Verify dyno configurations. The tool provides process visibility with optional JSON output format.

Inputs: app (required), json.

ps_restartA

Restart Heroku application processes. Use this tool when you need to: 1) Restart specific dynos by name, 2) Restart all dynos of a process type, 3) Perform full application restarts, 4) Reset dyno states selectively. The tool manages process restarts with flexible targeting options.

Inputs: app (required), dyno-name, process-type.

ps_scaleA

Scale and resize Heroku application dynos. Use this tool when you need to: 1) Adjust dyno quantities up or down, 2) Change dyno sizes for performance, 3) View current formation details, 4) Manage resource allocation. The tool handles dyno scaling with support for type-specific adjustments.

Inputs: app (required), dyno.

rename_appA

Rename an existing Heroku application. Use this tool when a user needs to: 1) Change an app's name, or 2) Resolve naming conflicts. Requires both current app name and desired new name. The tool validates name availability and handles the rename process.

Inputs: app (required), newName (required).

transfer_appA

Transfer ownership of a Heroku application. Use this tool when a user wants to: 1) Transfer an app to another user's account, 2) Move an app to a team, 3) Change app ownership for organizational purposes. Requires the app name and recipient (email for users, name for teams). The current user must be the app owner or a team admin to perform the transfer.

Inputs: app (required), recipient (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 33 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting specific resources and actions, such as create_app vs. get_app_info. However, some PostgreSQL tools like pg_ps and pg_outliers have overlapping monitoring functions that could cause confusion, though their descriptions help differentiate them.

    Naming Consistency5/5

    Tool names follow a highly consistent verb_noun or noun_verb pattern throughout, such as create_addon, list_addons, pg_backups, and ps_scale. All use snake_case uniformly, with clear prefixes like 'pg_' for PostgreSQL and 'ps_' for process-related tools, making the naming predictable and readable.

    Tool Count3/5

    With 33 tools, the count is high and may feel heavy for the Heroku domain, as it includes many specialized PostgreSQL tools that could be consolidated. While comprehensive, it borders on being overwhelming compared to typical well-scoped servers (3-15 tools), though it covers a broad range of operations.

    Completeness5/5

    The tool set provides complete CRUD and lifecycle coverage for Heroku's core domains, including apps, add-ons, PostgreSQL, pipelines, and processes. It handles creation, retrieval, updates, deletion, and management operations across all areas, with no obvious gaps that would cause agent failures.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Provides comprehensive Heroku application management through the Heroku Platform API for AI assistants using the Model Context Protocol. It enables users to scale dynos, view deployment history, access logs, and manage environment variables through natural language.
      8
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables agent clients to safely connect to tools and execution resources through MCP with authorization, approvals, audit, chat-context isolation, SSH/Docker access, and long-running command session tracking.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants and MCP clients to execute commands, copy/move files, manage background jobs and port forwarding, and optionally view and control remote screens using scoped, expiring agent tokens.
      6 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI assistants to create projects, deploy files, container images, or Git repositories, attach domains, set write-only secrets, add Postgres, read logs, metrics, and failure summaries, and roll back.
      Apache 2.0