Langsung ke konten
Skillpedia
API & server (backend)7.0k ยท #13689

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.md

Salin 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

Gunakan skill ini untuk membantu saya: https://github.com/internet-court/internet-court-skill/blob/main/vendored/tempo/mppx/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

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 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

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.

repo: internet-court/internet-court-skill

Popularitas

Bintang GitHub
7.0k
Peringkat
#13689
Lisensi
โ€”
Diperbarui
26/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa