mppx
यह क्या करती है
यह स्किल Payment HTTP authentication scheme के लिए mppx TypeScript SDK को कवर करती है। यह उन डेवलपर्स के लिए है जिनके क्लाइंट को संसाधनों का भुगतान करना है, या सर्वर को उनके लिए शुल्क लेना है।
कब इस्तेमाल करें
- ✓जब आपके क्लाइंट ऐप को 402 भुगतान-आवश्यक जवाब मिले और उसे अपने-आप भुगतान करना हो।
- ✓जब आप चाहते हों कि आपके सर्वर रूट Tempo stablecoin या Stripe से पहुँच का शुल्क लें।
- ✓जब आपको MCP क्लाइंट या सर्वर को ऐसे लपेटना हो कि टूल कॉल के लिए भुगतान चाहिए।
Skill का लिंक
https://github.com/internet-court/internet-court-skill/blob/main/vendored/tempo/mppx/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरा सर्वर endpoint डेटा लौटाने से पहले Tempo के ज़रिए छोटा USDC भुगतान माँगे। क्या आप इसे mppx से सेट कर सकते हैं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट प्रोजेक्ट में mppx क्लाइंट या सर्वर helpers जोड़ता है, करेंसी और रकम सेट करता है, और भुगतान चुनौती को रूट से जोड़ता है। गुप्त कुंजी सर्वर पर रहती है, और वह ज़रूरी रसीद लौटाता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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
अक्सर पूछे जाने वाले सवाल
गुप्त कुंजी कहाँ रखें?
स्किल कहती है कि MPP_SECRET_KEY सर्वर पर रहे और लॉग से बाहर।
कौन-से भुगतान तरीके सपोर्ट हैं?
इसमें Tempo के एक-बार और मीटर्ड stablecoin भुगतान, और Stripe कार्ड भुगतान का ज़िक्र है।
क्या यह USDC या USDC.e इस्तेमाल करता है?
Tempo के bridged USDC उदाहरणों के लिए स्किल USDC.e इस्तेमाल करने को कहती है।
जानकारी
लेखक का मूल विवरण
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.
लोकप्रियता
- GitHub स्टार
- 7.0k
- रैंकिंग में स्थान
- #13689
- लाइसेंस
- —
- अपडेट की गई
- 26/10/2026
कमेंट
- …
इस repository की और skills
internet-court
7.0kयह आपके एजेंट को AI एजेंट या पेड सेवा से सुरक्षित तरीके से भुगतान और लेन-देन की शुरुआती दिशा देती है, और सही विशेष गाइड बताती है।
genlayer-erc7710-connector
7.0kयह आपके एजेंट को AI समीक्षा के नतीजे को अनुमति प्रणाली से जोड़ने देती है, ताकि खराब समीक्षा एजेंट की अनुमतियाँ सीमित कर सके।
genlayer-intelligent-contracts
7.0kयह आपके एजेंट को AI जज के नियम, सबूत और नतीजे तय करने में मदद करती है, जो जाँचता है कि दूसरा एजेंट अपने अधिकार के दायरे में रहा या नहीं।
x402-erc7710
7.0kयह आपके एजेंट को हर अनुरोध पर वेब सेवा का भुगतान करने और तय सीमा के भीतर लगातार खर्च करने की व्यवस्था में मदद करती है।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।