ucp-supplier-gateway
Ships a SAP Commerce (OCC v2) backend adapter that lets agents search a supplier's catalog, build carts and request/negotiate quotes at the linked buyer account's contract and volume prices, without modifying the SAP backend. Includes a mock OCC B2B storefront (with volume breaks, MOQ, stock and customer-specific prices) for development, and can be pointed at a real OCC system via OCC_BASE_URL and OCC_SITE_ID.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
ucp-supplier-gateway
A reference supplier-side endpoint for the Universal Commerce Protocol (UCP), over REST and MCP, in front of a B2B commerce backend.
It lets AI agents and procurement platforms search a supplier's catalog, build carts, and request or negotiate quotes, all at the linked buyer account's contract and volume prices, without changing the backend. The first backend adapter targets SAP Commerce (OCC v2), including on-premise 2205 systems that won't get native agent support.
Status: reference implementation, not production-ready. The SAP backend is a mock built from SAP's OCC documentation, buyer identity uses static demo tokens, and stores are in-memory. See Limitations.
Why
B2B buying is quote-led and account-priced: the same item has a different price for every customer, volume breaks, minimum order quantities, and "call for quote". UCP's B2B work (the B2B Procurement charter, #947, and the quote proposal, #929) is just starting. This project shows, in working and tested code, what the supplier side of that looks like against a legacy ERP-backed storefront.
Related MCP server: Shopping MCP Server
What it implements
UCP capability | REST | MCP tool | Notes |
Discovery |
| — | Business profile advertising REST and MCP services |
|
|
| Account pricing with identity linking |
|
|
| Batch lookup with |
|
|
| Contract and volume pricing, MOQ and stock messages, expiry |
|
|
| From a cart via |
|
|
| Placed on complete; carries the accepted quotation and payment term |
|
| same tools | Net 30 (default) and Net 60 with a 1.5% fee, paid on account by invoice |
Quote extension (#929, draft) |
| same tools | Firm quotes, price proposals, pending review, accept by id, invalidation, Cart to Checkout to Order |
Protocol behaviour that's implemented and tested:
Conformance: every response is validated in tests against the official UCP JSON Schemas (vendored from release
2026-08-25) and the draft quote schema from PR #930.Idempotency per UCP: SHA-256 of the raw request body,
409on key reuse with a different body, replay withIdempotent-Replayed: true, and server errors aren't stored, so retries work after recovery. Also honoured for MCP viameta["idempotency-key"].Two-layer errors: transport errors as HTTP status (REST) or JSON-RPC
-32000(MCP); business outcomes as UCPmessageswith severity and JSONPathpath.Access control: carts and quotes are scoped to the buyer account; other accounts get
not_found. Quoting requires a linked account (identity_requiredotherwise).Money is always integer minor units; decimal backend prices convert without float maths.
Quick start
Requires Node.js 22+ and pnpm.
pnpm install
pnpm test # 117 tests, including schema conformance and a real MCP client
pnpm start # mock SAP OCC on :9002, gateway on :8080REST
H='UCP-Agent: profile="https://agent.example/profile.json"'
A='authorization: Bearer demo-token-acme' # a linked buyer account (demo token)
J='content-type: application/json'
# Same search, anonymous vs. Acme's contract prices
curl -s -X POST localhost:8080/ucp/catalog/search -H "$H" -H "$J" -d '{"query":"hex bolt"}'
curl -s -X POST localhost:8080/ucp/catalog/search -H "$H" -H "$A" -H "$J" -d '{"query":"hex bolt"}'
# Cart for 500 boxes (volume break) and ask for a firm quote
curl -s -X POST localhost:8080/ucp/carts -H "$H" -H "$A" -H "$J" -H 'idempotency-key: demo-1' \
-d '{"line_items":[{"item":{"id":"HX-1040"},"quantity":500}],"quote":{"proposal":{}}}'
# Accept it: PUT the same line items with quote.accepted_id = the returned quote.id
# Check out on account: the accepted quotation carries over, Net 30 is selected by default
curl -s -X POST localhost:8080/ucp/checkout-sessions -H "$H" -H "$A" -H "$J" -H 'idempotency-key: demo-2' \
-d '{"cart_id":"cart_…","line_items":[]}'
curl -s -X POST localhost:8080/ucp/checkout-sessions/chk_…/complete -H "$H" -H "$A" -H "$J" -H 'idempotency-key: demo-3' \
-d '{"payment":{}}'
curl -s localhost:8080/ucp/orders/ord_… -H "$H" -H "$A"MCP
Point any MCP client at http://localhost:8080/ucp/mcp (streamable HTTP). Send the buyer's
token as an Authorization: Bearer header, and include UCP metadata in every call:
{ "name": "search_catalog",
"arguments": { "meta": { "ucp-agent": { "profile": "https://agent.example/profile.json" } },
"catalog": { "query": "hex bolt" } } }Quotes, end to end
Buyer sends ( | Default policy answers | Result |
| Firm quotation at the current account price |
|
| Accept |
|
… within 10% below | Send to a person |
|
… lower | Decline |
|
| Accept that quotation if it's current |
|
| Accept if it's for this account, the same items and quantities (any order), and unexpired |
|
Line items or quantities change | — | Quotation invalidated, |
(Business withdraws a | — |
|
(The account price for the same lines falls below a quotation and its list price at issue) | — | Re-issued as |
The policy is a pluggable interface (QuotePolicy), so rules, a model or a sales desk can decide.
new ThresholdQuotePolicy(0.03, 0.1, false) answers {} with quote_unavailable instead of a
quotation, for a Business whose answer would reveal its floor (the MAY discussed on #929).
Checkout and orders
Account buyers check out on account: there are no payment handlers, and the Checkout offers
two payment terms, Net 30
(the default) and Net 60 with a 1.5% fee, which appears as its own fee totals entry. The
selected term's invoice amount always equals the Checkout total. Complete takes payment: {}.
Cart to Checkout:
cart_idcarries the cart's lines and quote state forward with the same ids; aquotesent with it is ignored. Converting the same cart again returns the open Checkout. While both exist, changes on the Checkout are reflected back to the Cart, and the Cart is cleared when the order is placed.Quote on Checkout: propose and accept on the Checkout with Update, exactly as on a Cart. Completing while
quotedorpendingpays the totals as they stand, and the Order carries no quote; only an accepted quotation reaches the Order, as{id, subtotal}.payment_term_changedis reported whenever the amount due under the selected term changes between responses, including when a quotation is accepted, as #929 requires.No surprise totals at completion. Complete reprices first. If that changes what the buyer pays (a re-issued quotation, a new term amount), the Checkout comes back with the warnings and no order, so the buyer can review it; the next Complete places the order at the new total.
Without a linked account there is nothing to pay with, so the Checkout is
requires_escalationwith acontinue_urlto the storefront.The Order carries the line items, totals, the accepted quotation and the accepted term (
payment.accepted_term), now with the invoice'sdue_at. A completed Checkout is immutable.
With ADMIN_TOKEN set, two routes stand in for a sales desk:
Route | Does |
|
|
| Issues a quotation outside any cart: |
Conformance runner for the quote extension (#929)
A black-box checker for any UCP Business that advertises the #929 quote extension on Cart.
It discovers the Business through /.well-known/ucp, runs the extension's lifecycle over REST,
and reports each vector against the #929 section it checks. If the Business also advertises
Checkout, it checks the Cart to Checkout to Order projection too.
Run it without cloning anything, as a single dependency-free file:
npx ucp-quote-conformance --origin https://business.example --token <buyer access token> --item SKU-1:10or in CI, as a GitHub Action:
- uses: swapnull-in/ucp-supplier-gateway@v0.2.3
with:
origin: https://business.example
token: ${{ secrets.UCP_TEST_BUYER_TOKEN }}
items: SKU-1:10 SKU-2:20From a checkout of this repo:
pnpm conformance --origin https://business.example --token <buyer access token> \
--item SKU-1:10 --item SKU-2:20 # orderable test items; the second enables extra-line checks
[--proposal 12345] # if the Business answers {} with quote_unavailable
[--admin-token … --account-id …] # this gateway's admin routes, for withdraw and out-of-band vectors
[--place-orders] # complete test checkouts to check the Order: places REAL orders
[--json]Vectors | What they check |
| Cart and the extension are advertised; every cart response validates against the #930 draft schema |
| Idle |
| Quantity changes invalidate; invalidated or unknown ids fail closed with |
| Withdrawal keeps id and subtotal; out-of-band quotations bind by items, quantities and currency (needs Business hooks) |
| Cart to Checkout keeps a quoted and an accepted quotation's id and status, with one |
| The Order carries only the accepted quotation's |
The test token needs dev.ucp.shopping.checkout:manage (and dev.ucp.shopping.order:read for
the Order vectors); without it the checkout vectors are skipped, not failed. Vectors that can't be
observed from outside (expiry over time, currency or unit changes, Platform behaviour) are
reported N/A with the reason, never as passes. It exits non-zero on any failure, so it can gate
CI. Against this gateway with --place-orders: 16 passed, 0 failed, 6 not observable.
The runner is tested against deliberately broken Businesses (silent invalidation, duplicate totals
entries, quote state leaking onto the Order, a missing capability) to make sure it fails them.
Architecture
AI agent / procurement platform
│ UCP over REST │ UCP over MCP (streamable HTTP)
▼ ▼
┌──────────── ucp-supplier-gateway ─────────────┐
│ profile · catalog · cart · quote extension │ MCP tools are translated onto the
│ identity → account · idempotency · validation │ REST routes in-process: one implementation
│ pricing: contract · volume breaks · MOQ · stock│
└────────────────────┬───────────────────────────┘
│ CommerceBackend port (swappable)
▼
SAP Commerce OCC v2 (mock included)Path | What |
| Canonical catalog model and the |
| SAP Commerce OCC v2 adapter, plus a mock B2B storefront |
| Pure line pricing: volume breaks, MOQ, stock, currency checks |
| Profile, catalog and cart routes, quote state machine, schemas |
| UCP MCP binding (official MCP TypeScript SDK) |
| UCP replay protection |
| Black-box conformance runner for the #929 quote extension; |
| Official UCP schemas (Apache-2.0) and the draft quote schema |
Run against a real OCC system by setting OCC_BASE_URL and OCC_SITE_ID. In production,
set PUBLIC_ORIGIN. The quote extension's namespace is derived from it, so its served schema
passes UCP authority binding.
Limitations
No real SAP system tested yet. OCC field names follow SAP's documentation and still need checking against a 2205 sandbox.
Identity linking is stubbed: static tokens map to buyer accounts. Production needs a UCP identity-linking OAuth server.
No request signature verification (RFC 9421) yet.
In-memory stores for carts, checkouts, orders and idempotency keys; production needs Postgres.
On-account payment only. No payment handlers; a complete that sends a payment instrument is refused with
payment_failedrather than invoiced. No tax or shipping calculation (they go on the invoice), no fulfillment selection, and orders aren't sent to the backend yet. No confirmation email, which UCP requires of a production Business.The quote extension follows a draft (#929 / PR #930) and will change with it. It is served under the gateway's own namespace until
dev.ucp.common.quoteis released.Price falls under a quotation: our own rule, pending the spec. If the account price for the same lines falls below both a
quotedoracceptedquotation and the list price when it was issued, the gateway re-issues it at the lower price under a new id (a subtotal never changes for an id) and reportsquote_changed, so the buyer never pays more than today's price. The new quotation isquoted, even if the old one was accepted: accepting is the Buyer's act, so the Buyer accepts the new id. A rise leaves the quotation alone, and so does a quotation set above list on purpose, until the price falls below list. Every quotation records the account's subtotal for its lines when it's issued, including one issued by the desk outside the cart, and the rule also runs when anaccepted_idis accepted, so a stale desk quotation isn't kept as a premium. The draft spec doesn't settle this yet; see the discussion on #929.
Open design questions
Backend credentials per buyer account. OCC prices a B2B customer's session, so account pricing needs an OCC token per buyer organisation (a technical customer per unit, token exchange, or price rows via the Integration API).
Slow ERP pricing. Customer prices often come from the ERP (ECC/S/4HANA) in real time. The likely answer is caching with short TTLs, and
pendingor async responses when pricing is slow.
Roadmap
Postgres stores; RFC 9421 signature verification; real identity linking
Track #929 / #877 / #969 as they evolve; per-line quoted prices if the spec adds them
Orders placed in the backend (OCC
placeOrderwith the B2B cost center), with async completion (complete_in_progress) for slow backends; fulfillment and taxA second backend adapter
Contributing
Issues and pull requests are welcome, especially from people running SAP Commerce or other
B2B backends who can test against real systems. Please run pnpm test and pnpm typecheck
before opening a PR.
License
Apache-2.0. Includes UCP schemas under Apache-2.0; see NOTICE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Search multi-merchant supply, checkout, and track orders via MCP.
Agent-native commerce with trusted catalog, durable carts, and Stripe Checkout via MCP and UCP.
Universal Commerce Protocol (UCP 2026-08-25) MCP storefront for AI shopping agents and @shopify/ucp-cli: catalog search, batch lookup, product detail pages, stateful carts, Stripe & USDC checkouts, and order tracking.
Self-sovereign BYOC headless commerce & agentic MCP checkout engine for B2B storefronts.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to discover products, build carts, and complete purchases across multiple downstream commerce services through a secure, contract-driven API.-
- FlicenseAqualityDmaintenanceEnables eBay-backed product search, authenticated shopping carts, checkout quotes, and order management through MCP tools and resources.11-
- AlicenseAqualityDmaintenanceEnables AI agents to query tenants, browse catalogue items with pricing, pull recent orders, and add products through the MCP tool-calling interface.4MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to discover products, verify signed catalog feeds, negotiate within published policies, and place mandate-bound orders with signed receipts via MCP, A2A, or REST.1MIT