lemon-cake-mcp

lemon-cake-mcp

Pay-per-call USDC payment proxy for AI agents. Issue scoped Pay Tokens with hard spending caps and auto-journal every charge to freee / Money Forward / QuickBooks.

Category
Visit Server

README

<div align="center">

๐Ÿ‹ LemonCake

Give your AI agent a wallet โ€” with a kill switch.

JWT-based Pay Tokens + USDC balance management for autonomous Machine-to-Machine payments.

License: Proprietary MCP Compatible npm: lemon-cake-mcp npm: eliza-plugin-lemoncake Status

๐Ÿ“š Docs ยท ๐Ÿš€ Quickstart ยท ๐Ÿ“ง Contact

Public website, Discord, and Twitter are launching alongside public beta. For now, please reach out via email โ€” we reply within 1 business day.

<br />

LemonCake demo โ€” AI agent spending down a Pay Token

<sub>โ†‘ An agent calling a paid API via a Pay Token. Balance drops in real time. Kill Switch stops it in one click.</sub>

</div>


โšก๏ธ 60-second quickstart

# 1. Register at https://lemoncake.xyz, grab a BUYER_JWT

# 2. Issue a Pay Token (scoped, expiring, revocable)
curl -X POST https://lemoncake.xyz/api/tokens \
  -H "Authorization: Bearer $BUYER_JWT" \
  -H "Content-Type: application/json" \
  -d '{"serviceId":"svc_xxx","limitUsdc":"2.00","sandbox":true}'
# โ†’ { "jwt": "<pay_token>", ... }

# 3. Hand it to your agent. Done.
#    Claude / Cursor:
npx lemon-cake-mcp
#    Eliza v2:
npm install eliza-plugin-lemoncake
#    Anything else:
curl -X POST https://lemoncake.xyz/api/proxy/svc_xxx/your/endpoint \
  -H "Authorization: Bearer <pay_token>" \
  -H "Idempotency-Key: $(uuidgen)"

Budget exhausted? 402. Token revoked? 422. No runaway agents. No stolen keys.


What is LemonCake?

LLM agents are getting powerful โ€” but they still can't pay for things autonomously.

LemonCake solves this with Pay Tokens: short-lived JWTs that give an agent a scoped spending limit. The agent calls paid APIs through our proxy, gets charged per call in USDC, and stops automatically when the budget runs out.

You                    Agent                   Paid API
 โ”‚                       โ”‚                        โ”‚
 โ”œโ”€ issue Pay Token โ”€โ”€โ–ถ  โ”‚                        โ”‚
 โ”‚   limit: $2.00        โ”‚                        โ”‚
 โ”‚                       โ”œโ”€ call /api/proxy โ”€โ”€โ”€โ”€โ–ถ โ”‚
 โ”‚                       โ”‚   Authorization: Bearer <pay_token>
 โ”‚                       โ”‚                        โ”‚
 โ”‚                       โ”‚  โ—€โ”€ response + charge โ”€โ”ค
 โ”‚                       โ”‚    X-Charge-Id: ch_...  โ”‚
 โ”‚                       โ”‚    X-Amount-Usdc: 0.001 โ”‚
 โ”‚                       โ”‚                        โ”‚
 โ”‚                       โ”œโ”€ (budget exhausted)     โ”‚
 โ”‚                       โ”‚   402 Payment Required  โ”‚
 โ”‚                       โœ—   agent stops cleanly   โ”‚

๐Ÿ”Œ Integrations

MCP ใ‚ตใƒผใƒใƒผ โ€” lemon-cake-mcp

Claude DesktopใƒปCursor ใซ npx ไธ€็™บใงๆŽฅ็ถšใงใใ‚‹ๅ…ฌๅผ MCP ใ‚ตใƒผใƒใƒผใ€‚

npx lemon-cake-mcp

claude_desktop_config.json ใซ่ฟฝ่จ˜ใ™ใ‚‹ใ ใ‘๏ผš

{
  "mcpServers": {
    "lemon-cake": {
      "command": "npx",
      "args": ["-y", "lemon-cake-mcp"],
      "env": {
        "LEMON_CAKE_PAY_TOKEN": "<Pay Token JWT>",
        "LEMON_CAKE_BUYER_JWT": "<Buyer JWT>"
      }
    }
  }
}
ใƒ„ใƒผใƒซ ่ชฌๆ˜Ž
setup ่ช่จผ็Šถๆ…‹ใฎ็ขบ่ชใจ่จญๅฎšๆ‰‹้ †ใฎใ‚ฌใ‚คใƒ‰๏ผˆ่ช่จผไธ่ฆ๏ผ‰
list_services ใƒžใƒผใ‚ฑใƒƒใƒˆใƒ—ใƒฌใ‚คใ‚นใฎๆ‰ฟ่ชๆธˆใฟ API ไธ€่ฆงใ‚’ๅ–ๅพ—
call_service Pay Token ใง่ชฒ้‡‘ API ใ‚’ใƒ—ใƒญใ‚ญใ‚ทๅ‘ผใณๅ‡บใ—
check_balance USDC ๆฎ‹้ซ˜ใƒปKYC ใƒ†ใ‚ฃใ‚ขใ‚’็ขบ่ช

