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

@bayonai/mcp

v0.1.0

Published

Shared MCP OAuth and protocol helpers for Bayon apps.

Readme

@bayonai/mcp

Shared MCP OAuth and protocol helpers for Bayon apps.

This package contains app-agnostic helpers for remote MCP servers:

  • OAuth protected-resource and authorization-server metadata.
  • WWW-Authenticate bearer challenges that point MCP clients to metadata.
  • PKCE S256 challenge creation and verification.
  • Secret hashing, random token generation, and constant-time comparisons.

Application code remains responsible for its own MCP tools/resources/prompts, business authorization, persistence, audit logging, and user-consent UI.

Install

pnpm add @bayonai/mcp

Metadata

import {
  createMcpWwwAuthenticateHeader,
  getOAuthAuthorizationServerMetadata,
  getOAuthProtectedResourceMetadata,
} from "@bayonai/mcp";

const baseUrl = "https://bounded.example/api";
const scopes = ["bounded.read", "bounded.write"];

export const protectedResource = getOAuthProtectedResourceMetadata({
  documentationUrl: "https://bounded.example/docs/mcp",
  scopes,
  serviceUrl: baseUrl,
});

export const authorizationServer = getOAuthAuthorizationServerMetadata({
  scopes,
  serviceUrl: baseUrl,
});

export const wwwAuthenticate = createMcpWwwAuthenticateHeader({
  metadataUrl: `${baseUrl}/.well-known/oauth-protected-resource`,
  realm: "Bounded MCP",
  scopes,
});

PKCE

import { buildPkceChallenge, verifyPkceChallenge } from "@bayonai/mcp";

const challenge = buildPkceChallenge(codeVerifier);

if (!verifyPkceChallenge({ challenge, method: "S256", verifier })) {
  throw new Error("Invalid PKCE verifier.");
}

Token Secrets

import { createMcpRandomToken, hashMcpSecret } from "@bayonai/mcp";

const accessToken = `app_mcp_access_${createMcpRandomToken(40)}`;
const accessTokenHash = hashMcpSecret(accessToken);

Store token hashes, not bearer tokens. The app owns expiry, revocation, refresh rotation, and user/session lookup.

Package Boundaries

Keep these app-specific concerns outside @bayonai/mcp:

  • Tool/resource/prompt registries.
  • Firestore collection names and indexes.
  • Firebase Auth, service-token, or admin consent flows.
  • Product-specific scopes such as thunderlist.read or bounded.write.
  • Audit logging and mutation authorization.

Release Checks

corepack pnpm --dir packages/bayonai-mcp run lint
corepack pnpm --dir packages/bayonai-mcp run build
corepack pnpm exec vitest run packages/bayonai-mcp/src/metadata.test.ts packages/bayonai-mcp/src/pkce.test.ts packages/bayonai-mcp/src/secrets.test.ts
corepack pnpm --dir packages/bayonai-mcp run smoke:pack