A Pi extension that gives the agent direct access to the Shopify Admin GraphQL API for any store you've authed with shopify store auth.
Built originally for internal teams who needed live-store access from inside Pi sessions — partner solutions engineers, implementation specialists, and anyone who spends time inside real merchant stores while building or demoing. It's been useful enough day-to-day that it seemed worth sharing with anyone else in the Pi + Shopify ecosystem who'd benefit.
The Shopify AI Toolkit ships first-party plugins for Claude Code, Cursor, Gemini CLI, Codex, and VS Code — each gives the AI direct access to the Shopify Admin GraphQL API so the agent can query stores, create products, publish pages, edit metaobjects, and run mutations against a live store using your existing shopify store auth token.
Pi didn't have an equivalent. This extension closes that gap using the same shopify store execute primitive every first-party AI Toolkit client uses under the hood, so a Pi session against a store behaves the same way a Claude Code or Cursor session would.
| Tool | What it does |
|---|---|
shopgql_status |
CLI version, resolved binary path, default store, alias map |
shopgql_query |
Read-only GraphQL query against a store |
shopgql_mutate |
WRITE mutation — requires confirm: true + a description string |
shopgql_auth |
Emits the exact shopify store auth command for a given store |
# Shopify CLI 3.93.0+ — needed for `shopify store execute`
pnpm add -g @shopify/cli@latest
# One-time auth per store (opens a browser)
shopify store auth --store <handle> --scopes read_products,read_content,read_metaobject_definitions,read_metaobjects,read_themes,read_customers,read_ordersFor mutations, use the wider scope set the extension suggests (run shopgql_auth with write: true from inside Pi to see the exact command).
pi install https://github.com/miahcodes/pi-shopgqlThat's it. Pi auto-loads the extension on next session start.
To pin a version:
pi install https://github.com/miahcodes/pi-shopgql@v0.1.0To get updates:
pi updateTwo reasons:
- There's no first-party Shopify Admin MCP server. Shopify ships
@shopify/dev-mcp, but it's docs + schema search only — it doesn't connect to live stores or run mutations against merchant data. - Third-party Shopify Admin MCP servers exist but each requires you to create a custom app, generate a per-store access token, and paste it into env vars. They don't integrate with
shopify store auth, are unaudited by Shopify, and shift token management onto you.
Wrapping shopify store execute keeps auth entirely inside the CLI. The extension never sees, parses, or caches tokens. Scope upgrades, revocation, and re-auth flows are handled by shopify store auth itself.
A nice side effect: the extension carries no Admin schema bindings, so new Admin API versions require nothing here — upgrade @shopify/cli and everything keeps working.
- Query tool rejects any GraphQL containing the
mutationkeyword. - Mutate tool requires both
confirm: trueand a human-readabledescription. The Pi UI renders the call in red withapplies to LIVE store — no undobefore execution. - Auth tool is inert — it prints a
shopify store authcommand; you run it yourself in your terminal. - Auth errors include a hint about the cosmetic-vs-permanent
*.myshopify.comdomain gotcha.
Full reference lives in extensions/shopgql/README.md, including:
- Env vars:
SHOPIFY_DEFAULT_STORE,SHOPIFY_CLI_BIN,SHOPIFY_SHOP_ALIASES,PI_SHOPGQL_DEBUG - Shop alias resolution (cosmetic handle → permanent myshopify domain), with merge semantics for combining team-shared and personal alias files
- Worked examples for each of the four tools
git clone https://github.com/miahcodes/pi-shopgql
cd pi-shopgql
npm install
npm test # vitest
npm run typecheck # tsc --noEmitRun the extension locally without installing:
pi -e https://github.com/miahcodes/pi-shopgqlOr from a local checkout:
pi -e ./extensions/shopgql/index.tsMIT © Jeremiah Abalos
Personal project. Not affiliated with, endorsed by, or supported by Shopify Inc. The Shopify name and the shopify CLI are property of Shopify Inc. Use at your own discretion against your own authorized stores.