Skip to Content
ReferenceUCP API ReferenceMCP Transport

MCP transport

When a merchant enables UCP and the MCP server on a channel, UCP shopping and common capabilities are exposed as MCP tools at https://{shop-domain}/mcp.

The OpenRPC schema URLs are published in /.well-known/ucp under the MCP transport bindings (dev.ucp.shopping publishes services/shopping/mcp.openrpc.json, and dev.ucp.common publishes services/common/mcp.openrpc.json when location capabilities are active).

Transport

Storefront MCP uses stateless Streamable HTTP JSON-RPC 2.0 on POST /mcp:

  • Request format: POST /mcp with Content-Type: application/json, supporting both single and batch JSON-RPC 2.0 requests.
  • Supported MCP protocol versions: 2025-06-18, 2025-03-26, 2024-11-05.
  • Capabilities: tools only (no resources or prompts).
  • Other HTTP methods: GET /mcp (SSE streaming) returns 405 Method Not Allowed; DELETE /mcp and OPTIONS /mcp return 204 No Content.

Tools and tiers

The Storefront MCP server exports 16 tools. tools/list filters the returned tools by the caller’s authenticated tier (anonymous callers see only the 10 anonymous-tier tools; signed, user, and token callers see all 16), and tools/call enforces tier authorization again at execution time.

ToolMin tierArgumentsmeta["idempotency-key"]REST equivalent
ucp_describeanonymous{ meta }NoGET /.well-known/ucp
search_cataloganonymous{ meta, catalog? }NoPOST /api/ucp/catalog/search
lookup_cataloganonymous{ meta, catalog } (catalog.ids)NoPOST /api/ucp/catalog/lookup
get_productanonymous{ meta, catalog } (catalog.id)NoPOST /api/ucp/catalog/product
create_cartanonymous{ meta, cart } (cart.line_items)NoPOST /api/ucp/carts
get_cartanonymous{ meta, id }NoGET /api/ucp/carts/{id}
update_cartanonymous{ meta, id, cart } (cart.line_items)NoPUT /api/ucp/carts/{id}
cancel_cartanonymous{ meta, id }RequiredPOST /api/ucp/carts/{id}/cancel
search_locationsanonymous{ meta, location? }NoPOST /api/ucp/locations/search
lookup_locationsanonymous{ meta, location } (location.ids)NoPOST /api/ucp/locations/lookup
create_checkoutsigned{ meta, checkout } (cart_id or line_items)NoPOST /api/ucp/checkout-sessions
get_checkoutsigned{ meta, id }NoGET /api/ucp/checkout-sessions/{id}
update_checkoutsigned{ meta, id, checkout }NoPUT /api/ucp/checkout-sessions/{id}
complete_checkoutsigned{ meta, id, checkout? }RequiredPOST /api/ucp/checkout-sessions/{id}/complete
cancel_checkoutsigned{ meta, id }RequiredPOST /api/ucp/checkout-sessions/{id}/cancel
get_ordersigned{ meta, id }NoGET /api/ucp/orders/{id}

For get_order, Token and Signed callers can read orders by their server-issued public order ID. When a User-tier token (Authorization: Bearer ucp_at_...) is also presented, the token must hold scope dev.ucp.shopping.order:read and access is restricted to the linked customer’s orders.

Discover exact schemas from tools/list or the OpenRPC schemas in /.well-known/ucp. Do not derive tool names from capability identifiers.

Arguments and required metadata

Every tools/call validates params.arguments against the tool’s JSON Schema before execution.

Required meta

All 16 tools, including ucp_describe, require meta["ucp-agent"].profile in params.arguments:

{ "meta": { "ucp-agent": { "profile": "https://your-platform.example/.well-known/ucp" } } }

Domain-object argument wrapping

Unlike REST request bodies, MCP tool payloads are nested inside a named domain object (catalog, cart, checkout, or location) rather than passed as root-level fields. Resource IDs for get_*, update_*, complete_*, and cancel_* tools are passed at the root as id.

Catalog search example (with pagination inside catalog):

{ "meta": { "ucp-agent": { "profile": "https://your-platform.example/.well-known/ucp" } }, "catalog": { "query": "blue t-shirts under 30", "pagination": { "limit": 20 } } }

Cart creation example:

{ "meta": { "ucp-agent": { "profile": "https://your-platform.example/.well-known/ucp" } }, "cart": { "line_items": [ { "item": { "id": "12345" }, "quantity": 1 } ] } }

Idempotency keys

Three MCP tools require meta["idempotency-key"]:

  • cancel_cart
  • complete_checkout
  • cancel_checkout
{ "meta": { "ucp-agent": { "profile": "https://your-platform.example/.well-known/ucp" }, "idempotency-key": "550e8400-e29b-41d4-a716-446655440000" }, "id": "{checkout-id}" }

