# AntiStagFlation Shop — full integration guide for AI agents This is the complete, self-contained manual for connecting an AI assistant to AntiStagFlation Shop over MCP (Model Context Protocol). Everything an agent needs is in this one file: endpoint, authentication, ready-to-paste client configuration, every tool with its parameters, the ordering flow, store policies, rate limits and error codes. No other document is required. The short summary version is at https://shop.antistagflation.com/llms.txt The human-readable version of this guide is at https://shop.antistagflation.com/agents ## What this store is AntiStagFlation sells groceries and everyday essentials in warehouse pack sizes. Prices are in USD and are the final item prices; shipping is free to deliverable US addresses (see Policies). A customer shops either in person on the website, or through their own AI assistant connected over MCP. The assistant may browse, build a cart and prepare an order — but an order is only placed after the customer has seen the complete summary (items, shipping, tax, total) and confirmed it. Payment runs through Shop Pay; card details never pass through the assistant. ## Quick start (3 steps) 1. The customer registers a free account at https://account.antistagflation.com and creates an API key with the "shop" scope. The full key is shown once. 2. Configure the assistant with the endpoint and the key (copy-paste blocks below). 3. Call shop_search to find products, then follow the ordering flow below. ## Endpoint and transport - Endpoint: POST https://mcp.antistagflation.com/mcp - Transport: MCP Streamable HTTP, protocol version 2024-11-05 - Discovery: https://shop.antistagflation.com/.well-known/mcp/server-card.json - Registry: com.antistagflation/shop in the official MCP registry ## Authentication Send the customer's API key on every request: Authorization: Bearer - Keys start with asf_ and are issued only at https://account.antistagflation.com - The key belongs to the customer and acts only on that customer's own carts and orders. Treat it like a password: store it in the client's credential store, never print it in chat or logs. - Scopes: "shop" is required for all shopping tools below. Two additional data-lookup tools (listed at the end) require "products" / "shelf" scopes. - A revoked or unknown key returns HTTP 401 with error "invalid_key". A missing or malformed key returns HTTP 401 with error "missing_key". ### OAuth (no key needed) Assistants that support OAuth 2.0 can connect without an API key: - The MCP endpoint answers 401 with a WWW-Authenticate header pointing to https://shop.antistagflation.com/.well-known/oauth-protected-resource - Authorization server: https://account.antistagflation.com (metadata at /.well-known/oauth-authorization-server; dynamic client registration; authorization-code flow with PKCE S256). - The customer signs in and clicks Allow once; the assistant receives an access token (Authorization: Bearer , valid 24 hours) plus a rotating refresh token (90 days). Tokens act only on that customer's own carts and orders, with the same scopes and limits as an API key. ### Anonymous trial (no credential) With no Authorization header at all, the server answers initialize, ping and tools/list, and allows shop_search with at most 5 results per call (rate-limited per IP: 10 calls/minute, small daily budget). Every other tool returns HTTP 401 with error "auth_required" and connection guidance. Anonymous calls never touch carts, orders or the data-lookup tools. ## Ready-to-paste client configuration Generic MCP client (mcpServers format): ```json { "mcpServers": { "antistagflation-shop": { "url": "https://mcp.antistagflation.com/mcp", "headers": { "Authorization": "Bearer " } } } } ``` VS Code / Cursor style (servers format): ```json { "servers": { "antistagflation-shop": { "type": "http", "url": "https://mcp.antistagflation.com/mcp", "headers": { "Authorization": "Bearer " } } } } ``` Raw HTTP handshake (curl): ```bash curl -X POST https://mcp.antistagflation.com/mcp \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"your-client","version":"1.0"}}}' ``` ## Session behavior The endpoint is stateless. The initialize handshake returns no session id, and each request is an independent POST with the Authorization header. Sending the standard notifications/initialized notification after initialize is harmless but not required. ## Calling a tool Tools are called with the standard MCP tools/call method. Example — shop_search: ```bash curl -X POST https://mcp.antistagflation.com/mcp \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"shop_search","arguments":{"query":"olive oil"}}}' ``` A tool result arrives as JSON text inside the MCP result's content[0].text field. Example (trimmed): ```json {"ok":true,"query":"olive oil","count":10,"items":[{"product_id":"<12-char code>","name":"...","price":25.99,"available":100,"in_stock":true}],"note":"..."} ``` Result objects carry an "ok" flag, the tool's own fields (items, totals, ids), and often a short human-readable "note". On failure the result text is a JSON object with "ok":false and an "error" code, or the call returns an HTTP error as described under Errors. ## Ordering flow 1. shop_search (or shop_list_items) — find products. Products are identified only by the store's own 12-character product_id, as returned by search. Never invent an id; use ids returned by search. 2. shop_get_item — full details for one product, in the customer's language when requested. 3. shop_create_cart, then shop_add_to_cart / shop_update_cart_item / shop_remove_from_cart — build the cart. shop_get_cart shows the current cart with totals at any time. 4. shop_prepare_checkout with the delivery address — returns a checkout summary and a checkout_token. Show the customer the COMPLETE summary: items, quantities, shipping (free), tax and the final total. If any price or stock level changed since the item was found, say so and get a fresh confirmation. Never place an order the customer has not confirmed in this form. 5. shop_place_order with the checkout_token and a unique idempotency_key — creates the order in "created" (awaiting payment) state and reserves stock. Re-sending the same idempotency_key returns the original order instead of duplicating it. The customer then pays through Shop Pay; the order is final only when payment completes. The result includes a pay_url — a signed payment link for this exact order. Give it to the customer: opening it shows the order summary and a Shop Pay payment button. shop_get_order returns the same pay_url for any order still awaiting payment. 6. shop_get_order — order status. shop_cancel_order — cancels an unpaid, unshipped order and releases the reserved stock. ## Policies the agent must honour - Delivery area: street addresses in the 50 US states and DC only. No island territories, no military APO/FPO/DPO addresses, no USPS-only PO boxes. - Shipping is free within the delivery area; delivery follows USPS Ground Advantage timelines. - Prices are USD, final, and shown in full before ordering — no hidden fees are added after confirmation. - If an item is out of stock, ask the customer first. Never substitute a different product without the customer's explicit choice; the substitution_policy parameter of shop_prepare_checkout carries the customer's standing preference. - Returns: unopened items within 30 days; see https://shop.antistagflation.com/returns for the full policy. ## Rate limits - 60 requests per minute per key. - A daily budget of roughly 2,000 weighted statement-equivalents per key (individual keys also carry their own daily quota; HTTP 429 with error "quota_exceeded" when it is exhausted). - shop_search returns at most 20 results per call; paginate with shop_list_items limit/offset for browsing. ## Errors Errors are JSON with an "error" code and a human-readable "message". Common codes: missing_key (401), invalid_key (401), quota_exceeded (429), plus per-tool validation errors returned as MCP tool errors. Surface the message to the customer in plain language; do not retry a 401 with the same key. ## Shopping tools (scope: shop) ### shop_search 用自然语言在购物目录里搜已授权在售商品(混合搜索:语义向量+全文检索;只认购物目录,不返采集数据,未授权/未上架商品不会出现)。中英文自然语言都可,返回按相关度排序,含 product_id、price(结算价)、available 与 matched_via(命中来源:semantic/fts),meta.semantic 标明语义是否启用。需要 shop 权限。 Parameters: - query (string, required): 想找的商品描述,如 peanut butter、unsalted cashews、无盐腰果 - limit (number, optional): 最多返回几件,1–20,默认 10 ### shop_list_items 列出已授权正在销售的商品(购物专用,只认本站自有 12 位商品编号 product_id,商家 SKU/UPC 在购物里一律不认)。limit 每页最多 50(默认 20),offset 翻页。返回含 price(结算价)、available(可买数量)、in_stock。需要 shop 权限。 Parameters: - limit (number, optional): 每页件数,1–50,默认 20 - offset (number, optional): 从第几件开始,默认 0 ### shop_get_item 按自有商品编号 product_id 查一件在售商品;未授权销售、未上架或已下架的商品会被统一屏蔽,回 not_sellable,不泄露价格与库存。需要 shop 权限。 Parameters: - product_id (string, required): 本站自有 12 位连串商品编号 ### shop_create_cart 新建一个购物购物车。需要 shop 权限。 Parameters: none. ### shop_add_to_cart 把在售商品加入购物车(product_id 为自有商品编号)。需要 shop 权限。 Parameters: - cart_id (number, required) - product_id (string, required) - qty (number, optional) ### shop_update_cart_item 改购物车里某件商品的数量(0 为移除)。需要 shop 权限。 Parameters: - cart_id (number, required) - product_id (string, required) - qty (number, required) ### shop_remove_from_cart 从购物车移除一件商品。需要 shop 权限。 Parameters: - cart_id (number, required) - product_id (string, required) ### shop_get_cart 看购物车内容与小计。需要 shop 权限。 Parameters: - cart_id (number, required) ### shop_prepare_checkout 结账确认(下单前必经一步):算清逐件价、运费、税费与总计,返回 human_summary 摘要供人看清拍板,并发一次性确认码 checkout_token(10 分钟有效、单次使用、与金额绑定;价格或库存变化后下单会被拦下要求重新确认)。地址只收美国 50 州+DC 街道地址,领地/军事地址/纯 P.O. Box 会被拒并说明原因。substitution_policy 缺货策略:ask=先问本人(默认,不擅自替换)、refund=缺货退款。需要 shop 权限。 Parameters: - cart_id (number, required) - address (object, required) - name (string, required) - street (string, required) - city (string, required) - state (string, required): 二字母州代码 - zip (string, required) - substitution_policy (string (one of: ask, refund), optional): 缺货策略,默认 ask ### shop_place_order 用结账确认码下单(必须带 idempotency_key 防重复:同一 Key 重复提交只回原来那一单)。订单状态停在 created(待付款),库存会预留;顾客通过 Shop Pay 完成付款后订单转已付款、才安排发货,未发货前可取消。成功返回里带 pay_url 付款链接,把它转给顾客,顾客打开链接就能用 Shop Pay 付款。需要 shop 权限。 Parameters: - cart_id (number, optional) - checkout_token (string, required): shop_prepare_checkout 返回的一次性确认码 - idempotency_key (string, required): 防重复下单的唯一标记,重试时保持不变 ### shop_get_order 按订单号查自己的订单状态,返回里 next_steps 会说明下一步该做什么(待付款/已取消等)。待付款订单的返回里带 pay_url 付款链接,转给顾客即可付款。需要 shop 权限。 Parameters: - order_no (string, required) ### shop_cancel_order 取消自己未发货(created 待付款)的订单并释放预留库存;重复取消是安全的,会回已取消、不会重复释放库存。需要 shop 权限。 Parameters: - order_no (string, required) ## Data lookup tools (scopes: products, shelf) These two tools expose the store's underlying product catalog data (SKU-level lookup and search). They are not part of the shopping flow; most assistants only need the shopping tools above. ### lookup_sku 按 SKU 精确查一件商品(名称、价格;Key 带 shelf 权限时含库位)。store 可选 costco(默认)、shoprite、bjs、restaurant-depot、stop-and-shop、aldi、cvs、walgreens、petco、staples。 Parameters: - store (string, optional) - sku (string, required) ### search_products 按名称关键词搜商品(子串匹配),返回最多 limit 件。 Parameters: - q (string, required) - limit (number, optional) ## See also - AI Visitors (which assistants and crawlers have visited): https://antistagflation.com/visitors - Shipping policy: https://shop.antistagflation.com/shipping - Returns policy: https://shop.antistagflation.com/returns - Contact: https://shop.antistagflation.com/contact