npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

agent-payment-mcp

v0.6.1

Published

AI agent payment MCP server — USDC micropayments for any HTTP API, with kill switch and spend limits. No signup needed (Demo Mode). Formerly pay-per-call-mcp.

Readme

agent-payment-mcp — AI Agent Payment MCP Server by LemonCake

🎮 Try instantly — no signup needed. Click "Try in Browser" above → leave BOTH env var fields EMPTY → click Start Inspector. Demo Mode hits real Wikipedia / httpbin / live FX APIs. No account, no card, no API key.

npm version npm downloads MCP License: MIT Glama MCP Node.js

📦 v0.6.0 rename: the npm package is now agent-payment-mcp (was lemon-cake-mcp). The old name still works as a thin wrapper, but new configs should use npx -y agent-payment-mcp.

Give your AI agent a wallet. Pay-per-call USDC payments for any HTTP API — straight from Claude Desktop, Cursor, Cline, or any MCP client. No human in the loop, no per-API signups, no API key juggling.

LemonCake の MCP サーバーで、Claude Desktop / Cursor / Cline などの MCP 互換クライアントから、人間の介在なしに USDC で有料 API を呼び出せるようになります。

English ↓ Quickstart · Tools · Use Cases · Compatibility


🚀 3分で始める

MCP サーバーの利用には LemonCake アカウントと USDC 残高が必要です。

  1. 無料アカウント作成 — メール1つで完了
  2. 残高チャージ — 最低 $5 USDC または JPYC(Billing
  3. Buyer JWT をコピーDashboard → API Keys から
  4. 下記の claude_desktop_config.json に設定

📚 詳細: クイックスタート ドキュメント


📦 インストール

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", "agent-payment-mcp"],
      "env": {
        "LEMON_CAKE_BUYER_JWT": "eyJhbGci..."
      }
    }
  }
}

Claude Desktop を再起動すれば、🔨 ツールアイコンに LemonCake のツールが表示されます。

Cursor / Cline / その他 MCP クライアント

同様に、サーバー起動コマンドを npx -y agent-payment-mcp / 環境変数に LEMON_CAKE_BUYER_JWT を設定してください。

Node.js 要件: v20 以上


🛠️ 提供ツール

| ツール名 | 用途 | 主なパラメータ | |---|---|---| | setup | 初回セットアップガイド(アカウント作成・チャージ方法を返す) | — | | list_services | LemonCake マーケットプレイスで利用可能な有料 API 一覧 | limit? (1–100) | | call_service | 指定サービスへ Pay Token 経由で課金付き呼び出し | serviceId, path?, method?, body?, idempotencyKey? | | check_balance | 現在の USDC 残高と KYA 上限を取得 | — | | check_tax | 国税庁 API で適格請求書発行事業者番号を検証 | registrationNumber (T+13桁), description?, amountJpy? | | get_service_stats | サービス別の利用統計・課金履歴集計 | — |

すべての引数スキーマは 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_servicedemo_* サービスは実フリー 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 名 | 内容 | 認証 | |---|---|---| | 🎮 explore-demo | デモモードで setup → list_services → demo_search → demo_fx を一気通貫 | 不要 | | 🛍 discover-marketplace | 実マーケットの全サービスを listing して、用途別に top 3 を推薦 | 不要 | | 🇯🇵 japan-tax-check | 適格請求書発行事業者番号を国税庁で検証+源泉徴収判定 | 不要 | | 💰 spend-with-budget | check_balance → call_service → check_balance のパターンで予算管理を実演 | demo OK / 実 service には PAY_TOKEN | | 🔄 real-vs-demo | 同じクエリを demo_search と実 Serper で叩いて比較 | demo OK / 比較に PAY_TOKEN | | 🏯 japan-finance-bundle | 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 は自動で:

  1. setup でセットアップ状況を確認(初回のみ)
  2. call_service(serviceId="demo_agent_search_api", limitUsdc="0.50", body={query:"AI agent payments"})
  3. 結果を要約して返答

