npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@heroku-mcp/core

v1.1.0

Published

Core building blocks for Heroku MCP servers: probe machinery, tool runner, sensitive-data redaction, shared types.

Readme

@heroku-mcp/core

Core building blocks for Heroku MCP servers: probe machinery, tool runner, sensitive-data redaction, shared types. Also provides the HTTP client, schema discovery, encrypted token storage, structured error types, and audit logging shared across every @heroku-mcp/* tool package.

This is a library, not a runnable server. Most users will install @heroku-mcp/platform (or deploy @heroku-mcp/http-server) instead, both of which depend on this package. Direct consumers should read the architecture doc for context.

Not affiliated with Salesforce or Heroku. See TRADEMARKS.md.

Install

npm install @heroku-mcp/core

Requires Node ≥ 24.

What's in this package

HerokuClient        — fetch wrapper with retry, ETag caching, rate-limit
                      awareness, ratelimit-remaining tracking, audit logging
fetchSchema         — fetch and cache the Heroku Platform API JSON Schema
runProber           — execute the capability probe matrix against a token
createTokenStore    — TokenStore factory (keychain → file → in-memory)
ConfirmationRequiredError, ConfirmationMismatchError, assertConfirm
                    — destructive-op confirmation helpers
buildDryRunResponse — structured preview for mutating tools that haven't
                      executed
HerokuApiError, AuthError, ForbiddenError, RateLimitError, ...
                    — typed error hierarchy mirroring Heroku's response shapes
redact              — recursive secret redaction for logs and error messages
appendAuditEntry    — JSONL audit log with daily rotation

Example

import {
  createHerokuClient,
  runProber,
  createTokenStore,
  PROBE_MATRIX,
} from '@heroku-mcp/core';

const tokens = await createTokenStore();
const token = await tokens.get({ scope: 'platform-user', userId: 'me' });
if (!token) throw new Error('No token configured.');

const client = createHerokuClient({ token });

// Discover what this token can do.
const capabilities = await runProber({ client, probes: PROBE_MATRIX });
console.log(capabilities.tiers);
// → { account: { available: true }, apps: { available: true },
//     teams: { available: true }, enterprise: { available: false }, ... }

// Make an authenticated request.
const account = await client.get('/account');
console.log(account.data.email);

Key design points

  • All requests go through the HerokuClient, which applies redaction, rate-limit tracking, ETag caching, and audit logging consistently. There is no shortcut path that bypasses these.
  • TokenStore has three backends chosen automatically by the bootstrap layer: OS keychain (via keytar) for stdio installations, AES-256-GCM encrypted file for stdio installs without keychain access, and Postgres-backed envelope encryption (Phase 4+) for hosted deployments.
  • The probe matrix is data, not code. Probes are declared in probes.ts and the prober interprets them. Adding a capability tier means adding a probe definition, not writing a new module.
  • Errors are typed by kind (auth, forbidden, rate_limit, confirmation, etc.) so the host can react programmatically without parsing strings.

Tests

pnpm test              # 242 unit tests
pnpm test:integration  # 2 live tests against api.heroku.com (requires HEROKUMCP_TEST_TOKEN)

Documentation

Related

License

Apache-2.0.