Help us improve
Share bugs, ideas, or general feedback.
From stripe-mpp
Implements MPP client-side payment handling with mppx.fetch() for AI agents and automated clients consuming 402-protected APIs via transparent challenge-response flows.
npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin stripe-mppHow this skill is triggered — by the user, by Claude, or both
Slash command
/stripe-mpp:mpp-client-fetchThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Fetch live docs**:
Implements Mppx server middleware for Hono, Express, Next.js, and Elysia to protect API routes with HTTP 402 payment gates, verify proofs of payment, and configure methods like Stripe.
Implements x402 (paid APIs via OZ Channels) and MPP (Machine Payments Protocol) for AI-agent-to-agent payments on Stellar, supporting Charge and Channel modes with USDC.
Injects x402 payment middleware into Express APIs to enforce USDC micropayments on Base L2 for machine-to-machine monetization. Useful for premium endpoints or MCP servers.
Share bugs, ideas, or general feedback.
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.