qoliber / ucp
Qoliber UCP - Universal Commerce Protocol catalog discovery, search, lookup and product detail for Magento.
Requires
- php: ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0
- ext-intl: *
- ext-mbstring: *
- laminas/laminas-http: ^2.15
- magento/framework: ^103.0
- magento/module-backend: ^102.0
- magento/module-catalog: ^104.0
- magento/module-catalog-rule: ^101.2
- magento/module-config: ^101.2
- magento/module-configurable-product: ^100.4
- magento/module-customer: ^103.0
- magento/module-inventory-sales: ^1.2
- magento/module-inventory-sales-api: ^1.2
- magento/module-quote: ^101.2
- magento/module-store: ^101.1
- magento/module-tax: ^100.4
- magento/module-weee: ^100.4
- psr/log: ^1.1 || ^2.0 || ^3.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
qoliber/ucp / Qoliber_Ucp implements the published UCP 2026-08-25 catalog REST binding: discovery, search, correlated batch lookup and product detail. Checkout, payments, carts, identity linking and orders are not advertised.
Install the package, enable the module, run setup:upgrade, compile DI, and clean caches. Under Stores → Configuration → Qoliber → UCP Catalog, enable it only for the intended store views. It ships disabled. HTTPS is required for discovery.
The module supports PHP 8.1–8.5 and requires ext-intl and ext-mbstring. Use a PHP version supported by your Magento installation. Availability uses Magento Inventory (MSI): Magento_InventorySales must stay enabled. Pricing requires Magento_Weee and Magento_Quote, including when fixed product tax is disabled.
Routes and store context
GET /.well-known/ucp: business profile. Standard discovery is at the domain root; Magento routes this internally to/ucp/discovery/index.POST /ucp/catalog/search: query/category/price filtering with bounded keyset pagination.POST /ucp/catalog/lookup: at most fifty IDs; deduplicated products with variantinputscorrelation. Larger batches return HTTP 400request_too_large.POST /ucp/catalog/product: product/variant detail and interactive option selection.
URLs under store-code prefixes use Magento's store routing. On a physical subdirectory installation, configure the web server to internally rewrite the domain-root /.well-known/ucp to that installation's discovery controller, without an HTTP redirect. Only one default market profile can occupy a host's well-known URI; use the advertised store endpoint for that market. Additional store-scoped discovery URLs are Magento aliases, not replacements for domain-root discovery.
The endpoints are stateless: they never start a PHP session, so agent traffic adds no session records. Magento core may still set its private_content_version cookie on POST responses.
Install the optional qoliber/ucp-mcp package to offer the same catalog through remote MCP. The business profile advertises the MCP transport when enabled for the store.
Agent onboarding
Requests require JSON, Request-Id and UCP-Agent: profile="https://platform.example/.well-known/ucp". UCP-Agent is parsed as an RFC 8941 Dictionary: other members and their parameters are ignored, and a malformed field, a profile that is not a String or a repeated key returns invalid_profile_url. Platform profile snapshots must be placed in the merchant-maintained Cached Platform Profiles JSON object during platform onboarding. The whole object may be at most 64 KiB, the size Magento's configuration table stores intact. Each URI maps to the verified platform profile, including protocol version and catalog capabilities. Keep snapshots current when onboarding or changing protocol support.
Unknown profiles return profile_unreachable (424); the module never fetches an arbitrary agent URI. If the stored profiles cannot be read, every request is refused and the reason is written to the Magento log. Cached compatible capabilities are intersected for the requested operation. Namespace binding and schema validation of onboarded profiles remain the responsibility of the onboarding integration; arbitrary automatic platform onboarding is not supported.
Catalog contract and limits
Store/website membership, enabled status and public visibility determine access. Text search returns products visible in Search or Catalog, Search; filter-only browsing returns products visible in Catalog or Catalog, Search, as the storefront does. Lookup and product detail accept any visible product. Configurable children are accessible through an eligible public parent. Supports simple, virtual, downloadable and configurable products; grouped and bundle pricing are outside this initial catalog implementation.
Catalog prices are public guest, single-unit prices in the store's default presentment currency, with the NOT LOGGED IN group's tax class and configured default-location tax treatment. Fixed product taxes follow Magento's catalog-list FPT display setting and VAT treatment, using the same guest destination and tax class. Products without an FPT value are found with one batched query and skip Magento's per-product FPT calculation. They are added before currency conversion and minor-unit rounding. Each catalog operation refreshes indexed catalog-rule prices. Minor units are rounded the way Magento's own price rounding does, so they match checkout on every supported PHP version. A requested different currency must use the corresponding market/store endpoint. Checkout remains authoritative for address-specific taxes, quantities, shipping and custom-option charges.
Prices use ISO currency minor-unit precision. Availability uses the website's resolved MSI stock; a configurable variant is available only when both its parent and child are salable. Product, variant and image URLs use the store's secure base URLs, even when a request reaches the endpoint over plain HTTP. Product IDs are gid://qoliber/Product/{entity_id} and purchasable variant IDs are gid://qoliber/Variant/{entity_id}. Identifiers do not change when prices or stock change. SKUs match case-insensitively, as Magento's catalog does.
- Search and lookup feature the first purchasable variant of each product, or the first variant when none can be bought. A lookup by variant ID returns that variant.
price_rangealways covers every eligible variant of the product. - Product detail returns every option value with
existsandavailableflags. A variant ID takes precedence over conflicting selections and appears first. For a product ID, omittedselecteduses the featured variant's options; explicitselected: []clears those defaults. Each selected option name may appear only once. Price and category filters apply after a variant ID or explicit selection, so they cannot silently relax an existing choice; without either, the default variant is one the filters allow. Option order follows the attribute's option sort order. - Options and selections: every variant option and option value carries the attribute option's
idnext to itslabel, so values that share a label stay apart. A selection is{"name", "label"}with an optionalid; with anidit matches that value, otherwise the label. Member order never matters, a selection repeated identically counts once, and two different values of one option are refused. - Identifiers: a Product GID names a product visible on its own, a Variant GID names a standalone simple product or a configurable child, and a SKU names either. The wrong kind of GID returns
not_found. - Descriptions are plain text from the product description, or the short description when the description has no text. Page Builder style blocks and CMS directives are removed.
Search requires nonempty query text or a recognized category/price filter; unknown filters alone are refused. It supports product name/SKU text matching and merchant category IDs. Category filters use Magento's category product index, as storefront category pages do: an anchor category matches products in its subcategories, inactive categories and categories outside the store's root match nothing, and new assignments appear once that index is updated. Product categories list the same store categories, including anchor categories above the product's own, without the store root. It does not implement semantic search; text matching uses SQL LIKE, so very rare terms can scan much of the catalog. Cursors are bound to store and criteria; JSON key order and category order or duplicates do not change the criteria. Each page projects at most 200 candidate products, returns at most fifty results and may return a partial/empty page with a continuation cursor.
Configurable parents and children, categories, catalog-rule prices and stock statuses load in shared batches across a search page or lookup. Product detail supports at most 200 variants. A larger configurable is skipped in search and lookup with an info message coded catalog_complexity_limit whose content names the product, and product detail returns a catalog_complexity_limit business error.
Each request also has a 1,000-variant work budget, reserved before child hydration or pricing. Every projected configurable consumes its linked child count, including children later excluded by eligibility or filters; simple products consume one. Repeated identifiers for an already projected product reuse its budget. Search ends the page before a product that cannot fit and retries it through the continuation cursor; a product that cannot fit even an unused budget is reported with catalog_request_limit and skipped, so pagination always advances. Lookup keeps completed products and reports each identifier that cannot fit with an info message coded catalog_request_limit; retry those identifiers in a smaller batch. JSON request size is capped at 64 KiB. Product/availability responses are not shared-cacheable.
Only public catalog reads are available; there are no customer data, payment or order endpoints. UCP projects what a guest may see by status, visibility, website membership and product type; it cannot evaluate permission systems that hide more products from guests. While Adobe Commerce category permissions (Magento_CatalogPermissions) or B2B shared catalogs (Magento_SharedCatalog) are active on a store, discovery and every catalog operation answer 404 catalog_restricted there. The list lives in the restrictions argument of Qoliber\Ucp\Model\GuestCatalogPolicy (etc/di.xml): add another private-catalog module as module name => store-scoped flag that activates it, or set a module's item to null once an eligibility adapter evaluates its rules. Add ordinary gateway rate limiting to the public catalog paths as part of production deployment.
Verification
The development repository's QA harness covers unit tests on PHP 8.1 through 8.5, native integration tests in an isolated database, offline validation against checksummed official UCP schemas, and Chromium browser tests. Native controller tests and browser tests validate actual HTTP responses, including separate transport and business errors.
The native integration fixtures exercise exact inclusive/exclusive tax and FPT prices, half-cent gross prices, currency conversion, dated special prices, independent website MSI stocks, parent stock restrictions, numeric option labels, anchor and inactive category filters, secure URLs on plain HTTP requests, pagination and configurable selection. With FPT disabled in the load fixtures, SQL budgets are 250 queries for a 50-product search or lookup, 40 queries for three aliases of one product, 40 queries for search, lookup or detail of a 200-variant configurable, including when every child is out of stock, and 150 queries each for a search page of 30 configurables, a lookup of their variant IDs and a lookup of the parents. Enabling FPT adds at most two queries to a 50-product search whose products have no FPT value; products with one add Magento's per-product FPT calculation within the same request work budget. A 220-product fixture verifies that a filtered empty page continues after its 200-candidate limit. Six 200-variant configurables verify request-budget pagination, lookup messages and alias reuse. The 201st variant is reported rather than failing search or lookup.
Hosting-specific latency, throughput and gateway throttling targets are deployment checks. The concurrent-read and query-budget tests provide repeatable module-level measurements.
Contributing
Issues and pull requests are welcome at github.com/qoliber/ucp. See CONTRIBUTING.md; AGENTS.md has the same guidance for AI coding agents.
Security
Report vulnerabilities privately as described in SECURITY.md, never in a public issue.
License
MIT © Qoliber. Commercial support and custom work: qoliber.com.