# Build Shopify apps and themes with AI

> Shopify's APIs change often, so agents guess at fields and write broken code.

This setup is for developers building Shopify apps, extensions or themes with an AI coding agent. Shopify's Dev MCP server gives Cursor or Claude Code current Shopify docs and GraphQL schemas, and the GitHub server lets the agent work through branches and pull requests. You end up with code checked against Shopify's real APIs instead of fields the model remembered from older versions.

## Steps

1. **Add Shopify Dev MCP**: Add the Shopify Dev MCP server to Cursor or Claude Code with the command npx -y @shopify/dev-mcp@latest. It needs Node and no Shopify login, because it serves public docs and schemas. Ask the agent to search Shopify docs for a known topic, such as webhooks, to confirm it works.
   Tip: Pin the API version you target in your project notes so the agent checks the right schema.
2. **Connect GitHub**: Add GitHub's MCP server, either the hosted version or the local one with a fine-grained personal access token limited to your app's repository. Give it permission to read code, create branches and open pull requests. Protect your main branch so changes always go through review.
   Tip: A fine-grained token scoped to one repo limits damage if it leaks.
3. **Build with real schemas**: Describe the feature, for example add a product metafield and show it in a theme app extension block. Ask the agent to introspect the Admin GraphQL schema and validate its queries before writing code. Run the app locally with Shopify CLI on a development store and review the pull request.
   Tip: Tell the agent which surface you target, such as Admin API, Storefront API, Functions or Liquid, so it searches the right docs.

## Prompts to try

- Search the Shopify docs for how to register an orders/create webhook in a Remix app and show me the code.
- Write an Admin GraphQL mutation to set a custom metafield on a product, and validate it against the schema.
- Add a theme app extension block that shows the product's care instructions metafield.
- Check every GraphQL query in this repo against the current Admin API schema and list deprecated fields.
- Create a branch, implement the discount Function from the spec in docs/discount.md and open a pull request.

## What you need

- Node.js installed for npx
- A Shopify Partner account and a development store
- Cursor or Claude Code
- A GitHub repository and a scoped access token

## Limits

- Valid schema fields do not guarantee correct business logic; you still need tests and review.
- The agent cannot click through the Shopify admin or check how a theme looks; that testing is yours.
- Docs searches return excerpts, so complex topics may still need you to read the full Shopify guide.

## Security notes

- The Dev MCP only reads docs and schemas. It can't change your store.
- Review pull requests before deploying.

## MCP servers

- [Shopify Dev MCP Server](https://shopify.dev/docs/apps/build/devmcp): docs-read, api-schema-read
- [GitHub MCP Server](https://github.com/github/github-mcp-server): repository-read, issue-write, pull-request-write

## FAQ

**Can the Dev MCP server change my store?**

No. It only searches documentation and reads API schemas. Changes to a store come from your app code, which you run with Shopify CLI and your own credentials.

**Does it cost anything?**

The Shopify Dev MCP server is free and runs locally with npx. You need a Shopify Partner account and a development store to test apps, which Shopify provides at no charge.

**Which editors work?**

Cursor, Claude Code and other MCP clients that run local servers. Claude Desktop also works but is less useful without access to your code.

**What about Liquid themes?**

The server covers theme and Liquid documentation as well as the APIs. Test theme changes with Shopify CLI's theme dev command on a development store before publishing.

## Tools

- **[Shopify](https://suiteintent.com/t/shopify?m=GB)**: Build and run an online store. · Best for: Brands selling online, in person and on social · Pricing on request · 1
- **[GitHub](https://suiteintent.com/t/github?m=GB)**: Code hosting, issues and pull requests. · Best for: Teams reviewing code through pull requests · Free plan · 10000
