MCP.so
Sign In
C

ClawPay MCP — Non-custodial x402 Payment Layer for AI Agents

@up2itnow0822

About ClawPay MCP — Non-custodial x402 Payment Layer for AI Agents

Non-custodial x402 MCP payment protocol for AI agents. Agents sign locally, no custodial infra. Supports EVM (Base) + Solana, auto-handles HTTP 402 payment flows, on-chain spend limits. Published in Coinbase x402 ecosystem (PR #1381).

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "clawpay-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "clawpay-mcp"
      ],
      "env": {
        "AGENT_PRIVATE_KEY": "<YOUR_PRIVATE_KEY>",
        "AGENT_WALLET_ADDRESS": "<YOUR_WALLET_ADDRESS>",
        "CHAIN_ID": "8453"
      }
    }
  }
}

Tools

11

Deploy a new AgentAccountV2 wallet via the factory contract. The wallet is deterministically addressed (CREATE2) and owned by an NFT. Returns the wallet address and deployment transaction hash. Requires FACTORY_ADDRESS and NFT_CONTRACT_ADDRESS env vars (or pass them as arguments).

Get comprehensive wallet information including address, on-chain balance, spend limits, remaining period allowance, and queue depth. Use token parameter to check budget for a specific ERC20 (defaults to ETH).

Send ETH or ERC20 tokens from the Agent Wallet. If the amount is within the configured spend limits, it executes immediately and returns the tx hash. If it exceeds limits, the transaction is queued for owner approval (use queue_approval to manage). Always check spend limits first with check_spend_limit to avoid surprises.

Check whether a proposed payment amount is within the wallet's autonomous spend limits. Returns a clear yes/no with remaining budget details. Use this before send_payment to avoid surprise queuing.

Manage over-limit transactions queued for owner review. Use action="list" to see pending transactions, "approve" to approve one by ID, or "cancel" to cancel one by ID. Approve/cancel require the agent key to have owner privileges.

Fetch a URL and automatically handle HTTP 402 Payment Required responses. If an active x402 V2 session covers this URL, the session token is used instead of making a new payment (no on-chain cost). If no session exists, the Agent Wallet pays the required amount and retries. Payment is rejected if it exceeds your wallet's spend limits or the max_payment_eth cap. Powered by the x402 protocol on Base network. Tip: Use x402_session_start to pay once for a session and save on repeated calls.

Retrieve the wallet's recent on-chain transaction history from event logs. Shows executions, queued transactions, approvals, cancellations, spend policy updates, and operator changes. Filter by event type or block range for targeted queries.

Establish an x402 V2 payment session: make a SINGLE on-chain payment and receive a cryptographically signed session token. All subsequent calls to the same endpoint within the session lifetime use x402_session_fetch — no additional payments required. Agents pay once per session rather than once per API call. Session tokens are signed locally by your wallet key (non-custodial). Returns a session_id you pass to x402_session_fetch for all future calls.

Make an HTTP request within an established x402 V2 session — NO payment required. The session token (signed by your wallet) is automatically attached to the request. The server recognises your session and grants access without a new on-chain payment. Requires a session_id from x402_session_start. Returns an error if the session has expired (call x402_session_start again to renew).

Check the status of x402 V2 payment sessions. Without arguments, lists all active sessions with TTL remaining. With a session_id, shows full details for that session including call count, payment info, and the signed session token.

Explicitly close an x402 V2 session before it expires naturally. After calling this, x402_session_fetch will return an error for the closed session. Useful for security hygiene or when you know a session is no longer needed.

Overview

What is AgentPay MCP?

AgentPay MCP is a Model Context Protocol server that wraps the Agent Wallet SDK, enabling MCP-compatible AI clients (Claude Desktop, Cursor, Windsurf) to make on-chain payments with built-in spend limit enforcement. It is non-custodial, runs on the Base network (Mainnet and Sepolia), and supports the x402 HTTP 402 payment standard. It is designed for developers building AI agents that need to pay for APIs, tokens, or services autonomously.

How to use AgentPay MCP?

Install globally via npm install -g agentpay-mcp, set environment variables (AGENT_PRIVATE_KEY, AGENT_WALLET_ADDRESS, optionally CHAIN_ID and RPC_URL), and add the server to your MCP client’s configuration (e.g., Claude Desktop’s claude_desktop_config.json). The server exposes tools such as deploy_wallet, send_payment, x402_pay, check_spend_limit, get_wallet_info, queue_approval, and get_transaction_history.

Key features of AgentPay MCP

  • 🔐 Non-custodial — you hold your keys via an NFT-owned smart contract wallet.
  • 💸 On-chain spend limits cap per-transaction and per-period spending.
  • ⚡ x402-native automatic handling of HTTP 402 Payment Required responses.
  • 🌐 Operates on Base network (fast, cheap, EVM-compatible).
  • 🧩 Fully compatible with any MCP client (Claude Desktop, Cursor, Windsurf, etc.).
  • 📋 Over-limit transactions queue for your explicit on-chain approval.

Use cases of AgentPay MCP

  • AI agents autonomously paying for premium API access via x402.
  • Automated recurring payments within strict per-period budget limits.
  • Agent-to-agent micropayments for services, data, or compute.
  • Safe deployment of agent wallets with spend controls to prevent runaway costs.

FAQ from AgentPay MCP

What does “non-custodial” mean for AgentPay MCP?

You own the wallet via an NFT. The agent only holds a limited hot key that can spend within on-chain limits you set; you retain full control of the wallet.

What happens if the agent private key is compromised?

On-chain spend limits cap any potential loss. The agent can only spend within the configured per-transaction and per-period limits, and over-limit transactions are queued for your approval.

Which networks does AgentPay MCP support?

It supports Base Mainnet (chain ID 8453) and Base Sepolia testnet (chain ID 84532), both EVM-compatible L2 chains.

How do I deploy a new agent wallet?

Use the deploy_wallet tool with token_id, factory_address, and nft_contract_address. After deployment, set AGENT_WALLET_ADDRESS in your environment.

What is x402 and how does it work in AgentPay MCP?

x402 is a standard where an API returns HTTP 402 Payment Required. AgentPay MCP’s x402_pay tool automatically fetches the URL, interprets the 402 response, and sends the required payment (within a max_payment_eth cap) using the agent wallet.

Frequently asked questions

What does “non-custodial” mean for AgentPay MCP?

You own the wallet via an NFT. The agent only holds a limited hot key that can spend within on-chain limits you set; you retain full control of the wallet.

What happens if the agent private key is compromised?

On-chain spend limits cap any potential loss. The agent can only spend within the configured per-transaction and per-period limits, and over-limit transactions are queued for your approval.

Which networks does AgentPay MCP support?

It supports Base Mainnet (chain ID 8453) and Base Sepolia testnet (chain ID 84532), both EVM-compatible L2 chains.

How do I deploy a new agent wallet?

Use the `deploy_wallet` tool with `token_id`, `factory_address`, and `nft_contract_address`. After deployment, set `AGENT_WALLET_ADDRESS` in your environment.

What is x402 and how does it work in AgentPay MCP?

x402 is a standard where an API returns HTTP 402 Payment Required. AgentPay MCP’s `x402_pay` tool automatically fetches the URL, interprets the 402 response, and sends the required payment (within a `max_payment_eth` cap) using the agent wallet.

Comments

More Other MCP servers