🎯 Use Cases

  • Autonomous research agents — Let your agent pay-per-call for premium search, scraping, or data APIs without giving it your credit card.
  • Multi-API workflows — One JWT, one balance, dozens of upstream APIs. No per-vendor signup or rotating keys.
  • Compliance-aware spending — KYA (Know-Your-Agent) limits cap how much an agent can spend per session/day.
  • Japanese tax automationcheck_tax validates 適格請求書 numbers against 国税庁 API for invoice compliance.
  • Idempotent retriesidempotencyKey makes call_service safe to retry without double-charging.

🪙 x402-compatible interface (since v0.5.1)

This server speaks the x402 idiom even though settlement happens off-chain via a Pay Token. The same agent code that handles on-chain x402 receipts works against agent-payment-mcp unmodified.

Successful calls return an x402Receipt

{
  "status": 200,
  "chargeId": "ch_abc123",
  "amountUsdc": "0.005",
  "response": { "...": "upstream payload" },
  "x402Receipt": {
    "scheme":          "lemoncake-pay-token-v1",
    "x402Compatible":  true,
    "chain":           "off-chain (LemonCake Pay Token)",
    "asset":           "USDC",
    "amount":          "0.005",
    "recipient":       "serper",
    "paymentIntentId": "ch_abc123",
    "settledAt":       "2026-05-09T14:50:11.019Z"
  }
}

Upstream 402 challenges are parsed

If a service returns an x402 challenge, call_service surfaces it as x402Challenge for your agent to reason about. Three challenge sources are recognised:

| Source | Example | |---|---| | WWW-Authenticate header | WWW-Authenticate: x402 chain="base" asset=USDC amount=0.01 recipient=0xabc | | X-402-* headers | X-402-Chain: polygon, X-402-Asset: USDC, ... | | Body x402 field | { "x402": { "chain": "ethereum", ... } } |

⚠️ On-chain auto-pay of detected challenges (debiting the upstream's address from the Pay Token's USDC balance) is gated on the LemonCake HOT_WALLET rollout — see issue #4. For now, the agent should escalate or pick another service.

PAYMENT_PENDING semantics for async settlement

If upstream returns 202 + Retry-After + X-Payment-Status: pending, call_service returns:

{
  "status": "PAYMENT_PENDING",
  "paymentIntentId": "pi_xyz",
  "retryAfterMs": 5000,
  "retryContract": "Call call_service again with the SAME idempotencyKey after 5000ms. The original request will resume; no double-charge."
}

Agents should sleep retryAfterMs and retry with the same idempotencyKey. Demo Mode shows the same shape so you can write the handler against demo_search and ship it unchanged.


✅ Tested Clients

| Client | Status | Notes | |---|:---:|---| | Claude Desktop (macOS / Windows) | ✅ | Primary target | | Cursor | ✅ | stdio transport | | Cline (VS Code) | ✅ | stdio transport | | Claude Code CLI | ✅ | stdio transport | | Continue.dev | ✅ | MCP support since v0.9 | | Custom MCP clients | ✅ | Any client speaking MCP 1.10+ over stdio |


🔐 環境変数

| 変数名 | 必須 | 説明 | |---|:---:|---| | LEMON_CAKE_BUYER_JWT | ✅ | Buyer JWT(ダッシュボードの Settings → API Keys から取得)| | LEMON_CAKE_PAY_TOKEN | — | Pay Token JWT(call_service で必要、未設定なら demo_* サービスのみ呼べる)| | LEMON_CAKE_API_URL | — | API エンドポイント(デフォルト: https://api.lemoncake.xyz)|


🏃 ローカル開発

git clone https://github.com/evidai/lemon-cake.git
cd lemon-cake/mcp-server
npm install
npm run build
npm start

Docker

docker build -t agent-payment-mcp .
docker run --rm -i -e LEMON_CAKE_BUYER_JWT=eyJhbGci... agent-payment-mcp

イメージは Glama Inspector のブラウザ内プレビューにも利用されます。


🔗 関連リンク


📄 ライセンス

MIT © LemonCake