mcpField
M
moonpay-x402

moonpay-x402

github.com/moonpayDevelopment11246 installsUpdated 23w ago
Repository

About moonpay-x402

moonpay-x402 is a skill for making paid HTTP requests to x402-protected endpoints through the MoonPay CLI. The CLI detects 402 responses, builds and signs a payment transaction, then retries with payment proof; failed requests do not settle the payment.

Key features

  1. 01Send HTTP requests with a chosen method
  2. 02Handle the 402 payment flow automatically
  3. 03Sign payments with a local wallet
  4. 04Avoid settlement when a request fails

Use cases

  1. 01Call an x402-protected API
  2. 02Upgrade a service rate limit through a request
  3. 03Pay for requests with a Solana or Base wallet

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/moonpay/skills --skill moonpay-x402

After installing, type/moonpay-x402in Claude Code to confirm it loaded.

Details

From the project README

x402 paid API requests

Goal

Make HTTP requests to x402-protected endpoints. The CLI automatically detects 402 Payment Required responses, builds and signs a payment transaction with your local wallet, and retries the request with the payment proof.

Command

mp x402 request \
  --method POST \
  --url <x402-endpoint-url> \
  --body '<json-body>' \
  --wallet <wallet-name-or-address> \
  --chain solana

Available x402 endpoints

EndpointCostInput
https://agents.moonpay.com/x402/upgrade$1-$20{"duration": "day"} or {"duration": "month"}

Example flow

  1. User: "Upgrade my rate limit for a day."
  2. Run: mp upgrade --duration day --wallet my-wallet --chain solana
  3. The CLI handles the 402 payment flow automatically and applies the upgrade.

Notes

  • Requires a local wallet with USDC on Solana or Base.
  • Payments accepted on Solana mainnet and Base.
  • If the request fails (status >= 400), the payment is not settled — you don't pay for errors.
  • Use moonpay-auth to set up a local wallet first.

Related skills

  • moonpay-auth — Create or import a local wallet.
  • moonpay-check-wallet — Check your wallet balance before making paid requests.
  • moonpay-upgrade — Upgrade your rate limit via x402.

Comments

Markdown supported