pay-per-call-mcp — USDC · x402 · AI Agent Billing | LemonCake
lemon-cake-mcp is an MCP server that gives AI agents a USDC wallet to autonomously discover, pay for, and call premium HTTP APIs without human intervention.
Setup guidance (
setup): Detects missing credentials and provides step-by-step onboarding instructions, including a ready-to-paste MCP config snippet for obtaining a Buyer JWT and Pay Token.Discover APIs (
list_services): Browse the LemonCake marketplace for approved paid API/MCP services, including their IDs, providers, types, per-call USDC pricing, and endpoints.Call paid services (
call_service): Invoke any upstream API through LemonCake's pay-per-call proxy, automatically charging USDC per successful call. Supports GET/POST/PUT/PATCH/DELETE, custom sub-paths, JSON bodies, and idempotency keys for safe retries without double-charging.Check account balance (
check_balance): View your current USDC balance, KYC/KYA tier, and account info to confirm sufficient funds before making calls.Japanese tax compliance (
check_tax): Validate a Japanese qualified-invoice (インボイス) registration number against the NTA registry, determine if source-withholding (源泉徴収) applies, and calculate withholding amounts and net payable.Marketplace usage stats (
get_service_stats): Access public usage statistics (call counts, total USDC revenue, last-called timestamps) to help choose the best service.Demo mode: Run without any credentials to explore demo services (
demo_search,demo_echo,demo_fx) with canned responses and a mock $1.00 balance — no signup required.
Allows AI agents to search and retrieve content from Wikipedia via a pay-per-call API proxy, with USDC-based billing and no manual authentication.
agent-payment-mcp — AI Agent Payment MCP Server
Give your AI agent a wallet. Pay-per-call USDC micropayments for any HTTP API — directly from Claude Desktop, Cursor, Cline, or any MCP client. No human approval per call. Kill switch included.
Try in 30 seconds (Demo Mode — no signup)
{
"mcpServers": {
"pay-per-call": {
"command": "npx",
"args": ["-y", "agent-payment-mcp"]
}
}
}Leave LEMON_CAKE_BUYER_JWT unset → Demo Mode activates automatically. Calls hit real Wikipedia, httpbin, and live FX rate APIs with no charges.
💡 Or click "Try in Browser" on Glama → leave both env fields empty → click Start Inspector.
What it does
agent-payment-mcp lets an AI agent discover, pay for, and call premium HTTP APIs using USDC — with no human approval per call.
Agent (Claude / Cursor / Cline)
│
├─ list_services() → browse LemonCake API marketplace
├─ call_service(serviceId) → invoke paid API, USDC deducted automatically
├─ check_balance() → current USDC balance + spend limits
├─ setup() → onboarding guide if credentials missing
├─ check_tax(regNum) → 国税庁 invoice number validation (Japan)
└─ get_service_stats() → usage + revenue analyticsSafety mechanisms
Kill switch — halts all charges instantly (atomic, one-call revocation)
Spend caps — session/daily USD ceiling the agent cannot exceed
Pay Token (JWT) — scoped, short-lived spend credential; no raw wallet key exposed to the agent
Idempotency —
idempotencyKeyparameter makes retries safe; no double-charges
Live mode (real USDC)
Sign up at lemoncake.xyz
Top up with USDC (min $5) or JPYC
Copy your Buyer JWT from the dashboard
{
"mcpServers": {
"pay-per-call": {
"command": "npx",
"args": ["-y", "agent-payment-mcp"],
"env": {
"LEMON_CAKE_BUYER_JWT": "eyJhbGci..."
}
}
}
}Tools reference
setup
Returns onboarding instructions if credentials are missing.
Input: none
Output:
{ "status": "ok", "mode": "demo", "message": "Set LEMON_CAKE_BUYER_JWT to enable live payments." }list_services
Browse the LemonCake API marketplace.
Input: { "limit": 20 }
Output:
{
"services": [
{ "id": "serper", "name": "Serper — Google Search", "priceUsdc": "0.005" }
]
}call_service
Invoke a paid API. USDC is deducted from your balance automatically.
Input:
{
"serviceId": "serper",
"path": "/search",
"method": "POST",
"body": { "q": "AI agent payments" },
"idempotencyKey": "req-abc-001"
}Output (success):
{
"status": 200,
"chargeId": "ch_abc123",
"amountUsdc": "0.005",
"response": { "organic": ["..."] },
"x402Receipt": {
"scheme": "lemoncake-pay-token-v1",
"x402Compatible": true,
"amount": "0.005",
"asset": "USDC",
"settledAt": "2026-05-09T14:50:11.019Z"
}
}Output (budget exceeded):
{ "error": "BUDGET_EXCEEDED", "remaining": "0.00", "limit": "5.00" }check_balance
Returns current USDC balance and KYA tier limits.
Output:
{
"balanceUsdc": "4.995",
"kyaTier": "standard",
"dailyLimitUsdc": "50.00",
"sessionSpentUsdc": "0.005"
}check_tax
Validates a Japanese qualified-invoice (適格請求書) registration number against the 国税庁 API.
Input: { "registrationNumber": "T1234567890123", "amountJpy": 10000 }
Output:
{ "valid": true, "businessName": "株式会社Example", "registrationDate": "2023-10-01" }get_service_stats
Returns aggregated usage data for all services.
Output:
{
"totalCalls": 142,
"totalSpentUsdc": "0.71",
"byService": [{ "serviceId": "serper", "calls": 80, "spentUsdc": "0.40" }]
}Available services
Service | ID | Price | Demo |
Serper — Google Search |
| $0.005/call | ✅ |
Hunter.io — Email finder |
| $0.005/call | ✅ |
Open Exchange Rates |
| $0.002/call | ✅ |
Jina Reader — Web scraper |
| $0.002/call | ✅ |
国税庁 Invoice API |
| $0.002/call | ✅ |
gBizINFO — 法人情報 |
| $0.003/call | ✅ |
IPinfo — Geolocation |
| $0.003/call | ✅ |
Firecrawl — Scraping |
| $0.005/call | ✅ |
Slack — Human-in-the-loop |
| $0.005/call | ✅ |
TRUSTDOCK — eKYC |
| $0.05/call | ✅ |
Full marketplace: lemoncake.xyz/services
x402 compatibility (since v0.5.1)
This server speaks the x402 protocol. Agent code written for on-chain x402 works unmodified:
call_servicereturnsx402Receipton every successful chargeUpstream
402challenges are parsed (WWW-Authenticate,X-402-*headers, bodyx402field)PAYMENT_PENDINGsemantics withretryAfterMs+idempotencyKeyfor async settlement
Environment variables
Variable | Required | Description |
| ✅ live | Buyer JWT from dashboard → API Keys |
| — | Pre-issued Pay Token JWT (alternative) |
| — | API endpoint override (default: |
Leave both JWT vars unset → Demo Mode (no charges, real demo APIs).
Tested MCP clients
Client | Status |
Claude Desktop (macOS / Windows) | ✅ |
Cursor | ✅ |
Cline (VS Code) | ✅ |
Claude Code CLI | ✅ |
Continue.dev | ✅ |
Any MCP 1.10+ stdio client | ✅ |
For MCP server developers
Add pay-per-call billing to your own MCP server in 3 lines:
npm install @lemon-cake/mcp-sdkimport { createLemonCakeSDK } from "@lemon-cake/mcp-sdk";
const lc = createLemonCakeSDK({ sellerKey: process.env.LEMONCAKE_SELLER_KEY });
execute: lc.charge({ price: 0.05 })(async (args) => myHandler(args))Demo Mode activates automatically when LEMONCAKE_SELLER_KEY is absent.
Sibling MCPs
Package | What it does |
Buy tokenized US stocks (xStocks) on Solana via Jupiter DEX | |
Alpaca brokerage with hard daily USD cap guard | |
Polymarket prediction markets with USDC billing |
Local development
git clone https://github.com/evidai/agent-payment-mcp.git
cd agent-payment-mcp/mcp-server
npm install && npm run build && npm startLicense
MIT © LemonCake · contact@aievid.com
Maintenance
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/evidai/lemon-cake'
If you have feedback or need assistance with the MCP directory API, please join our Discord server