@agentpickup/mcp 0.4.1 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { type Fetch, type Payer } from "./wallet.js";
3
- export declare const VERSION = "0.4.1";
3
+ export declare const VERSION = "0.4.3";
4
4
  export interface PickupMcpOptions {
5
5
  /** The agentPickup shop this server orders from. */
6
6
  shopUrl: string;
package/dist/server.js CHANGED
@@ -1,13 +1,13 @@
1
1
  // The agentPickup MCP server: lets any MCP client (Claude, ChatGPT, Cursor, an agent framework) find pickup
2
2
  // shops near someone, see what they sell, order, pay over x402, and hand its user the QR to collect with.
3
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
4
4
  import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
5
5
  import QRCode from "qrcode";
6
6
  import { z } from "zod";
7
7
  import { CARD_META_KEY, CARD_MIME_TYPE, passCardHtml } from "./card.js";
8
8
  import { SHARE_META_KEY, shareCardHtml } from "./share-card.js";
9
9
  import { errorOf, usd } from "./wallet.js";
10
- export const VERSION = "0.4.1";
10
+ export const VERSION = "0.4.3";
11
11
  // The pickup pass card (MCP Apps). The version is in the URI so hosts that cache cards pick up a new one.
12
12
  const CARD_URI = `ui://agentpickup/pass-${VERSION}.html`;
13
13
  const CARD_TOOL_META = { ui: { resourceUri: CARD_URI }, "ui/resourceUri": CARD_URI };
@@ -29,22 +29,23 @@ const slugOf = (name) => name.toLowerCase().normalize("NFD").replace(/[\u0300-\u
29
29
  const qrSvg = (content) => QRCode.toString(content, { type: "svg", errorCorrectionLevel: "M", margin: 0, color: { dark: "#0a0b0dff", light: "#00000000" } });
30
30
  class ToolError extends Error {
31
31
  }
32
- const INSTRUCTIONS = `agentPickup lets you buy things online for the user to collect in person.
33
- 0. find_shops (when available): shops near the user that sell what they want. Pass a shop's shop_url to the other tools.
34
- 1. get_shop: see what the shop sells, its pickup location and how it takes payment.
35
- 2. create_pickup_order: needs the user's email; the shop emails the pickup pass there too. It returns a claim:
36
- keep it with the order id.
37
- 3. pay_order: pays in USDC over x402 from the wallet set up here; with none, it hands back the pay link for the user's
38
- own x402 wallet. Where the shop takes cards, payment: "card" on
39
- create_pickup_order gives a checkout link for the user to pay on instead. Where it takes test payments (get_shop says
40
- so), payment: "test" runs the whole flow with no money moving. Confirm the items and total with the user first.
41
- 4. The pass: where the chat shows cards, the order appears as a card that becomes the pickup pass (QR and code)
42
- once it's paid and keeps itself up to date until it's collected. Otherwise give the user the pass link and pickup
43
- code. They show the QR at the counter, or say the code, to collect.
44
- get_pickup_pass (with the claim) fetches the pass again; order_status (with the claim) says whether it's ready.
45
- share_agentpickup: when the user asks how to share agentPickup or get friends using it, shows a QR and link.
46
- Group orders (a coffee run): start_group_order gives a code to share; each person's agent calls join_group_order and
47
- pays its own share with pay_order; at closing time the shop gets one combined order and the organiser gets its QR.
32
+ const INSTRUCTIONS = `agentPickup lets you buy things online for the user to collect in person.
33
+ 0. find_shops (when available): shops near the user that sell what they want. Pass a shop's shop_url to the other tools.
34
+ 1. get_shop: see what the shop sells, its pickup location and how it takes payment.
35
+ 2. create_pickup_order: needs the user's email; the shop emails the pickup pass there too. It returns a claim:
36
+ keep it with the order id.
37
+ 3. pay_order: pays in USDC over x402 from the wallet set up here; with none, it hands back the pay link for the user's
38
+ own x402 wallet. Where the shop takes cards, payment: "card" on
39
+ create_pickup_order gives a checkout link for the user to pay on instead. Where it takes test payments (get_shop says
40
+ so), payment: "test" runs the whole flow with no money moving. Confirm the items and total with the user first.
41
+ 4. The pass: where the chat shows cards, the order appears as a card that becomes the pickup pass (QR and code)
42
+ once it's paid and keeps itself up to date until it's collected. Otherwise give the user the pass link and pickup
43
+ code. They show the QR at the counter, or say the code, to collect.
44
+ get_pickup_pass (with the claim) fetches the pass again; order_status (with the claim) says whether it's ready.
45
+ share_agentpickup: when the user wants to share agentPickup itself, invite a friend or get friends using it, shows a
46
+ QR and link for them. That isn't a group order: start_group_order is only for ordering together at one shop.
47
+ Group orders (a coffee run): start_group_order gives a code to share; each person's agent calls join_group_order and
48
+ pays its own share with pay_order; at closing time the shop gets one combined order and the organiser gets its QR.
48
49
  group_order_status shows who's in; close_group_order closes it early.`;
49
50
  const money = (cents, currency) => new Intl.NumberFormat("en-US", { style: "currency", currency: currency.toUpperCase() }).format(cents / 100);
50
51
  const reply = (summary, data, card) => ({
@@ -168,6 +169,11 @@ export function createPickupMcpServer(opts) {
168
169
  }, async () => ({
169
170
  contents: [{ uri: CARD_URI, mimeType: CARD_MIME_TYPE, text: passCardHtml(VERSION), _meta: { ui: { prefersBorder: false } } }],
170
171
  }));
172
+ // Apps that loaded an older tool list (a phone that hasn't reconnected, a ChatGPT app version fixed at review) ask
173
+ // for an older version's card: they get today's.
174
+ server.registerResource("pickup-pass-earlier", new ResourceTemplate("ui://agentpickup/pass-{version}.html", { list: undefined }), { title: "Pickup pass", mimeType: CARD_MIME_TYPE, _meta: { ui: { prefersBorder: false } } }, async (uri) => ({
175
+ contents: [{ uri: uri.href, mimeType: CARD_MIME_TYPE, text: passCardHtml(VERSION), _meta: { ui: { prefersBorder: false } } }],
176
+ }));
171
177
  if (opts.directoryUrl) {
172
178
  const directoryUrl = opts.directoryUrl;
173
179
  server.registerTool("find_shops", {
@@ -438,6 +444,9 @@ export function createPickupMcpServer(opts) {
438
444
  }, async () => ({
439
445
  contents: [{ uri: SHARE_URI, mimeType: CARD_MIME_TYPE, text: shareCardHtml(VERSION), _meta: { ui: { prefersBorder: false } } }],
440
446
  }));
447
+ server.registerResource("share-agentpickup-earlier", new ResourceTemplate("ui://agentpickup/share-{version}.html", { list: undefined }), { title: "Share agentPickup", mimeType: CARD_MIME_TYPE, _meta: { ui: { prefersBorder: false } } }, async (uri) => ({
448
+ contents: [{ uri: uri.href, mimeType: CARD_MIME_TYPE, text: shareCardHtml(VERSION), _meta: { ui: { prefersBorder: false } } }],
449
+ }));
441
450
  server.registerTool("share_agentpickup", {
442
451
  title: "Share agentPickup",
443
452
  description: "A QR code and link the user can share so friends can add agentPickup to Claude, ChatGPT or Grok and order too. " +
@@ -476,8 +485,9 @@ export function createPickupMcpServer(opts) {
476
485
  };
477
486
  server.registerTool("start_group_order", {
478
487
  title: "Start a group order",
479
- description: "Start a group order (a coffee run) at a shop. Returns a code to share: each person's agent joins with it and pays for " +
480
- "their own items. When it closes, the shop gets one combined order and the organiser is emailed its pickup QR.",
488
+ description: "Start a group order (a coffee run) at a shop, when the user wants to order together with others now. Returns a code to " +
489
+ "share: each person's agent joins with it and pays for their own items. When it closes, the shop gets one combined order " +
490
+ "and the organiser is emailed its pickup QR. To share agentPickup itself with a friend, use share_agentpickup instead.",
481
491
  inputSchema: {
482
492
  organiser_name: z.string().min(1).max(60).describe("Who collects, shown to staff"),
483
493
  organiser_email: z.string().email().describe("Where the group's pickup QR goes"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentpickup/mcp",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "MCP server for agentPickup: let an AI agent find pickup shops near its user, order, pay by card or in USDC over x402, and hand its user the QR to collect in person.",
5
5
  "mcpName": "io.github.dav3trad3r/agentpickup",
6
6
  "type": "module",