epicmerch-mcp 1.1.0 → 1.2.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.
@@ -1,23 +1,23 @@
1
- {
2
- "name": "epicmerch",
3
- "description": "Run your EpicMerch store from chat — products, orders, analytics, Shopify migration, Stripe setup. Auto-installs the MCP + slash commands + browser OAuth.",
4
- "version": "1.0.0",
5
- "author": {
6
- "name": "Aditya Patel",
7
- "email": "aditya141312@gmail.com",
8
- "url": "https://epicmerch.in"
9
- },
10
- "homepage": "https://epicmerch.in",
11
- "repository": "https://github.com/MTAV-media/Epicmerch-Platform",
12
- "license": "MIT",
13
- "keywords": [
14
- "epicmerch",
15
- "ecommerce",
16
- "shopify",
17
- "stripe",
18
- "merchant",
19
- "mcp",
20
- "storefront",
21
- "skills"
22
- ]
23
- }
1
+ {
2
+ "name": "epicmerch",
3
+ "description": "Run your EpicMerch store from chat — products, orders, analytics, Shopify migration, Stripe setup. Auto-installs the MCP + slash commands + browser OAuth.",
4
+ "version": "1.0.0",
5
+ "author": {
6
+ "name": "Aditya Patel",
7
+ "email": "aditya141312@gmail.com",
8
+ "url": "https://epicmerch.in"
9
+ },
10
+ "homepage": "https://epicmerch.in",
11
+ "repository": "https://github.com/MTAV-media/Epicmerch-Platform",
12
+ "license": "MIT",
13
+ "keywords": [
14
+ "epicmerch",
15
+ "ecommerce",
16
+ "shopify",
17
+ "stripe",
18
+ "merchant",
19
+ "mcp",
20
+ "storefront",
21
+ "skills"
22
+ ]
23
+ }
package/.mcp.json CHANGED
@@ -1,8 +1,8 @@
1
- {
2
- "mcpServers": {
3
- "epicmerch": {
4
- "command": "npx",
5
- "args": ["epicmerch-mcp@latest"]
6
- }
7
- }
8
- }
1
+ {
2
+ "mcpServers": {
3
+ "epicmerch": {
4
+ "command": "npx",
5
+ "args": ["epicmerch-mcp@latest"]
6
+ }
7
+ }
8
+ }
@@ -1,37 +1,37 @@
1
- #!/usr/bin/env node
2
- // Plugin hook — runs on Claude Code session startup.
3
- // If the merchant hasn't logged in (no ~/.epicmerch/token.json), prints a
4
- // one-line nudge so the assistant knows to suggest `/epicmerch-setup` if
5
- // the merchant asks for store operations.
6
- // Stays silent if already authenticated — no startup noise for happy paths.
7
-
8
- import { existsSync, readFileSync } from 'node:fs';
9
- import { homedir } from 'node:os';
10
- import { join } from 'node:path';
11
-
12
- const tokenPath = join(homedir(), '.epicmerch', 'token.json');
13
-
14
- if (!existsSync(tokenPath)) {
15
- // No token file at all — not logged in. Hint to the assistant.
16
- console.error('[epicmerch] Not yet authenticated. The merchant can connect with /epicmerch-setup or by running `npx epicmerch-mcp setup`.');
17
- process.exit(0);
18
- }
19
-
20
- try {
21
- const data = JSON.parse(readFileSync(tokenPath, 'utf-8'));
22
- const entry = data?.stores?.[data?.defaultStore];
23
- if (!entry) {
24
- console.error('[epicmerch] Token file exists but has no default store. Run `npx epicmerch-mcp login` to fix.');
25
- process.exit(0);
26
- }
27
- const refreshExpiry = new Date(entry.refreshTokenExpiresAt);
28
- if (refreshExpiry < new Date()) {
29
- console.error('[epicmerch] Refresh token expired. Merchant should run `npx epicmerch-mcp login` to re-authenticate.');
30
- }
31
- // Happy path: stay silent.
32
- } catch (_) {
33
- // Malformed token file — silent. The MCP tools themselves will surface
34
- // a clearer error if they're invoked.
35
- }
36
-
37
- process.exit(0);
1
+ #!/usr/bin/env node
2
+ // Plugin hook — runs on Claude Code session startup.
3
+ // If the merchant hasn't logged in (no ~/.epicmerch/token.json), prints a
4
+ // one-line nudge so the assistant knows to suggest `/epicmerch-setup` if
5
+ // the merchant asks for store operations.
6
+ // Stays silent if already authenticated — no startup noise for happy paths.
7
+
8
+ import { existsSync, readFileSync } from 'node:fs';
9
+ import { homedir } from 'node:os';
10
+ import { join } from 'node:path';
11
+
12
+ const tokenPath = join(homedir(), '.epicmerch', 'token.json');
13
+
14
+ if (!existsSync(tokenPath)) {
15
+ // No token file at all — not logged in. Hint to the assistant.
16
+ console.error('[epicmerch] Not yet authenticated. The merchant can connect with /epicmerch-setup or by running `npx epicmerch-mcp setup`.');
17
+ process.exit(0);
18
+ }
19
+
20
+ try {
21
+ const data = JSON.parse(readFileSync(tokenPath, 'utf-8'));
22
+ const entry = data?.stores?.[data?.defaultStore];
23
+ if (!entry) {
24
+ console.error('[epicmerch] Token file exists but has no default store. Run `npx epicmerch-mcp login` to fix.');
25
+ process.exit(0);
26
+ }
27
+ const refreshExpiry = new Date(entry.refreshTokenExpiresAt);
28
+ if (refreshExpiry < new Date()) {
29
+ console.error('[epicmerch] Refresh token expired. Merchant should run `npx epicmerch-mcp login` to re-authenticate.');
30
+ }
31
+ // Happy path: stay silent.
32
+ } catch (_) {
33
+ // Malformed token file — silent. The MCP tools themselves will surface
34
+ // a clearer error if they're invoked.
35
+ }
36
+
37
+ process.exit(0);
package/hooks/hooks.json CHANGED
@@ -1,16 +1,16 @@
1
- {
2
- "hooks": {
3
- "SessionStart": [
4
- {
5
- "matcher": "startup",
6
- "hooks": [
7
- {
8
- "type": "command",
9
- "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/check-auth.js\"",
10
- "async": true
11
- }
12
- ]
13
- }
14
- ]
15
- }
16
- }
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "matcher": "startup",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/check-auth.js\"",
10
+ "async": true
11
+ }
12
+ ]
13
+ }
14
+ ]
15
+ }
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epicmerch-mcp",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "MCP server for EpicMerch — integrates e-commerce into Claude and ChatGPT",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: epicmerch-payments
3
+ description: Set up payments on an EpicMerch store — help the merchant pick between Razorpay (India, default) and Stripe (international), then route to the right setup skill.
4
+ ---
5
+
6
+ # EpicMerch Payments — the umbrella
7
+
8
+ This is the entry point for any "set up payments" / "configure checkout" / "add card payments" intent. Your job is to figure out **which processor the merchant should use**, then hand off to the matching detailed skill.
9
+
10
+ ## Step 1: Check what's already configured
11
+
12
+ Before asking anything, call `merchant_get_checkout_settings()`. The response tells you:
13
+
14
+ - `checkoutType` — current active flow (`"epicmerch"`, `"stripe"`, or `"shiprocket"`)
15
+ - `razorpayKeyId` (string or null) + `razorpayKeySecretIsSet` (bool)
16
+ - `stripePublishableKey` (string or null) + `stripeSecretKeyIsSet` (bool) + `stripeWebhookSecretIsSet` (bool)
17
+
18
+ Decide based on what's there:
19
+
20
+ | Current state | Suggested action |
21
+ |---|---|
22
+ | Nothing configured | Help the merchant pick + set up (continue to Step 2) |
23
+ | Razorpay configured, `checkoutType: epicmerch` | Tell them: "Razorpay is already live on your store. Want to add Stripe as a backup / switch to Stripe?" |
24
+ | Stripe configured, `checkoutType: stripe` | Tell them: "Stripe is already live. Want to switch back to Razorpay?" |
25
+ | Both configured, only one active | Tell them which is active + ask if they want to switch |
26
+
27
+ If something's clearly already set up and they didn't ask to change it, stop here. Don't redo configured work.
28
+
29
+ ## Step 2: Help them pick
30
+
31
+ If nothing is configured (or they want to add a new one), help them choose:
32
+
33
+ | Question | Razorpay | Stripe |
34
+ |---|---|---|
35
+ | Where are most of your customers? | India 🇮🇳 | International 🌍 |
36
+ | Currency you charge in? | INR primarily | USD, EUR, GBP, AUD, etc. |
37
+ | Payment methods you want? | UPI, netbanking, Indian cards, wallets | Cards, Apple Pay, Google Pay, Stripe Link |
38
+ | Compliance | RBI-compliant by default | Stripe handles PCI; you handle GDPR |
39
+ | Setup time | ~5 min if account exists | ~10 min (needs webhook config) |
40
+ | Account onboarding | KYC ~24h (already done usually) | Stripe activation can take a day |
41
+
42
+ Ask the merchant ONE question that disambiguates. Don't make them read the table. The best single question is usually:
43
+
44
+ > "Where are most of your customers — India, or international?"
45
+
46
+ - **India only** → Razorpay
47
+ - **International / mostly outside India** → Stripe
48
+ - **Both / not sure** → ask: "What currency do you want to charge in?" then route accordingly.
49
+
50
+ ## Step 3: Hand off to the specific skill
51
+
52
+ Once you know which one:
53
+
54
+ - **Razorpay** → hand off to `/epicmerch-razorpay`. Don't try to configure it inline; the specific skill has the right Razorpay-dashboard URLs, key format hints, and the activation step.
55
+ - **Stripe** → hand off to `/epicmerch-stripe`. Same reasoning — that skill has the webhook URL, the test recipe, and the activation step.
56
+
57
+ If you're running inside a client that doesn't support slash command handoff (e.g. **Codex**), invoke the same MCP tools yourself:
58
+
59
+ **For Razorpay inline:**
60
+ ```
61
+ merchant_configure_razorpay({ keyId: "rzp_live_...", keySecret: "..." })
62
+ merchant_set_checkout_type({ type: "epicmerch" })
63
+ merchant_get_checkout_settings() // verify
64
+ merchant_diagnose() // confirm readiness
65
+ ```
66
+
67
+ **For Stripe inline:**
68
+ ```
69
+ merchant_configure_stripe({ publishableKey: "pk_live_...", secretKey: "sk_live_...", webhookSecret: "whsec_..." })
70
+ merchant_test_stripe_connection()
71
+ merchant_set_checkout_type({ type: "stripe" })
72
+ ```
73
+
74
+ ## Step 4: After setup
75
+
76
+ Once whichever processor is live, suggest:
77
+
78
+ - "Want to test? Place a small test order on your storefront. With test keys, no real money moves; with live keys, you can refund it after."
79
+ - "Need to set up Shiprocket for shipping? Use `merchant_get_logistics_settings` first to see what's there."
80
+ - "Ready to launch? Run `merchant_diagnose()` — I'll check everything."
81
+
82
+ ## Style
83
+
84
+ - Don't ask "Razorpay or Stripe?" out of context. ALWAYS check current state first (Step 1) — if it's set up, just confirm.
85
+ - Don't pile up questions. One at a time.
86
+ - Never paste the merchant's secret back at them — refer to it as `"the secret you provided"`. Treat secrets as write-only.
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: epicmerch-razorpay
3
+ description: Set up Razorpay payments for an EpicMerch store conversationally — get the Key ID + Secret from Razorpay's dashboard, save them, and activate the EpicMerch Checkout flow.
4
+ ---
5
+
6
+ # EpicMerch Razorpay Setup
7
+
8
+ You're helping a merchant configure Razorpay as their payment processor. This pairs Razorpay with EpicMerch's default checkout flow (Razorpay for payments + Shiprocket for shipping). Walk them through these steps.
9
+
10
+ ## Step 1: Confirm they have a Razorpay account
11
+
12
+ Ask: "Do you already have a Razorpay account at dashboard.razorpay.com? If not, sign up first — it's free and KYC takes ~24 hours."
13
+
14
+ If they're in India and just starting out, Razorpay is the most common choice. For international merchants, hand off to `/epicmerch-stripe` instead.
15
+
16
+ ## Step 2: Decide test vs live mode
17
+
18
+ Ask: "Are you setting up for testing (`rzp_test_...` keys), or going live with real customers (`rzp_live_...`)?"
19
+
20
+ Make sure they understand:
21
+ - **Test keys** — no real money. Use Razorpay's test card numbers from their docs. Switch to live before launching.
22
+ - **Live keys** — real money. Account must be activated (KYC complete + bank account linked).
23
+
24
+ ## Step 3: Collect their API keys
25
+
26
+ Tell them:
27
+
28
+ > "In a new browser tab, open https://dashboard.razorpay.com → Settings → API Keys → Generate Key (or Show, if you've generated one before).
29
+ >
30
+ > Copy these two values:
31
+ > - **Key ID** — looks like `rzp_live_XXXXX` or `rzp_test_XXXXX`
32
+ > - **Key Secret** — long random string. Razorpay only shows it ONCE when you generate. If you've already saved it somewhere safe, paste it now."
33
+
34
+ If the merchant lost their secret, tell them: "You'll need to regenerate the key pair in Razorpay's dashboard. The old Key ID stops working when you do this, so update both fields below."
35
+
36
+ ## Step 4: Save them
37
+
38
+ Call:
39
+
40
+ ```
41
+ merchant_configure_razorpay({
42
+ keyId: "rzp_live_XXXXX",
43
+ keySecret: "your_secret_here"
44
+ })
45
+ ```
46
+
47
+ The server encrypts the secret before storing. The response confirms the save with `razorpayKeyId` echoed back and `razorpayKeySecretIsSet: true`.
48
+
49
+ ## Step 5: Activate the checkout
50
+
51
+ Razorpay only powers payments under EpicMerch's default checkout flow. Activate it:
52
+
53
+ ```
54
+ merchant_set_checkout_type({ type: "epicmerch" })
55
+ ```
56
+
57
+ This sets the storefront to use EpicMerch Checkout (Razorpay payments + Shiprocket shipping). If the merchant was previously on Stripe or Shiprocket-managed checkout, this switches them over.
58
+
59
+ ## Step 6: Verify it took effect
60
+
61
+ Call `merchant_get_checkout_settings()` and confirm the response includes:
62
+ - `checkoutType: "epicmerch"`
63
+ - `razorpayKeyId` matching what you just set
64
+ - `razorpayKeySecretIsSet: true`
65
+
66
+ If those line up, you're done.
67
+
68
+ ## Step 7: Smoke test (optional but recommended)
69
+
70
+ Tell the merchant: "Want me to do a quick health check? I'll look at your full store readiness, including payment config."
71
+
72
+ Then call `merchant_diagnose()`. Read off the `payment.razorpayConfigured` value — should be `true` — and the `readinessScore`.
73
+
74
+ ## Step 8: Done
75
+
76
+ Say:
77
+
78
+ > "Razorpay is now live on your storefront. Customers will see Razorpay's payment widget at checkout — cards, UPI, netbanking, wallets. **Make sure you're using live keys before launch** — test keys won't charge real money."
79
+
80
+ If they're on test keys, remind them again: "When you're ready to launch, repeat Steps 3–4 with live keys."
81
+
82
+ ## Style
83
+
84
+ - Ask one question at a time. Don't dump all the steps at once.
85
+ - After each `merchant_*` call, read back the relevant field so the merchant sees progress.
86
+ - If a save fails (e.g. validation error from the server), surface the error message verbatim — don't paraphrase.
87
+
88
+ ## Troubleshooting
89
+
90
+ If `merchant_get_checkout_settings` shows `razorpayKeySecretIsSet: false` after Step 4, the secret didn't persist. Causes:
91
+ - Empty string passed (Razorpay secrets are 30+ chars; if the merchant pasted nothing, the field stays empty)
92
+ - Encryption key mismatch on the server side (rare; tell the merchant to check with support)
93
+
94
+ If Step 5 errors with "must be one of: ...", you typed the wrong checkout type. Use exactly `"epicmerch"` (lowercase).
95
+
96
+ ## Handoff
97
+
98
+ If the merchant says "actually I want Stripe instead" — switch to `/epicmerch-stripe`. If "what's the difference between Razorpay and Stripe?" — use `/epicmerch-payments` to compare.
@@ -1,92 +1,101 @@
1
- ---
2
- name: epicmerch-setup
3
- description: Connect this Claude/Codex session to EpicMerch — runs the browser OAuth login + MCP config setup from inside chat, no terminal commands required.
4
- ---
5
-
6
- # EpicMerch Setup (in-chat)
7
-
8
- This skill onboards the merchant **from inside the chat session itself**, so they don't have to alt-tab to a terminal. By the end the chat has access to all the `merchant_*` tools and the other `/epicmerch-*` skills.
9
-
10
- If you can already call `merchant_get_settings` (or any other `merchant_*` tool) and get a real response back, the merchant is already set up — just say so and stop. Don't reinstall.
11
-
12
- ## Step 1: Detect the environment
13
-
14
- Use whatever shell/CLI tools you have to determine the merchant's setup:
15
- - Their OS (look at the path style, `$HOME`, etc.)
16
- - Whether Node.js is installed (`node --version` if you can run it)
17
- - Whether the `epicmerch-mcp` MCP server is already wired up (look in `~/.claude.json`, `~/Library/Application Support/Claude/claude_desktop_config.json`, or `~/.codex/config.toml` depending on the client you're running inside)
18
-
19
- Don't dump this to the merchant — it's for routing decisions in the next steps.
20
-
21
- ## Step 2: Install the MCP if missing
22
-
23
- **If `epicmerch-mcp` is NOT already configured** in the client you're running inside:
24
-
25
- Tell the merchant:
26
-
27
- > "I'll set up the EpicMerch connection now. Running the installer in your terminal — it'll open a browser for login."
28
-
29
- Then run, using whatever shell/Bash tool you have:
30
-
31
- ```bash
32
- curl -fsSL https://api.epicmerch.in/install.sh | bash
33
- ```
34
-
35
- (Or on Windows PowerShell: `iwr -useb https://api.epicmerch.in/install.ps1 | iex`)
36
-
37
- This wraps `npx epicmerch-mcp@latest setup`, which:
38
- 1. Checks Node 18+ is installed (fails clean if not)
39
- 2. Opens a browser at `https://api.epicmerch.in/api/oauth/authorize`
40
- 3. Saves the token locally after login
41
- 4. Writes MCP config to whichever clients are detected (Claude Desktop / Cursor / VS Code / Codex)
42
- 5. Drops slash commands into `~/.claude/commands/`
43
-
44
- **If `epicmerch-mcp` is already configured but the merchant isn't logged in** (any `merchant_*` tool call returns "Not authenticated"):
45
-
46
- ```bash
47
- npx epicmerch-mcp login
48
- ```
49
-
50
- Just the OAuth re-login, no config rewrite.
51
-
52
- ## Step 3: Restart the client
53
-
54
- After install completes, tell the merchant:
55
-
56
- > "Setup complete. **Fully quit and reopen Claude Desktop / Cursor / VS Code / Codex** (not just reload window — the MCP child process only respawns on app launch). Then come back here and ask me anything — I'll have access to your store."
57
-
58
- Stop here if they're in Claude Desktop / Cursor / VS Code. The MCP child process won't pick up the new config in the current session — they need a restart.
59
-
60
- **Special case for Claude Code (terminal):** if they're in `claude` CLI rather than Claude Desktop, the user-scope MCP registration we just added is live immediately — they don't need to restart. Try calling `merchant_get_settings` to confirm.
61
-
62
- ## Step 4: Confirm the connection
63
-
64
- Once they're back, call `merchant_get_settings` and read the response. If you see real store data:
65
-
66
- > "Connected. Your store is **[name]**. I can help with products, orders, analytics, customers, Stripe setup, or Shopify migration. What would you like to do?"
67
-
68
- If `merchant_get_settings` still errors with "Not authenticated":
69
-
70
- > "The MCP isn't seeing the new config — make sure you **fully quit** the app (not just reload window) and reopen it. Then ask me anything."
71
-
72
- ## What this skill does NOT do
73
-
74
- - It does not collect email/password in chat. Auth always goes through the browser OAuth flow.
75
- - It does not modify files in the merchant's project — for storefront scaffolding use `/epicmerch`, `/epicmerch-auth`, `/epicmerch-products`, `/epicmerch-orders`.
76
- - It does not work for ChatGPT users. ChatGPT can't run shell commands, so the install must happen via the dashboard's Connect AI page → "Open in ChatGPT" Custom GPT.
77
-
78
- ## Routing notes
79
-
80
- Once setup is done, hand off:
81
- - "set up my store" → `/epicmerch-merchant` (skill that walks them through their first products / settings)
82
- - "migrate my Shopify store" → `/epicmerch-migrate`
83
- - "configure Stripe" → `/epicmerch-stripe`
84
- - "scaffold a storefront" → `/epicmerch`
85
-
86
- ## Fallback when the install script fails
87
-
88
- If `curl -fsSL https://api.epicmerch.in/install.sh | bash` fails (no Node, no network, restricted env, etc.) — tell the merchant exactly what's wrong and link to the dashboard fallback:
89
-
90
- > "The auto-installer hit an issue: **[error]**. You can connect manually instead go to `https://epicmerch.in/dashboard Connect AI` and follow the copy-paste instructions there."
91
-
92
- Never leave them stuck. Always give a manual fallback path.
1
+ ---
2
+ name: epicmerch-setup
3
+ description: Connect this Claude/Codex session to EpicMerch — runs the browser OAuth login + MCP config setup from inside chat, no terminal commands required.
4
+ ---
5
+
6
+ # EpicMerch Setup (in-chat)
7
+
8
+ This skill onboards the merchant **from inside the chat session itself**, so they don't have to alt-tab to a terminal. By the end the chat has access to all the `merchant_*` tools and the other `/epicmerch-*` skills.
9
+
10
+ If you can already call `merchant_get_settings` (or any other `merchant_*` tool) and get a real response back, the merchant is already set up — just say so and stop. Don't reinstall.
11
+
12
+ ## Step 1: Detect the environment
13
+
14
+ Use whatever shell/CLI tools you have to determine the merchant's setup:
15
+ - Their OS (look at the path style, `$HOME`, etc.)
16
+ - Whether Node.js is installed (`node --version` if you can run it)
17
+ - Whether the `epicmerch-mcp` MCP server is already wired up (look in `~/.claude.json`, `~/Library/Application Support/Claude/claude_desktop_config.json`, or `~/.codex/config.toml` depending on the client you're running inside)
18
+
19
+ Don't dump this to the merchant — it's for routing decisions in the next steps.
20
+
21
+ ## Step 2: Install the MCP if missing
22
+
23
+ **If `epicmerch-mcp` is NOT already configured** in the client you're running inside:
24
+
25
+ Tell the merchant:
26
+
27
+ > "I'll set up the EpicMerch connection now. Running the installer in your terminal — it'll open a browser for login."
28
+
29
+ Then run, using whatever shell/Bash tool you have:
30
+
31
+ ```bash
32
+ curl -fsSL https://api.epicmerch.in/install.sh | bash
33
+ ```
34
+
35
+ (Or on Windows PowerShell: `iwr -useb https://api.epicmerch.in/install.ps1 | iex`)
36
+
37
+ This wraps `npx epicmerch-mcp@latest setup`, which:
38
+ 1. Checks Node 18+ is installed (fails clean if not)
39
+ 2. Opens a browser at `https://api.epicmerch.in/api/oauth/authorize`
40
+ 3. Saves the token locally after login
41
+ 4. Writes MCP config to whichever clients are detected (Claude Desktop / Cursor / VS Code / Codex)
42
+ 5. Drops slash commands into `~/.claude/commands/`
43
+
44
+ **If `epicmerch-mcp` is already configured but the merchant isn't logged in** (any `merchant_*` tool call returns "Not authenticated"):
45
+
46
+ ```bash
47
+ npx epicmerch-mcp login
48
+ ```
49
+
50
+ Just the OAuth re-login, no config rewrite.
51
+
52
+ ## Step 3: Restart the client
53
+
54
+ After install completes, tell the merchant:
55
+
56
+ > "Setup complete. **Fully quit and reopen Claude Desktop / Cursor / VS Code / Codex** (not just reload window — the MCP child process only respawns on app launch). Then come back here and ask me anything — I'll have access to your store."
57
+
58
+ Stop here if they're in Claude Desktop / Cursor / VS Code. The MCP child process won't pick up the new config in the current session — they need a restart.
59
+
60
+ **Special case for Claude Code (terminal):** if they're in `claude` CLI rather than Claude Desktop, the user-scope MCP registration we just added is live immediately — they don't need to restart. Try calling `merchant_get_settings` to confirm.
61
+
62
+ ## Step 4: Confirm the connection
63
+
64
+ Once they're back, call `merchant_get_settings` and read the response. If you see real store data:
65
+
66
+ > "Connected. Your store is **[name]**. I can help with products, orders, analytics, customers, Stripe setup, or Shopify migration. What would you like to do?"
67
+
68
+ If `merchant_get_settings` still errors with "Not authenticated":
69
+
70
+ > "The MCP isn't seeing the new config — make sure you **fully quit** the app (not just reload window) and reopen it. Then ask me anything."
71
+
72
+ ## What this skill does NOT do
73
+
74
+ - It does not collect email/password in chat. Auth always goes through the browser OAuth flow.
75
+ - It does not modify files in the merchant's project — for storefront scaffolding use `/epicmerch`, `/epicmerch-auth`, `/epicmerch-products`, `/epicmerch-orders`.
76
+ - It does not work for ChatGPT users. ChatGPT can't run shell commands, so the install must happen via the dashboard's Connect AI page → "Open in ChatGPT" Custom GPT.
77
+
78
+ ## Routing notes
79
+
80
+ Once setup is done, hand off:
81
+ - "set up my store" → `/epicmerch-merchant` (skill that walks them through their first products / settings)
82
+ - "migrate my Shopify store" → `/epicmerch-migrate`
83
+ - "configure Stripe" → `/epicmerch-stripe`
84
+ - "scaffold a storefront" → `/epicmerch`
85
+
86
+ **Slash commands only work in Claude Code / Claude Desktop / Cursor** (which read from `~/.claude/commands/`). If the merchant is running you inside **Codex CLI**, slash commands aren't available — just do the same thing inline using the MCP tools directly. The mapping:
87
+
88
+ | Slash command | Equivalent inline behavior |
89
+ |---|---|
90
+ | `/epicmerch` | Walk through the 8 scaffold steps yourself: detect framework, install SDK, write Login.jsx + ProductCard.jsx + ProductList.jsx + Cart.jsx + Checkout.jsx + OrderHistory.jsx (skipping any that exist), call `merchant_generate_api_key` and write `.env`. The full step-by-step instructions are in the `epicmerch` skill — read them via the MCP's resources if available, or just follow the same plan from memory. |
91
+ | `/epicmerch-stripe` | Conversationally walk through Stripe setup using `merchant_configure_stripe`, `merchant_test_stripe_connection`, `merchant_set_checkout_type`. |
92
+ | `/epicmerch-migrate` | Use `merchant_shopify_migrate` in two stages: extract → confirm → import. |
93
+ | `/epicmerch-merchant` | Call `merchant_get_analytics_stats` + `merchant_diagnose` and summarise the store. |
94
+
95
+ ## Fallback when the install script fails
96
+
97
+ If `curl -fsSL https://api.epicmerch.in/install.sh | bash` fails (no Node, no network, restricted env, etc.) — tell the merchant exactly what's wrong and link to the dashboard fallback:
98
+
99
+ > "The auto-installer hit an issue: **[error]**. You can connect manually instead — go to `https://epicmerch.in/dashboard → Connect AI` and follow the copy-paste instructions there."
100
+
101
+ Never leave them stuck. Always give a manual fallback path.
@@ -317,6 +317,13 @@ export const TOOL_EXAMPLES = {
317
317
  'Is Stripe configured correctly?',
318
318
  'Verify my Stripe keys work',
319
319
  ],
320
+
321
+ // --- Razorpay ---
322
+ merchant_configure_razorpay: [
323
+ 'Set up Razorpay for my store',
324
+ 'Add my Razorpay keys',
325
+ 'Configure Razorpay payments',
326
+ ],
320
327
  merchant_set_checkout_type: [
321
328
  'Switch my checkout to Stripe',
322
329
  'Change checkout to Razorpay',
@@ -362,6 +362,18 @@ export function merchantTools(client, session) {
362
362
  return ok(await client.authGet('/users/stripe/test'));
363
363
  },
364
364
 
365
+ // --- RAZORPAY CONFIGURATION ---
366
+ async merchant_configure_razorpay({ keyId, keySecret }) {
367
+ requireAuth();
368
+ if (!keyId && !keySecret) {
369
+ throw new Error('At least one of `keyId` or `keySecret` must be provided.');
370
+ }
371
+ const body = {};
372
+ if (keyId !== undefined) body.razorpayKeyId = keyId;
373
+ if (keySecret !== undefined) body.razorpayKeySecret = keySecret;
374
+ return ok(await client.authPut('/users/checkout-settings', body));
375
+ },
376
+
365
377
  async merchant_set_checkout_type({ type }) {
366
378
  requireAuth();
367
379
  const valid = ['epicmerch', 'stripe', 'shiprocket'];
@@ -603,6 +615,14 @@ const _baseMerchantToolDefs = [
603
615
  description: 'Verify the merchant\'s Stripe keys work by fetching their Stripe account. Returns accountId, country, and charges-enabled status.',
604
616
  schema: {},
605
617
  },
618
+ {
619
+ name: 'merchant_configure_razorpay',
620
+ description: 'Configure Razorpay payment processing for the merchant: stores Key ID + Key Secret. Pair with merchant_set_checkout_type({type:"epicmerch"}) to activate the EpicMerch Checkout flow that uses Razorpay. Both fields are optional individually so you can update one at a time (e.g. rotating the secret without re-entering the key id).',
621
+ schema: {
622
+ keyId: { type: 'string', description: 'Razorpay Key ID, e.g. rzp_live_... or rzp_test_...' },
623
+ keySecret: { type: 'string', description: 'Razorpay Key Secret. Stored encrypted server-side.' },
624
+ },
625
+ },
606
626
  {
607
627
  name: 'merchant_set_checkout_type',
608
628
  description: 'Set which checkout flow the merchant\'s storefront uses. Must be one of: "epicmerch" (Razorpay + Shiprocket), "stripe" (Stripe + Shiprocket), or "shiprocket" (full SR Checkout).',