Skip to main content
Glama
evidai

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

by evidai
README.md
# πŸ‹ 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](https://lemoncake.xyz/app) or copy the [mcp-monetization-starter](../examples/mcp-monetization-starter).

[![npm](https://img.shields.io/npm/v/agent-payment-mcp)](https://www.npmjs.com/package/agent-payment-mcp)
[![downloads](https://img.shields.io/npm/dm/agent-payment-mcp)](https://www.npmjs.com/package/agent-payment-mcp)
[![Glama score](https://img.shields.io/badge/Glama_score-AAB-success)](https://glama.ai/mcp/servers/evidai/lemon-cake)
[![MCP Registry](https://img.shields.io/badge/MCP_Registry-listed-blue)](https://registry.modelcontextprotocol.io)
[![x402](https://img.shields.io/badge/x402-native-blueviolet)](https://x402.org)
[![FSA-confirmed](https://img.shields.io/badge/Japan_FSA-registration_not_required-blue)](https://lemoncake.xyz/security)
[![pricing](https://img.shields.io/badge/pricing-3%2C000_calls_free-fffd43)](https://lemoncake.xyz/pricing)

> πŸ’° **No monthly fee. First 3,000 calls free (lifetime). Then 3% only when your API earns.**
> [See pricing β†’](https://lemoncake.xyz/pricing)

---

## ⚑ Try in 30 seconds β€” no signup

Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (or Cursor / Cline):

```json
{
  "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.

---

## 🎁 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](https://x402.org) β€” 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](https://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](https://lemoncake.xyz/app)
2. Save a card once at [/agent/fund](https://lemoncake.xyz/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](https://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).

```typescript
// 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](https://lemoncake.xyz/security)

---

## πŸ”Œ The LemonCake family

| Package | Use |
|---|---|
| [`agent-payment-mcp`](https://www.npmjs.com/package/agent-payment-mcp) | **Main MCP** β€” x402 gateway + agent payment rail (this one) |
| [`@lemon-cake/mcp-sdk`](https://www.npmjs.com/package/@lemon-cake/mcp-sdk) | SDK to monetize your own MCP server |
| [`xstocks-mcp`](https://www.npmjs.com/package/xstocks-mcp) | Buy tokenized US stocks on Solana |
| [`alpaca-guard-mcp`](https://www.npmjs.com/package/alpaca-guard-mcp) | Alpaca paper / live trading with hard USD cap |
| [`tokenized-stock-mcp`](https://www.npmjs.com/package/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.

---

## Links

| | |
|---|---|
| **Try demo** | `npx -y agent-payment-mcp` or [lemoncake.xyz/demo](https://lemoncake.xyz/demo) |
| **Seller dashboard** | [lemoncake.xyz/app](https://lemoncake.xyz/app) |
| **Agent card setup** | [lemoncake.xyz/agent/fund](https://lemoncake.xyz/agent/fund) |
| **Docs** | [lemoncake.xyz/docs](https://lemoncake.xyz/docs) |
| **Source** | [github.com/evidai/agent-payment-mcp](https://github.com/evidai/agent-payment-mcp) |
| **MCP Registry** | [registry.modelcontextprotocol.io](https://registry.modelcontextprotocol.io) |
| **License** | MIT |

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
ResponsivenessWithin a week