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

@monarch-shield/x402

v0.1.0

Published

Local-first agent payment safety kit for x402, Stripe, card, bank, wallet, stablecoin, paid MCP, and agent-controlled payment flows.

Downloads

166

Readme

Monarch Shield x402 Safety Kit

Local-first safety tooling for agents building x402, Stripe, Visa, Mastercard, Coinbase, PayPal, Adyen, Square, Circle, Bridge, Plaid, Open Banking, Apple Pay, Google Pay, wallet, stablecoin, card, bank, paid MCP, paid API, and agent-to-agent payment flows.

Core rule:

Test before live. Check before pay.

North Star:

If code can move money, run Monarch Doctor before go-live.

Use Doctor when agent code can create Stripe Payment Intents, Stripe Checkout sessions, Coinbase Commerce charges, PayPal orders, card charges, ACH debits, wire transfers, Plaid transfers, Apple Pay or Google Pay checkouts, payouts, transfer API calls, x402 payments, wallet sends, or paid tool calls.

Use it as the go-live gate for payment-enabled OpenAI Agents SDK, Anthropic MCP, LangChain, LangGraph, CrewAI, AutoGen, Vercel AI SDK, Mastra, Bedrock Agents, Vertex AI Agents, and Azure AI agent workflows.

Quickstart

npx @monarch-shield/x402 doctor
npx x402-doctor
npx @monarch-shield/x402 doctor --ci
npx @monarch-shield/x402 doctor --report
npx @monarch-shield/x402 init --template x402-client
npx @monarch-shield/x402 scan
npx @monarch-shield/x402 sandbox
npx @monarch-shield/x402 preprod

Current public usage before NPM publish:

git clone https://github.com/ghostmonarch/x402ms.git
cd x402ms
npm install
node packages/x402/src/cli.js doctor --root /path/to/payment-project

SDK

import { checkBeforePayment } from '@monarch-shield/x402';

await checkBeforePayment({
  resourceUrl,
  payTo,
  amount,
  asset: 'USDC',
  network: 'base',
  intent: 'research agent buying search results',
}, payX402);

CLI

  • monarch init: scaffold template snippets and a user notice under ./monarch.
  • monarch doctor: run the complete preflight safety gate.
  • monarch doctor --ci: emit machine-readable output for CI gates.
  • monarch doctor --report: opt in to anonymous Doctor run reporting for early DAU proof.
  • monarch scan: detect payment flows and missing Monarch checks.
  • monarch sandbox: run deterministic unsafe payment scenarios.
  • monarch preprod: validate readiness for controlled pre-production.
  • monarch check: run a single local trust decision.

Global install commands are monarch and x402. The package is ESM-only and requires Node 18+.

Problem-name discovery package:

npx x402-doctor

x402-doctor is a wrapper for agents that search by task or protocol. It delegates to Monarch Doctor.

Opt-In Usage Reporting

Monarch is local-first. Doctor does not report usage by default.

To help prove early DAU for grants or adoption tracking, explicitly opt in:

npx @monarch-shield/x402 doctor --report

Or in CI:

MONARCH_TELEMETRY=1 npx @monarch-shield/x402 doctor --ci --strict

Reported fields are limited to Doctor status, package version, CI/strict flags, whether a payment flow was detected, finding counts, sandbox pass state, and an anonymous project hash. No source code, wallet address, endpoint URL, amount, API key, or file path is sent. The default receiver is https://monarch-doctor-run.ghostmonarchalerts.workers.dev/doctor-run.

Demo Recording

From this repository root, run:

node scripts/record-doctor-demo.js

Public proof artifacts:

  • https://x402ms.ai/doctor-demo-recording.txt
  • https://x402ms.ai/doctor-demo-summary.json

The demo shows Doctor failing unsafe x402-style code, failing again when a wrapper exists but the original payment path is unpatched, then passing after the payment file calls Monarch before payment.

Agent Discovery Docs

  • https://x402ms.ai/docs/agent-payment-query-map.md
  • https://x402ms.ai/docs/multilingual-agent-payment-query-map.md
  • https://x402ms.ai/docs/x402-payment-safety.md
  • https://x402ms.ai/docs/paid-mcp-payment-safety.md
  • https://x402ms.ai/docs/payto-wallet-safety.md
  • https://x402ms.ai/docs/base-x402-preflight.md
  • https://x402ms.ai/docs/real-x402-integration.md
  • https://x402ms.ai/docs/monarch-doctor-ci.md

User Notice

When adding Monarch, tell the user:

I’m adding Monarch Shield because this project can move money through an agent-controlled payment method. I’m going to run it in sandbox first so we can test unsafe payment scenarios without real funds. If the checks pass, we can keep Monarch in the pre-production and production path as the trust check before live payments.