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

@mdlog/agentgate

v0.2.1

Published

Wrap any HTTP API into a paid x402 service on Casper — HTTP 402 micropayments in native CSPR with on-chain discovery and reputation.

Readme

@mdlog/agentgate

Wrap any HTTP API into a paid x402 service on Casper — HTTP 402 micropayments in native CSPR, with on-chain discovery and reputation. One command turns your endpoint into a machine-payable service that AI agents can discover, pay, and rate autonomously.

Services carry an on-chain accepts[] price list (registry v2): native CSPR, or a CEP-18 token like WCSPR settled through the official Casper x402 facilitator (gas sponsored — true sub-CSPR micropayments). buy auto-detects the rail from the 402.

Read the live catalog — zero setup

The read commands run against Casper Testnet with no configuration and no keys:

npx @mdlog/agentgate list        # on-chain service catalog with scores + trust tiers
npx @mdlog/agentgate status 1    # one service: record, price, trust, attestations

Wrap your API (writes)

wrap registers your service on Casper Testnet and drops a 402 paywall in front of it — one line, the only thing besides the args is your funded wallet key:

npx @mdlog/agentgate wrap https://api.example.com/gold --price 2.5 --name "Gold Spot Feed" --pem ./key.pem

It signs the on-chain registration with --pem, then maps your upstream on the gateway by signing an ownership challenge with the same key — no shared admin token. --gateway defaults to the hosted gateway; pass it to target a local or self-hosted one. (--pem is irreducible: registering on-chain is a signed, gas-paying transaction.)

Buy a call (writes)

buy runs the whole x402 exchange for you: fetch the 402 invoice, pay it with a native CSPR transfer carrying the invoice nonce as transfer_id, retry with the X-PAYMENT proof, and print the result — response body on stdout (pipeable), payment receipt on stderr:

npx @mdlog/agentgate buy 2 --pem ./buyer.pem --max 5

--max is a budget cap: any invoice priced above it is refused (PRICE_EXCEEDED) before a single mote moves. Unknown or paused services fail fast before any payment.

Use from any MCP agent

mcp serves AgentGate as a Model Context Protocol stdio server, so any MCP-capable agent (Claude Desktop, a custom client, an MCP-aware framework) gets AgentGate as native tools — discover, inspect, and pay services:

npx @mdlog/agentgate mcp

Tools: agentgate_list_services, agentgate_get_service, agentgate_get_invoice (read-only, no key) and agentgate_buy (pays a 402 invoice in native CSPR from the buyer key, capped by maxCspr). Wire it into Claude Desktop's claude_desktop_config.json:

{ "mcpServers": { "agentgate": { "command": "npx", "args": ["-y", "@mdlog/agentgate", "mcp"] } } }

Flags & environment

Every config value can be given as a flag or an env var; precedence is flag > env var > built-in default.

| Flag | Env var | Needed for | |---|---|---| | --mode <mock\|live> | AGENTGATE_MODE | all (CLI defaults to live) | | --node-url <url> | CASPER_NODE_URL | all (defaults to Testnet) | | --registry <hash> | REGISTRY_CONTRACT_PACKAGE_HASH | all (defaults to the deployed registry) | | --gateway <url> | — | wrap (defaults to the hosted gateway in live) · buy (defaults to the service's on-chain endpoint) | | --pem <path> | SELLER_SIGNER_PEM_PATH (wrap/pause/resume) · BUYER_SIGNER_PEM_PATH (buy) | live writes — your wallet key | | --max <cspr> | — | buy: refuse invoices priced above this many CSPR | | --api-key <key> | CSPR_CLOUD_API_KEY | status attestation history only | | --admin-token <token> | AGENTGATE_ADMIN_TOKEN | mock / self-hosted-admin mapping only |

Live wrap uses owner-signature auth, so no admin token is needed. --pem is a path, not a secret — safe in shell history. --api-key / --admin-token are secrets (visible in history and ps); prefer their env vars.

On an invalid value the CLI fails fast with a clear one-line message (e.g. error: SIGNER_MISSING: live mode needs a seller key — pass --pem <path> or set SELLER_SIGNER_PEM_PATH) — never a stack trace.

Commands

  • list — list on-chain services (zero-config)
  • status <id> — service detail + reputation (zero-config; --api-key adds attestation history)
  • wrap <url> --price <CSPR> --name <name> — register + put a 402 paywall in front of an API
  • buy <id> --pem <key> — pay a service's 402 invoice and print the response (--max caps the price)
  • mcp — serve AgentGate as an MCP stdio server (agent tools: list / inspect / buy)
  • pause <id> / resume <id> — toggle a service you own
  • demo-accounts — mint faucet-funded buyer/seller accounts on the mock devnet (mock mode only)

Notes

  • Node ≥ 22 required.
  • Source: https://github.com/mdlog/AgentGate