# Mppx

TypeScript SDK for the Payment HTTP Authentication Scheme.

- Repository: https://github.com/internet-court/internet-court-skill (7050 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-10-26
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add internet-court/internet-court-skill --skill mppx -g -a claude-code -y`
Codex: `npx skills add internet-court/internet-court-skill --skill mppx -g -a codex -y`
Cursor: `npx skills add internet-court/internet-court-skill --skill mppx -g -a cursor -y`
Gemini CLI: `npx skills add internet-court/internet-court-skill --skill mppx -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add internet-court/internet-court-skill`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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

```ts
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:

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

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

## Server

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

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

The rest: https://github.com/internet-court/internet-court-skill/blob/HEAD/vendored/tempo/mppx/SKILL.md
