Shopify in the Terminal: Claude Code, Codex and Cursor with MCP
Shopify MCP in Claude Code, Codex and Cursor: Dev MCP validates GraphQL and Liquid with no login, but running a store needs a custom app, token and approval.
by Ailton Carvalho · AI and automation · November 7, 2026 · 11 min read
In this article
- The short answer
- 1. What the Dev MCP does and what it does not do
- 2. Installing in Claude Code
- 3. Installing in Cursor and Codex
- 4. Operating the store: custom app, token and scopes
- 5. Read first, write later
- 6. Bulk writes: the 10% price increase example
- 7. The same toolkit in Codex: a daily report with codex exec and cron
- A ready-made prompt for your agent
- Frequently asked questions
- Conclusion
The short answer
The Shopify Dev MCP is an official MCP server, run locally, that gives your coding agent access to Shopify's documentation and schemas and validates GraphQL and Liquid, for anyone building a theme, an app or an integration. It requires no authentication and, for that very reason, it cannot see your store: it does not list orders, change prices or publish products. To operate the store, the path is a custom app with a token and minimal scopes, called by a script or by an MCP server of your own. Bulk writes only with a person confirming before each batch. The same toolkit works in Claude Code, Cursor and Codex, and Codex can also schedule a daily report with codex exec and cron.
1. What the Dev MCP does and what it does not do
The official page describes the server as a way to connect the agent to "Shopify's developer resources" through MCP, and states that it "doesn't require authentication". What does need a login is something else: the AI Toolkit's store management goes through the authenticated Shopify CLI context, and only runs when you choose to execute it (source: Shopify.dev, AI Toolkit, read on 2026-11-07).
In practice, here is what you get by installing the server:
- The agent looks up the current documentation instead of guessing field names from memory.
- It validates a GraphQL query, a Liquid template or an extension against the schema before you run it.
- It works with the code of your theme or app, which sits on your disk.
What you do not get: order, inventory or customer data. For that, the agent needs a store credential, and that credential is a separate topic, covered in section 4. If you do not yet know what MCP is, read MCP in Claude Code and Cursor: what it is and how to set it up first.
| Piece | Needs a login? | Sees the store? | Source (read on 2026-11-07) |
|---|---|---|---|
Dev MCP (@shopify/dev-mcp) |
No | No | Shopify.dev, Dev MCP server |
Agent skills (npx skills add) |
No | No | Shopify.dev, AI Toolkit |
| Store management via Shopify CLI | Yes, the CLI's authenticated context | Yes, when you execute it | Shopify.dev, AI Toolkit |
| Custom app with a token | Yes, the app token | Yes, within its scopes | Shopify.dev, access tokens |
The environment requirement is Node.js 18 or higher (source: Shopify.dev, AI Toolkit, 2026-11-07). The skills do not update themselves: the page tells you to run npx skills update to get new versions. The server, on the other hand, is launched with @latest in the official commands, so it fetches the current version on every start.
2. Installing in Claude Code
Shopify's official command for Claude Code uses the stdio transport, which means the server runs as a local process on your machine:
claude mcp add --transport stdio shopify-dev-mcp -- npx -y @shopify/dev-mcp@latest
The -- matters: everything before it is a Claude option, everything after it goes to the server unchanged (source: Claude Code Docs, MCP, 2026-11-07). After adding it, restart Claude Code, as the Shopify page asks. To check:
claude mcp list
The list shows the state of each server, such as "Connected" or "Failed to connect". Inside a session, the /mcp command shows the status and lets you reconnect.
Scope: local, project or user
The default is the local scope: it applies only to the current project and lives in your ~/.claude.json. With --scope project, the configuration goes into the .mcp.json at the repository root and the whole team gets the same server when cloning the repository. With --scope user, it applies to all your projects. For the Dev MCP, which carries no secret, project scope usually makes sense in a shared theme repository. Any server that carries a token, however, should stay in local or user scope, with the credential coming from an environment variable (.mcp.json accepts ${VAR}), never written into the versioned file.
The documentation's warning applies both ways: "Verify you trust each server before connecting it". A stdio server runs a command on your machine with your user's permissions, and Claude Code asks for approval before using servers that come from a .mcp.json. Read the file of someone else's repository before approving.
3. Installing in Cursor and Codex
Cursor
In Cursor, the server goes in through .cursor/mcp.json (project) or ~/.cursor/mcp.json (global). For stdio, the fields are type, command, args and, if needed, env (source: Cursor Docs, MCP, 2026-11-07):
{
"mcpServers": {
"shopify-dev-mcp": { "type": "stdio", "command": "npx", "args": ["-y", "@shopify/dev-mcp@latest"] }
}
}
Shopify also describes the path through the interface, under Settings, Tools and MCP, with the name shopify-dev-mcp, the command npx and the same arguments. Cursor asks before running each MCP tool by default, and you can open the call's arguments before approving. Keep that behavior on whenever a store token is involved.
Codex
In Codex, the block goes in ~/.codex/config.toml, according to the Shopify page:
[mcp_servers.shopify-dev-mcp]
command = "npx"
args = ["-y", "@shopify/dev-mcp@latest"]
You can also add it from the command line with codex mcp add, and codex mcp list shows what is configured (source: Codex MCP documentation, 2026-11-07). Restart Codex afterwards. The optional required = true field makes the run fail if the server does not start, which is useful in automation, where you prefer a clear error to a report produced without the tool.
4. Operating the store: custom app, token and scopes
For the agent to read orders or change products, Shopify requires an app with its own credential. There are two paths, and the date matters. According to the Help Center, new custom apps are created in the Dev Dashboard, and custom apps created before January 1, 2026 can still be managed from the store admin (source: Shopify Help Center, Custom apps, 2026-11-07). The admin token page confirms it: custom apps created directly in the admin "can no longer be created", but existing ones keep working.
In a Dev Dashboard app installed on your own store, the token comes from client credentials: a POST to /admin/oauth/access_token with grant_type, client_id and client_secret. You do not send scope, because the token carries the scopes the store granted to the installation. The token expires in 24 hours (expires_in of 86399 seconds), and the app and the store must be in the same Dev Dashboard organization (source: Shopify.dev, Get API access tokens, 2026-11-07). In a legacy admin app, the token is "shown only once", and you cannot rotate the key: only uninstall and reinstall.
Whichever path you take, the call is a POST to the Admin GraphQL API, with the token in the X-Shopify-Access-Token header, at an address like https://{store}.myshopify.com/admin/api/2026-10/graphql.json. The API limits requests by query cost and returns the THROTTLED error when you go over the limit (source: Shopify.dev, GraphQL Admin API, 2026-11-07).
Minimal scopes
Shopify tells you to request "only the data your app needs to function". read_products covers reading products, variants and collections; write_products covers changing them and already includes reading (source: Shopify.dev, access scopes, 2026-11-07). Two rules follow from this:
- Anyone who only generates reports gets only
read_scopes. A token withoutwrite_cannot wreck a price, no matter how badly the agent errs. - A declared scope is not a granted scope. Query
currentAppInstallationto see what the installation actually has.
Where the token lives
The token lives in an environment variable, read by a script or by an MCP server of your own, and never in a versioned file, in a prompt or in a log. In Claude Code, .mcp.json accepts ${VAR} precisely for this; in Cursor, the equivalent is ${env:NAME}. An MCP server that carries a token is the part that changes from store to store, and it is the kind of piece that gets written to measure.
5. Read first, write later
The split that avoids nasty surprises: one set of read-only credentials for day-to-day work and another, separate one for writing, used briefly and only on the approved batch. The safest flow with the agent is this:
- The Dev MCP writes and validates the GraphQL query against the schema.
- A script with a
read_token runs the query and saves the result to a local file. - The agent reads the file and builds the report or the list of proposed changes.
- A person reviews the list. Only then does a script with a write token apply it.
Notice that the agent never holds the write token while it decides. Whoever decides proposes; whoever holds the credential only executes what was approved. For running the agent on a server 24 hours a day, the article Claude Code 24/7 on a Hostinger VPS covers the infrastructure.
6. Bulk writes: the 10% price increase example
Take a typical request: "raise the price of every product in a collection by 10%". It sounds simple, and it is exactly the kind of order that, badly executed, reprices the whole store in seconds. The safe design has four safeguards:
- Preview without writing. The first step only reads and prints a table with product, variant, current price and new price. Nothing is saved.
- Explicit human confirmation. The script shows the count and the total of items and only continues if a person types the requested confirmation. An empty or different answer cancels.
- Small batches and a log. Apply in batches, respecting query cost and
THROTTLED, and save each variant's previous price to a file so you can undo. - Stop at the first error. A user error in the mutation response interrupts the batch instead of pushing on.
| Step | Token used | Who approves |
|---|---|---|
| Building the query and the mutation | None (the Dev MCP validates against the schema) | Nobody, it is just text |
| Preview with current and new price | read_products |
A person reads the table |
| Applying the batch | write_products |
A person types the confirmation |
| Rollback | write_products |
A person confirms again |
In Cursor, per-tool approval is already the default. In Claude Code and Codex, keep the mode that asks permission for commands that write, and do not approve a write script "forever". The confirmation inside the script is worth more than the agent's: it keeps working even if someone changes the permission mode without noticing.
7. The same toolkit in Codex: a daily report with codex exec and cron
Codex runs outside interactive mode with codex exec, designed for scripts and CI. By default it uses a read-only sandbox, progress goes to stderr and only the agent's final message goes to stdout. The -o option writes that final message to a file (source: Codex non-interactive mode documentation, 2026-11-07). That fits a report well: the agent only needs to read and write text.
The design has two separate pieces, so the agent never touches the write credential:
- A script of yours, scheduled in cron, uses a read-only token (for example
read_orders, which covers orders according to Shopify's token page) and saves the day's data to a JSON file inside a Git repository. codex execreads that file and writes the report in Markdown.
The command for the second step:
codex exec -o relatorio-diario.md "Read dados-do-dia.json and write a short report: orders, revenue, out-of-stock items and stalled orders. Only describe what is in the file."
And the crontab line that triggers both steps in a wrapper script:
0 7 * * * cd /caminho/do/repo && ./coletar-dados.sh && ./gerar-relatorio.sh
Precautions the documentation points out
- Git repository. Codex requires a Git repository unless you pass
--skip-git-repo-check. Run it inside the report's repository. - Credentials.
codex execreuses the CLI's saved login. The page warns against settingCODEX_API_KEYas a job variable in workflows that run repository code, because build scripts or tests could read it. - Required server. With
required = truein the MCP server block, the run ends with an error if the server does not start. In scheduling, failing loudly is better than delivering a report without the tool. - Sandbox. To write files, the documentation points to
--sandbox workspace-write;--full-autois no longer supported. Thedanger-full-accessmode is only justified in an isolated runner or container. For a report that is only read, the read-only default with-ois enough.
This report is a draft someone reads in the morning, not a decision already made. If the report suggests something like "reprice that collection", the action goes back to the section 6 flow, with preview and confirmation. Keeping the agent running on a server, with a persistent session, is covered in Claude Code on a VPS with tmux and systemd, and the same service logic applies to scheduled scripts. To keep the same instructions across all three agents, see Rulesync.
How to know it worked
The test is objective, in three steps: claude mcp list shows the server as connected; codex mcp list shows shopify-dev-mcp; and codex exec finishes by producing the file passed to -o, with content that matches the day's JSON. If any of them fails, the problem is in the installation, not in the report.
A ready-made prompt for your agent
Paste the text below into Claude Code, Codex or Cursor, inside the folder of your theme or integration project. The agent checks the prerequisites, installs the Dev MCP in the agent you use, shows each command before running it and hands back to you the steps that require your credential.
You are my terminal assistant. Reply in English.
MY DETAILS
- Agent I use: <AGENT_CLAUDE_CODE_CODEX_OR_CURSOR>
- Store: <STORE_NAME>.myshopify.com
- Do I also want a daily report? <YES_OR_NO>
RULES
- Never print, paste into the chat or write to a versioned file any password, token, API key or login code.
- Show each command before running it and stop at the exact error, without trying to work around it.
- Do not invent commands. If you are not sure, say so and check the official documentation.
STEPS
0. Check the prerequisites: Node.js 18 or higher installed and the chosen agent available in the terminal.
1. If it is Claude Code, show and run: claude mcp add --transport stdio shopify-dev-mcp -- npx -y @shopify/dev-mcp@latest
Then run claude mcp list and confirm that shopify-dev-mcp shows up as connected. Ask me to restart Claude Code.
2. If it is Cursor, create or edit .cursor/mcp.json with the shopify-dev-mcp server: type "stdio", command "npx", args ["-y", "@shopify/dev-mcp@latest"]. Ask me to restart Cursor.
3. If it is Codex, add to ~/.codex/config.toml the block [mcp_servers.shopify-dev-mcp] with command = "npx" and args = ["-y", "@shopify/dev-mcp@latest"]. Run codex mcp list and confirm. Ask me to restart Codex.
4. Explain in two sentences that the Dev MCP needs no login and cannot see my store.
5. If I want to operate the store: guide me to create a custom app and choose only read_ scopes for reporting. My step: I create the app myself and keep the token in an environment variable. You never see the token.
6. For any write (for example, repricing a collection): first generate only the preview (product, current price, new price), without saving anything. Only apply after I type the requested confirmation, in batches, keeping the previous price.
7. If I want the daily report (Codex only): a script of mine collects the data with a read token into a JSON file; then run codex exec -o relatorio-diario.md with the prompt to read the JSON and summarize it, inside a Git repository. Propose the cron line and wait for my OK to install it.
FINAL VALIDATION
- claude mcp list or codex mcp list shows shopify-dev-mcp connected (or Cursor lists the server under Tools and MCP).
- If there was a report, the -o file exists and its content matches the day's JSON.
- Only say you are done when these tests pass. If any fails, show the exact error and stop.
Frequently asked questions
Does the Shopify Dev MCP need a login or access my store's data?
No. The official page says the server "doesn't require authentication" and describes it as a connection to Shopify's developer resources. It searches documentation and validates code; it does not read orders or change products. For that you need an app with a token and scopes.
What is the difference between the Dev MCP, the AI Toolkit and skills?
The AI Toolkit is the package: plugins, agent skills and the Dev MCP. Skills are instructions installed with npx skills add Shopify/shopify-ai-toolkit and do not update themselves. The Dev MCP is the @shopify/dev-mcp server, which runs locally. All of them require Node.js 18 or higher (source: Shopify.dev, AI Toolkit, 2026-11-07).
Can I let the agent change prices and inventory on its own?
Technically, a token with write_products allows it. In practice, bulk writes should go through a preview and confirmation by a person, in batches and with a record of the previous value. A report without writes is the best starting point, with a read-only token.
Do Claude Code, Cursor and Codex use the same configuration?
The server is the same, the file changes. Claude Code uses claude mcp add (or .mcp.json), Cursor uses .cursor/mcp.json and Codex uses config.toml. Shopify publishes the command or block for each one.
Can codex exec run in cron every day?
Yes. The documentation cites scripts, CI and scheduled jobs as uses of codex exec. It runs in a read-only sandbox by default, requires a Git repository and writes the final message with -o. Mind the credential: the page warns against CODEX_API_KEY as a job variable where repository code runs.
Conclusion
The Dev MCP handles writing and validating code for Shopify, with no login and without touching the store. Operating orders, inventory and prices is different work: an app with a token, minimal scopes, reading kept apart from writing and a person confirming each batch before anything is saved. Start with a read-only daily report, which delivers value without risk, and only then design the writes with preview and safeguards. If what you need is the agent reading your ERP, your store or your database, that is custom integration work (MCP, webhook, queue). Describe the system and what you want to automate at