Heroku Code MCP

io.github.dsouzaAnush由 GitHub 账号 dsouzaAnush 发布v0.1.0更新于 Oct 24, 2026

Search and execute Heroku Platform API operations

概览

AI 生成的概览

精简的 MCP 服务器,让助手通过 auth_status、search 和 execute 三个工具检索并执行 Heroku 平台 API 操作。

可以做什么
  • 检查调用方是否已通过 Heroku 身份验证,便于在调用 API 前分支处理
  • 用自然语言意图从 schema 与文档上下文中检索并排序 Heroku 操作
  • 按选定的操作执行请求,传入路径参数、查询参数和请求体
  • 对写操作先做试运行,再凭确认令牌重放执行
适用场景
适合希望助手通过实时 API 调用管理 Heroku 应用与平台资源、同时保持工具列表精简省 token 的场景。也适合已在使用 Heroku CLI、想让智能体执行读取操作并可选地受控写入的用户。
运行要求
以本地 Node.js 进程运行,需从仓库安装依赖、构建并启动,提供本地 HTTP MCP 端点,也可通过 npx 从 GitHub 启动。需要 Heroku 账户令牌(从 Heroku CLI 播种或走 OAuth),以及 TOKEN_STORE_PATH 和 TOKEN_ENCRYPTION_KEY_BASE64;客户端以 x-user-id 请求头连接。启用写操作还需 ALLOW_WRITES 和 WRITE_CONFIRMATION_SECRET。
安装前请注意
它会在本地加密令牌存储中保存 Heroku 账户令牌,需妥善保护 TOKEN_STORE_PATH 与 TOKEN_ENCRYPTION_KEY_BASE64。变更操作默认被阻止,但设置 ALLOW_WRITES 后助手即可创建、修改或删除 Heroku 资源,确认前应检查试运行结果。敏感请求头与请求体字段会被脱敏,但 API 数据仍会发送给 Heroku。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Heroku Code MCP,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Heroku]

Heroku Code MCP

A compact MCP server for the Heroku Platform API using a Code Mode pattern: search + execute + auth_status.

Heroku Code MCP gives agent clients a small, token-efficient control surface for Heroku operations. Pair it with Heroku Skills when you want workflow guidance, safety checks, and Heroku product context alongside live API tools.

Design references:

Quick Start

Default MCP URL: http://127.0.0.1:3000/mcp

bash
git clone https://github.com/dsouzaAnush/heroku-code-mcp.gitcd heroku-code-mcpnpm installnpm run buildnpm test

Seed auth from the Heroku CLI:

bash
heroku auth:whoaminpm run seed:token

Start the server:

bash
TOKEN_STORE_PATH=./data/tokens.integration.json \TOKEN_ENCRYPTION_KEY_BASE64="<seed-output-key>" \PORT=3000 HOST=127.0.0.1 npm run dev

Smoke test:

bash
curl -sS http://127.0.0.1:3000/healthzMCP_URL=http://127.0.0.1:3000/mcp USER_ID=default npm run smoke:mcp

Before npm publication, the package can also run from GitHub:

bash
HOST=127.0.0.1 PORT=3333 \TOKEN_STORE_PATH="$HOME/.heroku-code-mcp/tokens.json" \TOKEN_ENCRYPTION_KEY_BASE64="<base64-32-byte-key>" \WRITE_CONFIRMATION_SECRET="<random-secret>" \npx -y github:dsouzaAnush/heroku-code-mcp

Install in Agent Clients

[Claude Code] Claude Code

Install the companion plugin for skills plus MCP wiring:

bash
claude plugin marketplace add dsouzaAnush/heroku-pluginclaude plugin install heroku@heroku-pluginclaude plugin enable heroku@heroku-plugin

Or add the running MCP server directly:

bash
claude mcp add \  --transport http \  --scope local \  heroku-code-mcp \  http://127.0.0.1:3000/mcp \  --header "x-user-id: default"

[Claude Desktop] Claude Desktop

Use the HTTP endpoint directly when supported:

json
{  "mcpServers": {    "heroku-code-mcp": {      "type": "http",      "url": "http://127.0.0.1:3000/mcp",      "headers": {        "x-user-id": "default"      }    }  }}

For Desktop builds that expect stdio servers, bridge through mcp-remote:

json
{  "mcpServers": {    "heroku-code-mcp": {      "command": "npx",      "args": ["-y", "mcp-remote", "http://127.0.0.1:3000/mcp", "--allow-http", "--header", "x-user-id:default"]    }  }}

Build a .mcpb bundle with:

bash
npm run build:mcpb

[OpenAI Codex] Codex

Codex uses Heroku Plugin for skills and optional MCP wiring:

bash
codex plugin marketplace add dsouzaAnush/heroku-plugin --ref main

Enable heroku-plugin@heroku-plugin in the Codex Plugins tab, or add:

