MCP examples

JSON-RPC examples for paid MCP access

Use the server-card to create checkout, claim a bearer token, and call the fixed budget tools.

Initialize

POST /mcp
Authorization: Bearer <token>
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-06-18",
    "capabilities": {},
    "clientInfo": { "name": "catalog-budget-agent", "version": "1.0.0" }
  }
}

Analyze catalog budget

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "analyze_catalog_budget",
    "arguments": {
      "serverUrl": "https://catalog.example.com/mcp",
      "targetModel": "gpt-5.2",
      "catalog": {
        "tools": [
          { "name": "search_accounts", "description": "Search accounts" },
          { "name": "create_invoice", "description": "Create invoice", "inputSchema": { "type": "object" } }
        ]
      }
    }
  }
}

Structured result shape

{
  "ok": true,
  "workspaceId": "ws_...",
  "source": { "type": "analyze_catalog_budget", "serverUrl": "https://catalog.example.com/mcp" },
  "timeRange": { "generatedAt": "2026-05-17T00:00:00.000Z" },
  "budget": { "eagerTokens": 6420, "progressiveTokens": 3780 },
  "savings": { "percent": 41, "monthlyUsd": 280 },
  "progressiveManifest": {},
  "reportUrl": "https://mcploadbudgeter.space/success/?report=...",
  "nextActions": []
}