Search by

qoliber / ucp-mcp

qoliber

Qoliber UCP MCP: optional MCP transport for the Qoliber UCP catalog on Magento.

Package info

github.com/qoliber/ucp-mcp

Documentation

Type:magento2-module

pkg:composer/qoliber/ucp-mcp

Statistics

Installs: 1

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.1 2026-11-30 12:19 UTC

This package is auto-updated.

Last update: 2026-11-30 12:27:50 UTC


README

License: MIT Packagist

qoliber/ucp-mcp adds a remote MCP transport to the Qoliber UCP catalog. It requires qoliber/ucp 1.0 or later and PHP 8.2 or later. It uses the official MCP PHP SDK and shares the REST catalog's store scope, public product visibility, guest pricing, pagination, and request limits.

It needs mcp/sdk 0.10. Mage-OS 4.0's project template ships Bricklayer (inchoo/magento-bricklayer), which accepts only SDK 0.3 or 1.x, so Composer refuses with inchoo/magento-bricklayer 1.18.0 requires mcp/sdk ^0.3 || ^1.0 / qoliber/ucp-mcp 1.0.0 requires mcp/sdk ^0.10. Remove it first with composer remove --dev inchoo/magento-bricklayer.

Install the package alongside qoliber/ucp, enable Qoliber_UcpMcp, and run the standard Magento setup upgrade, DI compilation, and cache clean. Under Stores → Configuration → Qoliber → UCP Catalog, enable both the catalog and Enable Catalog MCP Transport for the intended HTTPS store view. Both settings default to disabled. The UCP profile lists the MCP transport alongside REST when MCP is enabled.

Route Purpose
/ucp/mcp Remote, stateless MCP endpoint
/ucp/mcp/server-card MCP Server Card with media type application/mcp-server-card+json
/ucp/mcp/server-card.schema.json First-party JSON Schema for validating either card
/.well-known/mcp/server-card.json Compatibility card for clients that probe the older location
/.well-known/ucp UCP business profile with the enabled catalog transports

On a storefront behind a reverse proxy, pass these routes to Magento over the configured canonical host and preserve the HTTPS scheme and MCP headers. Keep MCP and profile responses uncached. Test the domain-root discovery routes on the default storefront and the canonical /ucp/mcp URL of each enabled store view.

MCP clients can discover search_catalog, lookup_catalog, and get_product. Tool calls carry the onboarded platform profile under arguments.meta["ucp-agent"].profile and the catalog request under arguments.catalog. Configure platform snapshots in Cached Platform Profiles. The module uses the cached HTTPS /.well-known/ucp profile and validates its version and capabilities before executing a catalog read. Results carry the UCP payload in structuredContent. UCP MCP catalog binding

Test/ holds the unit tests, including differential tests through the real MCP SDK stack. The integration suite of qoliber/ai-readiness-suite calls the catalog tools over MCP at runtime on a real Magento store and checks that they show the same products, SKUs, URLs, prices and stock as UCP over REST, Search for Agents and the storefront.

The transport bounds the entire JSON-RPC envelope to 80 KiB while the shared REST validator bounds the catalog object to 64 KiB. A lazy php://input stream avoids an additional eager copy. PHP and nginx can buffer the body before module execution; enforce matching request-size limits at the reverse proxy. The SDK reader is bounded for unknown-length streams, but reads in chunks and may consume one extra 8 KiB chunk before rejecting a body. A narrow adapter corrects SDK 0.10's legacy unknown-method error code to JSON-RPC -32601; modern protocol dispatch and other SDK errors are preserved.

The canonical Server Card follows an experimental proposal (SEP-2127), not an accepted official MCP extension. The Cloudflare format is a separate draft; its card is best-effort compatibility and does not establish production Cloudflare interoperability. The compatibility card additionally publishes Cloudflare's serverInfo, transport, authentication.required: false, and the same three tools exposed at runtime. The canonical card leaves tool discovery to MCP. The upstream declared schema URL currently returns 404. Both cards therefore also advertise a first-party schema URL through a Link response header with rel="describedby". This endpoint serves the pinned upstream definitions with a root reference selecting ServerCard, so a validator actually checks the card. The schema, provenance, checksum and upstream license are packaged in etc/schema/. The upstream-required $schema value is retained to match the pinned experimental schema; clients that insist on downloading that upstream URI still depend on its publication. The first-party schema follows the same store-view flags and response protections as the cards.

Cached platform profiles are merchant-configured negotiation snapshots. Request handling does not fetch their URLs. They are not identity credentials; these tools expose the anonymous storefront catalog and do not create a PHP or MCP session. Magento core can still set a private_content_version cookie on POST responses; session-free does not mean cookie-free.

For a qoliber.com rollout, publish and install the base and optional packages separately, audit the consuming application's lockfile, and repeat the local SDK checks against the final hostname. Configure both flags and verified snapshots in the intended store view. Route domain-root discovery to that view, preserve HTTPS and MCP headers through trusted proxies, bypass edge caching and browser challenges for these routes, and apply request-size/rate limits. Publishing packages, modifying the production proxy or Cloudflare configuration, and enabling production flags are separate deployment steps.

Input validation returns actionable isError: true tool results with JSON error locations. Lookup batch limits and search page limits retain JSON-RPC -32602 with data.code, data.content and validator locations. Unknown tools remain protocol errors. UCP business outcomes retain their UCP envelope in structuredContent.

MCP discovery, both cards and the schema are available only when Magento recognizes a secure request. At a TLS-offloading proxy, preserve the public Host header, overwrite the configured offloader header on every request, and prevent direct origin access. Discovery omits MCP if offloading is misconfigured. Magento's offloader-header trust is a platform deployment assumption, not a module authentication mechanism.

The SDK compatibility adapter is intentionally coupled to SDK 0.10's default message registry. This module registers no extension methods. Its differential tests run through the real SDK stack; review them on every SDK update and remove the adapter when the upstream method/notification behavior is fixed. Do not install another owner of /.well-known/ucp (such as MageOS_Agentic) without resolving the route conflict and testing the combined discovery document.

Contributing

Issues and pull requests are welcome at github.com/qoliber/ucp-mcp. 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.