🍋 LemonCake — Billing & budgets for AI agents
🍋 LemonCake — AIエージェントウォレット & USDC Pay-per-call MCPサーバー
🎮 今すぐ試せます — サインアップ不要。 上記の 「Try in Browser」 をクリック → 両方の環境変数フィールドを 空のまま にする → 「Start Inspector」 をクリック。デモモードで実際のWikipedia / httpbin / ライブFX APIを呼び出せます。アカウント、カード、APIキーは不要です。
📦 v0.5.0での名称変更: npmパッケージ名は
pay-per-call-mcpになりました(旧lemon-cake-mcp)。古い名前も薄いラッパーとして機能しますが、新しい設定ではnpx -y pay-per-call-mcpを使用してください。
AIエージェントにウォレットを持たせましょう。 Claude Desktop、Cursor、Cline、または任意のMCPクライアントから直接、あらゆるHTTP APIに対してUSDCで都度払い(Pay-per-call)が可能です。人間が介在する必要はなく、APIごとのサインアップやAPIキーの管理も不要です。
LemonCakeのMCPサーバーを使えば、Claude Desktop / Cursor / ClineなどのMCP互換クライアントから、人間の介在なしにUSDCで有料APIを呼び出せるようになります。
English ↓ Quickstart · Tools · Use Cases · Compatibility
🚀 3分で始める
MCPサーバーの利用にはLemonCakeアカウントとUSDC残高が必要です。
無料アカウント作成 — メールアドレス1つで完了
残高チャージ — 最低 $5 USDC または JPYC(Billing)
Buyer JWT をコピー — Dashboard → API Keys から
下記の
claude_desktop_config.jsonに設定
📚 詳細: クイックスタート ドキュメント
Related MCP server: @arispay/payagent-mcp
📦 インストール
Claude Desktop の場合
~/Library/Application Support/Claude/claude_desktop_config.json(macOS)または
%APPDATA%\Claude\claude_desktop_config.json(Windows)に追加:
{
"mcpServers": {
"pay-per-call": {
"command": "npx",
"args": ["-y", "pay-per-call-mcp"],
"env": {
"LEMON_CAKE_BUYER_JWT": "eyJhbGci..."
}
}
}
}Claude Desktopを再起動すれば、🔨 ツールアイコンにLemonCakeのツールが表示されます。
Cursor / Cline / その他 MCP クライアント
同様に、サーバー起動コマンドを npx -y pay-per-call-mcp とし、環境変数に LEMON_CAKE_BUYER_JWT を設定してください。
Node.js 要件: v20 以上
🛠️ 提供ツール
ツール名 | 用途 | 主なパラメータ |
| 初回セットアップガイド(アカウント作成・チャージ方法を返す) | — |
| LemonCakeマーケットプレイスで利用可能な有料API一覧 |
|
| 指定サービスへPay Token経由で課金付き呼び出し |
|
| 現在のUSDC残高とKYA上限を取得 | — |
| 国税庁APIで適格請求書発行事業者番号を検証 |
|
| サービス別の利用統計・課金履歴集計 | — |
すべての引数スキーマはMCP Inspectorまたは tools/list で取得可能です。
🎮 Demo Mode(認証情報なしで試せる)
LEMON_CAKE_BUYER_JWT / LEMON_CAKE_PAY_TOKEN を何も設定せずに起動すると、自動で DEMO MODE になります。サインアップなしで以下が動きます:
list_services→ 実マーケット +demo_search(Wikipedia) /demo_echo(httpbin) /demo_fx(open.er-api) の3つのデモが先頭に表示call_service→demo_*サービスは実際のフリーAPIを叩いて生データを返却(課金なし、認証なし)check_balance→$1.00のモック残高を返却(mode: "demo")check_tax/get_service_stats→ 通常通り(元から認証不要)
→ Glama Inspectorや npmの試用環境 でも、何も設定せず実装挙動を確認できます。本番の有料APIを叩きたくなったら LEMON_CAKE_PAY_TOKEN を設定してください。
💡 Try these prompts(MCP プロンプト)
このサーバーはMCPの prompts capability に対応しています。Glama Inspector / Claude Desktop / Cursor の "prompt picker" に下記のプリセットが表示され、ワンクリックで実行できます:
Prompt 名 | 内容 | 認証 |
🎮 | デモモードで setup → list_services → demo_search → demo_fx を一気通貫 | 不要 |
🛍 | 実マーケットの全サービスを listing して、用途別に top 3 を推薦 | 不要 |
🇯🇵 | 適格請求書発行事業者番号を国税庁で検証+源泉徴収判定 | 不要 |
💰 | check_balance → call_service → check_balance のパターンで予算管理を実演 | demo OK / 実 service には PAY_TOKEN |
🔄 | 同じクエリを demo_search と実 Serper で叩いて比較 | demo OK / 比較に PAY_TOKEN |
🏯 | gBizINFO + 国税庁 + e-Gov を組み合わせた日本企業リサーチ | PAY_TOKEN(demo部分は不要) |
→ Glama / Claude Desktop で pay-per-call MCP(旧 lemon-cake)を有効にすると、上記が自動で候補に出ます。
💡 使い方の例
Claude Desktop で:
「LemonCake で
demo_agent_search_apiを 0.50 USDC で呼び出して、"AI agent payments" を検索して」
Claude は自動で:
setupでセットアップ状況を確認(初回のみ)call_service(serviceId="demo_agent_search_api", limitUsdc="0.50", body={query:"AI agent payments"})結果を要約して返答
🎯 Use Cases
自律型リサーチエージェント — クレジットカードを渡すことなく、プレミアム検索、スクレイピング、データAPIをエージェントが都度払いで利用可能。
マルチAPIワークフロー — 1つのJWT、1つの残高で、数十のアップストリームAPIを利用可能。ベンダーごとのサインアップやキーのローテーションは不要。
コンプライアンスを意識した支出管理 — KYA (Know-Your-Agent) 上限により、エージェントがセッション/日ごとに使用できる金額を制限可能。
日本の税務自動化 —
check_taxが国税庁APIに対して適格請求書番号を検証し、インボイス対応を支援。冪等性のあるリトライ —
idempotencyKeyにより、二重課金のリスクなしでcall_serviceを安全にリトライ可能。
✅ Tested Clients
Client | Status | Notes |
Claude Desktop (macOS / Windows) | ✅ | プライマリターゲット |
Cursor | ✅ | stdio transport |
Cline (VS Code) | ✅ | stdio transport |
Claude Code CLI | ✅ | stdio transport |
Continue.dev | ✅ | v0.9以降でMCPサポート |
カスタムMCPクライアント | ✅ | stdio経由でMCP 1.10+を話す全クライアント |
🔐 環境変数
変数名 | 必須 | 説明 |
| ✅ | Buyer JWT(ダッシュボードの Settings → API Keys から取得) |
| — | Pay Token JWT( |
| — | API エンドポイント(デフォルト: |
🏃 ローカル開発
git clone https://github.com/evidai/lemon-cake.git
cd lemon-cake/mcp-server
npm install
npm run build
npm startDocker
docker build -t pay-per-call-mcp .
docker run --rm -i -e LEMON_CAKE_BUYER_JWT=eyJhbGci... pay-per-call-mcpイメージは Glama Inspector のブラウザ内プレビューにも利用されます。
🔗 関連リンク
📄 ライセンス
MIT © LemonCake
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.36248 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