🍋 LemonCake — Billing & budgets for AI agents
🍋 LemonCake — Кошелек для AI-агентов и MCP-сервер для оплаты USDC за вызов
🎮 Попробуйте мгновенно — регистрация не требуется. Нажмите "Try in Browser" выше → оставьте ОБА поля переменных окружения ПУСТЫМИ → нажмите Start Inspector. Демо-режим работает с реальными Wikipedia / httpbin / API курсов валют. Без аккаунта, без карты, без API-ключа.
📦 Переименование в v0.5.0: npm-пакет теперь называется
pay-per-call-mcp(ранееlemon-cake-mcp). Старое имя все еще работает как тонкая обертка, но в новых конфигурациях следует использоватьnpx -y pay-per-call-mcp.
Дайте своему AI-агенту кошелек. Платежи в USDC за вызов любого HTTP API — прямо из Claude Desktop, Cursor, Cline или любого MCP-клиента. Никакого участия человека, никаких регистраций в каждом API, никакого жонглирования API-ключами.
MCP-сервер LemonCake позволяет вызывать платные API из MCP-совместимых клиентов, таких как Claude Desktop / Cursor / Cline, с оплатой в USDC без участия человека.
English ↓ Quickstart · Tools · Use Cases · Compatibility
🚀 3 минуты до старта
Для использования MCP-сервера необходим аккаунт LemonCake и баланс в USDC.
Создайте бесплатный аккаунт — достаточно одного email.
Пополните баланс — минимум $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 или выше
🛠️ Предоставляемые инструменты
Название инструмента | Назначение | Основные параметры |
| Руководство по начальной настройке | — |
| Список доступных платных API на маркетплейсе LemonCake |
|
| Платный вызов API через Pay Token |
|
| Получение текущего баланса USDC и лимитов KYA | — |
| Проверка номера плательщика НДС через API налоговой службы Японии |
|
| Статистика использования и история платежей по сервисам | — |
Схемы всех аргументов доступны через MCP Inspector или tools/list.
🎮 Демо-режим (без учетных данных)
Если запустить сервер, не задавая LEMON_CAKE_BUYER_JWT / LEMON_CAKE_PAY_TOKEN, он автоматически перейдет в DEMO MODE. Без регистрации работают следующие функции:
list_services→ в начале списка отображаются 3 демо-сервиса:demo_search(Wikipedia),demo_echo(httpbin),demo_fx(open.er-api).call_service→ сервисыdemo_*вызывают реальные бесплатные API и возвращают живые данные (без оплаты, без авторизации).check_balance→ возвращает фиктивный баланс$1.00(mode: "demo").check_tax/get_service_stats→ работают в обычном режиме (авторизация не требуется).
→ Вы можете проверить реализацию даже в Glama Inspector или тестовой среде npm без каких-либо настроек. Когда захотите вызвать реальные платные API, просто укажите LEMON_CAKE_PAY_TOKEN.
💡 Попробуйте эти команды (MCP prompts)
Этот сервер поддерживает возможности MCP prompts. В "выборе промптов" (prompt picker) Glama Inspector / Claude Desktop / Cursor появятся следующие пресеты, которые можно запустить в один клик:
Название промпта | Содержание | Авторизация |
🎮 | Демо-режим: setup → list_services → demo_search → demo_fx | Не нужна |
🛍 | Список всех сервисов маркетплейса с рекомендацией топ-3 | Не нужна |
🇯🇵 | Проверка номера плательщика НДС и определение удержаний | Не нужна |
💰 | Демонстрация управления бюджетом: check_balance → call_service → check_balance | demo OK / для реальных сервисов нужен PAY_TOKEN |
🔄 | Сравнение результатов demo_search и реального Serper | demo OK / для сравнения нужен PAY_TOKEN |
🏯 | Исследование японских компаний: gBizINFO + Налоговая + e-Gov | Нужен PAY_TOKEN |
→ После активации MCP pay-per-call (ранее lemon-cake) в Glama / Claude Desktop, эти варианты появятся автоматически.
💡 Пример использования
В 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"}).Обобщит результат и ответит.
🎯 Варианты использования
Автономные исследовательские агенты — Позвольте агенту оплачивать премиальный поиск, парсинг или API данных без передачи ему вашей кредитной карты.
Рабочие процессы с несколькими API — Один JWT, один баланс, десятки внешних API. Никаких регистраций у каждого поставщика и смены ключей.
Расходы с учетом комплаенса — Лимиты KYA (Know-Your-Agent) ограничивают сумму, которую агент может потратить за сессию/день.
Автоматизация налогов в Японии —
check_taxпроверяет номера плательщиков НДС через API налоговой службы для соблюдения требований к счетам.Идемпотентные повторы —
idempotencyKeyделает вызовыcall_serviceбезопасными для повтора без двойного списания средств.
✅ Протестированные клиенты
Клиент | Статус | Примечания |
Claude Desktop (macOS / Windows) | ✅ | Основная цель |
Cursor | ✅ | Транспорт stdio |
Cline (VS Code) | ✅ | Транспорт stdio |
Claude Code CLI | ✅ | Транспорт stdio |
Continue.dev | ✅ | Поддержка MCP с v0.9 |
Пользовательские MCP-клиенты | ✅ | Любой клиент с поддержкой MCP 1.10+ через stdio |
🔐 Переменные окружения
Имя переменной | Обязательно | Описание |
| ✅ | 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.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