/stripe-mpp:mpp-client-fetchfrom stripe-mpp
Implements MPP client-side payment handling using mppx.fetch() as a drop-in fetch replacement. Handles transparent 402 challenge-response flow for AI agents and automated clients.
Ships in stripe-mpp. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fetch live docs:
https://www.npmjs.com/package/mppx for the current client API and wallet configurationmppx client fetch payment wallet configuration for client-side setup patternssite:github.com stripe-samples machine-payments client for official client sample codehttps://mpp.dev/overview for the client-side protocol flow descriptionmppx.fetch() is a drop-in replacement for the standard fetch() API that transparently handles the full HTTP 402 payment flow:
WWW-Authenticate: Payment challengeAuthorization: Payment credentialPayment-Receipt header from the responseThe developer's code sees only the final successful response — all payment negotiation is handled internally.
import { mppx } from 'mppx/client';
// Configure once
const client = mppx.create({
wallet: {
privateKey: process.env.WALLET_PRIVATE_KEY, // For Tempo/crypto payments
},
// OR for Stripe SPT payments:
stripe: {
sharedPaymentToken: sptToken, // Obtained from SPT provisioning
},
});
// Use like fetch()
const response = await client.fetch('https://api.example.com/paid-resource');
const data = await response.json();
When a server supports multiple payment methods, the client selects based on:
Clients should implement spending controls:
After a successful payment, the Payment-Receipt header contains:
Clients should log receipts for accounting and dispute resolution.
| Scenario | Behavior |
|---|---|
| Insufficient balance | Throw error with details |
| Unsupported payment method | Throw error listing supported methods |
| Challenge expired | Retry with fresh request |
| Network error during payment | Do not retry payment (risk of double-pay) |
| Server returns non-402 error | Pass through as normal fetch error |
The mppx CLI provides a quick way to test payments:
npx mppx https://api.example.com/paid-resource
A client can be configured with multiple payment methods:
const client = mppx.create({
methods: [
{ type: 'tempo', wallet: { privateKey: process.env.WALLET_KEY } },
{ type: 'stripe', spt: { token: sptToken } },
],
preference: ['tempo', 'stripe'], // Try Tempo first, fall back to Stripe
});
Fetch the latest mppx client documentation for exact configuration options, wallet setup, and error types before implementing.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
mpp, machine-payments, payment-handling, http-402, fetch-wrapper, client-payment
12 skills in this plugin
/mpp-charge-flowImplement MPP one-time charge payment flows — per-request payment gates for API monetization, data access, and file downloads. Use when building pay-per-call APIs or protecting individual resources with HTTP 402 charges./mpp-conformanceValidate MPP implementations against the specification — verify HTTP 402 challenge-response compliance, header formats, payment method correctness, service discovery, and production readiness. Use when auditing an MPP integration or preparing for production launch./mpp-dev-patternsCross-cutting MPP development patterns — security, replay protection, HMAC challenge binding, receipt validation, error handling, retry logic, TLS requirements, and monitoring. Use when designing architecture or solving production concerns.npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin stripe-mppOther plugins' skills for the same job