π LemonCake β Billing & budgets for AI agents
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.
π LemonCake β agent-payment-mcp
Let your AI agent pay for any API β capped, no account.
Give your agent a spend-capped Pay Token and it pays for paid APIs on its own. Discover β pay β pass through. No per-call key, no human in the loop, and it can't exceed your cap. First 3,000 calls free, then 3%. Seller gets 97%. LemonCake never holds your funds.
Want to monetize your own MCP server or API? Start at lemoncake.xyz/app or copy the mcp-monetization-starter.
π° No monthly fee. First 3,000 calls free (lifetime). Then 3% only when your API earns. See pricing β
β‘ Try in 30 seconds β no signup
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (or Cursor / Cline):
{
"mcpServers": {
"lemon": {
"command": "npx",
"args": ["-y", "agent-payment-mcp"]
}
}
}Restart, then ask:
"use lemon to translate 'Hello, agent payments' to Japanese"
Zero env vars. Zero signup. Zero credit card. Demo Mode activates automatically.
Related MCP server: @arispay/payagent-mcp
π 8 free demo tools (real APIs, no auth)
Tool | What it does | Upstream |
π | Search Wikipedia (5 results + URLs) | en.wikipedia.org |
π± | Live FX rates (160+ currencies) | open.er-api.com |
π | Translate 80+ languages | MyMemory |
π€ | Current weather for any lat/lon | Open-Meteo |
π | Place name β coordinates | OpenStreetMap Nominatim |
π | Current time + DST for any IANA timezone | worldtimeapi |
π | English definitions / synonyms | dictionaryapi.dev |
π | HTTP echo (request inspector) | httpbin.org |
π³ How agents pay for APIs (x402 autonomous payment)
LemonCake speaks x402 β the HTTP 402 payment protocol for AI agents.
Agent β POST /g/<endpoint>
β
402 + accepts[] { pricePerCall, buyUrl, mintUrl }
β
Agent mints a Pay Token (off-session, capped)
β
Bearer <jwt> β gateway β your APISeller registers any HTTP API at lemoncake.xyz/app and sets a price per call
Buyer prepays via card β Pay Token (JWT) issued automatically
Agent passes
Authorization: Bearer <token>β gateway verifies, meters, forwardsBudget exhausted β gateway returns
402 + accepts[]so agents can self-fund
π€ Agent autonomous top-up (Agent Funding API)
For fully autonomous operation with no human per-session:
Issue a Buyer Key (
bk_...) in the Pay Tokens pane at /appSave a card once at /agent/fund
Agent uses
bk_to mint/top-up Pay Tokens off-session β hard-capped per your limits
Agent β POST /api/lc/agent/tokens (Bearer bk_...)
β off-session card charge β Pay Token issued
β Bearer <jwt> β gateway β pass throughCaps enforced server-side: per-mint / daily / monthly. Cannot overspend.
πͺ Publish your own API (for sellers)
Monetize any HTTP API or MCP server in minutes:
Sign in at lemoncake.xyz/app
Add API β paste your URL, set price per call
Share the buy link β buyers prepay with a card, Pay Token issued automatically
You keep 97%. LemonCake takes 3% once at checkout. Never holds funds (Stripe Connect Direct Charge).
// Your tool code is unchanged β LemonCake sits in front as a gateway
class MyTool extends MCPTool {
// existing logic β no SDK required
}
// Route traffic through: https://lemoncake.xyz/g/<shortId>π Compliance β registration not required in 7 jurisdictions
Japan FSA Fintech Support Desk (2026-06) confirmed: no electronic payment means management registration required. LemonCake never holds funds (Stripe Connect Direct Charge, custody-free).
Jurisdiction | Basis |
π―π΅ Japan | FSA confirmed β registration not required |
πΊπΈ USA | FinCEN 2019 Β§4.5 β non-custodial software β MSB |
πͺπΊ EU | MiCA β non-CASP |
π¬π§ UK | FCA β Tech Service Provider |
πΈπ¬ Singapore | MAS β DPT non-applicable |
π¨π¦ Canada | FINTRAC β non-custodial exemption |
π¨π Switzerland | FINMA β non-financial intermediary |
Full posture: lemoncake.xyz/security
π The LemonCake family
Package | Use |
Main MCP β x402 gateway + agent payment rail (this one) | |
SDK to monetize your own MCP server | |
Buy tokenized US stocks on Solana | |
Alpaca paper / live trading with hard USD cap | |
Dinari dShares |
π‘ Security
Server-side hard caps β per-mint / daily / monthly limits enforced on the server. Cannot be exceeded.
Pay Token = JWT β signed HS256, verified on every gateway call. Not a blockchain asset.
No private keys in the MCP server β Buyer Key (
bk_) has hashed secret, PM reference only (no raw card data).Stripe Connect Direct Charge β funds go seller-direct. LemonCake never holds customer funds.
RLS on all DB tables,
upstream_authnever returned in API responses.
Links
Try demo |
|
Seller dashboard | |
Agent card setup | |
Docs | |
Source | |
MCP Registry | |
License | MIT |
Available Tools
6 toolscall_serviceA
Invoke an upstream API service through LemonCake's pay-per-call proxy. Each successful call automatically debits USDC from your wallet via the permit you signed. LemonCake never holds your USDC β the transfer is direct wallet β provider on Base.
PRECONDITIONS:
β’ LEMON_CAKE_PERMIT env var must be set for real services. Get one in ~30 seconds at
https://lemoncake.xyz/start/v2 (sign in with Google, sign 1 EIP-712 permit, copy the blob).
If missing, the tool returns a structured PERMIT_MISSING error with how-to-fix steps.
β’ DEMO MODE: any serviceId starting with demo_ works WITHOUT a permit and hits real
free upstreams (Wikipedia / httpbin / Open-Meteo / Nominatim / MyMemory / dictionaryapi /
worldtimeapi / open.er-api). 8 demos cover search / echo / fx / translate / weather /
geocode / time / dictionary β useful for Glama Inspector or new-user trial. They are
marked with mode: "demo" and incur no charge.
β’ serviceId must come from list_services.
BEHAVIOR: β’ Returns the upstream response body verbatim (JSON or text), plus the X-Charge-Id and X-Amount-Usdc headers reported by the proxy. β’ HTTP 402 Payment Required is returned as a normal result (NOT thrown) so the agent can autonomously stop spending when the daily $25 permit cap is exhausted. β’ Pass the same idempotencyKey to retry safely without double-charging. β’ This tool spends real money and contacts an external service β it is non-idempotent by default and has external side effects.
x402-COMPATIBLE INTERFACE:
β’ Successful calls include an x402Receipt field with { scheme, chain, asset, amount,
recipient, paymentIntentId, settledAt }. Same shape as on-chain x402 receipts so the
agent's payment-handling logic is portable.
β’ If upstream returns an x402 challenge (WWW-Authenticate: x402, X-402-* headers, or
body.x402), it's parsed into x402Challenge for the agent to reason about.
β’ If upstream returns 202 + Retry-After + X-Payment-Status: pending, the result is
{ status: "PAYMENT_PENDING", paymentIntentId, retryAfterMs, retryContract }.
Re-call with the same idempotencyKey to resume β no double-charge.
Returns: { status, chargeId, amountUsdc, response, x402Receipt?, x402Challenge?, hint? }
Inputs: serviceId (required), body, path, method, +1 more.
check_balanceARead-onlyIdempotent
Check the current on-chain USDC balance of the wallet that owns the configured permit.
PRECONDITIONS: β’ DEMO MODE (no LEMON_CAKE_PERMIT): returns a canned $1.00 demo balance so trial users see something useful before signing. β’ LIVE: queries Base USDC.balanceOf(owner) directly + reports remaining daily permit cap. LemonCake's backend doesn't store the balance β it's read from the chain.
Use BEFORE call_service to confirm sufficient funds and remaining daily cap.
Returns: { balanceUsdc, dailyCap, remainingToday, ownerAddress, [mode], [note] }
Inputs: no named parameters.
check_taxARead-onlyIdempotent
Run a Japanese tax compliance check on a single transaction. No authentication required.
Performs three checks in one call:
Validates the qualified-invoice registration number (T-number) against the NTA registry.
Determines whether source-withholding (ζΊζ³εΎ΄ε) applies based on the service description.
If withholding applies, computes the withholding amount and net payable.
Intended for Japanese corporations that pay AI / API services and need to file withholding correctly under the qualified-invoice (γ€γ³γγ€γΉεΆεΊ¦) regime.
Returns: { invoice: { valid, name, ... }, withholding: { required, rate, amount, net } } Errors: invalid registrationNumber returns invoice.valid = false (not an exception).
Inputs: grossAmountJpy (required), registrationNumber (required), serviceDescription (required).
get_service_statsARead-onlyIdempotent
Return public usage statistics for every approved service on the marketplace. No authentication required.
Use this AFTER list_services and BEFORE call_service to pick a service based on real-world traction (call counts, USDC revenue, last-used timestamp).
Returns: an array of { serviceId, callCount, totalRevenueUsdc, lastCalledAt }.
Inputs: no named parameters.
list_servicesARead-onlyIdempotent
List approved API services available on the LemonCake marketplace. No authentication required.
Use this BEFORE call_service to discover serviceId values and per-call USDC pricing.
When LEMON_CAKE_PERMIT is missing, 8 demo services are prepended: demo_search β Wikipedia opensearch demo_echo β httpbin.org/anything demo_fx β live FX rates (open.er-api) demo_translate β 80+ languages (MyMemory) demo_weather β current weather any lat/lon (Open-Meteo) demo_geocode β place name β lat/lon (OpenStreetMap Nominatim) demo_time β IANA timezone time + DST (worldtimeapi) demo_dictionary β English definitions / synonyms (dictionaryapi.dev) All real upstreams, no auth, free. Live users (permit set) see real marketplace entries; demo_* IDs remain callable directly.
Each item: { id, name, provider, type ('API' | 'MCP'), pricePerCall, [usage], [mode] }.
Errors: HTTP-level errors are returned as Error: API <status>: <body>.
Inputs: limit.
setupARead-onlyIdempotent
Show the LemonCake MCP first-run setup guide. No authentication required. Call this tool FIRST to learn what is missing and how to obtain a permit.
If LEMON_CAKE_PERMIT is not set, the server is in DEMO MODE: list_services returns 8 free demo services (search / echo / fx / translate / weather / geocode / time / dictionary) powered by real upstreams (Wikipedia, httpbin, Open-Meteo, Nominatim, etc.). call_service and check_balance respond with mock data so you can verify integration before signing.
Returns the current credential status (permit presence), demo-mode flag, and step-by-step instructions for getting a permit at /start/v2, including a sample MCP client config snippet ready to paste.
Returns: { version, apiUrl, mode, credentials, availableTools, setupSteps, permitUrl, docs } Errors: none β this tool always succeeds.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 6 tools
Each tool has a clearly distinct role: setup guides onboarding, list_services discovers offerings, call_service executes paid calls, check_balance monitors funds, check_tax handles compliance, and get_service_stats provides marketplace analytics. There is no meaningful overlap or ambiguity between them.
Tool names follow a consistent snake_case verb_noun pattern: list_services, call_service, check_balance, check_tax, get_service_stats. Even 'setup' fits as a single-word imperative without breaking the overall stylistic consistency.
Six tools is a well-scoped count for a billing/proxy service: onboarding, discovery, execution, balance checking, tax compliance, and usage stats each earn their place. The server feels neither bloated nor thin.
The core lifecycle is well covered: discover services, call them, check balance, and verify tax obligations. Minor gaps exist, such as no explicit transaction-history or budget-configuration tool, but the daily cap and receipt fields mitigate these and the main workflows are complete.
Maintenance
Related MCP Connectors
Machine-payable API infrastructure for autonomous agents. Per-call x402 settlement in USDC.
30 pay-per-call APIs for AI agents: compliance, trade, safety, web, data. USDC on Base via x402.
Non-custodial stablecoin bill-pay rails on Celo & Base for AI agents, settled on-chain via MCP.
Pay-per-use MCP tools for AI agents. USDC on Base via x402. No API keys.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI agents to manage USDC wallets on Solana, allowing them to send payments, create invoices, and access paid APIs within human-defined spending limits. It uses threshold signatures to provide agents with financial autonomy while ensuring secure oversight and transaction approval.3670 npm4Apache 2.0

@arispay/payagent-mcpofficial
AlicenseAqualityBmaintenanceEnables AI agents to call paid APIs and settle HTTP 402 payment challenges with USDC on Base, without private keys ever being involved.7444 npmMIT- AlicenseAqualityDmaintenanceLets AI agents discover, pay for, and call any HTTP API per request using USDC, with gasless nanopayments and no API keys or accounts needed.561 npmMIT
- AlicenseAqualityBmaintenanceEnables AI agents to make non-custodial USDC payments on Base through an MCP endpoint, with server-enforced per-payment and daily caps, human approval bands, and recipient allowlists.739 npmMIT