본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)7.0k · #13689

mppx

하는 일

이 스킬은 Payment HTTP 인증 방식을 위한 mppx TypeScript SDK를 다룹니다. 자원에 대해 결제해야 하는 클라이언트나 그 자원에 요금을 받으려는 서버를 만드는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓클라이언트 앱이 402 결제 필요 응답을 받아 자동으로 결제해야 할 때.
  • ✓서버 경로에서 Tempo 스테이블코인이나 Stripe로 접근 요금을 받고 싶을 때.
  • ✓MCP 클라이언트나 서버를 감싸서 도구 호출에 결제를 요구해야 할 때.

스킬 링크

https://github.com/internet-court/internet-court-skill/blob/main/vendored/tempo/mppx/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/internet-court/internet-court-skill/blob/main/vendored/tempo/mppx/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 서버 엔드포인트가 데이터를 반환하기 전에 Tempo로 소액 USDC 결제를 받도록 mppx로 설정해 주실 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 프로젝트에 mppx 클라이언트나 서버 도우미를 추가하고, 통화와 금액을 설정한 뒤, 결제 요구를 경로에 연결합니다. 비밀 키는 서버에 두고, 필요한 영수증을 돌려줍니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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

자주 묻는 질문

비밀 키는 어디에 두나요?

MPP_SECRET_KEY는 서버에 두고 로그에 남기지 않는다고 스킬은 말합니다.

어떤 결제 방식을 지원하나요?

Tempo의 일회성 및 사용량 기반 스테이블코인 결제와 Stripe 카드 결제를 언급합니다.

USDC와 USDC.e 중 무엇을 쓰나요?

Tempo에서 브리지된 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.

repo: internet-court/internet-court-skill

인기도

GitHub 스타
7.0k
순위
#13689
라이선스
—
업데이트
2026. 10. 26.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