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

@phoenixvc/mcp-http

v0.1.0

Published

In-process product MCP HTTP envelope: fail-closed Bearer, RFC 9728 challenge, health probe. Extracted from Baton and Docket.

Readme

@phoenixvc/mcp-http

In-process product MCP HTTP envelope shared by Baton and Docket.

This is the extractable pattern. It is not the @phoenixvc/mcp stdio OAuth CLI.

What this package is

The envelope every product API copies:

  1. MCP lives on the same process and port as the product HTTP API.
  2. Mount at /mcp. Leave /health public.
  3. Guard /mcp with Authorization: Bearer ${MCP_SECRET} (machine / orchestrator lane).
  4. Fail closed (503) if the secret is missing outside local/dev.
  5. Optional RFC 9728 WWW-Authenticate + protected-resource metadata when a human OAuth lane exists.

Tool handlers stay in the product. Mystira introspection, project grants, and actor API keys stay in Baton.

Node

import { applyMcpSecretAuth, mcpHealthPayload } from "@phoenixvc/mcp-http";

app.post("/mcp", async (req, res) => {
  if (!applyMcpSecretAuth(req, res, { secret: process.env.MCP_SECRET })) return;
  // existing Streamable HTTP / FastMCP handler
});

app.get("/health/mcp", (_req, res) => {
  res.json(mcpHealthPayload({
    name: "my-product-mcp",
    tools: ["list_things"],
    authRequired: Boolean(process.env.MCP_SECRET),
  }));
});

OAuth-ready products (Baton) add:

import {
  protectedResourceMetadataUrl,
  sendProtectedResourceMetadata,
} from "@phoenixvc/mcp-http";

const resource = "https://mcp.example.com/mcp";
app.get("/.well-known/oauth-protected-resource/mcp", (_req, res) => {
  sendProtectedResourceMetadata(res, {
    resource,
    authorization_servers: ["https://identity.example/"],
    scopes_supported: ["example.read"],
  });
});

Pass resourceMetadataUrl: protectedResourceMetadataUrl(resource) into applyMcpSecretAuth so 401s carry resource_metadata.

Python (Docket recipe — not shipped as a wheel)

Use FastMCP's http_app(stateless_http=True) mounted at /mcp. Guard with a pure ASGI middleware (not Starlette BaseHTTPMiddleware — it buffers and breaks streamable HTTP):

  • Secret set → hmac.compare_digest(auth, f"Bearer {secret}"), else 401 + WWW-Authenticate: Bearer.
  • Secret unset and ENVIRONMENT not in {development, local, test} → 503.
  • Mirror authorizeMcpSecret({ missingSecretMode: "local-open" }).

What not to extract

  • Product tools (tasks, cost KQL, YAML mirrors).
  • Baton actor identity / project membership.
  • A stdio OAuth runner — use native HTTP MCP clients, or mcp-remote, or the official SDK StreamableHTTPClientTransport.