shopify-theme-mcp
Provides tools for managing Shopify themes, including listing, pulling, pushing, editing, and publishing themes in a Shopify store.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@shopify-theme-mcp Pull my theme, update the footer copyright to 2025, and push it as a new unpublished theme."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
shopify-theme-mcp
An MCP server that lets Claude read and edit your Shopify theme. It wraps the Shopify CLI and a local theme directory, auto-commits every change to git, and refuses to touch your live theme unless you explicitly say so.
Runs as a local stdio server for Claude Desktop, or as a remote HTTP endpoint you can reach from claude.ai and mobile.
How it works
Claude ──stdio──> shopify-theme-mcp ──> local theme dir (git repo)
└─> shopify CLI ──> Shopify AdminEdits happen locally in
THEME_DIR— fast, token-cheap, fully versioned.Every mutation auto-commits with a
[claude]prefix, sogit_history+git_revert_filegive you instant undo. The server runsgit inititself ifTHEME_DIRisn't already a repo.theme_pull/theme_pushsync with Shopify through the CLI.Live-theme protection:
theme_pushdefaults to creating a new unpublished theme. Pushing to the published theme requiresallow_live: true;publish_themerequiresconfirm: true.Hidden content is skipped by default — see Hidden and disabled content.
Related MCP server: Shopify MCP Server
Contents
Requirements
Node.js | 22.12 or newer — required by the Shopify CLI ( |
Shopify CLI | |
Git | Preinstalled on macOS; |
Shopify auth | A Theme Access password, or an interactive CLI login |
On the Node version. This package's own
enginesfield says Node 18+, which is true of the server itself, but the Shopify CLI it shells out to requires 22.12+. Install 22.12 or newer or theme commands will fail. nvm is the easiest way to manage this:nvm install 22 && nvm use 22.
Installing the Shopify CLI
The CLI does the actual talking to Shopify — this server wraps it. Theme commands are built into
@shopify/cli; there is no separate theme package to install any more.
npm (any platform):
npm install -g @shopify/cli@latestHomebrew (macOS):
brew tap shopify/shopify
brew install shopify-cliyarn global add @shopify/cli@latest
# or
pnpm install -g @shopify/cli@latestVerify the install — this must work before the MCP server will:
shopify version
which shopify # note this path; you may need it for Claude Desktop's PATHIf shopify isn't found, your global npm bin directory isn't on your PATH. Find it with
npm bin -g and add it to your shell profile.
The CLI self-upgrades from v4.0 onward. If that is a problem on a server you manage, disable it with
shopify config autoupgrade off.
Getting a Theme Access token
This is the recommended way to authenticate, and the only option for headless or remote use. The token is scoped to themes only — it cannot read orders or customer data.
1. Check you have permission
Store owner — access is automatic.
Staff — you need Edit permissions (including Add and remove staff) plus Themes permissions.
Collaborators — you need Themes permissions under online store settings.
If you don't have these, ask the store owner to generate the password and send it to you.
2. Install the Theme Access app
Go to the Theme Access app on the Shopify App Store, click Add app, then Install app in your admin to authorise it.
3. Create a password
In the Theme Access app, click Create theme password, enter the developer's name and email address, and submit. Shopify emails that address a link to the password.
⚠️ You can only view the password once
The emailed link expires after 7 days, or immediately once the password has been viewed — whichever comes first. Copy it straight into your Claude Desktop config, systemd unit or password manager the moment you open it. If you lose it, you cannot recover it; delete the entry and create a new one.
Theme Access passwords typically begin shptka_.
4. Use it
Set it as SHOPIFY_CLI_THEME_TOKEN wherever you configure the server (Claude Desktop env block,
or the systemd unit). The server passes your environment through to the Shopify CLI, so it is picked
up automatically.
Test it independently of Claude first:
SHOPIFY_CLI_THEME_TOKEN=shptka_xxxx shopify theme list --store my-storeIf that lists your themes, the MCP server will work.
Revoking a token
In the Theme Access app, open the Passwords page, click Delete next to the developer, and confirm. Access is revoked immediately. Do this when someone leaves, or if a token is ever exposed.
Alternative: interactive login
For local use only, you can skip the token entirely:
shopify theme list --store my-storeComplete the browser login and the CLI caches the session. This is fine on your own machine, but the session expires and cannot be used headlessly — remote mode needs a Theme Access token.
Install
git clone https://github.com/GOFORWRD/shopify-theme-mcp.git
cd shopify-theme-mcp
npm install
npm run build
mkdir -p ~/projects/my-theme # local theme directoryTHEME_DIR does not need to be a git repo or contain anything — the server initialises git on first
use and theme_pull will populate it.
Claude Desktop (local, stdio)
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or
%APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"shopify-theme": {
"command": "node",
"args": ["/Users/you/projects/shopify-theme-mcp/dist/index.js"],
"env": {
"SHOPIFY_STORE": "my-store",
"THEME_DIR": "/Users/you/projects/my-theme",
"SHOPIFY_CLI_THEME_TOKEN": "shptka_xxxxxxxxxxxx",
"PATH": "/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin"
}
}
}
}SHOPIFY_STOREis the handle only — the part before.myshopify.com.Both paths must be absolute.
The explicit
PATHmatters. Claude Desktop launches servers with a minimal environment, and the server shells out toshopifyandgit. Runwhich shopifyand make sure that directory is in the list, or every tool call will fail with "command not found".Omit
SHOPIFY_CLI_THEME_TOKENif you used interactive login.Restart Claude Desktop after saving.
Then start it once and pull your theme: ask Claude to run list_themes, then theme_pull.
Tools
Twelve tools. Anything that writes commits to git automatically.
Tool | What it does | Key parameters |
| List themes with IDs and roles (live / unpublished / development) | — |
| Download a theme into |
|
| List local theme files |
|
| Read a file with line numbers |
|
| Grep theme files for text or regex |
|
| Create or overwrite a file → commits |
|
| Exact find-and-replace → commits |
|
| Delete a local file → commits |
|
| Upload to Shopify |
|
| Make a theme live |
|
| Show recent commits |
|
| Restore a file to an earlier commit |
|
Writes are restricted to valid Shopify theme directories: assets, blocks, config, layout,
locales, sections, snippets, templates.
With theme_id omitted, theme_push creates a new unpublished theme named
claude-edit-YYYY-MM-DD unless you pass new_theme_name.
Hidden and disabled content
This is the behaviour most likely to surprise you. Shopify marks sections and blocks that exist
in a template but aren't shown with "disabled": true. Themes accumulate a lot of these.
The server treats hidden content as off-limits by default:
search_filesskips matches inside disabled sections/blocks and tells you how many it skipped. Passinclude_hidden: trueto see them.patch_filerefuses to edit inside disabled content unless you passallow_hidden: true.
So if Claude reports "no matches" for text you can see in a template JSON file, the section is
probably disabled — the visible copy you actually meant is likely worded differently elsewhere.
Ask Claude to search again with include_hidden.
This exists because "change the headline" almost always means the live headline, and editing a dormant section produces a change that appears to do nothing.
Remote mode (HTTP)
The same server can run as a remote MCP endpoint, reachable from claude.ai, Claude Desktop and
mobile. Set MCP_TRANSPORT=http and it serves Streamable HTTP on localhost behind an unguessable
secret path segment.
export SHOPIFY_STORE=my-store
export THEME_DIR=/opt/my-theme
export SHOPIFY_CLI_THEME_TOKEN=shptka_xxxx
export MCP_TRANSPORT=http
export PORT=8787
export MCP_SECRET=$(openssl rand -hex 24) # save this — it's your credential
node dist/index.jsEndpoint | Method | Purpose |
|
| MCP endpoint |
|
| Returns |
Anything else returns 404. MCP_SECRET must be at least 16 characters or the server exits.
It binds to 127.0.0.1 only — put a tunnel or reverse proxy in front of it, never expose the
port directly.
Requests are stateless (a fresh server per request), but all filesystem, git and CLI work is serialized through a global mutex, so concurrent sessions can't corrupt the repo.
VPS setup (Ubuntu/Debian)
# 1. dependencies
# Node 22.12+ is required by the Shopify CLI
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash - && sudo apt install -y nodejs git
sudo npm install -g @shopify/cli@latest
# 2. application
sudo mkdir -p /opt/shopify-theme-mcp /opt/my-theme
sudo git clone https://github.com/GOFORWRD/shopify-theme-mcp.git /opt/shopify-theme-mcp
cd /opt/shopify-theme-mcp && npm install && npm run buildCreate /etc/systemd/system/shopify-theme-mcp.service:
[Unit]
Description=Shopify Theme MCP
After=network.target
[Service]
WorkingDirectory=/opt/shopify-theme-mcp
ExecStart=/usr/bin/node dist/index.js
Restart=always
Environment=SHOPIFY_STORE=my-store
Environment=THEME_DIR=/opt/my-theme
Environment=SHOPIFY_CLI_THEME_TOKEN=shptka_xxxx
Environment=MCP_TRANSPORT=http
Environment=PORT=8787
Environment=MCP_SECRET=replace-with-openssl-rand-hex-24
[Install]
WantedBy=multi-user.targetThe unit file holds live credentials — keep it at 0600 and outside the repo.
sudo chmod 600 /etc/systemd/system/shopify-theme-mcp.service
sudo systemctl daemon-reload && sudo systemctl enable --now shopify-theme-mcp
curl http://127.0.0.1:8787/healthz # -> ok
curl -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8787/ # -> 404, as expectedExpose it with a Cloudflare Tunnel
Add to your tunnel's ingress rules:
- hostname: shopify-theme.example.com
service: http://localhost:8787cloudflared tunnel route dns <tunnel-name> shopify-theme.example.com
sudo systemctl restart cloudflaredConnect Claude
claude.ai / Desktop / mobile: Settings → Connectors → Add custom connector →
https://shopify-theme.example.com/<MCP_SECRET>/mcpLocal stdio: omit
MCP_TRANSPORTand use the Claude Desktop config above.
Seed the theme directory once on the host by calling theme_pull (or running
shopify theme pull) before your first editing session.
Configuration reference
Variable | Required | Default | Purpose |
| yes | — | Store handle, e.g. |
| yes | — | Absolute path to the local theme directory |
| recommended | — | Theme Access password ( |
| no | stdio | Set to |
| no |
| HTTP listen port (http mode only) |
| http mode | — | Secret path segment, min 16 chars ( |
The server exits at startup if SHOPIFY_STORE or THEME_DIR is missing, or if MCP_TRANSPORT=http
without a valid MCP_SECRET. See .env.example.
Typical session
You: "Update the countdown in the announcement bar to say 'Last day for guaranteed delivery'"
Claude pulls the live theme → searches for the text → patches the template JSON → pushes to a new unpublished theme → returns the preview URL → you review → you say "publish" → Claude publishes.
Every step is committed to git, so git_history and git_revert_file will undo anything.
Security
SHOPIFY_CLI_THEME_TOKENandMCP_SECRETare credentials. Keep them in your Claude Desktop config or systemd unit — never commit them..gitignorecovers.env; the systemd unit lives outside the repo by design.In remote mode the secret path is the credential. Anyone with the full URL can read and rewrite your theme. URLs leak more readily than headers — shell history, proxy logs, config files — so rotate
MCP_SECRETif it is ever exposed, and update your connector.The server binds to
127.0.0.1only; a tunnel or proxy should be the sole public route.Prefer a Theme Access token over a full CLI login: it is scoped to themes and cannot reach orders or customer data.
Live-theme changes always require an explicit flag (
allow_live,confirm). Don't configure Claude to auto-approve those tools.
Known limitations
theme_pushdoes not delete remote files that were deleted locally. Remove them via the Shopify admin, or run the CLI manually.Binary assets (images, fonts) sync but can't be read or edited via
read_file/patch_file.If someone edits the theme in the Shopify admin at the same time, re-run
theme_pullbefore editing or you may clobber their changes.search_filesandpatch_filehide disabled content by default — see Hidden and disabled content.
Troubleshooting
"Missing required env vars" on startup. SHOPIFY_STORE or THEME_DIR isn't set. In Claude
Desktop they must be inside the server's env block, not your shell profile.
spawn shopify ENOENT / "command not found". Claude Desktop's minimal environment can't find
the Shopify CLI. Add its directory to the explicit PATH in your config — check with
which shopify.
CLI asks for a browser login, or hangs in remote mode. Set SHOPIFY_CLI_THEME_TOKEN.
Interactive sessions expire and can't work headlessly.
Shopify CLI errors about the Node version. The CLI requires Node 22.12+. Check with
node --version; upgrade with nvm install 22 && nvm use 22, or reinstall Node from your package
manager. This package's own engines field says 18+, but the CLI is the binding constraint.
You lost the Theme Access password. It can only be viewed once and the link expires after 7 days. Delete the entry on the Theme Access Passwords page and create a new one — see Getting a Theme Access token.
401 / Unauthorized from theme commands. The token was revoked, belongs to a different store,
or SHOPIFY_STORE doesn't match it. Verify outside Claude with
SHOPIFY_CLI_THEME_TOKEN=… shopify theme list --store my-store.
Search finds nothing for text you can see. The section is probably disabled — retry with
include_hidden: true. See Hidden and disabled content.
Push refused with a live-theme message. Working as intended. Push to an unpublished copy
(omit theme_id), preview it, then publish deliberately.
404 from the tunnel. Every path except /<MCP_SECRET>/mcp and /healthz returns 404. Check the
URL includes the full secret segment.
Server exits immediately in http mode. MCP_SECRET is missing or shorter than 16 characters.
Licence
MIT — see LICENSE.
Available Tools
12 toolsdelete_fileDelete theme fileA
Delete a local theme file and auto-commit. Note: theme_push does not delete remote files unless you push with the CLI's --nodelete disabled; mention this to the user.
Inputs: filename (required), message.
git_historyShow edit historyA
Show recent git commits for the local theme (every edit auto-commits).
Inputs: limit.
git_revert_fileRevert a file to a previous commitA
Restore one file to its state at a given commit (from git_history), then commit the revert. Use to undo a bad edit.
Inputs: commit (required), filename (required).
list_filesList theme filesA
List files in the local theme directory. Optionally filter with a substring or simple pattern (e.g. 'sections/', '.liquid', 'countdown').
Inputs: filter.
list_themesList themesA
List all themes in the store with their IDs and roles (live, unpublished, development). Use this first to find theme IDs.
Inputs: no named parameters.
patch_filePatch theme file (find & replace)A
Edit an existing theme file by replacing an exact string. old_str must appear exactly once in the file (include enough surrounding lines to make it unique). Auto-commits to git. Preferred over write_file for edits.
Inputs: new_str (required), old_str (required), filename (required), message, +1 more.
publish_themePublish theme (make it live)A
Make an unpublished theme the live storefront theme. DESTRUCTIVE for the current live theme's status — only call after the user has previewed the theme and explicitly asked to publish. confirm must be true.
Inputs: confirm (required), theme_id (required).
read_fileRead theme fileA
Read a theme file's contents with line numbers. For large files, pass start_line/end_line to read a slice. Use search_files first to locate the relevant region.
Inputs: filename (required), end_line, start_line.
search_filesSearch theme filesA
Search all text files in the theme for a string or JavaScript regex. Returns matching files with line numbers and context. Always use this to locate code instead of reading whole files.
Inputs: query (required), is_regex, file_filter, max_results, +1 more.
theme_pullPull themeA
Download a theme's files from Shopify into the local theme directory and snapshot the result in git. Pass theme_id (from list_themes); omit to pull the LIVE theme. Run this before starting an editing session so local files are fresh.
Inputs: only, theme_id.
theme_pushPush theme to ShopifyA
Upload the local theme directory to Shopify.
Default: push to an UNPUBLISHED copy (safe; returns a preview URL).
Pass theme_id to push to a specific existing theme.
Pushing to the LIVE theme is BLOCKED unless allow_live=true. Only set allow_live after the user explicitly confirms.
Inputs: only, theme_id, allow_live, new_theme_name.
write_fileWrite theme file (full contents)A
Create a new theme file or fully overwrite an existing one, then auto-commit to git. For small edits to existing files prefer patch_file — it is safer and cheaper.
Inputs: content (required), filename (required), message.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Each tool targets a distinct resource and action: theme lifecycle, local file operations, and git safety. write_file and patch_file are clearly differentiated by overwrite vs exact-string edit, and list_themes vs list_files are unambiguous.
Most tools follow verb_noun naming (list_themes, read_file, patch_file), but theme_pull and theme_push reverse that pattern, and git_history/git_revert_file use a prefix style. The mix is readable but not fully predictable.
At 12 tools, the set is well-scoped and every tool fills a clear role in the theme development workflow. There is no bloat or trivial redundancy.
The tool surface covers the full local-to-remote Shopify theme workflow: theme discovery, pulling/pushing files, file CRUD, publishing, and git-backed undo. No major operational gaps are evident for standard editing sessions.
Maintenance
Related MCP Connectors
Build, deploy and manage MaShop e-commerce projects from Claude, Cursor or any MCP client.
Safe Shopify theme changes for AI agents: staging, validation, visual review, approval, rollback.
Run a WooCommerce shop from Claude or ChatGPT: sales and stock reports, SEO, prices, products, menus and site design. Every change is a draft that you approve with one click, and you can undo it. Free forever: 100 actions a day. Skill: github.com/SakkoulasGiannis/addsynapse-woocommerce
Read, edit, publish, and preview your pepita websites from Claude.
Related MCP Servers
- AlicenseAqualityDmaintenanceAllows Claude to execute terminal commands on your computer and perform file system operations including surgical code editing with diff-based replacements.197MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Shopify store data (products, customers, orders) via GraphQL, providing comprehensive tools for store management through Claude.3MIT
- AlicenseNot gradedqualityCmaintenanceEnables querying Shopify store data (products, customers, orders) via GraphQL API using read-only tools. Works with Claude Desktop via npx command.24 npmMIT
- AlicenseCqualityDmaintenanceConnects your Shopify store data to Claude Desktop, enabling access to products, orders, customers, inventory, and more through natural language.154MIT