get-paid-per-call
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.
get-paid-per-call
A tiny MCP server with one tool that AI agents pay for per call: one cent, in USDC, over the x402 protocol. It's the reference repo for Savantly's guide to getting paid by AI agents. Copy the pattern into your own server.
Adding payments to your own server? Point your coding agent at AGENT-GUIDE.md: "Follow AGENT-GUIDE.md to make my
searchtool cost $0.01 per call."
Status: v0.1, testnet only. It runs on Base Sepolia with test money. Read "Going live" before taking real payments.
The whole idea in one diff
A free tool and a paid tool differ by one wrapper (src/paid-server.ts):
server.tool('ping', 'Free health check.', {}, async () => ({content: [{type: 'text', text: 'pong'}]}));
server.tool('sun_times', 'Sunrise and sunset… Costs $0.01 per call.', schema,
paid(async ({lat, lon, date}) => ({content: [{type: 'text', text: JSON.stringify(sunTimes(lat, lon, date))}]})),
);paid comes from @x402/mcp's createPaymentWrapper, configured once with a facilitator, a
network, a price and the address you're paid at.
Related MCP server: pitchpilot-agent-tools
How a paid call works
The agent calls
sun_timeswith no payment.The server answers with an x402 PaymentRequired result: amount, asset (USDC), network,
payTo.The agent's wallet signs a USDC transfer authorization and retries the call with it attached.
The server asks the facilitator to verify the payment, runs the tool, then settles it on-chain.
The agent gets the answer plus the transaction hash. You get a cent, and a signed record of the call.
The server never holds a private key. It only needs the address you're paid at.
Quick start (testnet, about 5 minutes)
npm install
cp .env.example .env # set PAY_TO to an address you control
npm test # free tool works; paid tool returns PaymentRequired
# (npm scripts load .env via Node's --env-file-if-exists; Node >= 22.9)
npm start # MCP server at http://localhost:4022/mcpPay for a call yourself, playing the agent:
npm run new-wallet # throwaway TESTNET buyer wallet
# fund it with Base Sepolia USDC from a faucet, then:
BUYER_PRIVATE_KEY=0x... npm run payWith BUYER_PRIVATE_KEY set, npm test also makes a real testnet payment end to end.
Check any server's paid tool without paying (exit code 0 = it asks for payment correctly):
MCP_URL=http://localhost:3000/mcp TOOL=my_tool ARGS='{"q":"x"}' EXPECT_PRICE='$0.01' npm run checkWho can pay you today (November 2026)
Can pay: agents developers build with an x402 client (
@x402/mcp,@x402/fetch, the Python SDK), Cloudflare's Agents SDK, AWS Bedrock AgentCore payments.Can't yet: ChatGPT, Claude and Cursor don't pay MCP tools per call natively.
So keep a free tier or an API-key path next to the paid one. In this repo,
pingis free; in yours, it might be a rate-limited free plan.
Going live (real money)
Set
X402_NETWORK=eip155:8453(Base mainnet) and use a mainnet facilitator. The public x402.org facilitator serves testnet; for mainnet, check the current x402 docs (Coinbase's CDP facilitator needs API keys). To verify before the guide ships.Receive at an address whose keys you keep offline, or at a split contract if you share revenue.
Keep records: each settlement hook (
onAfterSettlement) gives you the payer and transaction.Watch for wash traffic: lots of tiny payments from wallets you control or that pay each other.
CI
.github/workflows/weekly-paid-call.yml runs the tests on every push and weekly. With the
PAY_TO and BUYER_PRIVATE_KEY secrets set (a testnet wallet with faucet USDC), it makes a real paid
call, so we hear about SDK or facilitator changes before readers do.
Roadmap
Agent guide (AGENT-GUIDE.md); eval 1 (2026-11-22): a fresh agent made a sample server's
searchtool paid and passed the check, and its findings are folded inStripe MPP variant
Python variant
Hosted demo endpoint that readers' agents can pay
Mainnet notes verified
Pinned to @x402/* 2.32.0 and @modelcontextprotocol/sdk 1.32.2 (checked 2026-11-22).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Pay-per-use tool API for AI agents. Free tier, x402 USDC micropayments, or API key.
Pay-per-call tools for autonomous agents, settled in USDC on Base via x402.
x402-paid Base agent tools (USDC). 5 deterministic tools. No API keys. No NFT pass.
17 pay-per-call web, finance, legal and onchain tools for AI agents. USDC on Base via x402/MPP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to call 45 micro-priced utility tools via x402 micropayments on Base, covering search, screenshots, OCR, PDFs, WHOIS, geo-IP, and more without API keys.-
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to access 13 paid micro-tools over x402, paying per request in USDC on Base without API keys or signup. It covers email deliverability, grading, and templates, plus utilities like crypto prices, domain age, hashing, JSON conversion, JWT decoding, regex, slugs, UUIDs, and weather.MIT
- AlicenseAqualityCmaintenanceEnables AI agents to fetch crypto market and on-chain data, including prices across venues, token facts, OHLC candles, market overview, DeFi TVL, and wallet balances, with two free tools and the rest paid per call in USDC on Base via x402.8MIT
- AlicenseAqualityCmaintenanceEnables agents to call paid utilities for DNS/SSL checks, site status, summarization, keyphrase extraction, decision advice, data cleanup, claim verification, and grounding via per-call USDC payments over x402, with free discovery tools and no signup or API key.10MIT