toml
[plugins."heroku-plugin@heroku-plugin"]enabled = true

Run this MCP server on http://127.0.0.1:3333/mcp when you want live Heroku API tools through the plugin.

[Cursor] Cursor

bash
git clone https://github.com/dsouzaAnush/heroku-plugin.gitcursor agent --plugin-dir heroku-plugin

Add the MCP server to ~/.cursor/mcp.json or project-local .cursor/mcp.json:

json
{  "mcpServers": {    "heroku-code-mcp": {      "type": "streamable-http",      "url": "http://127.0.0.1:3333/mcp",      "headers": {        "x-user-id": "default"      }    }  }}

Other MCP Clients

Use streamable HTTP:

json
{  "mcpServers": {    "heroku-code-mcp": {      "transport": "streamable_http",      "url": "http://127.0.0.1:3000/mcp",      "headers": {        "x-user-id": "default"      }    }  }}

Or bridge to stdio:

json
{  "mcpServers": {    "heroku-code-mcp": {      "command": "npx",      "args": ["-y", "mcp-remote", "http://127.0.0.1:3000/mcp", "--allow-http", "--header", "x-user-id:default"]    }  }}

How It Works

ToolWhat it doesWhy it exists
auth_statusReports whether the caller is authenticated with HerokuLets agents branch cleanly before API work
searchRanks Heroku operations from schema and docs contextAvoids exposing dozens of endpoint-shaped tools up front
executeValidates params/body and calls the selected Heroku operationGives one deterministic execution path

Typical flow:

  1. Call auth_status.
  2. Call search with natural language intent.
  3. Choose one operation_id.
  4. Call execute with path_params, query_params, and body.
  5. For writes, run dry_run=true, then replay with confirm_write_token and ALLOW_WRITES=true.

Examples:

json
{  "query": "list apps",  "limit": 5}
json
{  "operation_id": "GET /apps"}
json
{  "operation_id": "PATCH /apps/{app_identity}",  "path_params": {    "app_identity": "my-app"  },  "body": {    "maintenance": true  },  "dry_run": true}

Safety and Configuration

Mutations (POST, PATCH, PUT, DELETE) are blocked by default. To allow a write, set ALLOW_WRITES=true, request a dry run, and replay with the returned confirm_write_token. Sensitive headers and body fields are redacted.

Key env vars:

  • ALLOW_WRITES
  • REQUEST_TIMEOUT_MS
  • MAX_RETRIES
  • CATALOG_CACHE_PATH
  • READ_CACHE_TTL_MS
  • EXECUTE_MAX_BODY_BYTES
  • EXECUTE_BODY_PREVIEW_CHARS

Full example: .env.example

Benchmarks

Benchmarks were captured on February 22, 2026 on the same machine and account for both implementations.

Metricheroku-code-mcpofficial Heroku MCPDelta
Tool count33791.9% lower
Tool-list payload bytes1,46925,50094.2% lower
Tool-list approx tokens3686,37594.2% lower
Connect avg14.8 ms10,168.7 ms687x faster
list_tools avg4.3 ms10.3 ms2.4x faster
Read op avg528.0 ms (execute GET /apps)9,697.4 ms (list_apps)18.4x faster

Charts:

Full methodology and artifacts live in BENCHMARKS.md and benchmarks/results/.

Development and Release

Validate locally:

bash
npm run buildnpm testnpm run validate:servernpm run publish:dry-run

This repo uses free GitHub Actions:

  • validate.yml runs build, tests, server.json validation, and npm pack dry-run on PRs and pushes to main.
  • release.yml runs on v* tags, builds the .mcpb, updates release server.json, creates or updates the GitHub Release, and publishes to the MCP Registry through GitHub OIDC.
  • Dependabot checks npm and GitHub Actions dependencies weekly.

Publish manually when needed:

bash
npm publish --access publicmcp-publisher login githubmcp-publisher publish server.json

For CI-based npm publishing, configure npm trusted publishing for repo dsouzaAnush/heroku-code-mcp and workflow release.yml, then run the release workflow with publish_npm=true.

Repository Layout

  • src/schema/*: ingestion, operation normalization, and cache
  • src/search/*: search index and ranking
  • src/execute/*: validation and Heroku API execution
  • src/auth/*: OAuth and encrypted token storage
  • tests/*: catalog, search, and execute tests
  • benchmarks/results/*: benchmark artifacts
  • server.json: MCP Registry metadata

Brand and Troubleshooting

This repo includes the official Heroku wordmark and mark under assets. Use them according to the Heroku Brand Guidelines.

Common fixes:

  • MCP Inspector connection error: confirm URL http://127.0.0.1:3000/mcp and server health.
  • AUTH_REQUIRED: seed a token or complete OAuth.
  • Write blocked: confirm ALLOW_WRITES=true and send the dry-run confirmation token.
  • Large response body: narrow query scope or lower output caps.

来源:README.md,提交 79ff865

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分