GitHub - heroku/heroku-mcp-server: Heroku Platform MCP Server using the Heroku CLI (original) (raw)

heroku-mcp-server

Install MCP Server smithery badge

The Heroku Platform MCP Server works on Common Runtime, Cedar Private and Shield Spaces, and Fir Private Spaces.

Prerequisites

Deploy on Heroku

Deploy

Overview

The Heroku Platform MCP Server is a specialized Model Context Protocol (MCP) implementation designed to facilitate seamless interaction between large language models (LLMs) and the Heroku Platform. This server provides a robust set of tools and capabilities that enable LLMs to read, manage, and operate Heroku Platform resources.

Key Features:

Note: The Heroku Platform MCP Server is currently in early development. As we continue to enhance and refine the implementation, the available functionality and tools may evolve. We welcome feedback and contributions to help shape the future of this project.

Note: The Heroku Platform MCP Server requires the Heroku CLI to be installed globally (v10.8.1+). Ensure you have the correct version by running heroku --version.

Authentication

Generate a Heroku authorization token with one of these methods:

Configure the Heroku Platform MCP Server

You can configure Claude Desktop, Zed, Cursor, Windsurf and others to work with the Heroku Platform MCP Server.

Claude Desktop

Add this snippet to your claude_desktop_config.json:

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

Zed

Add this snippet to your Zed settings.json:

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

Cursor

Note: Both the simple and explicit forms work, but the key should be "heroku" (not "heroku-mcp-server") for maximum compatibility with agent tools.

Add this snippet to your Cursor mcp.json:

Simple form:

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

Explicit form:

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

Windsurf

Add this snippet to your Windsurf mcp_config.json:

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

Cline

Add this snippet to your Cline config.json:

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

VSCode

Add this snippet to your VSCode settings.json or .vscode/mcp.json:

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

Trae

Add this snippet to your Trae mcp_settings.json:

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

Available Tools

Application Management

Process & Dyno Management

Add-ons

Maintenance & Logs

Pipeline Management

Team & Space Management

PostgreSQL Database Management

Debugging

You can use the MCP inspector or theVS Code Run and Debug function to run and debug the server.

  1. Link the project as a global CLI using npm link from the project root.
  2. Build with npm run build:dev or watch for file changes and build automatically with npm run build:watch.

Use the MCP Inspector

Use the MCP inspector with no breakpoints in the code:

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

Alternatively, if you installed the package in a specific directory or are actively developing on the Heroku MCP server:

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

Use the VS Code Run and Debug Function

Use the VS CodeRun and Debug launcher with fully functional breakpoints in the code:

  1. Locate and select the run debug.
  2. Select the configuration labeled "MCP Server Launcher" in the dropdown.
  3. Select the run/debug button.

VS Code / Cursor Debugging Setup

To set up local debugging with breakpoints:

  1. Store your Heroku auth token in the VS Code user settings:
    • Open the Command Palette (Cmd/Ctrl + Shift + P).
    • Type Preferences: Open User Settings (JSON).
    • Add the following snippet:
      {
      "heroku.mcp.authToken": "your-token-here"
      }
  2. Create or update .vscode/launch.json:
    {
    "version": "0.2.0",
    "configurations": [
    {
    "type": "node",
    "request": "launch",
    "name": "MCP Server Launcher",
    "skipFiles": ["/"],
    "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": ["/
    "],
    "sourceMaps": true,
    "outFiles": ["${workspaceFolder}/dist//*.js"]
    },
    {
    "type": "node",
    "request": "attach",
    "name": "Attach to REPL Process",
    "port": 9333,
    "skipFiles": ["/
    "],
    "sourceMaps": true,
    "outFiles": ["${workspaceFolder}/dist/**/*.js"]
    }
    ],
    "compounds": [
    {
    "name": "Attach to MCP Server",
    "configurations": ["Attach to Debug Hook Process", "Attach to REPL Process"]
    }
    ]
    }
  3. Create .vscode/tasks.json:
    {
    "version": "2.0.0",
    "tasks": [
    {
    "type": "npm",
    "script": "build:watch",
    "group": {
    "kind": "build",
    "isDefault": true
    },
    "problemMatcher": ["$tsc"]
    }
    ]
    }
  4. (Optional) Set breakpoints in your TypeScript files.
  5. Press F5 or use the Run and Debug sidebar.

Note: the debugger automatically builds your TypeScript files before launching.

Installing via Smithery

To install Heroku Platform MCP Server for Claude Desktop automatically viaSmithery:

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

Environment Variables

The Heroku Platform MCP Server supports the following environment variables:

HEROKU_API_KEY

Your Heroku authorization token. Required for authentication with the Heroku Platform.

MCP_SERVER_REQUEST_TIMEOUT

Timeout in milliseconds for command execution. Defaults to 15000 (15 seconds) if not set.

Example configuration with custom timeout:

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