shopify-agent
Provides tools for interacting with the Shopify Admin API, enabling AI agents to manage products, variants, options, inventory, orders, fulfillments, customers, and locations in a Shopify store.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
shopify-agent
An agentic Shopify server. It exposes Shopify Admin operations as callable tools over three transports, so any tool that can receive orders from an AI can drive a Shopify store.
There is no chat interface and no LLM inside. This server does not talk to the user. It executes orders. That is the whole point: you put it behind Claude, Cursor, an OpenAI function-calling loop, n8n, a Make scenario, or your own agent, and the agent gets a clean, typed tool surface.
┌──────────────┐ MCP / HTTP / OpenAI functions ┌────────────────┐ GraphQL ┌─────────┐
│ your AI tool │ ───────────────────────────────▶ │ shopify-agent │ ──────────▶ │ Shopify │
└──────────────┘ └────────────────┘ └─────────┘Zero runtime dependencies. Node's own
httpandfetch. No SDK, nozod, nographql-request, nodotenv, no build step.Runs offline. With no credentials it starts against a built-in mock store, so you can develop, test and demo without touching a real store.
One catalogue, three transports. MCP, plain REST and OpenAI function definitions are generated from the same 17 tool definitions.
Look at it
Open http://127.0.0.1:8788 in a browser: a catalogue page listing all 17 tools, their contracts, and a form to execute any of them against the mock store. It is a catalogue and a test console, not a chat: there is no conversation and no model behind it.
Quick start
git clone https://github.com/devopvila-hue/shopify-agent.git
cd shopify-agent
npm startThat is it — no npm install needed, there are no dependencies. The server
starts on http://127.0.0.1:8788 against the offline mock store.
curl http://127.0.0.1:8788/health
# {"ok":true,"status":"ready","mode":"mock","tools":17,"apiVersion":"mock"}
curl -X POST http://127.0.0.1:8788/tools/search_products \
-H 'Content-Type: application/json' \
-d '{"query":"sweater"}'To talk to a real store, copy .env.example to .env and fill in your
credentials. Then npm start again.
npm test # 62 tests, no network needed
npm run smoke # boots the server and exercises all three transportsRelated MCP server: MCP Shopify
Connecting it to your AI tool
1. Any MCP client (Claude Desktop, Claude Code, Cursor, Zed, …)
Point the client at the HTTP endpoint:
{
"mcpServers": {
"shopify": {
"type": "http",
"url": "http://127.0.0.1:8788/mcp"
}
}
}If the client only speaks stdio MCP, pipe it:
npx @modelcontextprotocol/server-proxy --url http://127.0.0.1:8788/mcp2. Any OpenAI-compatible function-calling loop
The catalogue is already in the shape the OpenAI API expects:
curl http://127.0.0.1:8788/tools/openai[
{
"type": "function",
"function": {
"name": "search_products",
"description": "List or search catalogue products. …",
"parameters": { "type": "object", "properties": { /* … */ } }
}
}
]Feed that straight into your tools parameter, then call the tool the model
chose:
curl -X POST http://127.0.0.1:8788/tools/search_products \
-H 'Content-Type: application/json' \
-d '{"query":"hoodie","limit":5}'3. A batch of orders in one request
POST /commands takes a list and returns one result per command. A failure
in one command does not stop the others.
curl -X POST http://127.0.0.1:8788/commands \
-H 'Content-Type: application/json' \
-d '{
"commands": [
{ "tool": "list_locations", "arguments": {} },
{ "tool": "search_products", "arguments": { "query": "mug" } },
{ "tool": "get_order", "arguments": { "orderId": "gid://shopify/Order/7001" } }
]
}'{
"ok": true,
"data": {
"results": [
{ "tool": "list_locations", "ok": true, "data": { "locations": [ /* … */ ] } },
{ "tool": "search_products", "ok": true, "data": { "products": [ /* … */ ] } },
{ "tool": "get_order", "ok": false, "error": { "code": "not_found", "message": "…" } }
],
"succeeded": 2,
"failed": 1
}
}4. A custom agent loop
Every response has the same shape, so the loop is trivial:
const res = await fetch('http://127.0.0.1:8788/tools/' + name, {
method: 'POST',
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${KEY}` },
body: JSON.stringify(args),
});
const { ok, data, error } = await res.json();
if (!ok) return modelFeedback(error.message);
return modelFeedback(data);Endpoints
Method | Path | What it does |
|
| Catalogue page: browse the tools and run them against the mock. |
|
| Liveness and readiness. Always open. |
|
| Service description and the endpoint list. |
|
| Full catalogue with JSON Schemas. |
|
| The catalogue as OpenAI function definitions. |
|
| One tool's schema and annotations. |
|
| Run one tool. The body is the tool's arguments. |
|
| Run one tool, name and args in the body. |
|
| Run a batch of tools. |
|
| MCP Streamable HTTP (JSON-RPC 2.0). |
Responses are always { "ok": true, "data": … } or
{ "ok": false, "error": { "code", "message", "details" } }.
Error codes: invalid_input, not_found, unauthorized, forbidden,
conflict, upstream_error, unsupported, internal_error.
The tools
Tool | Kind | What it does |
| read | Which store, live or mock, API version, auth mode. |
| read | Store locations. You need one to move stock. |
| read | Search the catalogue, paginated. |
| read | One product with variants, prices and stock. |
| write | New product, optionally with options. |
| write | Change title, handle, status, tags, SEO, collections. |
| write, destructive | Permanent delete. Needs |
| write | Create, update or delete variants. |
| write, destructive | Create, rename or delete product options. |
| write | Set or adjust stock at a location. |
| read | Search orders by status or query. |
| read | One order with line items and totals. |
| write | Tags, email, note, shipping address, metafields. |
| write | Ship items, with optional tracking. |
| read | Search customers by email, name or tag. |
| read | One customer with addresses and spend. |
| write | Name, email, phone, tags, note, tax exemption. |
Read-only tools are flagged as such (readOnly in the catalogue,
annotations.readOnlyHint in MCP), so a host can allowlist reads and let a
model write only when it should.
Destructive tools require confirm: true. An agent that forgets it gets a
clear error instead of a deleted product.
Configuration
Everything is environment variables. A .env file next to package.json is
read automatically; real environment variables always win.
Variable | Default | Meaning |
|
|
|
| — |
|
| — | Static |
| — | Client id for the client-credentials flow. |
| — | Client secret for the client-credentials flow. |
|
| Admin API version. |
|
| Bind address. |
|
| Bind port. |
| — | If set, every call needs |
|
| Refuse to start in mock mode. |
Authentication
Shopify stopped issuing static Admin API tokens through its UI in January 2026, so the client-credentials flow is the forward path:
SHOPIFY_STORE_DOMAIN=your-store.myshopify.com
SHOPIFY_CLIENT_ID=...
SHOPIFY_CLIENT_SECRET=...The server exchanges the credentials for a short-lived token and refreshes it in the background, so a long-lived agent process never has to think about it. Static tokens still work if that is all you have.
What was simplified, and why
This started as a reverse engineering pass over the published
shopify-mcp package (v1.0.8): 14 tools, stdio transport only, 6 runtime
dependencies, a module-level mutable client, and no inventory or fulfillment
tool at all. The result here keeps the useful ideas and drops the rest.
|
| |
Transports | stdio only | MCP over HTTP, REST, OpenAI functions |
Runtime dependencies | 6 ( | 0 |
State | module-level mutable singleton client | one injected backend per request |
Errors | raw GraphQL exceptions | uniform |
Pagination |
| opaque cursor everywhere |
Inventory | missing |
|
Fulfillment | missing |
|
Metafields | passed into |
|
Options API | hand rolled |
|
Runs without a store | no | yes, offline mock |
Tests | none | 62 |
The live backend was written against the current Admin GraphQL docs
(2026-10 is the latest stable as of now), including the version-gated
@idempotent directive and changeFromQuantity on inventory adjustments.
Layout
src/
index.js entry point: config → backend → server
config.js environment and .env
server.js HTTP routing, auth, error envelope
mcp.js MCP Streamable HTTP (JSON-RPC 2.0)
registry.js the tool catalogue and the three serialisations
validate.js small JSON Schema validator
errors.js the error contract
tools/ one file per domain
backends/
mock.js offline, seeded, in-memory
shopify.js live Admin GraphQL
public/
index.html the catalogue page
test/ 63 testsThe two backends implement the same domain API, so a tool never learns which one it is talking to, and the mock can be trusted as a contract for the live one.
License
MIT.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Unofficial Shopify MCP Pack — wraps the Shopify Admin REST API (2024-01)
Universal Commerce Protocol (UCP 2026-08-25) MCP storefront for AI shopping agents and @shopify/ucp-cli: catalog search, batch lookup, product detail pages, stateful carts, Stripe & USDC checkouts, and order tracking.
Hosted Shopify MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
AI commerce for Shopify: product search, comparison, recommendations, and checkout via MCP.
Related MCP Servers
- AlicenseAqualityDmaintenanceExposes Shopify Admin API capabilities to LLMs, enabling product, order, customer, and inventory management via natural language.491MIT
- AlicenseNot gradedqualityCmaintenanceA comprehensive MCP server for Shopify Admin API integration, enabling AI assistants to manage products, orders, customers, inventory, analytics, and more through natural language.19 npm20MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for the Shopify Admin API, enabling 36 tools for managing products, orders, customers, inventory, fulfillments, collections, analytics, marketing, content, and webhooks.1MIT
- AlicenseNot gradedqualityDmaintenanceProduction-grade MCP server for the Shopify Admin GraphQL API, exposing typed tools for AI agents to manage products, orders, customers, and more.Business Source 1.1