Skip to content

feat(sdks): MCP tools for catalog-search, commerce-extensions, flows, payments and pricebooks - #759

Merged
field123 merged 1 commit into
mainfrom
feat/mcp-tools-commerce-config
Oct 19, 2026
Merged

field123 merged 1 commit into
mainfrom
feat/mcp-tools-commerce-config

Conversation

@field123

@field123 field123 commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #753. Part of #735.

Summary

Five SDKs ship a ./mcp export, set up the way catalogs and rule-promotions were.

Package Tools Tool list (chars) Over a quarter of the package
catalog-search 40 123,423 none
commerce-extensions 21 62,788 create_a_custom_field 26.3%
flows 19 28,690 none
payments 12 15,693 none
pricebooks 18 40,783 none
  • commerce-extensions create_a_custom_field is partly the rule-promotions problem. Its input repeats one 603-character property block 6 times, once for each field type in the union, which is about 3.6K of its 15.7K.
  • catalog-search is the largest package. create_search_profile and update_search_profile are about 17K each, but they have no repeated block: the search profile schema is simply large.

types.gen.ts, sdk.gen.ts and zod.gen.ts come out byte-identical for all five.

 specs/config/redocly.yaml
   catalog_search-standalone@v1        + operation overrides
-  commerce-extensions-standalone@v1   # corrections + path-add + (overrides never reached the added paths)
+  commerce-extensions-paths@v1        # corrections + path-add
+  commerce-extensions-standalone@v1   # root: the paths bundle; operation overrides
+  flows-standalone@v1, payments-standalone@v1, pricebooks-standalone@v1

Why commerce-extensions bundles twice: path-add adds the five slug operations (/v2/extensions/{slug}) when the root is left, which is after operation-property-override has visited each operation. Their descriptions never reached the bundle. Running path-add on enter fails, because refs are resolved before the walk. Two bundles keep both decorators unchanged. The package's oas:build and generation test run both.

Risk choices

  • catalog-search postMultiSearch, multiSearchByCatalogRelease → read. These are POSTs that only run searches.
  • catalog-search moveSearchRule, setDefaultSearchProfile → update (confirmed in review). MCP defines a non-destructive tool as one that "performs only additive updates". These two replace live state across the store (rule order, the default search profile) and add nothing, so they get the same tier as a PUT or PATCH.
  • pricebooks importPricebook → update. It creates and updates prices in bulk, overwriting existing ones.
  • Left as create:
    • catalog-search ReindexTenantReleases: it rebuilds indexes but erases no source data.
    • pricebooks createPricebook, replicatePricebook, createProductPrice (fails if the SKU already has prices), and createPriceModifier.
    • commerce-extensions and flows create operations.
  • All 12 payments operations are PUT, so they default to update.

Titles

  • catalog-search:
    • postMultiSearch: "Run Multiple Shopper Catalog Searches" (was "Multi-search")
    • multiSearchByCatalogRelease: "Run Multiple Searches on a Catalog Release" (was "Admin Multi-search")
    • searchByContext: "Search the Shopper Catalog" (was "Search")
    • searchByCatalogRelease: "Search a Catalog Release" (was "Admin Search")
  • flows: 13 field, entry and relationship operations add "Flow", such as "Get a Flow Field" (was "Get a Field"), so they read differently from the Custom API entry tools.
  • pricebooks:
    • importPricebook: "Import Price Books and Prices" (was "Import a Price")
    • getProductPrices: "Get a Price Book's Prices"
    • getPrices: "Get Prices Across All Price Books"
    • the five modifier operations say "Price Modifier"

Credentials in responses (leave these out of an MCP server)

  • payments getAllGateways and getAGateway: the gateway schema carries login, password and signature.
  • payments update*Gateway:
    • Braintree returns private_key and public_key.
    • Stripe and Stripe Intents return login, the secret key.
    • Adyen, Authorize.net, CardConnect and CyberSource return login, password and signature.
  • I didn't check whether the API masks these values. The live check printed only item counts.
  • Manual, EP Payments (Stripe) and PayPal Express return no credential. None of the other four packages returns one.

Spec problems found (not fixed here)

  • pricebooks importPricebook has no requestBody, so the tool can't send the JSONL file the description talks about.
  • flows getAllFields says "in a flow" but takes no flow parameter.
  • flows deleteAnEntryRelationship defines no body.
  • commerce-extensions StringCustomField.max_length is described as the minimum.
  • payments Response.Error is typed as an array but has object properties.