Eliza v2 ใƒ—ใƒฉใ‚ฐใ‚คใƒณ โ€” eliza-plugin-lemoncake

@elizaos/core v2 ๅฏพๅฟœใฎๅ…ฌๅผใƒ—ใƒฉใ‚ฐใ‚คใƒณใ€‚character.plugins ใซ่ฟฝๅŠ ใ™ใ‚‹ใ ใ‘ใง Eliza ใ‚จใƒผใ‚ธใ‚งใƒณใƒˆใŒ่‡ชๅพ‹ๆฑบๆธˆใ‚’ๅฎŸ่กŒใงใใพใ™ใ€‚

npm install eliza-plugin-lemoncake
import { lemonCakePlugin } from "eliza-plugin-lemoncake";

const character = {
  name: "MyAgent",
  plugins: [lemonCakePlugin],
};
# ใฉใกใ‚‰ใ‹ไธ€ๆ–นใ‚’่จญๅฎš
LEMONCAKE_PAY_TOKEN=eyJhbGci...   # ใ‚ฏใ‚คใƒƒใ‚ฏใ‚นใ‚ฟใƒผใƒˆ๏ผˆไบ‹ๅ‰็™บ่กŒใƒˆใƒผใ‚ฏใƒณ๏ผ‰
LEMONCAKE_BUYER_JWT=eyJhbGci...   # ๆœฌ็•ช้‹็”จ๏ผˆๅ‘ผใณๅ‡บใ—ใ”ใจใซ้ƒฝๅบฆ็™บ่กŒ๏ผ‰

่‡ช็„ถ่จ€่ชžใงใใฎใพใพๅ‹•ใ๏ผš

"LemonCake ใฎ demo_search_api ใ‚’ 0.50 USDC ใงๅ‘ผใณๅ‡บใ—ใฆ"
"serviceId: svc_invoice ใซ 0.10 USDC ๆ”ฏๆ‰•ใ„ใ‚’ๅฎŸ่กŒใ—ใฆ"
ใ‚ขใ‚ฏใ‚ทใƒงใƒณ ่ชฌๆ˜Ž
EXECUTE_LEMONCAKE_PAYMENT ใƒกใ‚คใƒณใ‚ขใ‚ฏใ‚ทใƒงใƒณใ€‚serviceId + limitUsdc ใ‚’ๆŒ‡ๅฎšใ—ใฆ M2M ๆฑบๆธˆใ‚’ๅฎŸ่กŒ
PAY_WITH_LEMONCAKE / M2M_PAYMENT ใชใฉ ่‡ช็„ถ่จ€่ชžใƒˆใƒชใ‚ฌใƒผ็”จใ‚จใ‚คใƒชใ‚ขใ‚น๏ผˆsimiles๏ผ‰

โ†’ ่ฉณ็ดฐ: eliza-plugin-lemoncake/README.md


โœจ Features

For AI Agents (Buyers)

  • Pay Token (JWT) โ€” Scoped, expiring spend authorization. One token per task or session.
  • 402-first design โ€” Agents receive structured 402 Payment Required errors with machine-readable codes when budget runs out.
  • Idempotency keys โ€” Prevent double charges on retries with Idempotency-Key header (auto-assigned by plugins).
  • Real-time balance โ€” Check remaining USDC before committing to expensive calls.

For API Providers (Sellers)

  • Service registry โ€” Register any REST API. Set price-per-call in USDC.
  • Instant revenue โ€” Get paid per call with no invoicing, no net-30, no chargebacks.
  • Usage analytics โ€” See call counts, revenue, and error rates per service.

Infrastructure

  • JPYC on-chain deposit โ€” Charge balance with JPYC (Polygon ERC-20). Auto-verified via TX hash.
  • Accounting sync โ€” Auto-post journal entries to freee, QuickBooks, Xero, or Zoho.

๐Ÿ— Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    lemoncake.xyz                          โ”‚
โ”‚                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  Dashboard  โ”‚    โ”‚   Hono API   โ”‚   โ”‚  Pay Proxy  โ”‚  โ”‚
โ”‚  โ”‚  (Next.js)  โ”‚โ—€โ”€โ”€โ–ถโ”‚  + OpenAPI   โ”‚โ—€โ”€โ”€โ”‚  Middleware โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                            โ”‚                             โ”‚
โ”‚               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                โ”‚
โ”‚               โ–ผ            โ–ผ            โ–ผ                โ”‚
โ”‚          PostgreSQL      Redis       Polygon             โ”‚
โ”‚          (Prisma)       (Queue)    USDC / JPYC           โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ–ฒ                              โ–ฒ
        โ”‚                              โ”‚
   MCP / Eliza                   Upstream APIs
   (Claude, Cursor, Eliza...)    (registered services)

