Skip to main content
Glama
πŸ‹ LemonCake β€” Billing & budgets for AI agents

πŸ‹ LemonCake β€” Billing & budgets for AI agents

by evidai

πŸ‹ 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.

npm downloads Glama score MCP Registry x402 FSA-confirmed pricing

πŸ’° 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

πŸ” demo_search

Search Wikipedia (5 results + URLs)

en.wikipedia.org

πŸ’± demo_fx

Live FX rates (160+ currencies)

open.er-api.com

🌐 demo_translate

Translate 80+ languages

MyMemory

🌀 demo_weather

Current weather for any lat/lon

Open-Meteo

πŸ“ demo_geocode

Place name β†’ coordinates

OpenStreetMap Nominatim

πŸ• demo_time

Current time + DST for any IANA timezone

worldtimeapi

πŸ“– demo_dictionary

English definitions / synonyms

dictionaryapi.dev

πŸ” demo_echo

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 API
  1. Seller registers any HTTP API at lemoncake.xyz/app and sets a price per call

  2. Buyer prepays via card β†’ Pay Token (JWT) issued automatically

  3. Agent passes Authorization: Bearer <token> β€” gateway verifies, meters, forwards

  4. Budget 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:

  1. Issue a Buyer Key (bk_...) in the Pay Tokens pane at /app

  2. Save a card once at /agent/fund

  3. 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 through

Caps enforced server-side: per-mint / daily / monthly. Cannot overspend.


πŸͺ Publish your own API (for sellers)

Monetize any HTTP API or MCP server in minutes:

  1. Sign in at lemoncake.xyz/app

  2. Add API β†’ paste your URL, set price per call

  3. Share the buy link β€” buyers prepay with a card, Pay Token issued automatically

  4. 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

agent-payment-mcp

Main MCP β€” x402 gateway + agent payment rail (this one)

@lemon-cake/mcp-sdk

SDK to monetize your own MCP server

xstocks-mcp

Buy tokenized US stocks on Solana

alpaca-guard-mcp

Alpaca paper / live trading with hard USD cap

tokenized-stock-mcp

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_auth never returned in API responses.


Try demo

npx -y agent-payment-mcp or lemoncake.xyz/demo

Seller dashboard

lemoncake.xyz/app

Agent card setup

lemoncake.xyz/agent/fund

Docs

lemoncake.xyz/docs

Source

github.com/evidai/agent-payment-mcp

MCP Registry

registry.modelcontextprotocol.io

License

MIT

Available Tools

6 tools
call_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_balanceA
Read-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_taxA
Read-onlyIdempotent

Run a Japanese tax compliance check on a single transaction. No authentication required.

Performs three checks in one call:

  1. Validates the qualified-invoice registration number (T-number) against the NTA registry.

  2. Determines whether source-withholding (ζΊζ³‰εΎ΄εŽ) applies based on the service description.

  3. 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_statsA
Read-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_servicesA
Read-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.

setupA
Read-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

    A4.7/5.0

    Scored across 6 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      36
      70 npm
      4
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables 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.
      7
      39 npm
      MIT