Idempotency keys are cached for 24 hours, fingerprinted per operation and payload, and scoped per caller (or per downstream profile origin for broker keys). Reusing a key with a different payload returns JSON-RPC error -32000 (idempotency_conflict).

Unlike REST, MCP create_cart and create_checkout do not declare or consume meta["idempotency-key"].

Authentication, profile binding, and broker mode

Storefront MCP uses the same authentication tiers, credentials (X-API-Key, RFC 9421 signatures, enabled anonymous access, and paired Authorization: Bearer ucp_at_... tokens), and error rules as UCP authentication. Public keys (fq_pub_...) and bare Authorization: Bearer ucp_at_... tokens without an agent credential are rejected with HTTP 401.

Profile binding

For non-broker platform keys (fq_platform_*) and signed requests, meta["ucp-agent"].profile on every tools/call must share an origin (scheme, host, and port) with the authenticated platform or signer profile. Mismatches are rejected with isError: true and error code profile_mismatch. If the HTTP UCP-Agent header is also sent, Finqu checks it against the same origin at HTTP authentication time (403 profile_mismatch). Channel keys (fq_secret_*) are not bound to a platform profile.

Broker platform keys

A platform key provisioned by Finqu in broker mode may forward any valid public HTTPS downstream agent profile in meta["ucp-agent"].profile at Token tier:

  • Per-downstream-origin isolation: Rate-limit buckets and meta["idempotency-key"] caches are scoped per downstream profile origin.
  • Batching behavior: Single tools/call requests and same-origin JSON-RPC batches use the downstream origin’s rate-limit bucket; mixed-origin JSON-RPC batches and protocol handshakes (initialize, tools/list) use the broker’s shared bucket.
  • User-tier binding: When a broker key also presents Authorization: Bearer ucp_at_..., meta["ucp-agent"].profile is required and must match the origin the buyer token was issued to; omitting it or sending another origin fails with profile_mismatch.

Rate limiting

Storefront MCP uses the mcp resource bucket on the 60-second sliding window defined in UCP authentication. Platform and broker keys (fq_platform_...) receive higher limits than channel keys, and User-tier requests share the paired agent credential’s allowance. Responses include X-RateLimit-Remaining and X-RateLimit-Reset headers; 429 responses also include Retry-After.

Error responses

Clients must handle four error shapes on /mcp:

  1. HTTP transport, authentication, and rate-limit errors (HTTP 400, 401, 403, 404, 405, 413, 415, 429, 500, 502, 503, 504): JSON-RPC error object (-32600, -32700, -32603, or -32000) with message. 401 responses include WWW-Authenticate; 429 responses include X-RateLimit-Remaining, X-RateLimit-Reset, and Retry-After.
  2. Protocol-level JSON-RPC errors on tools/call (HTTP 200, JSON-RPC error):
    • -32001 ("UCP discovery failed", data: { "code", "content" }): profile negotiation failures (invalid_profile_url, profile_unreachable, profile_malformed, version_unsupported).
    • -32000 ("Idempotency conflict", data: { "code": "idempotency_conflict", "content" }): idempotency key reused for a different operation or payload.
  3. Policy and validation tool errors (HTTP 200, JSON-RPC result with isError: true): content[0].text contains a JSON-encoded UCP error envelope (ucp.status: "error", severity: "unrecoverable") for insufficient_tier, insufficient_scope, unauthorized, profile_mismatch, tool_not_found, invalid_parameters, and internal_error.
  4. Business-level tool errors (HTTP 200, JSON-RPC result with isError: false): content[0].text contains a JSON-encoded UCP error envelope (ucp.status: "error", messages: [...]) for business outcomes such as not_found, capabilities_incompatible, validation_error, customization_error, cart_error, cart_unavailable, checkout_creation_failed, checkout_update_failed, checkout_completion_failed, cancel_failed, request_too_large, and insufficient_scope (on User-tier get_order missing dev.ucp.shopping.order:read).

Always parse content[0].text and inspect ucp.status and messages, even when isError is false.

Connecting an agent

  1. Enable UCP and the MCP server on the channel (see Activating UCP).
  2. Point your Streamable HTTP MCP client to POST https://{shop-domain}/mcp.
  3. Authenticate with X-API-Key (fq_secret_... or fq_platform_...), RFC 9421 signatures, or an enabled anonymous tier, pairing with Authorization: Bearer ucp_at_... for buyer-scoped User-tier access.
  4. Call tools/list (filtered to your authenticated tier) or read the OpenRPC schemas from /.well-known/ucp.
  5. Send meta["ucp-agent"].profile on every tool call, wrap request fields in catalog, cart, checkout, or location, and include meta["idempotency-key"] on cancel_cart, complete_checkout, and cancel_checkout.