pay-per-call-mcp — USDC · x402 · AI Agent Billing | LemonCake
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LEMON_CAKE_BUYER_JWT | No | Buyer JWT for production use, issues tokens on each call. | |
| LEMON_CAKE_PAY_TOKEN | No | Pay Token JWT for quickstart or pre-issued token. |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {} |
| logging | {} |
| prompts | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| setup | Show the LemonCake MCP first-run setup guide. No authentication required. Call this tool FIRST to learn what credentials are missing and how to obtain them. If no auth env vars are set, the server is in DEMO MODE: list_services returns three demo services (demo_search / demo_echo / demo_fx) and call_service / check_balance respond with mock data so you can verify integration before signing up. Returns the current credential status (Pay Token / Buyer JWT), demo-mode flag, and step-by-step instructions to obtain anything that is missing, including a sample MCP client config snippet ready to paste. Returns: { version, apiUrl, mode, credentials, availableTools, setupSteps, register, dashboard, docs } Errors: none — this tool always succeeds. |
| list_services | 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_PAY_TOKEN is missing, three demo services are prepended (demo_search → Wikipedia, demo_echo → httpbin, demo_fx → open.er-api) so you can try call_service without signing up. Live users (PAY_TOKEN set) see only 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 |
| call_service | Invoke an upstream API service through LemonCake's pay-per-call proxy. Each successful call automatically charges USDC against your configured Pay Token. PRECONDITIONS:
• LEMON_CAKE_PAY_TOKEN env var must be set for real services. If missing, the tool
returns a structured CREDENTIAL_MISSING error with how-to-fix steps.
• DEMO MODE: serviceId values starting with 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 Pay Token's limitUsdc 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 (since v0.5.1):
• Successful calls include an Returns: { status, chargeId, amountUsdc, response, x402Receipt?, x402Challenge?, hint? } |
| check_balance | Check the current USDC balance, KYC tier, and account info of the configured buyer. PRECONDITIONS: • LEMON_CAKE_BUYER_JWT env var must be set. If missing AND no PAY_TOKEN is set, DEMO MODE returns a canned $1.00 demo balance with kycTier="DEMO" so trial users see something instead of an error. With PAY_TOKEN set but no BUYER_JWT, returns a structured CREDENTIAL_MISSING error. Use BEFORE call_service to confirm sufficient funds, especially before a long batch. Returns: { balanceUsdc, kycTier, email, name, [mode], [note] } |
| check_tax | Run a Japanese tax compliance check on a single transaction. No authentication required. Performs three checks in one call:
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). |
| get_service_stats | 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 }. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| explore-demo | Walk through demo_search → demo_fx → demo_echo with no auth required. |
| discover-marketplace | List approved services and pick one that matches a use case. |
| japan-tax-check | Use the check_tax tool to verify a 適格請求書発行事業者番号 against the NTA registry. |
| spend-with-budget | Pattern: check_balance → call_service → check_balance again, demonstrating KYA/Pay-Token spending limits. |
| real-vs-demo | Hit the same logical query against demo_search (Wikipedia) and a real marketplace search service to see the difference. |
| japan-finance-bundle | Combine gBizINFO 法人情報 + 国税庁 invoice check + e-Gov 法令 in one workflow. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/evidai/lemon-cake'
If you have feedback or need assistance with the MCP directory API, please join our Discord server