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

agentic-scraper-provider-sdk

v0.2.0

Published

Server-side SDK for Agentic Scraper MCP/API provider monetization.

Readme

Agentic Scraper Provider SDK for Node.js

Server-side SDK for event-driven MCP Market monetization. Use this package in the MCP or API service you publish as a provider. It is separate from the Agentic Scraper client SDK used by consumers to run agents and automations.

Requires Node.js 18 or newer.

npm install agentic-scraper-provider-sdk

How charging works

For a Marketplace entry configured with provider_event pricing, the Agentic Scraper proxy forwards a signed x-agentic-charge-token header to your service. Your service reports a configured event and count using charge().

For example, an event named tweet-returned can charge once for every tweet that your tool returns. The returned chargedCount is authoritative: it can be lower than the requested count when the buyer's run budget is nearly exhausted.

Express example

import { AgenticProviderClient, getChargeTokenFromHeaders } from 'agentic-scraper-provider-sdk';

const provider = new AgenticProviderClient({ apiKey: process.env.AGENTIC_PROVIDER_API_KEY! });

app.post('/mcp', async (req, res) => {
  const chargeToken = getChargeTokenFromHeaders(req.headers);
  if (!chargeToken) {
    return res.status(400).json({ error: 'Missing Agentic Scraper charge context' });
  }

  const records = await loadRecords();
  const result = await provider.charge({
    chargeToken,
    eventName: 'record-returned',
    count: records.length,
    idempotencyKey: `record-export:${req.body.id}`,
    metadata: { requestedCount: records.length }
  });

  res.json(records.slice(0, result.chargedCount));
});

Fastify handlers can pass request.headers to getChargeTokenFromHeaders() in the same way.

Direct token configuration

You can set a token for one short-lived request scope:

const provider = new AgenticProviderClient({
  apiKey: process.env.AGENTIC_PROVIDER_API_KEY!,
  chargeToken,
});

const result = await provider.charge({
  eventName: 'summary-created',
  idempotencyKey: `summary:${requestId}`,
});

Do not reuse a client-level token between unrelated incoming requests.

Reliability rules

  • Pass a stable idempotencyKey for each logical event. Reusing the same run and key returns the original charge instead of charging twice.
  • Only return or process result.chargedCount units.
  • The SDK retries transport failures, HTTP 429, and 5xx responses up to three times by default and preserves the same idempotency key.
  • Validation and other 4xx errors are not retried.
  • Verification uses the same charge() method and returns verification: true without debiting a wallet.
  • Keep the provider API key and charge token on the server. Never expose or log them.

The default API base URL is https://api.agenticscraper.com/api/v1. Full REST and SDK documentation is available at https://docs.agenticscraper.com.

Fastify handlers use request.headers with getChargeTokenFromHeaders() in the same way. Never log the provider API key or charge token.