setup
Display credential status and step-by-step instructions to obtain missing pay token and buyer JWT for the USDC payment proxy.
Instructions
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.
Returns the current credential status (Pay Token / Buyer JWT) and step-by-step instructions to obtain anything that is missing, including a sample MCP client config snippet ready to paste.
Returns: { version, apiUrl, credentials, availableTools, setupSteps, register, dashboard, docs } Errors: none — this tool always succeeds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp-server/src/index.ts:390-458 (handler)The tool handler for 'setup' — returns credential status (payToken/buyerJwt), step-by-step setup instructions in Japanese, a sample MCP client config snippet, version info, URLs for registration/billing/dashboard, and the list of available tools grouped by auth requirement. No authentication needed.
case "setup": { const status = { payToken: hasPayToken ? "✓ 設定済み" : "✗ 未設定(call_service が使えません)", buyerJwt: hasBuyerJwt ? "✓ 設定済み" : "✗ 未設定(check_balance が使えません)", }; const steps: string[] = []; if (!hasPayToken || !hasBuyerJwt) { steps.push("=== セットアップ手順 ==="); steps.push(""); steps.push("1. 無料アカウント作成(3分で完了)"); steps.push(` → ${REGISTER_URL}`); steps.push(""); steps.push("2. USDC残高をチャージ($5〜)"); steps.push(` → ${BILLING_URL}`); steps.push(" JPYCまたはUSDCで入金可能"); steps.push(""); } if (!hasPayToken) { steps.push("3. Pay Tokenを発行(call_service に必要)"); steps.push(" Dashboard → Tokens → 「Pay Tokenを発行」"); steps.push(" ・serviceId: 使いたいサービスのIDを選択"); steps.push(" ・limitUsdc: このトークンで使える上限額(例: 5.00)"); steps.push(" → 発行されたJWTをコピー"); steps.push(""); steps.push("4. MCP設定ファイルに追加:"); steps.push(' "LEMON_CAKE_PAY_TOKEN": "<コピーしたJWT>"'); steps.push(""); } if (!hasBuyerJwt) { steps.push(!hasPayToken ? "5." : "3." + " Buyer JWTを取得(check_balance に必要)"); steps.push(" Dashboard → Settings → 「Buyer JWTをコピー」"); steps.push(' "LEMON_CAKE_BUYER_JWT": "<コピーしたJWT>"'); steps.push(""); } steps.push("=== MCP設定ファイルのサンプル ==="); steps.push(""); steps.push(JSON.stringify({ mcpServers: { "lemon-cake": { command: "npx", args: ["-y", "lemon-cake-mcp"], env: { LEMON_CAKE_PAY_TOKEN: hasPayToken ? "(設定済み)" : "<ダッシュボードで発行したPay Token JWT>", LEMON_CAKE_BUYER_JWT: hasBuyerJwt ? "(設定済み)" : "<ダッシュボードのSettingsからコピーしたJWT>", }, }, }, }, null, 2)); return json({ version: MCP_VERSION, apiUrl: API_URL, credentials: status, availableTools: { noAuth: ["setup", "list_services", "get_service_stats", "check_tax"], needPayToken: ["call_service"], needBuyerJwt: ["check_balance"], }, setupSteps: steps.length > 0 ? steps.join("\n") : "✅ 全ての認証情報が設定されています。", register: REGISTER_URL, dashboard: DASHBOARD_URL, docs: "https://github.com/evidai/lemon-cake", }); } - mcp-server/src/index.ts:162-184 (schema)Tool registration/schema for 'setup' — defines name, description, annotations (readOnlyHint, idempotentHint, etc.), and an empty inputSchema (no parameters).
// ─── setup(認証不要) ──────────────────────────────────────────────── { name: "setup", description: [ "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.", "", "Returns the current credential status (Pay Token / Buyer JWT) and step-by-step", "instructions to obtain anything that is missing, including a sample MCP client", "config snippet ready to paste.", "", "Returns: { version, apiUrl, credentials, availableTools, setupSteps, register, dashboard, docs }", "Errors: none — this tool always succeeds.", ].join("\n"), annotations: { title: "Setup guide", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false, }, inputSchema: { type: "object", properties: {}, additionalProperties: false }, }, - mcp-server/src/index.ts:159-160 (registration)The ListToolsRequestSchema handler that registers all tools, including 'setup', via the tools array.
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ - mcp-server/src/index.ts:39-43 (helper)URL constants (REGISTER_URL, DASHBOARD_URL, BILLING_URL, DOCS_URL) used by the setup handler to generate setup instructions.
const UTM = "utm_source=mcp-server&utm_medium=cli"; const REGISTER_URL = `https://lemoncake.xyz/register?${UTM}&utm_campaign=credential-missing`; const DASHBOARD_URL = `https://lemoncake.xyz/dashboard?${UTM}`; const BILLING_URL = `https://lemoncake.xyz/dashboard/billing?${UTM}&utm_campaign=topup`; const DOCS_URL = `https://lemoncake.xyz/docs/quickstart?${UTM}`; - mcp-server/src/index.ts:124-148 (helper)The credentialError helper function referenced by other tools, which also mentions the 'setup' tool as a tip for full instructions.
/** 未設定の認証情報に対して、取得方法を含む分かりやすいエラーを返す */ function credentialError(envVar: string, toolName: string) { return { content: [{ type: "text" as const, text: JSON.stringify({ error: `${envVar} is not configured.`, code: "CREDENTIAL_MISSING", howToFix: [ `1. Create a free account → ${REGISTER_URL}`, `2. Top up balance ($5 USDC or JPYC) → ${BILLING_URL}`, envVar === "LEMON_CAKE_PAY_TOKEN" ? `3. Dashboard → Tokens → Issue Pay Token (set your spending limit) → ${DASHBOARD_URL}` : `3. Dashboard → Settings → Copy your Buyer JWT → ${DASHBOARD_URL}`, `4. Add to your MCP client config:`, ` "env": { "${envVar}": "<paste token here>" }`, `5. Restart your MCP client`, ], docs: DOCS_URL, tip: `You can also call the 'setup' tool to see full setup instructions.`, }, null, 2), }], isError: true, }; }