PayAgent
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
PayAgent — an MCP server that gives AI agents a wallet
An MCP server (Streamable HTTP, MCP spec 2025-11-25) that lets AI agents pay for metered web APIs per call, without a human in the loop. Built for the Alexa+ track of the Amazon Developer Hackathon (Build, Ship, Shape). Integrates with Alexa+ through the Alexa+ for Builders MCP toolkit.
The problem
AI agents can browse, reason, and act, but they cannot pay. Every metered API on the web expects a human with a credit card. PayAgent closes that gap: the agent holds its own USDC wallet and settles x402 micropayments autonomously, inside the spending limits its owner sets.
Related MCP server: x402 Micropayments MCP
Tools
Tool | What it does |
| Fetch a URL. On an x402 v2 |
| Show the agent wallet's address and testnet USDC balance. |
Safety bounds: only x402 v2 exact challenges are honored; per-call spend is capped
(default $1, hard cap $100); only http(s) URLs; private/loopback hosts are blocked
unless ALLOW_PRIVATE_HOSTS=true; 15s request timeout.
Run it
npm install
npm run build
# Terminal 1: stub x402 seller (local demo endpoint, $0.05 per call)
node dist/examples/paid-endpoint-stub.js
# Terminal 2: the MCP server (Streamable HTTP on :3001/mcp)
ALLOW_PRIVATE_HOSTS=true node dist/src/server.js
# Terminal 3: demo MCP client (connects like any Alexa+/MCP agent would)
node dist/examples/demo-client.jsExpected: the client lists both tools, wallet_info shows the agent address, and
x402_fetch returns PAID $0.050000 USDC ... HTTP 200 with the seller's data —
the full 402 → sign → 200 loop, negotiated over MCP spec 2025-11-25.
Env
Var | Default | Purpose |
| ephemeral demo key | Agent wallet (0x hex). Set your own for real use. |
|
| Set |
|
| MCP server port ( |
Copy .env.example to .env to configure.
How it works
MCP client (agent) --Streamable HTTP--> PayAgent --HTTPS--> paywalled API
402 challenge
<-- x402 v2 (price, payTo)
EIP-3009 sign (agent wallet)
PAYMENT-SIGNATURE -->
<-- 200 + dataThe x402 buyer logic (src/x402buyer.ts) is adapted from our production-tested
CRE x402 gateway:
same EIP-3009 domain, same PAYMENT-SIGNATURE (v2) header format.
Layout
src/
server.ts # McpServer, tool registrations, Streamable HTTP bridge
x402buyer.ts # x402 v2 buyer: challenge parsing, EIP-3009 signing, wallet info
x402verify.ts # x402 v2 seller-side verification (used by the stub)
examples/
paid-endpoint-stub.ts # local $0.05/query x402 seller for demos
demo-client.ts # MCP client driving the full paid-fetch flowLicense
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Let an AI agent find and pay for x402 APIs and products in USDC on Base, within owner-set limits.
Machine-payable API infrastructure for autonomous agents. Per-call x402 settlement in USDC.
Pay-per-call tools for autonomous agents, settled in USDC on Base via x402.
Pay-per-use tool API for AI agents. Free tier, x402 USDC micropayments, or API key.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables AI agents to call x402-gated APIs using a central credit balance, abstracting away blockchain complexity and payment proofs. It provides tools to fetch data from payment-required endpoints, check usage balances, and simulate transaction costs.660 npm2-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to discover, pay for, and sell HTTP APIs using the x402 micropayment protocol, with USDC settlement on Base mainnet. Includes tools for payment requirements, paying and fetching resources, building seller configurations, and monitoring revenue.223 npm1MIT

PayAgents MCP Serverofficial
AlicenseAqualityDmaintenanceEnables AI agents to autonomously make policy-controlled payments for APIs and tools via Bitcoin Lightning (L402) and Base USDC (x402), including paying paywalled endpoints, checking balances, and reviewing transactions.312 npm1MIT- AlicenseNot gradedqualityBmaintenanceEnables AI agents to check their wallet address and USDC balance, preview the cost of an x402 call, and pay for API requests in USDC on Base without an account or API key. Spend caps, allow-lists and blocked contracts are enforced in code before anything is signed, so a prompt injection cannot bypass them.MIT