@striderlabs/mcp-gap 0.1.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 +210 -0
- package/build.js +15 -0
- package/dist/index.js +21985 -0
- package/package.json +42 -0
- package/server.json +20 -0
- package/src/auth.ts +82 -0
- package/src/browser.ts +902 -0
- package/src/index.ts +515 -0
- package/tsconfig.json +14 -0
package/README.md
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# @striderlabs/mcp-gap
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for Gap Inc. — let AI agents search products, manage your shopping bag, track orders, check rewards, and more across **Gap**, **Old Navy**, **Banana Republic**, and **Athleta**.
|
|
4
|
+
|
|
5
|
+
Built by [Strider Labs](https://striderlabs.ai).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Product Search** — search across all four Gap Inc. brands
|
|
12
|
+
- **Product Details** — sizes, colors, fit type, materials, ratings
|
|
13
|
+
- **Store Inventory** — check in-store availability near any zip code
|
|
14
|
+
- **Cart Management** — add items, view bag with totals
|
|
15
|
+
- **Checkout** — guided checkout with Gap Cash instructions
|
|
16
|
+
- **Rewards** — check Gap Cash balance, points, and member tier
|
|
17
|
+
- **Order Tracking** — status, estimated delivery, tracking numbers
|
|
18
|
+
- **Store Finder** — locate stores by zip code with hours and phone
|
|
19
|
+
- **Returns** — initiate returns with instructions and prepaid labels
|
|
20
|
+
- **Size Guide** — US size charts for tops, bottoms, shoes, and kids
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install -g @striderlabs/mcp-gap
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or run directly with npx (no install required):
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx @striderlabs/mcp-gap
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## MCP Configuration
|
|
39
|
+
|
|
40
|
+
### Claude Desktop
|
|
41
|
+
|
|
42
|
+
Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"mcpServers": {
|
|
47
|
+
"gap": {
|
|
48
|
+
"command": "npx",
|
|
49
|
+
"args": ["-y", "@striderlabs/mcp-gap"]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Claude Code
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"mcpServers": {
|
|
60
|
+
"gap": {
|
|
61
|
+
"command": "npx",
|
|
62
|
+
"args": ["-y", "@striderlabs/mcp-gap"],
|
|
63
|
+
"type": "stdio"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### With a local install
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"mcpServers": {
|
|
74
|
+
"gap": {
|
|
75
|
+
"command": "node",
|
|
76
|
+
"args": ["/path/to/node_modules/@striderlabs/mcp-gap/dist/index.js"]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Authentication
|
|
85
|
+
|
|
86
|
+
Gap Inc. requires you to log in manually — there is no programmatic login API. Your session is saved automatically after you log in.
|
|
87
|
+
|
|
88
|
+
1. Ask your AI agent: *"Log me in to Gap"*
|
|
89
|
+
2. The agent will use `gap_login` to return a login URL
|
|
90
|
+
3. Open the URL in your browser and sign in
|
|
91
|
+
4. Your session cookies are saved to `~/.strider/gap/`
|
|
92
|
+
5. Verify with: *"Check my Gap login status"*
|
|
93
|
+
|
|
94
|
+
Sessions persist until they expire or you call `gap_logout`.
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
## Available Tools
|
|
99
|
+
|
|
100
|
+
### Authentication
|
|
101
|
+
|
|
102
|
+
| Tool | Description |
|
|
103
|
+
|------|-------------|
|
|
104
|
+
| `gap_status` | Check login status and session info |
|
|
105
|
+
| `gap_login` | Get login URL and instructions |
|
|
106
|
+
| `gap_logout` | Log out and clear saved session |
|
|
107
|
+
|
|
108
|
+
### Shopping
|
|
109
|
+
|
|
110
|
+
| Tool | Description |
|
|
111
|
+
|------|-------------|
|
|
112
|
+
| `gap_search` | Search products by keyword and brand |
|
|
113
|
+
| `gap_product_details` | Full product info: sizes, colors, fit, materials |
|
|
114
|
+
| `gap_store_inventory` | In-store availability by zip code |
|
|
115
|
+
| `gap_add_to_cart` | Add item to bag with size and color |
|
|
116
|
+
| `gap_view_cart` | View bag contents and totals |
|
|
117
|
+
| `gap_checkout` | Checkout instructions and URL |
|
|
118
|
+
|
|
119
|
+
### Account & Orders
|
|
120
|
+
|
|
121
|
+
| Tool | Description |
|
|
122
|
+
|------|-------------|
|
|
123
|
+
| `gap_rewards` | Gap Cash balance, points, member tier |
|
|
124
|
+
| `gap_track_order` | Order status, delivery, tracking number |
|
|
125
|
+
| `gap_find_stores` | Find stores near a zip code |
|
|
126
|
+
| `gap_initiate_return` | Start a return with instructions |
|
|
127
|
+
| `gap_size_guide` | Size charts for tops, bottoms, shoes, kids |
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Supported Brands
|
|
132
|
+
|
|
133
|
+
| Brand | Value |
|
|
134
|
+
|-------|-------|
|
|
135
|
+
| Gap | `"gap"` |
|
|
136
|
+
| Old Navy | `"old-navy"` |
|
|
137
|
+
| Banana Republic | `"banana-republic"` |
|
|
138
|
+
| Athleta | `"athleta"` |
|
|
139
|
+
|
|
140
|
+
Pass the brand as a parameter to any tool. Defaults to `"gap"` if not specified.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Example Usage
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
"Search for slim fit jeans on Banana Republic"
|
|
148
|
+
→ gap_search { query: "slim fit jeans", brand: "banana-republic" }
|
|
149
|
+
|
|
150
|
+
"Show me the details for this product: [url]"
|
|
151
|
+
→ gap_product_details { product_url: "https://..." }
|
|
152
|
+
|
|
153
|
+
"Add the medium in navy to my bag"
|
|
154
|
+
→ gap_add_to_cart { product_url: "...", size: "M", color: "Navy" }
|
|
155
|
+
|
|
156
|
+
"What's my Gap Cash balance?"
|
|
157
|
+
→ gap_rewards {}
|
|
158
|
+
|
|
159
|
+
"Find Gap stores near 10001"
|
|
160
|
+
→ gap_find_stores { zip_code: "10001" }
|
|
161
|
+
|
|
162
|
+
"Track my order 1234567890"
|
|
163
|
+
→ gap_track_order { order_id: "1234567890" }
|
|
164
|
+
|
|
165
|
+
"Start a return for my order — the jeans don't fit"
|
|
166
|
+
→ gap_initiate_return { order_id: "...", item_name: "Slim Jeans", reason: "Wrong size" }
|
|
167
|
+
|
|
168
|
+
"What size medium in tops means in measurements?"
|
|
169
|
+
→ gap_size_guide { category: "tops" }
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Session Storage
|
|
175
|
+
|
|
176
|
+
Session data is stored in `~/.strider/gap/`:
|
|
177
|
+
- `cookies.json` — browser session cookies
|
|
178
|
+
- `session.json` — account metadata (email, rewards info)
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Limitations
|
|
183
|
+
|
|
184
|
+
- **Manual login required** — no programmatic authentication
|
|
185
|
+
- **UI changes** — Gap website updates may break automation; open a GitHub issue if you encounter problems
|
|
186
|
+
- **CAPTCHAs** — occasional CAPTCHA challenges require manual solving in the browser
|
|
187
|
+
- **Checkout** — actual order placement is done in-browser for security; the agent provides the URL and instructions
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Development
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
git clone https://github.com/striderlabs/mcp-gap
|
|
195
|
+
cd mcp-gap
|
|
196
|
+
npm install
|
|
197
|
+
npm run build
|
|
198
|
+
node dist/index.js
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Type check only:
|
|
202
|
+
```bash
|
|
203
|
+
npm run typecheck
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## License
|
|
209
|
+
|
|
210
|
+
MIT — [Strider Labs](https://striderlabs.ai)
|
package/build.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { build } from 'esbuild';
|
|
2
|
+
|
|
3
|
+
await build({
|
|
4
|
+
entryPoints: ['src/index.ts'],
|
|
5
|
+
bundle: true,
|
|
6
|
+
platform: 'node',
|
|
7
|
+
format: 'esm',
|
|
8
|
+
outfile: 'dist/index.js',
|
|
9
|
+
external: ['patchright'],
|
|
10
|
+
banner: {
|
|
11
|
+
js: '#!/usr/bin/env node',
|
|
12
|
+
},
|
|
13
|
+
minify: false,
|
|
14
|
+
sourcemap: false,
|
|
15
|
+
}).catch(() => process.exit(1));
|