Heroku MCP Server

Comprehensive Heroku application management through the Heroku Platform API

README.md

☁️ MCP Heroku Server

A complete Heroku management server for the Model Context Protocol (MCP). Provides comprehensive Heroku app management through the Heroku Platform API for AI assistants like Claude.

✨ Features

  • 📋 App Management - List, view, and manage your Heroku applications
  • 🚀 Deployment History - View releases and deployment timeline
  • 📊 Dyno Operations - Scale, restart, and monitor dynos
  • 📝 Log Access - Stream and filter application logs
  • 🔧 Configuration - Manage environment variables (config vars)
  • 📦 Add-on Management - List and monitor add-ons (databases, caches, etc.)
  • 🔒 Secure - Uses your Heroku API key with proper authentication

📋 Prerequisites

  • Heroku CLI (optional, for generating API keys)
  • Node.js 16+ for running the MCP server
  • Heroku API Key - Get from Dashboard Account Settings

🚀 Quick Start

Using with npx (recommended)

HEROKU_API_KEY=your-api-key npx @artik0din/mcp-heroku

Install globally

npm install -g @artik0din/mcp-heroku
export HEROKU_API_KEY=your-api-key
mcp-heroku

🔧 Environment Variables

Set your Heroku API key:

Option 1: Environment Variable

export HEROKU_API_KEY=your-heroku-api-key

Option 2: .env file

cp .env.example .env
# Edit .env and add your HEROKU_API_KEY

Getting Your API Key

  1. Visit Heroku Dashboard Account Settings
  2. Scroll to "API Key" section
  3. Click "Reveal" to show your key
  4. Or use CLI: heroku auth:token

🔧 MCP Client Setup

Add this server to your MCP client configuration:

Claude Desktop Configuration

{
  "mcpServers": {
    "heroku": {
      "command": "npx",
      "args": ["@artik0din/mcp-heroku"],
      "env": {
        "HEROKU_API_KEY": "your-heroku-api-key-here"
      }
    }
  }
}

Other MCP Clients

{
  "name": "heroku",
  "command": "npx",
  "args": ["@artik0din/mcp-heroku"],
  "env": {
    "HEROKU_API_KEY": "your-heroku-api-key-here"
  }
}

📚 Available Tools

App Management

  • heroku_list_apps - List all your Heroku apps

    • team (string, optional) - Filter apps by team name
  • heroku_get_app - Get detailed app information

    • appName (string, required) - Name of the Heroku app

Deployment & Releases

  • heroku_list_releases - View deployment history
    • appName (string, required) - Name of the Heroku app
    • limit (number) - Max releases to return (default: 10)

Dyno Management

  • heroku_restart - Restart app dynos

    • appName (string, required) - Name of the Heroku app
    • dyno (string, optional) - Specific dyno (e.g., "web.1"), or omit for all
  • heroku_scale - Scale dynos up or down

    • appName (string, required) - Name of the Heroku app
    • dyno (string, required) - Dyno type (e.g., "web", "worker")
    • quantity (number, required) - Number of dynos to run
    • size (string, optional) - Dyno size (eco, basic, standard-1x, etc.)

Logs & Monitoring

  • heroku_get_logs - Retrieve application logs
    • appName (string, required) - Name of the Heroku app
    • lines (number) - Number of log lines (default: 100)
    • dyno (string, optional) - Filter by dyno (e.g., "web.1")
    • source (string, optional) - Filter by source ("app" or "heroku")

Add-ons

  • heroku_list_addons - List attached add-ons
    • appName (string, required) - Name of the Heroku app

Configuration

  • heroku_config_vars - Manage environment variables
    • appName (string, required) - Name of the Heroku app
    • set (boolean) - Set to true to modify (default: false, just lists)
    • key (string) - Config var key name
    • value (string) - Config var value (use with set=true)

💡 Usage Examples

List all apps

// Use the heroku_list_apps tool
// Returns array of apps with basic info

Scale web dynos

// Use heroku_scale tool with:
// appName: "my-app"
// dyno: "web"
// quantity: 2
// size: "standard-1x"

Get recent logs

// Use heroku_get_logs tool with:
// appName: "my-app" 
// lines: 50
// source: "app"

Set environment variable

// Use heroku_config_vars tool with:
// appName: "my-app"
// set: true
// key: "DATABASE_URL"
// value: "postgres://..."

🔒 Security

This server uses the Heroku Platform API securely:

  • API key is read from environment variables only
  • No credential storage or caching
  • All requests use HTTPS
  • Sensitive config vars are masked in responses
  • Uses official Heroku API endpoints

🛠️ Development


Tools 8

heroku_list_appsList all your Heroku apps
heroku_get_appGet detailed app information
heroku_list_releasesView deployment history
heroku_restartRestart app dynos
heroku_scaleScale dynos up or down
heroku_get_logsRetrieve application logs
heroku_list_addonsList attached add-ons
heroku_config_varsManage environment variables

Environment Variables

HEROKU_API_KEYrequiredYour Heroku API key from Account Settings

Try it

List all my Heroku applications and their current status.
Scale the web dynos for my app 'production-api' to 2 instances.
Show me the last 50 lines of logs for the 'web' dyno of my app 'my-app'.
What are the current environment variables set for my app 'staging-app'?
List all the add-ons currently attached to my app 'my-app'.

Frequently Asked Questions

What are the key features of Heroku MCP Server?

Manage and list Heroku applications. View deployment history and release timelines. Scale, restart, and monitor dyno performance. Stream and filter application logs. Manage environment variables and add-ons.

What can I use Heroku MCP Server for?

Quickly checking application status without leaving the AI chat interface. Scaling dynos up during high traffic periods via natural language. Debugging production issues by streaming logs directly to the AI. Auditing environment variables across multiple Heroku apps.

How do I install Heroku MCP Server?

Install Heroku MCP Server by running: HEROKU_API_KEY=your-api-key npx @artik0din/mcp-heroku

What MCP clients work with Heroku MCP Server?

Heroku MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Heroku MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare