@anton.andrusenko/shopify-mcp-admin 2.1.2 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +400 -18
- package/dist/{chunk-QXLLD2A7.js → chunk-5QMYOO4B.js} +20 -4
- package/dist/chunk-EQUN4XCH.js +257 -0
- package/dist/{chunk-UXI33LQD.js → chunk-JU5IFCVJ.js} +1 -1
- package/dist/chunk-RBXQOPVF.js +14743 -0
- package/dist/dashboard/assets/index-ClITn1me.css +1 -0
- package/dist/dashboard/assets/index-Cvo1L2xM.js +126 -0
- package/dist/dashboard/assets/index-Cvo1L2xM.js.map +1 -0
- package/dist/dashboard/index.html +6 -3
- package/dist/dashboard/mcp-icon.svg +34 -0
- package/dist/index.js +6678 -16909
- package/dist/mcp-auth-CWOWKID3.js +24 -0
- package/dist/{security-XP6MXK5B.js → security-44M6F2QU.js} +17 -3
- package/dist/{store-FM7HCQVW.js → store-JK2ZU6DR.js} +2 -2
- package/dist/tools-BCI3Z2AW.js +82 -0
- package/package.json +13 -2
- package/dist/chunk-DCQTHXKI.js +0 -124
- package/dist/dashboard/assets/index-BSh6M640.js +0 -107
- package/dist/dashboard/assets/index-BSh6M640.js.map +0 -1
- package/dist/dashboard/assets/index-DLoVESj2.css +0 -1
- package/dist/mcp-auth-2WVQELV5.js +0 -16
package/README.md
CHANGED
|
@@ -77,9 +77,70 @@ The AI will use the `list-products` tool to fetch your catalog.
|
|
|
77
77
|
|
|
78
78
|
## 🔐 Authentication Methods
|
|
79
79
|
|
|
80
|
-
shopify-mcp-admin supports
|
|
80
|
+
shopify-mcp-admin supports multiple authentication methods depending on your use case:
|
|
81
81
|
|
|
82
|
-
###
|
|
82
|
+
### Authentication Methods Overview
|
|
83
|
+
|
|
84
|
+
| Method | Use Case | Client Types |
|
|
85
|
+
|--------|----------|--------------|
|
|
86
|
+
| **OAuth 2.0 Authorization Code + PKCE** | Web-based AI clients with browser | ChatGPT MCP Apps, Claude Web Custom Connectors |
|
|
87
|
+
| **API Key Bearer Token** | Desktop/CLI apps, programmatic access | Claude Desktop, Cursor, LibreChat, VS Code |
|
|
88
|
+
| **Legacy Custom App Token** | Local development, single-tenant | STDIO transport, local testing |
|
|
89
|
+
| **Dev Dashboard Client Credentials** | Shopify Dev Dashboard apps | Local development with OAuth |
|
|
90
|
+
|
|
91
|
+
### Which Method Should I Use?
|
|
92
|
+
|
|
93
|
+
| Your Client | Recommended Method |
|
|
94
|
+
|-------------|-------------------|
|
|
95
|
+
| **ChatGPT (MCP Apps)** | OAuth 2.0 (automatic via DCR) — See [ChatGPT Integration](#-chatgpt-mcp-apps-integration) |
|
|
96
|
+
| **Claude Web (Custom Connectors)** | OAuth 2.0 (automatic via DCR) — See [Claude Web Integration](#-claude-web-custom-connectors-integration) |
|
|
97
|
+
| **Claude Desktop** | API Key Bearer Token — See [Claude Desktop](#️-claude-desktop-integration) |
|
|
98
|
+
| **Cursor, VS Code** | API Key Bearer Token — See [LibreChat](#-librechat-integration) |
|
|
99
|
+
| **LibreChat** | API Key Bearer Token — See [LibreChat](#-librechat-integration) |
|
|
100
|
+
| **Local Development** | Legacy Token or Dev Dashboard |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
### Option 1: OAuth 2.0 Authorization Code + PKCE (ChatGPT, Claude Web)
|
|
105
|
+
|
|
106
|
+
For web-based AI clients that support OAuth 2.0:
|
|
107
|
+
|
|
108
|
+
- **Automatic client registration** via Dynamic Client Registration (RFC 7591)
|
|
109
|
+
- **PKCE required** with S256 method (RFC 7636)
|
|
110
|
+
- **No manual credentials needed** — clients handle registration automatically
|
|
111
|
+
- **Browser-based authorization** with consent page
|
|
112
|
+
|
|
113
|
+
The server exposes discovery endpoints at:
|
|
114
|
+
- `/.well-known/oauth-authorization-server` (RFC 8414)
|
|
115
|
+
- `/.well-known/oauth-protected-resource` (RFC 9728)
|
|
116
|
+
|
|
117
|
+
> See [OAuth 2.0 Endpoints Reference](#-oauth-20-endpoints-reference) for details.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
### Option 2: API Key Bearer Token (Claude Desktop, Cursor, LibreChat)
|
|
122
|
+
|
|
123
|
+
For desktop apps and programmatic access:
|
|
124
|
+
|
|
125
|
+
1. **Get API Key**: Visit your MCP Dashboard (`/app`) → Settings → API Keys
|
|
126
|
+
2. **Generate Key**: Click "Create New Key" and copy the `sk_live_...` key
|
|
127
|
+
3. **Configure Client**: Add `Authorization: Bearer sk_live_...` header
|
|
128
|
+
4. **Ensure a Default Shop is set**: In the dashboard, go to **Settings → Default Shop** (recommended, especially if you have multiple shops connected)
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# Example: Test with curl
|
|
132
|
+
curl -X POST https://shopify-mcp.com/mcp \
|
|
133
|
+
-H "Accept: application/json, text/event-stream" \
|
|
134
|
+
-H "Content-Type: application/json" \
|
|
135
|
+
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
|
|
136
|
+
-d '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}'
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
> **Cursor note:** Cursor does not run an OAuth “Connect” flow inside MCP. Use an API key + `streamable-http` transport, and connect your Shopify store via the dashboard (`/app`) first.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
### Option 3: Legacy Custom App Token (Local Development)
|
|
83
144
|
|
|
84
145
|
If you have a Custom App with a static access token:
|
|
85
146
|
|
|
@@ -88,7 +149,9 @@ SHOPIFY_STORE_URL=mystore.myshopify.com
|
|
|
88
149
|
SHOPIFY_ACCESS_TOKEN=shpat_xxxxx
|
|
89
150
|
```
|
|
90
151
|
|
|
91
|
-
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### Option 4: Dev Dashboard Client Credentials (Local Development)
|
|
92
155
|
|
|
93
156
|
If you're using Shopify's new Dev Dashboard with client credentials:
|
|
94
157
|
|
|
@@ -102,15 +165,6 @@ Tokens are automatically refreshed every 24 hours.
|
|
|
102
165
|
|
|
103
166
|
> **Remote mode note (multi-tenant):** Shops connected via OAuth now support **expiring offline tokens with automatic refresh** (Shopify Dec 2025 refresh tokens). See `docs/TOKEN-REFRESH-IMPLEMENTATION.md`.
|
|
104
167
|
|
|
105
|
-
### Which Should I Use?
|
|
106
|
-
|
|
107
|
-
| Scenario | Method |
|
|
108
|
-
|----------|--------|
|
|
109
|
-
| Existing Custom App with static token | Legacy (Option 1) |
|
|
110
|
-
| New Dev Dashboard app | Client Credentials (Option 2) |
|
|
111
|
-
| Development/Partner store | Either works |
|
|
112
|
-
| Production store (after Jan 2026) | Client Credentials required |
|
|
113
|
-
|
|
114
168
|
---
|
|
115
169
|
|
|
116
170
|
## ⚙️ Configuration Reference
|
|
@@ -478,11 +532,248 @@ mcpServers:
|
|
|
478
532
|
|
|
479
533
|
---
|
|
480
534
|
|
|
481
|
-
##
|
|
535
|
+
## 🤖 ChatGPT MCP Apps Integration
|
|
536
|
+
|
|
537
|
+
ChatGPT supports connecting to MCP servers via **OAuth 2.0 Authorization Code Flow with PKCE**. This is the recommended method for ChatGPT Plus/Pro/Team/Enterprise users.
|
|
538
|
+
|
|
539
|
+
### How It Works
|
|
540
|
+
|
|
541
|
+
When you add the Shopify MCP server in ChatGPT:
|
|
542
|
+
|
|
543
|
+
1. **ChatGPT discovers** the OAuth endpoints via `/.well-known/oauth-authorization-server` (RFC 8414)
|
|
544
|
+
2. **ChatGPT registers** itself as an OAuth client via `/oauth/register` (RFC 7591 Dynamic Client Registration)
|
|
545
|
+
3. **You authorize** the connection via a consent page at `/oauth/authorize`
|
|
546
|
+
4. **ChatGPT exchanges** the authorization code for tokens via `/oauth/token`
|
|
547
|
+
5. **ChatGPT uses** the access token to call MCP tools
|
|
548
|
+
|
|
549
|
+
> **No manual `client_id` or `client_secret` needed** — ChatGPT handles registration automatically!
|
|
550
|
+
|
|
551
|
+
### Prerequisites
|
|
552
|
+
|
|
553
|
+
1. **Deployed MCP Server** — Your server running in remote mode at `https://shopify-mcp.com` (or your own domain)
|
|
554
|
+
2. **Shopify Store Connected** — At least one shop connected in your MCP Dashboard
|
|
555
|
+
3. **ChatGPT Plus/Pro/Team/Enterprise** — MCP Apps require a paid ChatGPT subscription
|
|
556
|
+
|
|
557
|
+
### Step-by-Step Setup
|
|
558
|
+
|
|
559
|
+
#### Step 1: Ensure Your Shop is Connected
|
|
560
|
+
|
|
561
|
+
1. Visit your MCP Dashboard: `https://shopify-mcp.com/app`
|
|
562
|
+
2. Log in or register a tenant account
|
|
563
|
+
3. Go to **Shops** and connect your Shopify store (OAuth or manual token)
|
|
564
|
+
4. Verify the shop shows as "Connected"
|
|
565
|
+
|
|
566
|
+
#### Step 2: Add MCP Server in ChatGPT
|
|
567
|
+
|
|
568
|
+
1. Open ChatGPT → **Settings** → **Connectors** (or **Apps**)
|
|
569
|
+
2. Enable **Developer Mode** in Advanced Settings (if required)
|
|
570
|
+
3. Click **Create** or **Add New MCP Server**
|
|
571
|
+
4. Fill in the configuration:
|
|
572
|
+
|
|
573
|
+
| Field | Value |
|
|
574
|
+
|-------|-------|
|
|
575
|
+
| **Name** | `Shopify MCP` |
|
|
576
|
+
| **Description** | `Manage Shopify store: products, inventory, collections, content, SEO` |
|
|
577
|
+
| **MCP Server URL** | `https://shopify-mcp.com/mcp` |
|
|
578
|
+
| **Authentication** | `OAuth 2.0` (auto-detected via discovery) |
|
|
579
|
+
|
|
580
|
+
5. Click **Save** or **Connect**
|
|
581
|
+
|
|
582
|
+
#### Step 3: Authorize the Connection
|
|
583
|
+
|
|
584
|
+
1. ChatGPT will open an authorization page at `https://shopify-mcp.com/oauth/authorize`
|
|
585
|
+
2. Log in with your MCP Dashboard credentials (same email/password)
|
|
586
|
+
3. Review the requested scopes and click **Authorize**
|
|
587
|
+
4. You'll be redirected back to ChatGPT with the connection established
|
|
588
|
+
|
|
589
|
+
#### Step 4: Test the Connection
|
|
590
|
+
|
|
591
|
+
In ChatGPT, try:
|
|
592
|
+
> "List all products in my Shopify store"
|
|
593
|
+
|
|
594
|
+
ChatGPT will use the `list-products` tool to fetch your catalog.
|
|
595
|
+
|
|
596
|
+
### ChatGPT Troubleshooting
|
|
597
|
+
|
|
598
|
+
| Issue | Solution |
|
|
599
|
+
|-------|----------|
|
|
600
|
+
| "OAuth discovery failed" | Verify server is running: `curl https://shopify-mcp.com/.well-known/oauth-authorization-server` |
|
|
601
|
+
| "Client registration failed" | Check server logs for registration errors |
|
|
602
|
+
| "Authorization failed" | Ensure you're logged in to the MCP Dashboard with the correct account |
|
|
603
|
+
| "No shop configured" | Connect a shop in your MCP Dashboard first |
|
|
604
|
+
| "Token expired" | Re-authorize the connection in ChatGPT settings |
|
|
605
|
+
| Connection timeout | Check server health: `curl https://shopify-mcp.com/health` |
|
|
606
|
+
|
|
607
|
+
### Re-Authorization
|
|
608
|
+
|
|
609
|
+
If your connection stops working:
|
|
610
|
+
|
|
611
|
+
1. Go to ChatGPT → **Settings** → **Connectors**
|
|
612
|
+
2. Find the Shopify MCP connection and click **Disconnect**
|
|
613
|
+
3. Click **Connect** again to start a fresh OAuth flow
|
|
614
|
+
4. Complete the authorization as described above
|
|
615
|
+
|
|
616
|
+
---
|
|
617
|
+
|
|
618
|
+
## 🔮 Claude Web Custom Connectors Integration
|
|
619
|
+
|
|
620
|
+
Claude Web (claude.ai) supports MCP connections via **Custom Connectors** using the same OAuth 2.0 Authorization Code Flow with PKCE.
|
|
621
|
+
|
|
622
|
+
> **Plan Requirements:** Claude Web Custom Connectors require **Claude Pro, Max, Team, or Enterprise** subscription.
|
|
623
|
+
|
|
624
|
+
### How It Works
|
|
625
|
+
|
|
626
|
+
Claude Web's Custom Connectors work similarly to ChatGPT's MCP Apps:
|
|
627
|
+
|
|
628
|
+
1. **Claude discovers** OAuth endpoints via `/.well-known/oauth-authorization-server`
|
|
629
|
+
2. **Claude registers** as an OAuth client via Dynamic Client Registration (RFC 7591)
|
|
630
|
+
3. **You authorize** the connection via the consent page
|
|
631
|
+
4. **Claude exchanges** the authorization code for tokens
|
|
632
|
+
5. **Claude uses** the access token for MCP tool calls
|
|
633
|
+
|
|
634
|
+
### Prerequisites
|
|
635
|
+
|
|
636
|
+
1. **Deployed MCP Server** — Your server at `https://shopify-mcp.com` (or your own domain)
|
|
637
|
+
2. **Shopify Store Connected** — At least one shop connected in your MCP Dashboard
|
|
638
|
+
3. **Claude Pro/Max/Team/Enterprise** — Custom Connectors require a paid subscription
|
|
639
|
+
|
|
640
|
+
### Step-by-Step Setup
|
|
641
|
+
|
|
642
|
+
#### Step 1: Ensure Your Shop is Connected
|
|
643
|
+
|
|
644
|
+
1. Visit your MCP Dashboard: `https://shopify-mcp.com/app`
|
|
645
|
+
2. Log in or register a tenant account
|
|
646
|
+
3. Connect your Shopify store under **Shops**
|
|
647
|
+
|
|
648
|
+
#### Step 2: Add Custom Connector in Claude Web
|
|
649
|
+
|
|
650
|
+
1. Go to **claude.ai** → **Settings** (gear icon)
|
|
651
|
+
2. Navigate to **Integrations** or **Custom Connectors**
|
|
652
|
+
3. Click **Add Connector** or **New**
|
|
653
|
+
4. Fill in the configuration:
|
|
654
|
+
|
|
655
|
+
| Field | Value |
|
|
656
|
+
|-------|-------|
|
|
657
|
+
| **Name** | `Shopify MCP` |
|
|
658
|
+
| **Description** | `Manage Shopify store via MCP` |
|
|
659
|
+
| **Server URL** | `https://shopify-mcp.com/mcp` |
|
|
482
660
|
|
|
483
|
-
|
|
661
|
+
5. Click **Save** or **Connect**
|
|
484
662
|
|
|
485
|
-
|
|
663
|
+
#### Step 3: Authorize the Connection
|
|
664
|
+
|
|
665
|
+
1. Claude will redirect you to `https://shopify-mcp.com/oauth/authorize`
|
|
666
|
+
2. Log in with your MCP Dashboard credentials
|
|
667
|
+
3. Review and approve the authorization request
|
|
668
|
+
4. You'll be redirected back to Claude with the connection active
|
|
669
|
+
|
|
670
|
+
#### Step 4: Test the Connection
|
|
671
|
+
|
|
672
|
+
In Claude, try:
|
|
673
|
+
> "What products are in my Shopify store?"
|
|
674
|
+
|
|
675
|
+
Claude will use the MCP tools to query your store.
|
|
676
|
+
|
|
677
|
+
### Claude Web Troubleshooting
|
|
678
|
+
|
|
679
|
+
| Issue | Solution |
|
|
680
|
+
|-------|----------|
|
|
681
|
+
| "Custom Connectors not available" | Upgrade to Claude Pro, Max, Team, or Enterprise |
|
|
682
|
+
| "OAuth flow failed" | Verify server discovery: `curl https://shopify-mcp.com/.well-known/oauth-authorization-server` |
|
|
683
|
+
| "Authorization error" | Ensure you're using the correct MCP Dashboard credentials |
|
|
684
|
+
| "Connector not responding" | Check server health: `curl https://shopify-mcp.com/health` |
|
|
685
|
+
| "Token expired" | Disconnect and reconnect the Custom Connector |
|
|
686
|
+
|
|
687
|
+
### Re-Authorization
|
|
688
|
+
|
|
689
|
+
If the connection expires or breaks:
|
|
690
|
+
|
|
691
|
+
1. Go to Claude Web → **Settings** → **Integrations**
|
|
692
|
+
2. Find the Shopify connector and click **Remove** or **Disconnect**
|
|
693
|
+
3. Add the connector again and complete the authorization flow
|
|
694
|
+
|
|
695
|
+
---
|
|
696
|
+
|
|
697
|
+
## 🔌 OAuth 2.0 Endpoints Reference
|
|
698
|
+
|
|
699
|
+
The MCP server exposes the following OAuth 2.0 endpoints for client authentication:
|
|
700
|
+
|
|
701
|
+
| Endpoint | Method | Description | RFC |
|
|
702
|
+
|----------|--------|-------------|-----|
|
|
703
|
+
| `/.well-known/oauth-authorization-server` | GET | Authorization server metadata (issuer, endpoints, capabilities) | [RFC 8414](https://tools.ietf.org/html/rfc8414) |
|
|
704
|
+
| `/.well-known/oauth-protected-resource` | GET | Protected resource metadata (resource server, scopes) | [RFC 9728](https://tools.ietf.org/html/rfc9728) |
|
|
705
|
+
| `/oauth/register` | POST | Dynamic Client Registration (automatic client registration) | [RFC 7591](https://tools.ietf.org/html/rfc7591) |
|
|
706
|
+
| `/oauth/authorize` | GET | Authorization endpoint with consent UI | [RFC 6749](https://tools.ietf.org/html/rfc6749) |
|
|
707
|
+
| `/oauth/token` | POST | Token endpoint (authorization_code, refresh_token grants) | [RFC 6749](https://tools.ietf.org/html/rfc6749), [RFC 7636](https://tools.ietf.org/html/rfc7636) |
|
|
708
|
+
|
|
709
|
+
### OAuth Flow Diagram
|
|
710
|
+
|
|
711
|
+
```
|
|
712
|
+
┌─────────────┐ ┌─────────────────────────┐
|
|
713
|
+
│ ChatGPT │ │ MCP Server │
|
|
714
|
+
│ or Claude │ │ (shopify-mcp.com) │
|
|
715
|
+
└──────┬──────┘ └───────────┬─────────────┘
|
|
716
|
+
│ │
|
|
717
|
+
│ 1. GET /.well-known/oauth-authorization-server │
|
|
718
|
+
│ ───────────────────────────────────────────────────> │
|
|
719
|
+
│ <─── Authorization server metadata (RFC 8414) │
|
|
720
|
+
│ │
|
|
721
|
+
│ 2. POST /oauth/register (Dynamic Client Registration)│
|
|
722
|
+
│ ───────────────────────────────────────────────────> │
|
|
723
|
+
│ <─── client_id, client_secret (RFC 7591) │
|
|
724
|
+
│ │
|
|
725
|
+
│ 3. Redirect user to /oauth/authorize?client_id=... │
|
|
726
|
+
│ &redirect_uri=...&code_challenge=...&state=... │
|
|
727
|
+
│ ───────────────────────────────────────────────────> │
|
|
728
|
+
│ │
|
|
729
|
+
│ ┌─────────────────────────────────────────┐ │
|
|
730
|
+
│ │ User sees consent page, logs in, │ │
|
|
731
|
+
│ │ approves authorization │ │
|
|
732
|
+
│ └─────────────────────────────────────────┘ │
|
|
733
|
+
│ │
|
|
734
|
+
│ <─── Redirect to callback with authorization code │
|
|
735
|
+
│ │
|
|
736
|
+
│ 4. POST /oauth/token (exchange code for tokens) │
|
|
737
|
+
│ code=...&code_verifier=...&grant_type=... │
|
|
738
|
+
│ ───────────────────────────────────────────────────> │
|
|
739
|
+
│ <─── access_token, refresh_token (RFC 6749/7636) │
|
|
740
|
+
│ │
|
|
741
|
+
│ 5. POST /mcp (with Bearer access_token) │
|
|
742
|
+
│ ───────────────────────────────────────────────────> │
|
|
743
|
+
│ <─── MCP tool results │
|
|
744
|
+
└───────────────────────────────────────────────────────┘
|
|
745
|
+
```
|
|
746
|
+
|
|
747
|
+
### Discovery Endpoint Example
|
|
748
|
+
|
|
749
|
+
```bash
|
|
750
|
+
curl https://shopify-mcp.com/.well-known/oauth-authorization-server
|
|
751
|
+
```
|
|
752
|
+
|
|
753
|
+
```json
|
|
754
|
+
{
|
|
755
|
+
"issuer": "https://shopify-mcp.com",
|
|
756
|
+
"authorization_endpoint": "https://shopify-mcp.com/oauth/authorize",
|
|
757
|
+
"token_endpoint": "https://shopify-mcp.com/oauth/token",
|
|
758
|
+
"registration_endpoint": "https://shopify-mcp.com/oauth/register",
|
|
759
|
+
"response_types_supported": ["code"],
|
|
760
|
+
"grant_types_supported": ["authorization_code", "refresh_token"],
|
|
761
|
+
"code_challenge_methods_supported": ["S256"],
|
|
762
|
+
"token_endpoint_auth_methods_supported": ["client_secret_post"]
|
|
763
|
+
}
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
---
|
|
767
|
+
|
|
768
|
+
## 🌐 OpenAI/ChatGPT Integration (Alternative Methods)
|
|
769
|
+
|
|
770
|
+
In addition to the OAuth-based ChatGPT MCP Apps integration above, you can also use API key authentication for programmatic access.
|
|
771
|
+
|
|
772
|
+
### Option 1: Local Server (Development)
|
|
773
|
+
|
|
774
|
+
Run the server locally for development and testing with OpenAI function calling.
|
|
775
|
+
|
|
776
|
+
#### Step 1: Start the Server
|
|
486
777
|
|
|
487
778
|
```bash
|
|
488
779
|
TRANSPORT=http \
|
|
@@ -492,7 +783,7 @@ SHOPIFY_ACCESS_TOKEN=shpat_xxxxx \
|
|
|
492
783
|
npx @anton.andrusenko/shopify-mcp-admin
|
|
493
784
|
```
|
|
494
785
|
|
|
495
|
-
|
|
786
|
+
#### Step 2: Test the Connection
|
|
496
787
|
|
|
497
788
|
```bash
|
|
498
789
|
# List available tools
|
|
@@ -501,7 +792,7 @@ curl -X POST http://localhost:3000/mcp \
|
|
|
501
792
|
-d '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}'
|
|
502
793
|
```
|
|
503
794
|
|
|
504
|
-
|
|
795
|
+
#### Step 3: Call a Tool
|
|
505
796
|
|
|
506
797
|
```bash
|
|
507
798
|
# Example: List products
|
|
@@ -518,9 +809,25 @@ curl -X POST http://localhost:3000/mcp \
|
|
|
518
809
|
}'
|
|
519
810
|
```
|
|
520
811
|
|
|
812
|
+
---
|
|
813
|
+
|
|
814
|
+
### Option 3: Remote Server with Bearer Token
|
|
815
|
+
|
|
816
|
+
Connect to your production MCP server from any OpenAI-compatible client.
|
|
817
|
+
|
|
818
|
+
```bash
|
|
819
|
+
# Authenticated request to remote server
|
|
820
|
+
curl -X POST https://your-server.com/mcp \
|
|
821
|
+
-H "Content-Type: application/json" \
|
|
822
|
+
-H "Authorization: Bearer sk_live_YOUR_API_KEY" \
|
|
823
|
+
-d '{"jsonrpc": "2.0", "method": "tools/list", "id": 1}'
|
|
824
|
+
```
|
|
825
|
+
|
|
826
|
+
---
|
|
827
|
+
|
|
521
828
|
### OpenAI Function Calling Format
|
|
522
829
|
|
|
523
|
-
Each tool can be converted to OpenAI function format:
|
|
830
|
+
Each tool can be converted to OpenAI function format for custom integrations:
|
|
524
831
|
|
|
525
832
|
```json
|
|
526
833
|
{
|
|
@@ -1144,6 +1451,81 @@ export SHOPIFY_MCP_LAZY_LOADING=true
|
|
|
1144
1451
|
| `ECONNREFUSED` | Server not running | Start server with `npx @anton.andrusenko/shopify-mcp-admin` |
|
|
1145
1452
|
| `Invalid store URL` | Wrong URL format | Use `store.myshopify.com` format |
|
|
1146
1453
|
|
|
1454
|
+
### OAuth Connection Troubleshooting
|
|
1455
|
+
|
|
1456
|
+
If you're having issues connecting ChatGPT or Claude Web via OAuth:
|
|
1457
|
+
|
|
1458
|
+
#### "OAuth discovery failed" or "Server not found"
|
|
1459
|
+
|
|
1460
|
+
1. Verify the server is running:
|
|
1461
|
+
```bash
|
|
1462
|
+
curl https://shopify-mcp.com/.well-known/oauth-authorization-server
|
|
1463
|
+
```
|
|
1464
|
+
Expected: JSON response with `issuer`, `authorization_endpoint`, etc.
|
|
1465
|
+
|
|
1466
|
+
2. Check server health:
|
|
1467
|
+
```bash
|
|
1468
|
+
curl https://shopify-mcp.com/health
|
|
1469
|
+
```
|
|
1470
|
+
Expected: `200 OK` with `{"status": "healthy", ...}`
|
|
1471
|
+
|
|
1472
|
+
#### "Client registration failed"
|
|
1473
|
+
|
|
1474
|
+
- **Cause**: Dynamic Client Registration (DCR) endpoint issue
|
|
1475
|
+
- **Solution**: Check server logs for `/oauth/register` errors
|
|
1476
|
+
- **Verify**: `curl -X POST https://shopify-mcp.com/oauth/register -H "Content-Type: application/json" -d '{"client_name":"test","redirect_uris":["https://example.com/callback"]}'`
|
|
1477
|
+
|
|
1478
|
+
#### "Authorization failed" or "Invalid credentials"
|
|
1479
|
+
|
|
1480
|
+
- **Cause**: Wrong MCP Dashboard credentials
|
|
1481
|
+
- **Solution**: Log in to `https://shopify-mcp.com/app` directly to verify your email/password
|
|
1482
|
+
- **Note**: OAuth login uses your MCP Dashboard account, not Shopify credentials
|
|
1483
|
+
|
|
1484
|
+
#### "No shop configured" or "No shops connected"
|
|
1485
|
+
|
|
1486
|
+
- **Cause**: No Shopify store connected to your tenant account
|
|
1487
|
+
- **Solution**:
|
|
1488
|
+
1. Log in to `https://shopify-mcp.com/app`
|
|
1489
|
+
2. Go to **Shops** → **Connect Shop**
|
|
1490
|
+
3. Complete the OAuth flow or enter a manual access token
|
|
1491
|
+
|
|
1492
|
+
#### "Token expired" or "Access denied"
|
|
1493
|
+
|
|
1494
|
+
- **Cause**: OAuth access token expired (tokens last 1 hour by default)
|
|
1495
|
+
- **Solution**:
|
|
1496
|
+
1. Disconnect the MCP connection in ChatGPT/Claude settings
|
|
1497
|
+
2. Reconnect and complete the OAuth flow again
|
|
1498
|
+
3. The server will issue fresh tokens
|
|
1499
|
+
|
|
1500
|
+
#### "PKCE verification failed"
|
|
1501
|
+
|
|
1502
|
+
- **Cause**: PKCE code_verifier doesn't match code_challenge
|
|
1503
|
+
- **Solution**: This is a client-side issue; report to ChatGPT/Claude support
|
|
1504
|
+
- **Note**: The server requires S256 PKCE method (plain is not supported)
|
|
1505
|
+
|
|
1506
|
+
#### "Invalid redirect_uri"
|
|
1507
|
+
|
|
1508
|
+
- **Cause**: The OAuth callback URL doesn't match a registered pattern
|
|
1509
|
+
- **Solution**:
|
|
1510
|
+
- ChatGPT: Redirect URIs must match `https://chatgpt.com/*` or `https://chat.openai.com/*`
|
|
1511
|
+
- Claude Web: Redirect URIs must match `https://claude.ai/*`
|
|
1512
|
+
|
|
1513
|
+
### Re-Authorizing OAuth Connections
|
|
1514
|
+
|
|
1515
|
+
If your OAuth connection stops working:
|
|
1516
|
+
|
|
1517
|
+
**For ChatGPT:**
|
|
1518
|
+
1. Go to ChatGPT → **Settings** → **Connectors** (or **Apps**)
|
|
1519
|
+
2. Find the Shopify MCP connection
|
|
1520
|
+
3. Click **Disconnect** or **Remove**
|
|
1521
|
+
4. Click **Connect** again and complete the OAuth flow
|
|
1522
|
+
|
|
1523
|
+
**For Claude Web:**
|
|
1524
|
+
1. Go to claude.ai → **Settings** → **Integrations**
|
|
1525
|
+
2. Find the Shopify MCP connector
|
|
1526
|
+
3. Click **Disconnect** or **Remove**
|
|
1527
|
+
4. Re-add the connector and authorize again
|
|
1528
|
+
|
|
1147
1529
|
### Debug Mode
|
|
1148
1530
|
|
|
1149
1531
|
Enable verbose logging to diagnose issues:
|
|
@@ -97,17 +97,33 @@ var log = {
|
|
|
97
97
|
* Info level logging
|
|
98
98
|
*
|
|
99
99
|
* @param msg - Info message
|
|
100
|
+
* @param data - Optional data object to include (JSON-stringified)
|
|
100
101
|
*/
|
|
101
|
-
info: (msg) => {
|
|
102
|
-
|
|
102
|
+
info: (msg, data) => {
|
|
103
|
+
const sanitizedMsg = sanitizeLogMessage(msg);
|
|
104
|
+
if (data) {
|
|
105
|
+
const sanitizedData = sanitizeObject(data);
|
|
106
|
+
const dataStr = safeStringify(sanitizedData);
|
|
107
|
+
console.error(`[INFO] ${sanitizedMsg} ${dataStr}`);
|
|
108
|
+
} else {
|
|
109
|
+
console.error(`[INFO] ${sanitizedMsg}`);
|
|
110
|
+
}
|
|
103
111
|
},
|
|
104
112
|
/**
|
|
105
113
|
* Warning level logging
|
|
106
114
|
*
|
|
107
115
|
* @param msg - Warning message
|
|
116
|
+
* @param data - Optional data object to include (JSON-stringified)
|
|
108
117
|
*/
|
|
109
|
-
warn: (msg) => {
|
|
110
|
-
|
|
118
|
+
warn: (msg, data) => {
|
|
119
|
+
const sanitizedMsg = sanitizeLogMessage(msg);
|
|
120
|
+
if (data) {
|
|
121
|
+
const sanitizedData = sanitizeObject(data);
|
|
122
|
+
const dataStr = safeStringify(sanitizedData);
|
|
123
|
+
console.error(`[WARN] ${sanitizedMsg} ${dataStr}`);
|
|
124
|
+
} else {
|
|
125
|
+
console.error(`[WARN] ${sanitizedMsg}`);
|
|
126
|
+
}
|
|
111
127
|
},
|
|
112
128
|
/**
|
|
113
129
|
* Error level logging
|