mppx
Fungsinya
Skill ini mencakup SDK TypeScript mppx untuk skema autentikasi pembayaran HTTP. Skill ini ditujukan untuk developer yang memerlukan klien mereka membayar sumber daya atau server mereka menagih akses.
Kapan dipakai
- โSaat aplikasi klien Anda menerima respons 402 payment-required dan harus membayar secara otomatis.
- โSaat rute server Anda ingin menagih akses memakai stablecoin Tempo atau Stripe.
- โSaat Anda perlu membungkus klien atau server MCP agar pemanggilan alat dapat meminta pembayaran.
Link skill
https://github.com/internet-court/internet-court-skill/blob/main/vendored/tempo/mppx/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
โSaya ingin endpoint server saya menagih pembayaran USDC kecil lewat Tempo sebelum mengembalikan data. Bisakah Anda menyiapkannya dengan mppx?โ
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent menambahkan helper klien atau server mppx ke proyek, mengatur mata uang dan jumlahnya, lalu memasang tantangan pembayaran ke rute. Agent menyimpan secret key di server dan mengembalikan tanda terima yang diperlukan.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
mppx
TypeScript SDK for the "Payment" HTTP Authentication Scheme. Full 402 flow: challenge โ credential โ receipt.
What I can accomplish
- Add
402payment handling to a client withFetch.polyfillorFetch.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
4217unless 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_KEYserver-side and out of logs. - Never commit private keys or wallet seeds.
- Treat runtime
402Challenges as authoritative for current payment terms. - Return
idandopaqueunchanged when responding to a Challenge. - Use
USDC.efor 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
| Method | Intent | Description |
|---|---|---|
tempo.charge |
charge |
One-time stablecoin payment (TIP-20 token transfer on Tempo) |
tempo.session |
session |
Streaming payments via payment channels on Tempo |
stripe.charge |
charge |
One-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
| Path | Purpose |
|---|---|
mppx |
Core primitives (Challenge, Credential, Method, Receipt, PaymentRequest) |
mppx/client |
Mppx, tempo, stripe, session, Transport |
mppx/server |
Mppx, tempo, stripe, Transport, Store, NodeListener |
mppx/hono |
Hono middleware |
mppx/express |
Express middleware |
mppx/nextjs |
Next.js middleware |
mppx/elysia |
Elysia 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
Pertanyaan umum
Di mana secret key disimpan?
Skill ini menyebutkan bahwa MPP_SECRET_KEY tetap di server dan tidak masuk ke log.
Metode pembayaran apa yang didukung?
Skill ini menyebutkan pembayaran stablecoin sekali bayar dan berbasis pemakaian di Tempo, serta pembayaran kartu Stripe.
Apakah memakai USDC atau USDC.e?
Untuk contoh USDC yang dijembatani di Tempo, skill ini menyebutkan untuk memakai USDC.e.
Detail
Deskripsi asli dari pembuat
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.
Popularitas
- Bintang GitHub
- 7.0k
- Peringkat
- #13689
- Lisensi
- โ
- Diperbarui
- 26/10/2026
Komentar
- โฆ
Skill lain dari repositori ini
internet-court
7.0kMembantu agent Anda membayar, menyewa, atau bertransaksi dengan aman bersama agent AI lain atau layanan berbayar, dan mengarahkannya ke panduan khusus yang tepat.
genlayer-erc7710-connector
7.0kMembantu agent Anda menghubungkan hasil tinjauan AI ke sistem izin, sehingga tinjauan yang buruk dapat membatasi atau mencabut izin agent.
genlayer-intelligent-contracts
7.0kMembantu agent Anda menentukan aturan, bukti, dan keluaran dari hakim AI yang memeriksa apakah agent lain mengikuti mandatnya.
x402-erc7710
7.0kMembantu agent Anda membayar layanan web per permintaan, dan mengatur pengeluaran berkelanjutan yang tetap dalam anggaran izin.
Skill serupa
api-connector-builder
280kMembuat agent Anda membangun koneksi API baru mengikuti pola yang sudah ada. Gunakan saat ingin menambah integrasi lagi tanpa membuat cara baru.
api-design
280kMembantu agent Anda merancang REST API sesuai praktik terbaik. Berguna untuk mengatur cara API berkomunikasi, menampilkan error, dan mengorganisasi data.
backend-patterns
280kMembantu agent Anda dengan pola arsitektur sisi server dan optimasi database. Berguna untuk membangun atau meninjau kode yang berjalan di server.