server-only toolkit for using shopify's ucp-compliant mcp tools from next.js (app router).
bun add shopify-ucp-nextimport { createShopifyUcpClient } from 'shopify-ucp-next';
const client = createShopifyUcpClient({
clientId: process.env.SHOPIFY_MCP_CLIENT_ID!,
clientSecret: process.env.SHOPIFY_MCP_CLIENT_SECRET!,
platformProfileUrl: 'https://your.app/.well-known/ucp',
});import { createUcpWellKnownRoute } from 'shopify-ucp-next';
export const GET = createUcpWellKnownRoute({
platformProfileUrl: 'https://your.app/.well-known/ucp',
platformId: 'your-app',
platformName: 'your app',
});import { createCatalogSearchRoute } from 'shopify-ucp-next';
export const POST = createCatalogSearchRoute(client);import { createCheckoutRoutes } from 'shopify-ucp-next';
export const { create, status, update, complete, cancel } =
createCheckoutRoutes(client);createShopifyUcpClient(config)client.catalog.searchGlobalProducts(input)client.catalog.getGlobalProductDetails(input)client.checkout.createCheckout(input)client.checkout.getCheckout(input)client.checkout.updateCheckout(input)client.checkout.completeCheckout(input)client.checkout.cancelCheckout(input)
createUcpWellKnownRoute(config)createCatalogSearchRoute(client)createCatalogLookupRoute(client)createCheckoutCreateRoute(client)createCheckoutStatusRoute(client)createCheckoutUpdateRoute(client)createCheckoutCompleteRoute(client)createCheckoutCancelRoute(client)createCheckoutRoutes(client)
- this package is server-only. do not import from client components.
- catalog route responses include
Cache-Control: no-store. completeCheckoutandcancelCheckoutrequireidempotencyKey.