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

@leigents/mcp

v0.1.0

Published

Turn your MCP server tools into paid endpoints using the Machine Payments Protocol

Readme

@mpp/mcp

Turn your MCP server tools into paid endpoints — in minutes, not days.

npm version License: MIT Testnet Status

@mpp/mcp makes it trivial to add the Machine Payments Protocol (MPP) to any MCP server. Define your tools, set a price, and get paid — in stablecoins or fiat — without touching blockchain code.

Built with ❤️ by clei | MIT License


Why

Today, if you want to monetize an API or tool for AI agents, you need:

  • An account system
  • API keys
  • Billing integration
  • Webhook handlers for payment events

@mpp/mcp replaces all of that with a price config. Agents pay automatically, wallet-to-wallet, in a single HTTP request.

Install

npm install @mpp/mcp

# Peer dependencies:
npm install @modelcontextprotocol/sdk mppx zod

Quick Start

import { createMcpServer } from '@mpp/mcp'
import { z } from 'zod'

const server = createMcpServer({
  name: 'my-paid-tools',
  version: '1.0.0',
  methods: [{
    type: 'tempo',
    currency: 'usd',
    recipient: '0x742d35Cc6634c0532925a3b844bC9e7595F8fE00',
  }],
  tools: {
    translate: {
      description: 'Translate text between languages',
      inputSchema: z.object({
        text: z.string(),
        targetLang: z.string(),
      }),
      price: {
        intent: 'charge',  // 'charge' = per-call, 'session' = streaming
        amount: '1',       // $0.01
        currency: 'usd',
        method: 'tempo',   // or 'stripe' for card payments
      },
      async execute({ text, targetLang }) {
        // Your business logic here
        return { translated: `[${targetLang}] ${text}` }
      },
    },
  },
})

// Start with STDIO transport (works with Claude Desktop, Cursor, etc.)
server.start()

That's it. No payment middleware. No webhooks. No account setup.


How Payment Works

Agent → MCP Server:  tools/call { name: "translate", arguments: {...} }
MCP Server → Agent:  error -32042 Payment Required { challenges: [...] }
Agent → Blockchain:  pays the amount on Tempo
Agent → MCP Server:  tools/call { name: "translate", ..., _meta: { ...credential } }
MCP Server → Agent:  { content: { text: "..." } }  ✅

All automatic from the agent's perspective.

Payment Methods

| Method | Description | Status | |--------|-------------|--------| | tempo | Stablecoin on Tempo blockchain (sub-second, <$0.01/tx) | ✅ Testnet | | stripe | Visa, Mastercard via Stripe Shared Payment Tokens | ✅ Production |

Two Intent Types

charge — Per-request payment

price: {
  intent: 'charge',
  amount: '10',   // $0.10 per call
  currency: 'usd',
  method: 'tempo',
}

session — Streaming payments

Open a payment channel once, make unlimited calls, settle on-chain:

price: {
  intent: 'session',
  setupAmount: '100',    // $1.00 to open session
  perCallAmount: '1',   // $0.01 per call
  maxTotal: '1000',     // Cap at $10.00
  currency: 'usd',
  method: 'tempo',
}

Full Example with Stripe

import { createMcpServer } from '@mpp/mcp'
import { stripeMethod } from '@mpp/mcp/methods/stripe'
import { z } from 'zod'

const server = createMcpServer({
  name: 'image-generator',
  version: '1.0.0',
  methods: [
    stripeMethod({
      currency: 'usd',
      stripeAccountId: 'acct_xxx',
    }),
  ],
  tools: {
    generate: {
      description: 'Generate an image from a text prompt',
      inputSchema: z.object({ prompt: z.string().max(500) }),
      price: {
        intent: 'charge',
        amount: '50',   // $0.50 per image
        currency: 'usd',
        method: 'stripe',
      },
      async execute({ prompt }) {
        // Call your image generation API
        return { imageUrl: 'https://example.com/img.png' }
      },
    },
  },
})

server.start()

API Reference

createMcpServer(config)

interface MppMcpServerConfig {
  name: string           // Server name
  version: string        // Semantic version
  methods: PaymentMethod[]     // Supported payment methods
  tools: Record<string, ToolDefinition>
  logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'silent'
}

PaymentMethod

// Tempo (stablecoin — testnet ready)
{ type: 'tempo', currency: string, recipient: string }

// Stripe (card)
{ type: 'stripe', currency: string, stripeAccountId: string }

ToolDefinition

{
  description: string
  inputSchema: ZodSchema | JSONSchema
  price: {
    intent: 'charge' | 'session'
    amount: string     // Smallest unit (cents for USD)
    currency: string
    method: string
    perCallAmount?: string  // session only
    maxTotal?: string       // session only
  }
  execute: (args: unknown) => Promise<unknown>
}

MCP Transport

STDIO (recommended for local agents)

import { startStdioServer } from '@mpp/mcp/adapters/stdio'
await startStdioServer(server)

HTTP/SSE (remote agents)

// Coming soon

Architecture

@mpp/mcp
├── core/
│   ├── createServer.ts      # Server factory
│   ├── paidTool.ts           # Tool with payment enforcement
│   ├── challengeBuilder.ts    # -32042 challenge builder
│   ├── sessionManager.ts      # Session lifecycle
│   └── credentialVerifier.ts # On-chain verification
├── methods/
│   ├── tempo.ts               # Tempo blockchain method
│   └── stripe.ts             # Stripe card method
├── adapters/
│   └── stdio.ts              # STDIO transport
└── index.ts                  # Public exports

Resources

Contributing

Contributions welcome! Please read the design doc first.

License

MIT © clei