Order with an AI agent
#8 Wire is built so an agent can do the whole job: find a coffee, fill the cart, pay, and look after a fortnightly subscription. There are two ways in.
1. In the browser, with WebMCP
Every page registers tools on document.modelContext (with a polyfill for browsers that don't have it yet, and on navigator.modelContext for the earlier API). An agent driving a browser, such as Claude in Chrome, the MCP-B extension, or Playwright with page.webmcp, can call them directly instead of clicking. The full purchase runs through these tools, payment included.
| Tool | Where | What it does |
|---|---|---|
list_products | Every page | Every coffee and the mug, with sizes, grinds and one-off and fortnightly prices in cents. |
get_product | Every page | One product by slug: tasting notes, origin, brew guide, prices. |
get_cart | Every page | Cart lines, subtotal, shipping, total, and whether checkout will be one-off or a subscription. |
add_to_cart | Every page | Add a coffee (slug, size, grind, purchase one_time or fortnightly, quantity) or the mug. |
update_cart_item | Every page | Change the quantity, size, grind or purchase type of a cart line. Quantity 0 removes it. |
remove_from_cart | Every page | Remove a cart line by line_id. |
clear_cart | Every page | Empty the cart. |
begin_checkout | Every page | Go to /checkout and start a Stripe checkout for the current cart. Payment happens on our own page, not Stripe's hosted page. |
get_account | Every page | The signed-in shopper: email, saved cards, subscriptions, recent orders. |
manage_subscription | Every page | Skip the next box, pause, resume or cancel a subscription for the signed-in shopper. |
get_checkout | /checkout | Checkout state: items, totals, email, address, delivery options, saved cards, and what's still missing before paying. |
set_contact | /checkout | Set the receipt email. |
set_shipping_address | /checkout | Set the NZ delivery address (name, line1, line2, city, postal_code). |
select_shipping_option | /checkout | Choose courier or rural delivery (one-off orders only). |
use_test_card | /checkout (sandbox) | Attach Stripe's test Visa to the shopper so the agent can pay without typing card numbers. |
pay | /checkout | Confirm payment with a saved card (payment_method_id) or the card typed into the form. Requires expected_total_cents. |
get_order_confirmation | /order/complete | Order number, items, total and delivery address after payment. |
join_newsletter | Every page (declarative form) | Sign up to the fortnightly roast-day email. |
The page sets <html data-ew-ready="true"> when its tools are registered, and data-ew-checkout moves from loading to ready to complete on the checkout page. When it reads complete, data-ew-order-number and data-ew-order-total hold the receipt.
2. Headless, with MCP
Our remote MCP server speaks Streamable HTTP at https://8wirecoffee.miller.cool/mcp. Anyone can browse and quote. To place orders, create an agent key after your first checkout and send it as a bearer token. The agent charges your saved card and ships to your saved address, up to the key's per-order limit.
{
"mcpServers": {
"8wire-coffee": {
"type": "http",
"url": "https://8wirecoffee.miller.cool/mcp",
"headers": {
"Authorization": "Bearer 8wk_your_agent_key"
}
}
}
}Clients that only accept a URL can use https://8wirecoffee.miller.cool/mcp?key=8wk_…. That puts the key in the URL, so prefer the header where you can.
| Tool | Needs key | What it does |
|---|---|---|
list_products | No | The catalog with prices in NZD cents. |
get_product | No | Full details for one product. |
quote_cart | No | Price a cart: lines, shipping options, total, and the fortnightly charge for subscriptions. |
create_checkout_link | No | A link to our checkout with the cart pre-filled, for a person (or a browser agent with WebMCP) to pay. |
get_order_status | No | Look up an order by number and email. |
get_shipping_info | No | Delivery rates, roast days and timings. |
get_account | Yes | Email, saved card, delivery address, subscriptions and recent orders for the key's owner. |
place_order | Yes | Buy now on the saved card. Needs expected_total_cents from quote_cart. |
subscribe | Yes | Start fortnightly delivery on the saved card. Needs expected_first_charge_cents from quote_cart. |
list_orders | Yes | Recent orders. |
list_subscriptions | Yes | Active, paused and cancelled subscriptions with next delivery dates. |
change_subscription | Yes | Swap coffee, size, grind or bag count. |
skip_next_delivery | Yes | Push the next box back a fortnight. |
pause_subscription | Yes | Pause until resumed. |
resume_subscription | Yes | Resume a paused or cancelling subscription. |
cancel_subscription | Yes | Cancel at the end of the current fortnight (or immediately). |
get_billing_portal_link | Yes | A Stripe billing portal link for the account owner to update their card. |
Guardrails
- Orders must include the exact total from
quote_cart. If the price has changed, the order is refused so the agent can check with you. - Each agent key has a per-order spending limit, and you can revoke it from your account.
- Every agent action is logged against the key that made it.
Also here
- /llms.txt: the buying guide in plain text
- /catalog.json: every product, size, grind and price
- /.well-known/ucp: Universal Commerce Protocol catalog search and lookup
- /.well-known/mcp.json: MCP server discovery