Key design decisions:

  • HMAC-SHA256 (HS256, RFC 7518) for JWT signing today; Ed25519 (EdDSA, RFC 8037) migration planned for v0.1.0 to enable asymmetric verification by external partners
  • Optimistic locking on usedUsdc โ€” prevents double charges under concurrent agent calls
  • Proxy-first โ€” upstream API keys never leave the server; agents only hold Pay Tokens

๐Ÿ”Œ Public API (selected endpoints)

Full OpenAPI spec available at /api/doc after signing in.

Auth

POST /api/auth/register
{ "name": "string", "email": "string", "password": "string (min 8)" }
โ†’ { "token": "<buyer_jwt>", "expiresIn": 2592000 }

POST /api/auth/buyer-login
{ "email": "string", "password": "string" }
โ†’ { "token": "<buyer_jwt>" }

Tokens (Pay Token)

POST /api/tokens
Authorization: Bearer <buyer_jwt>
{
  "serviceId": "<id>",
  "limitUsdc": "5.00",
  "buyerTag": "my-agent-session-42",
  "expiresAt": "2026-05-01T00:00:00Z"
}
โ†’ { "tokenId": "...", "jwt": "<pay_token>", "limitUsdc": "5.000000", "expiresAt": "..." }

Proxy (Pay-per-call)

ANY /api/proxy/<serviceId>/<upstream-path>
Authorization: Bearer <pay_token>
Idempotency-Key: <uuid>

โ†’ upstream response
  + X-Charge-Id: ch_...
  + X-Amount-Usdc: 0.001000

Error responses:

{ "error": "Token limit exceeded", "used": "4.999", "limit": "5.000" }   // 402
{ "error": "Insufficient balance: 1.23 USDC available" }                 // 402
{ "error": "Token expired" }                                              // 401

Services

GET /api/services?reviewStatus=APPROVED&limit=50
โ†’ [{ "id": "...", "name": "...", "pricePerCallUsdc": "0.001", ... }]

๐Ÿง‘โ€๐Ÿ’ป Local Development

# 1. Clone
git clone https://github.com/evidai/lemon-cake.git
cd lemon-cake

# 2. API server
cd api
cp .env.example .env
npm install && npx prisma migrate dev
npm run dev                    # http://localhost:3000

# 3. Dashboard
cd ../dashboard
cp .env.example .env.local    # NEXT_PUBLIC_API_URL=http://localhost:3000
npm install && npm run dev     # http://localhost:3001

# 4. MCP server
cd ../mcp-server
npm install && npm run build

# 5. Eliza plugin
cd ../eliza-plugin-lemoncake
npm install && npm run build

Seed demo data

node api/seed_demo.js
# Creates demo provider, 4 approved services, and 9,000+ sample charge records

๐Ÿ›ก Security

  • Brute-force protection โ€” 10 failed logins triggers a 15-minute lockout per email
  • Pay Token scoping โ€” Each token is bound to a single serviceId; cross-service reuse is rejected
  • No JWT storage โ€” Only the jti (token ID) is stored in the DB; the signed JWT never persists
  • CSRF protection โ€” OAuth state parameter with 10-minute TTL and single-use consumption
  • On-chain deposit verification โ€” JPYC transfers are verified against Polygon event logs before balance is credited

๐Ÿ—บ Roadmap

Shipped:

  • [x] Kill Switch โ€” atomic one-click token revocation (race-condition-free)
  • [x] KYA (Know Your Agent) โ€” tiered spending limits: 10 โ†’ 1,000 โ†’ 50,000 USDC/day
  • [x] Sandbox mode โ€” full-flow dry-run without moving real USDC
  • [x] MCP server + Eliza v2 plugin published to npm
  • [x] JPYC on-chain deposit with Polygon event-log verification

Next:

  • [ ] Panic button โ€” revoke all active tokens for a buyer in one click
  • [ ] Smart contract escrow for trustless settlement
  • [ ] Streaming / token-count billing for LLM APIs
  • [ ] Multi-chain support (Ethereum, Solana, Base)
  • [ ] Agent-to-agent sub-token delegation (parent caps child)
  • [ ] Self-hostable edition

๐Ÿ“„ License

Proprietary โ€” All rights reserved ยฉ 2026 LemonCake
MCP server and Eliza plugin source are available for review. Core API and payment engine are closed source.


Built for the agentic web. lemoncake.xyz

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured