Shopify Store Sync

v0.12.0
io.github.ussefidder/shopify-store-sync-mcp Checked 1 hour ago Published 5 days ago

Diff and sync Shopify stores: dry-run plans, cross-store ID remapping, never deletes.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_stores List configured stores

List the Shopify stores this server is configured for. Call it first: the aliases it returns are the store names every other tool takes (source, target, store). Returns { server, stores: [{ alias, domain, label, apiVersion, auth, allowWrites, protected }] }. allowWrites=false means apply_plan refuses that store; protected=true means a person confirms every apply to it. An empty list means no store is set up yet. Tokens and secrets are never returned. Takes no arguments and makes no Shopify calls. Next: list_resource_types for what can be synced, diff_stores to compare two stores.

list_resource_types List syncable resource types

List the resource types this server can snapshot, diff and sync (metafield definitions, metaobjects, pages, menus, products...). Returns [{ kind, default, description }]: kind is the value to pass in the resources argument of snapshot_store, export_snapshot, diff_stores and plan_sync; default tells whether it is read when resources is omitted; description says how items are keyed and what is copied. Use it to choose resources; use list_stores for the stores themselves. Takes no arguments and makes no Shopify calls.

snapshot_store Snapshot a store

Read one store's configuration (or a snapshot folder made with export_snapshot) and return it in the response, in portable form with store IDs replaced by handles. Returns { store, domain, takenAt, resources: [{ kind, count, items }] }: items are keys only, or { key, data } with full=true, which can be large, so narrow first with resources, include or the other filters. Use it to inspect one store; to save the configuration to files use export_snapshot, and to compare two stores use diff_stores. Writes nothing.

ParameterTypeDescription
store *stringStore alias, or "dir:<path>" for a snapshot folder made with export_snapshot.
as_draftsbooleanLeave the published state out of what is compared and copied: in a plan, new pages are created hidden and new metaobject entries as drafts, and existing ones keep their state. Products are always crea…
collection_productsbooleancollections: also compare and copy which products are picked by hand into manual collections, matched by handle. Added, never removed. Off by default (one read per manual collection).
currency_ratesobjectExchange rates for stores that sell in different currencies, like {"MAD:EUR": 0.092} (the reverse rate is used too). Product prices (with prices), catalog fixed prices and market currencies are conver…
excludearrayDrop keys matching any of these globs.
fullbooleanInclude each item's data (can be large).
includearrayOnly keys matching one of these globs, e.g. ["PRODUCT.custom.*", "faq/*", "fr:*"].
include_reservedbooleanmetafield_definitions: also compare Shopify-reserved ones (namespace "shopify", the category metafields that drive storefront filters). Compared only: a plan reports them as conflicts and never writes…
inventorybooleanproducts: include stock (the available quantity per location, matched to the target's location with the same name) in what is read, compared and planned. Off by default. Needs read_inventory and read_…
localesarrayLimit translations to these locales, e.g. ["fr", "de"]. Default: every non-primary locale.
market_translationsbooleantranslations: also read the translations each market overrides, keyed "<locale>@<market handle>:<Type>/<handle>", and register them for the market of the same handle in the target. Off by default (one…
metaobject_typesarrayLimit metaobjects to these types. Default: all non-reserved types.
namespacesarrayLimit metafield values (metafields) to these namespaces.
owner_typesarrayMetafield owner types. For metafield_definitions, default: PRODUCT, PRODUCTVARIANT, COLLECTION, CUSTOMER, ORDER, DRAFTORDER, COMPANY, COMPANY_LOCATION, LOCATION, MARKET, PAGE, BLOG, ARTICLE, SHOP. For…
pricesbooleanproducts: include variant prices and compare-at prices; catalogs: include fixed prices in price lists. Read, compared and planned only when on. Off by default, since prices usually differ per store.
resourcesarrayResource types to include. Default: metafield_definitions, metaobject_definitions, collections, pages, shop_policies, metaobjects, menus, redirects. products, metafields, translations, discounts, loca…
type_mismatchstringplan_sync only, when a metafield has one type in the source and another in the target (e.g. single_line_text_field and list.single_line_text_field). Default: reported as a conflict and skipped. "conve…

export_snapshot Export a store's configuration to files

Save a store's configuration to a folder on disk, one JSON file per item (sorted keys, no store IDs), ready to commit to git. dir must be new, empty, or an earlier snapshot folder (its item files are replaced); any other folder is refused. Returns a summary { dir, files, kinds } with the count per resource type, not the data; to see the data in the response use snapshot_store. Later, pass "dir:<path>" as the source of diff_stores or plan_sync to compare against it or restore from it. Reads the store and writes only local files, never to Shopify.

ParameterTypeDescription
dir *stringFolder to write, inside the snapshot base folder (SYNC_SNAPSHOT_DIR, or the folder the server runs in). Must be empty, new, or an earlier snapshot folder (its item files are replaced).
store *stringStore alias to read
as_draftsbooleanLeave the published state out of what is compared and copied: in a plan, new pages are created hidden and new metaobject entries as drafts, and existing ones keep their state. Products are always crea…
collection_productsbooleancollections: also compare and copy which products are picked by hand into manual collections, matched by handle. Added, never removed. Off by default (one read per manual collection).
currency_ratesobjectExchange rates for stores that sell in different currencies, like {"MAD:EUR": 0.092} (the reverse rate is used too). Product prices (with prices), catalog fixed prices and market currencies are conver…
excludearrayDrop keys matching any of these globs.
includearrayOnly keys matching one of these globs, e.g. ["PRODUCT.custom.*", "faq/*", "fr:*"].
include_reservedbooleanmetafield_definitions: also compare Shopify-reserved ones (namespace "shopify", the category metafields that drive storefront filters). Compared only: a plan reports them as conflicts and never writes…
inventorybooleanproducts: include stock (the available quantity per location, matched to the target's location with the same name) in what is read, compared and planned. Off by default. Needs read_inventory and read_…
localesarrayLimit translations to these locales, e.g. ["fr", "de"]. Default: every non-primary locale.
market_translationsbooleantranslations: also read the translations each market overrides, keyed "<locale>@<market handle>:<Type>/<handle>", and register them for the market of the same handle in the target. Off by default (one…
metaobject_typesarrayLimit metaobjects to these types. Default: all non-reserved types.
namespacesarrayLimit metafield values (metafields) to these namespaces.
owner_typesarrayMetafield owner types. For metafield_definitions, default: PRODUCT, PRODUCTVARIANT, COLLECTION, CUSTOMER, ORDER, DRAFTORDER, COMPANY, COMPANY_LOCATION, LOCATION, MARKET, PAGE, BLOG, ARTICLE, SHOP. For…
pricesbooleanproducts: include variant prices and compare-at prices; catalogs: include fixed prices in price lists. Read, compared and planned only when on. Off by default, since prices usually differ per store.
resourcesarrayResource types to include. Default: metafield_definitions, metaobject_definitions, collections, pages, shop_policies, metaobjects, menus, redirects. products, metafields, translations, discounts, loca…
type_mismatchstringplan_sync only, when a metafield has one type in the source and another in the target (e.g. single_line_text_field and list.single_line_text_field). Default: reported as a conflict and skipped. "conve…

diff_stores Diff two stores

Compare configuration between a source and a target, resource type by resource type. Returns for each type the counts (onlyInSource, changed, onlyInTarget, identical) and the keys in each section, with before and after values for every changed field (show_values=false keeps only the field paths); limit caps each list while the counts cover everything, and format="markdown" gives a report to share. Either side can be a snapshot folder ("dir:<path>"), e.g. to check whether production drifted from the committed config. The options shared with plan_sync (resources, include, prices, inventory, as_d…

ParameterTypeDescription
source *stringStore alias, or "dir:<path>" for a snapshot folder made with export_snapshot.
target *stringStore alias, or "dir:<path>" for a snapshot folder made with export_snapshot.
as_draftsbooleanLeave the published state out of what is compared and copied: in a plan, new pages are created hidden and new metaobject entries as drafts, and existing ones keep their state. Products are always crea…
collection_productsbooleancollections: also compare and copy which products are picked by hand into manual collections, matched by handle. Added, never removed. Off by default (one read per manual collection).
currency_ratesobjectExchange rates for stores that sell in different currencies, like {"MAD:EUR": 0.092} (the reverse rate is used too). Product prices (with prices), catalog fixed prices and market currencies are conver…
excludearrayDrop keys matching any of these globs.
formatstring"markdown" returns a report to paste into a ticket or an email.
includearrayOnly keys matching one of these globs, e.g. ["PRODUCT.custom.*", "faq/*", "fr:*"].
include_reservedbooleanmetafield_definitions: also compare Shopify-reserved ones (namespace "shopify", the category metafields that drive storefront filters). Compared only: a plan reports them as conflicts and never writes…
inventorybooleanproducts: include stock (the available quantity per location, matched to the target's location with the same name) in what is read, compared and planned. Off by default. Needs read_inventory and read_…
limitintegerMax items listed per section (default 100, markdown 50). The counts always cover everything.
localesarrayLimit translations to these locales, e.g. ["fr", "de"]. Default: every non-primary locale.
market_translationsbooleantranslations: also read the translations each market overrides, keyed "<locale>@<market handle>:<Type>/<handle>", and register them for the market of the same handle in the target. Off by default (one…
metaobject_typesarrayLimit metaobjects to these types. Default: all non-reserved types.
namespacesarrayLimit metafield values (metafields) to these namespaces.
owner_typesarrayMetafield owner types. For metafield_definitions, default: PRODUCT, PRODUCTVARIANT, COLLECTION, CUSTOMER, ORDER, DRAFTORDER, COMPANY, COMPANY_LOCATION, LOCATION, MARKET, PAGE, BLOG, ARTICLE, SHOP. For…
pricesbooleanproducts: include variant prices and compare-at prices; catalogs: include fixed prices in price lists. Read, compared and planned only when on. Off by default, since prices usually differ per store.
resourcesarrayResource types to include. Default: metafield_definitions, metaobject_definitions, collections, pages, shop_policies, metaobjects, menus, redirects. products, metafields, translations, discounts, loca…
show_valuesbooleanInclude before/after values for each changed field (default true).
type_mismatchstringplan_sync only, when a metafield has one type in the source and another in the target (e.g. single_line_text_field and list.single_line_text_field). Default: reported as a conflict and skipped. "conve…

compare_item Compare one item

Compare a single item between two stores, side by side: whether each has it, every field that differs (entry by entry inside JSON values), and whether the items it points at (products, pages, metaobjects...) exist in the target. Reads only that item where possible, so it is quick. Returns { status (identical, different, only in source, only in target, in neither), changes, refs, notCompared }. Use it for a targeted check instead of diff_stores; take the key from a diff_stores result.

ParameterTypeDescription
key *stringThe item's key, as diff_stores lists it: "size_guide/shirts" (metaobjects), "faq" (pages), "PRODUCT.custom.fabric" (metafield_definitions)...
resource *stringResource type of the item
source *stringStore alias, or "dir:<path>" for a snapshot folder made with export_snapshot.
target *stringStore alias, or "dir:<path>" for a snapshot folder made with export_snapshot.
formatstring"markdown" returns a report.

plan_sync Plan a sync

Build a dry-run plan that would make the target store match the source (a store or a "dir:<path>" snapshot folder) for the selected resources. Reads both sides and writes nothing. Returns { plan_id, expiresAt, totals (create, update, conflict), byResource, ops, warnings, filesToUpload, onlyInTarget, targetWritable, targetProtected }; each op has a seq number, key, action, reason, missing references and field changes (the first 200 ops are listed). Conflicts are items that can't be written, with the reason; items only in the target are listed and never deleted. Show the plan to the person, then…

ParameterTypeDescription
source *stringStore alias, or "dir:<path>" for a snapshot folder made with export_snapshot.
target *stringStore alias the plan would write to (see list_stores; snapshot folders can't be a target).
as_draftsbooleanLeave the published state out of what is compared and copied: in a plan, new pages are created hidden and new metaobject entries as drafts, and existing ones keep their state. Products are always crea…
collection_productsbooleancollections: also compare and copy which products are picked by hand into manual collections, matched by handle. Added, never removed. Off by default (one read per manual collection).
currency_ratesobjectExchange rates for stores that sell in different currencies, like {"MAD:EUR": 0.092} (the reverse rate is used too). Product prices (with prices), catalog fixed prices and market currencies are conver…
excludearrayDrop keys matching any of these globs.
includearrayOnly keys matching one of these globs, e.g. ["PRODUCT.custom.*", "faq/*", "fr:*"].
include_reservedbooleanmetafield_definitions: also compare Shopify-reserved ones (namespace "shopify", the category metafields that drive storefront filters). Compared only: a plan reports them as conflicts and never writes…
inventorybooleanproducts: include stock (the available quantity per location, matched to the target's location with the same name) in what is read, compared and planned. Off by default. Needs read_inventory and read_…
localesarrayLimit translations to these locales, e.g. ["fr", "de"]. Default: every non-primary locale.
market_translationsbooleantranslations: also read the translations each market overrides, keyed "<locale>@<market handle>:<Type>/<handle>", and register them for the market of the same handle in the target. Off by default (one…
metaobject_typesarrayLimit metaobjects to these types. Default: all non-reserved types.
namespacesarrayLimit metafield values (metafields) to these namespaces.
owner_typesarrayMetafield owner types. For metafield_definitions, default: PRODUCT, PRODUCTVARIANT, COLLECTION, CUSTOMER, ORDER, DRAFTORDER, COMPANY, COMPANY_LOCATION, LOCATION, MARKET, PAGE, BLOG, ARTICLE, SHOP. For…
pricesbooleanproducts: include variant prices and compare-at prices; catalogs: include fixed prices in price lists. Read, compared and planned only when on. Off by default, since prices usually differ per store.
resourcesarrayResource types to include. Default: metafield_definitions, metaobject_definitions, collections, pages, shop_policies, metaobjects, menus, redirects. products, metafields, translations, discounts, loca…
type_mismatchstringplan_sync only, when a metafield has one type in the source and another in the target (e.g. single_line_text_field and list.single_line_text_field). Default: reported as a conflict and skipped. "conve…

get_plan Get a plan

Show a sync plan made by plan_sync, before or after it is applied. With plan_id: the plan as plan_sync returned it (totals, ops with field changes, warnings, expiry) plus, once applied, the apply's state and totals; only the first 200 ops are listed and long values are shortened unless full=true, and format="markdown" gives a report to share for review. Without plan_id: the 20 most recent plans (plan_id, createdAt, status, source, target, op count), to find one. To create a plan use plan_sync, to write it use apply_plan, and to follow a running apply use apply_status. Reads only the plans save…

ParameterTypeDescription
formatstring"markdown" returns the plan as a report, to share before applying it.
fullbooleanList every op with full values (default: first 200 ops, long values shortened).
plan_idstringThe plan to show, as returned by plan_sync. Omit to list the recent plans.

apply_plan Apply a plan

Write a reviewed plan to the target store. Refused unless the target has allowWrites=true. For a protected store the person is asked to confirm in the client (or applies from the command line); the assistant can't confirm on their behalf. Re-reads the target first and skips anything that changed since planning. Uploads missing files. Creates and updates only, never deletes. Every op is written to the audit log (get_audit_log). Returns { plan_id, status, totals (created, updated, skipped, failed), results per op }; a plan of more than 50 steps runs in the background instead and returns at once:…

ParameterTypeDescription
plan_id *stringThe plan to write, from plan_sync. It must not have been applied yet and must be less than an hour old.
confirmstringLeave empty. Only read when the server runs with SYNC_ALLOW_AGENT_CONFIRM=true (unattended automation); otherwise a protected store is confirmed by the person, not by this argument.
onlyarrayApply only these ops, by their seq number in the plan (e.g. [1, 2, 3]). Default: every op.
waitbooleanWait for the whole apply before returning. By default a plan of more than 50 steps (SYNC_BACKGROUND_STEPS) runs in the background and this returns at once; follow it with apply_status.

apply_status Follow an apply

How far an apply has got: steps created, updated, skipped, failed and left per resource type, the current phase, progress inside a Shopify bulk operation, time so far and an estimate of the time left, failures counted per resource type and reason, and the latest failures. Also answers for an apply that ended or was interrupted by a server restart. Call it after apply_plan returns a background apply, every minute or so until state is done or error. resource narrows only the listed failures; the counts always cover every resource type. For what each step wrote use get_audit_log, to stop the appl…

ParameterTypeDescription
failuresintegerHow many of the latest failures to list (default 20).
plan_idstringThe plan whose apply to report on. Default: the most recent apply.
resourcestringList only the failures of this resource type, e.g. products.

cancel_apply Cancel an apply

Stop an apply that is running in the background: no further step is started and the Shopify bulk operations it started are cancelled. What was already written stays written (nothing is rolled back or deleted). Also stops bulk operations left running by an apply whose server was restarted. If the apply has already ended, nothing is cancelled and its final state is returned. Returns { plan_id, state (cancelling, or interrupted for an apply from before a restart), note }. Follow with apply_status, then plan_sync to see what is left.

ParameterTypeDescription
plan_idstringThe plan being applied. Default: the most recent apply.

get_audit_log Read the audit log

Read what apply_plan wrote: the most recent audit log entries, newest first, one per step (plan, target store, resource type, key, outcome and message). Filter by plan, outcome (created, updated, skipped, failed) or resource type. Returns { log (file path), matched, returned, entries }: limit (default 50) caps the entries while matched counts every match; in a very large log only the most recent 8 MB is searched. Use it after an apply to see exactly what was written; use apply_status for the progress of a running apply and get_plan for what a plan intended. The log is a local file; nothing is…

ParameterTypeDescription
limitintegerMax entries returned (default 50). matched counts them all.
outcomestringOnly entries with this outcome.
plan_idstringOnly entries of this plan.
resourcestringOnly entries of this resource type.

diff_themes Compare theme settings

Compare theme configuration between two stores: JSON templates, section groups and settings_data.json (default files: templates/*.json, sections/*.json, config/settings_data.json). Use it for theme settings; use diff_stores for store data such as metafields, metaobjects and pages. Compares the published themes unless source_theme or target_theme give theme ids. Returns file counts (onlyInSource, changed, onlyInTarget, identical), the files on one side only, and for each changed file the settings that differ with both values (first 100 per file); format="markdown" gives a report. Use ignore_set…

ParameterTypeDescription
source *stringStore alias to compare from (snapshot folders hold no themes).
target *stringStore alias to compare with.
excludearrayTheme file patterns to leave out, e.g. ["templates/gift_card.json"].
filesarrayTheme file patterns, e.g. ["templates/product*.json"]
formatstring"markdown" returns a report to paste into a ticket or an email.
ignore_settingsarraySettings to leave out, as globs on their path, optionally limited to files: ["current.sections.header.*", "config/settings_data.json:current.color_*"]. Use it to quiet settings that differ on purpose…
source_themestring"main" (default) or a theme id
target_themestring"main" (default) or a theme id