Skip to main content
MO

MoonPay

v0.2.0API Key

Fiat↔crypto on/off-ramp. Broader coverage than UnblockPay (100+ assets, 160+ countries) including BR Pix onramp. Sell-side flows enable agents paying out in crypto.

20 tools6 env vars🌐 GLOBALstable on npm

Install

terminal
$ npm install @codespar/mcp-moonpay

Quickstart

Add this entry to your claude_desktop_config.json (or any MCP-compatible client config).

claude_desktop_config.json
{
  "mcpServers": {
    "moonpay": {
      "command": "npx",
      "args": [
        "-y",
        "@codespar/mcp-moonpay"
      ],
      "env": {
        "MOONPAY_API_KEY": "<your_moonpay_api_key>"
      }
    }
  }
}

After restart, your agent can call any of the 20 tools below β€” try get_buy_quote first.

Environment variables Β· 6

Required to authenticate the server. Stored encrypted when using CodeSpar managed hosting.

MOONPAY_API_KEY
requiredsecret

MoonPay REST API key (sandbox or production β€” the key selects the environment)

MOONPAY_PUBLISHABLE_KEY
optional

MoonPay publishable key used as `apiKey` in signed widget URLs (required for sign_buy_url / sign_sell_url).

MOONPAY_SECRET_KEY
optionalsecret

MoonPay secret key used to HMAC-SHA256 sign widget URLs (required for sign_buy_url / sign_sell_url).

MOONPAY_BASE_URL
optional

MoonPay API base URL. Defaults to https://api.moonpay.com.

MOONPAY_BUY_WIDGET_URL
optional

MoonPay buy widget base URL. Defaults to https://buy.moonpay.com.

MOONPAY_SELL_WIDGET_URL
optional

MoonPay sell widget base URL. Defaults to https://sell.moonpay.com.

Available tools Β· 20

Each tool is independent β€” your agent loads only what it needs to reduce context and response time.

READget_buy_quote
Preview a fiat -> crypto buy quote in real time. Use this before create_buy_transaction to show the end user the exact crypto amount, fees, and effective rate.
WRITEcreate_buy_transaction
Create a buy transaction (fiat -> crypto). The returned object contains status plus β€” depending on method β€” redirect URL for hosted checkout, Pix QR data, or card auth next steps.
READget_buy_transaction
Retrieve a buy transaction (fiat -> crypto) by its MoonPay id. Returns current status and settlement detail.
READlist_buy_transactions
List buy transactions with optional filters. Used for reconciliation and agent-driven monitoring.
READget_sell_quote
Preview a crypto -> fiat sell quote in real time. Use this before create_sell_transaction to show the end user the exact fiat amount, fees, and effective rate.
WRITEcreate_sell_transaction
Create a sell transaction (crypto -> fiat). Used for agents that need to pay out in local fiat after receiving crypto.
READget_sell_transaction
Retrieve a sell transaction (crypto -> fiat) by its MoonPay id.
DELETErefund_sell_transaction
Request a refund on an off-ramp (sell) transaction. Used when the destination bank rejects payout or the user disputes the trade. Reason codes are MoonPay-defined.

Compatible frameworks

MCP is a protocol β€” any framework that speaks it can mount this server.

Claude Agent SDKAnthropic
OpenAI AgentsOpenAI
Vercel AI SDKVercel
LangChainLangChain
LlamaIndexLlamaIndex
CrewAICrewAI
MastraMastra
Any MCP clientProtocol

Frequently asked questions

All credentials are encrypted at rest in an isolated vault scoped per organization. OAuth2 tokens are automatically refreshed before expiry. Your agent code never sees raw secrets β€” it receives scoped, short-lived session tokens.
Servers β€” Every LatAm commerce API your agent needs | CodeSpar