AI Agent Package Tracking via MCP & Keyless HTTP 402 Stripe MPP (2026)

Large language models and autonomous customer support agents (Claude, ChatGPT, Cursor, Gorgias AI, Zendesk AI, Ritzer AI, LangChain, Mastra, and Vercel AI SDK agents) cannot inspect live package status on their own—and calling carrier tracking pages directly from cloud/serverless environments fails immediately with 403 Forbidden (Akamai Bot Manager on UPS, FedEx, and USPS; Firebase App Check on Veho; proof-of-work challenges on Sendle).

lastscanned gives AI agents native, deterministic access to 542 global carriers through two purpose-built protocols:

  1. Remote Model Context Protocol (MCP) Server (https://mcp.lastscanned.com): A stateless Streamable HTTP MCP endpoint exposing track_package, track_packages (up to 100 numbers per call), and list_carriers. Works immediately with zero API key (1 free lookup/day per IP, list_carriers always free), a standard lsk_live_... key, or an lsk_pack_... credit token.
  2. Keyless HTTP 402 Machine Payments Protocol (Stripe MPP): Autonomous agents without an account or API key can call GET https://api.lastscanned.com/v1/track/{trackingNumber}, receive a standard HTTP 402 Payment Required (WWW-Authenticate: Payment) challenge, and pay $0.02 per tracking number in USDC on Tempo or $0.50 by card (stripe/charge) for a 25-lookup reusable credit pack (lsk_pack_...).

Protocol Overview: When to Use MCP vs. REST API vs. HTTP 402 MPP

Integration PathEndpointAuth / Payment MechanismBest For
Remote MCP (Authenticated)https://mcp.lastscanned.com (or https://mcp.lastscanned.com/lsk_live_...)Authorization: Bearer lsk_live_... (Free tier: 5/day · Pro: $4.99/mo for 1,000 unique numbers)Production WISMO support agents, Claude Code, Cursor, ChatGPT Developer Mode, Windsurf, internal ops bots
Remote MCP (Keyless Trial)https://mcp.lastscanned.comNone requiredInstant zero-signup testing (1 free track_package lookup/day per IP; unlimited list_carriers)
REST API + Push WatchesGET /v1/track/:number & POST /v1/watchesAuthorization: Bearer lsk_live_...Custom tool-calling agents (OpenAI tools, Anthropic tool_use, Vercel AI SDK, LangChain) & proactive webhook triggers
Keyless HTTP 402 Stripe MPPGET https://api.lastscanned.com/v1/track/:numberWWW-Authenticate: Payment (mpp.dev): $0.02 USDC on Tempo or $0.50 / 25-number Stripe card packAutonomous agents with an MPP wallet (e.g., Stripe Link agent wallet or Tempo USDC wallet) operating without human signup

1. Connecting Any MCP Client to https://mcp.lastscanned.com

https://mcp.lastscanned.com speaks stateless Streamable HTTP (POST JSON-RPC 2.0 requests returning plain JSON responses—no fragile SSE session state to drop). Discovery metadata is published at https://mcp.lastscanned.com/.well-known/mcp.json.

Claude Code, Cursor, VS Code & ChatGPT Setup

# Claude Code (with API key or MPP lsk_pack_ credit token)
claude mcp add --transport http lastscanned https://mcp.lastscanned.com \
  --header "Authorization: Bearer lsk_live_YOUR_API_KEY"

# Claude Code (keyless — 1 free lookup/day + unlimited list_carriers)
claude mcp add --transport http lastscanned https://mcp.lastscanned.com

For MCP clients that do not support custom HTTP headers (such as ChatGPT Developer Mode or web-based agent builders), pass your key directly in the URL path:

https://mcp.lastscanned.com/lsk_live_YOUR_API_KEY

MCP Tool Signatures

Tool NameInput SchemaOutput
track_package{ "tracking_number": string, "carrier"?: string }Normalized TrackingResult JSON (carrier, status, estimatedDelivery, signedBy, message, chronological events[])
track_packages{ "tracking_numbers": string[], "carrier"?: string } (up to 100 numbers, max 35 per carrier){ "results": Array<{ "trackingNumber", "carrier", "result" | "error" }> }
list_carriers{}All 542 carrier slugs, display names, categories, and example tracking numbers

2. Autonomous Keyless Payments via HTTP 402 (Stripe MPP & Tempo USDC)

When an autonomous agent calls GET https://api.lastscanned.com/v1/track/{trackingNumber} without an Authorization header (after the IP's 1 free daily lookup is used, or on any batch GET /v1/track?numbers=... call), lastscanned responds with HTTP 402 Payment Required and a machine-readable WWW-Authenticate: Payment header (mpp.dev, OpenAPI discovery at https://api.lastscanned.com/openapi.json):

  1. 2-cent Stablecoin Rail (tempo/charge): The agent pays $0.02 per tracking number in USDC on Tempo and retries the request with Authorization: Payment <credential>.
  2. $0.50 Card Credit Pack Rail (stripe/charge): The agent pays $0.50 using a Stripe Shared Payment Token (for example, from Link's agent wallet) and receives 25 tracking number lookups.
    • If the request looked up 1 tracking number, the remaining 24 lookups are returned in the x-lastscanned-key response header (lsk_pack_<32hex>) and the JSON body:
      {
        "trackingNumber": "1Z54V8630394427740",
        "carrier": "ups",
        "status": "delivered",
        "events": [ "..." ],
        "credits": {
          "key": "lsk_pack_9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c",
          "remaining": 24
        }
      }
    • The agent can pass Authorization: Bearer lsk_pack_... on subsequent GET /v1/track or https://mcp.lastscanned.com requests until all 25 lookups are used.
    • Zero charge on carrier failures: Only lookups where the carrier returns a tracking result (200) or confirms not_found (404) deduct a credit. Upstream carrier errors (502 carrier_error) or invalid formats never spend credits.

3. Giving OpenAI, Anthropic, LangChain & Vercel AI SDK Agents Live Tracking Tools

If your agent framework uses native function/tool calling instead of MCP, wire GET /v1/track/:number directly as a tool. Because lastscanned auto-detects formats across 542 carriers and extracts cross-border handoff numbers into message, your tool function can automatically resolve both the origin waybill and the domestic last-mile courier in one turn:

export async function trackOrderForAgent(trackingNumber: string, carrier?: string) {
  const url = new URL(`https://api.lastscanned.com/v1/track/${encodeURIComponent(trackingNumber)}`);
  if (carrier) url.searchParams.set("carrier", carrier);

  const res = await fetch(url, {
    headers: { Authorization: `Bearer ${process.env.LASTSCANNED_API_KEY}` },
  });
  const data = await res.json();

  // If a cross-border consolidator (Yanwen, 4PX, Cainiao, YunExpress) handed off to a local courier
  // (e.g. "Handed to UniUni as UUS5BM1269395824723"), fetch the local courier's live scans automatically:
  const handoff = data.message?.match(/Handed to .+ as ([A-Z0-9]{8,34})/i);
  if (handoff && data.status !== "delivered") {
    const localRes = await fetch(
      `https://api.lastscanned.com/v1/track/${encodeURIComponent(handoff[1])}`,
      { headers: { Authorization: `Bearer ${process.env.LASTSCANNED_API_KEY}` } },
    );
    if (localRes.ok) {
      data.lastMileResult = await localRes.json();
    }
  }

  return data;
}

Want a ready-to-paste system prompt and JSON tool schema tailored to your exact carrier mix (USPS, UPS, FedEx, UniUni, SpeedX, Veho, GOFO, OnTrac, Yanwen, 4PX)? Use the interactive WISMO AI Agent Prompt & Tool-Schema Builder.


On this page