Evidence

  • Suites: catalog-search 82, commerce-extensions 59, flows 56, payments 48, pricebooks 52, all passing with no type errors. Each includes the generation test that regenerates twice and compares with the committed files.

  • A second reviewer checked all 110 descriptions against the bundled specs. 14 were rewritten where a claim was unsupported or said "the spec says".

  • Live, read-only (approved store): every tool registered on a real McpServer, and these returned data through a real Client:

    • catalog-search list_indexable_fields, list_indexed_fields (49)
    • commerce-extensions list_custom_apis (5), get_a_custom_api, get_open_api_specification
    • flows get_all_flows (18), get_a_flow, get_all_fields (37)
    • payments get_all_gateways (11)
    • pricebooks get_pricebooks (13), get_pricebook_by_id, get_product_prices (25)
  • Live writes, run by Robert (approved store, through a real Client):

    • commerce-extensions:
      • Created a Custom API and a string field.
      • Through the /v2/extensions/{slug} tools: created an entry, found it in the list, read it, updated it with a PUT (no If-Match), and deleted it, after which a read returned 404.
      • Then deleted the field and the Custom API.
      • This exercises the two-step bundling and the slug operations end to end.
    • pricebooks:
      • Created a price book, and a USD price for a SKU that has no product.
      • Read the price, updated its amount from 1000 to 2000, and deleted the price and the price book, each followed by a 404 on read.
    • Nothing was left behind.
  • Not run live: payments (it rewrites the store's gateway config), flows and catalog-search. Unit tests cover their request wiring.

Merge Danger

Door: two-way

Blast Radius: small

New ./mcp subpaths and an optional peer; the main entries don't change. Merge order with #757: whichever lands second needs mcp-support.gen.ts re-copied and the generation tests rerun. I'll do that here if #757 lands first.

@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
composable-frontend-core Ready Ready Preview Oct 19, 2026 1:10pm UTC
5 Skipped Deployments
Project Deployment Actions Updated
commerce-essentials Ignored Ignored Preview Oct 19, 2026 1:10pm UTC
composable-frontend-algolia Ignored Ignored Oct 19, 2026 1:10pm UTC
composable-frontend-docs Ignored Ignored Preview Oct 19, 2026 1:10pm UTC
composable-frontend-simple Ignored Ignored Preview Oct 19, 2026 1:10pm UTC
composable-frontend-subscriptions Ignored Ignored Preview Oct 19, 2026 1:10pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d4a9cd4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@epcc-sdk/sdks-catalog-search Minor
@epcc-sdk/commerce-extensions Minor
@epcc-sdk/flows Minor
@epcc-sdk/payments Minor
@epcc-sdk/sdks-pricebooks Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

…s, flows, payments and pricebooks

Each package ships a ./mcp export, set up as catalogs and rule-promotions
are: catalog-search (40 tools), commerce-extensions (21), flows (19),
payments (12) and pricebooks (18). Every operation has a written
description in a spec override; types.gen.ts, sdk.gen.ts and zod.gen.ts are
unchanged.

- flows, payments and pricebooks generate from new <package>-standalone@v1
  bundles; catalog-search adds its overrides to its existing bundle.
- commerce-extensions now bundles in two steps. Its slug operations are added
  by path-add when the root is left, after the per-operation overrides run, so
  commerce-extensions-paths@v1 adds them and commerce-extensions-standalone@v1
  applies the overrides to the result.
- Risk: catalog-search postMultiSearch and multiSearchByCatalogRelease are
  read; moveSearchRule and setDefaultSearchProfile are update, because they
  change existing search behaviour rather than add a record; pricebooks
  importPricebook is update, because it overwrites existing prices.
@field123
field123 force-pushed the feat/mcp-tools-commerce-config branch from 73b606c to d4a9cd4 Compare October 19, 2026 13:05
@field123
field123 merged commit 0849378 into main Oct 19, 2026
9 checks passed
@field123
field123 deleted the feat/mcp-tools-commerce-config branch October 19, 2026 13:34

This branch was successfully deployed

1 active deployment
Preview – composable-frontend-core — d4a9cd40 Deployed Oct 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP tools: catalog-search, commerce-extensions, flows, payments, pricebooks

1 participant