agentpay

v3.1.0
io.github.up2itnow0822/agentpay Checked 10 hours ago Published 8 months ago

Non-custodial x402 payment MCP server for AI agents.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

deploy_wallet

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).

ParameterTypeDescription
token_id *stringNFT token ID that will own this wallet (e.g. "1")
factory_addressstringFactory contract address. Defaults to FACTORY_ADDRESS env var.
nft_contract_addressstringNFT contract address. Defaults to NFT_CONTRACT_ADDRESS env var.

get_wallet_info

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).

ParameterTypeDescription
tokenstringToken address to check. Use "0x0000000000000000000000000000000000000000" for ETH (default).

send_payment

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.

ParameterTypeDescription
amount_eth *stringAmount in ETH (or token units). E.g. "0.001" for 0.001 ETH, "1.5" for 1.5 USDC
to *stringRecipient wallet address (0x-prefixed)
memostringOptional memo for this payment (not stored on-chain)
tokenstringERC20 token address. Omit for native ETH.
token_decimalsnumberToken decimals (default 18 for ETH, 6 for USDC)

check_spend_limit

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.

ParameterTypeDescription
amount_eth *stringAmount in ETH to check (e.g. "0.01")
tokenstringToken address. Omit for native ETH.

queue_approval

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.

ParameterTypeDescription
action *stringAction: "list", "approve", or "cancel"
tx_idstringTransaction queue ID (required for approve/cancel)

x402_pay

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.

ParameterTypeDescription
url *stringURL to fetch (HTTP 402 responses are handled automatically)
bodystringRequest body string (for POST/PUT/PATCH)
headersobjectAdditional request headers
max_payment_ethstringMaximum payment cap in ETH (e.g. "0.001")
methodstringHTTP method (default: GET)
skip_session_checkbooleanSkip session auto-detection and force a fresh x402 payment
timeout_msnumberTimeout in milliseconds (default: 30000)

get_transaction_history

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.

ParameterTypeDescription
event_typestringFilter by event type (default: all)
from_blockstringStart block (decimal string). Defaults to 1000 blocks ago.
limitnumberMax entries to return (default: 20, max: 100)
to_blockstringEnd block (decimal string). Defaults to latest.

x402_session_start

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.

ParameterTypeDescription
endpoint *stringBase URL to establish a session for (e.g., "https://api.example.com/v1")
bodystringRequest body for POST/PUT/PATCH session-start requests
headersobjectAdditional request headers
labelstringOptional label for this session (e.g., "Premium API session")
max_payment_ethstringMaximum ETH to pay for this session. Rejects if price exceeds this.
methodstringHTTP method for the initial request (default: GET)
scopestring"prefix": covers all paths under this URL (default). "exact": single URL only.
timeout_msnumberRequest timeout in milliseconds (default: 30000)
ttl_secondsnumberSession TTL in seconds (default: 3600 / 1 hour). Max: 30 days.

x402_session_fetch

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).

ParameterTypeDescription
session_id *stringSession ID from x402_session_start
url *stringURL to fetch (must be covered by the session)
bodystringRequest body for POST/PUT/PATCH
headersobjectAdditional headers (session token is injected automatically)
methodstringHTTP method (default: GET)
timeout_msnumberTimeout in milliseconds (default: 30000)

x402_session_status

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.

ParameterTypeDescription
session_idstringSpecific session ID to inspect. Omit to list all active sessions.

x402_session_end

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.

ParameterTypeDescription
session_id *stringSession ID to close (from x402_session_start)