A TypeScript SDK that handles 402 payment flows for web applications, integrating with Tempo and Stripe.

Install

mkdir -p .claude/skills/mppx && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/19520" && unzip -o skill.zip -d .claude/skills/mppx && rm skill.zip

Installs to .claude/skills/mppx

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

TypeScript SDK for the Payment HTTP Authentication Scheme. Handles 402 Payment Required flows with Tempo, Stripe, and other payment methods. Use when integrating payments or mppx into a client or server application.
215 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Add 402 payment handling to client-side fetch requests
  • Protect server-side HTTP routes with MPP challenges
  • Accept one-time stablecoin payments via Tempo
  • Accept metered Tempo stablecoin payments
  • Accept one-time card payments via Stripe
  • Wrap MCP clients and servers to require payment

How it works

The SDK implements the Payment HTTP Authentication Scheme by managing the challenge, credential, and receipt flow. It provides middleware for various frameworks to intercept requests and enforce payment before granting access.

Inputs & outputs

You give it
HTTP request or MCP tool call
You get back
402 Payment Required challenge or receipt-verified response

When to use mppx

  • Add 402 payment handling to client-side fetch requests
  • Protect server-side routes with MPP challenges
  • Integrate one-time stablecoin payments via Tempo
  • Implement metered payment sessions
  • Secure MCP tool calls with payment requirements

About this skill

mppx

TypeScript SDK for the "Payment" HTTP Authentication Scheme. Full 402 flow: challenge → credential → receipt.

What I can accomplish

  • Add 402 payment handling to a client with Fetch.polyfill or Fetch.from.
  • Protect HTTP routes with server-side MPP Challenges and Receipt responses.
  • Accept one-time Tempo stablecoin payments with tempo.charge.
  • Accept metered Tempo stablecoin payments with tempo.session.
  • Accept one-time card payments with stripe.charge.
  • Verify Credentials directly for custom transports or background workflows.
  • Wrap MCP clients and servers so tool calls can require payment.

Required inputs

  • Client integrations need a signing account and one or more client payment methods.
  • Server integrations need a recipient, currency, amount, and MPP_SECRET_KEY.
  • Tempo examples use chain ID 4217 unless a page explicitly covers Moderato testnet.
  • Stripe examples need a configured Stripe account and Shared Payment Token flow.
  • MCP integrations need the MCP client or server object to wrap.

Constraints

  • Keep MPP_SECRET_KEY server-side and out of logs.
  • Never commit private keys or wallet seeds.
  • Treat runtime 402 Challenges as authoritative for current payment terms.
  • Return id and opaque unchanged when responding to a Challenge.
  • Use USDC.e for Tempo bridged USDC examples, not generic USDC.

Client

import { Mppx, tempo } from 'mppx/client'

// Polyfills globalThis.fetch to handle 402 automatically
Mppx.create({
  methods: [tempo({ account })],
})

const res = await fetch('https://api.example.com/resource')

Without polyfilling:

const mppx = Mppx.create({
  methods: [tempo({ account })],
  polyfill: false,
})

const res = await mppx.fetch('https://api.example.com/resource')

Server

import { Mppx, Store, tempo } from 'mppx/server'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...')

const mppx = Mppx.create({
  methods: [
    tempo.charge({ currency: '0x...', recipient: '0x...' }),
    tempo.session({
      account,
      chainId: 4217,
      currency: '0x...',
      store: Store.memory(),
    }),
  ],
  secretKey: process.env.MPP_SECRET_KEY,
})

async function handler(request: Request): Promise<Response> {
  const result = await mppx.charge({ amount: '1.00' })(request)
  if (result.status === 402) return result.challenge
  return result.withReceipt(Response.json({ data: '...' }))
}

Methods

MethodIntentDescription
tempo.chargechargeOne-time stablecoin payment (TIP-20 token transfer on Tempo)
tempo.sessionsessionStreaming payments via payment channels on Tempo
stripe.chargechargeOne-time payment via Stripe

tempo() returns [tempo.charge, tempo.session] as a tuple using the current v2 Sessions implementation. Use tempo.charge() or tempo.session() individually if you only need one intent. Use tempo.sessionLegacy only for Legacy Sessions v1 compatibility.

Exports

PathPurpose
mppxCore primitives (Challenge, Credential, Method, Receipt, PaymentRequest)
mppx/clientMppx, tempo, stripe, session, Transport
mppx/serverMppx, tempo, stripe, Transport, Store, NodeListener
mppx/honoHono middleware
mppx/expressExpress middleware
mppx/nextjsNext.js middleware
mppx/elysiaElysia middleware

CLI

mppx includes a CLI for making paid requests during development:

npx mppx account create        # create wallet
npx mppx mpp.dev/api/ping/paid # make paid request
npx mppx example.com -v        # verbose output

References

When not to use it

  • Do not commit private keys or wallet seeds
  • Do not log the MPP_SECRET_KEY

Prerequisites

Signing account for client integrationsMPP_SECRET_KEY for server integrationsConfigured Stripe account for Stripe paymentsMCP client or server object for MCP integrations

Limitations

  • Runtime 402 challenges are authoritative for current payment terms
  • Tempo bridged USDC examples require USDC.e
  • MPP_SECRET_KEY must remain server-side

How it compares

Unlike manual payment integration, this SDK provides a standardized 402 flow that automatically handles payment polyfills and server-side route protection.

Compared to similar skills

mppx side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
mppx (this skill)018dReviewIntermediate
telegram-mini-app626moReviewAdvanced
stripe-integration482moNo flagsAdvanced
nodejs-backend-patterns122moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

telegram-mini-app

davila7

Expert in building Telegram Mini Apps (TWA) - web apps that run inside Telegram with native-like experience. Covers the TON ecosystem, Telegram Web App API, payments, user authentication, and building viral mini apps that monetize. Use when: telegram mini app, TWA, telegram web app, TON app, mini app.

62163

stripe-integration

wshobson

Implement Stripe payment processing for robust, PCI-compliant payment flows including checkout, subscriptions, and webhooks. Use when integrating Stripe payments, building subscription systems, or implementing secure checkout flows.

48165

nodejs-backend-patterns

wshobson

Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices. Use when creating Node.js servers, REST APIs, GraphQL backends, or microservices architectures.

1246

agent-dev-backend-api

ruvnet

Agent skill for dev-backend-api - invoke with $agent-dev-backend-api

318

shopify-apps

alinaqi

Shopify app development - Remix, Admin API, checkout extensions

19

ccxt-typescript

ccxt

CCXT cryptocurrency exchange library for TypeScript and JavaScript developers (Node.js and browser). Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors. Use when working with crypto exchanges in TypeScript/JavaScript projects, trading bots, arbitrage systems, or portfolio management tools. Includes both REST and WebSocket examples.

15

Search skills

Search the agent skills registry