ebay-mcp-remote-edition 1.0.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.
Files changed (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +755 -0
  3. package/build/api/account-management/account.js +301 -0
  4. package/build/api/analytics-and-report/analytics.js +102 -0
  5. package/build/api/client-trading.js +96 -0
  6. package/build/api/client.js +173 -0
  7. package/build/api/communication/feedback.js +119 -0
  8. package/build/api/communication/message.js +131 -0
  9. package/build/api/communication/negotiation.js +97 -0
  10. package/build/api/communication/notification.js +373 -0
  11. package/build/api/developer/developer.js +81 -0
  12. package/build/api/index.js +109 -0
  13. package/build/api/listing-management/inventory.js +640 -0
  14. package/build/api/listing-metadata/metadata.js +485 -0
  15. package/build/api/listing-metadata/taxonomy.js +58 -0
  16. package/build/api/marketing-and-promotions/marketing.js +768 -0
  17. package/build/api/marketing-and-promotions/recommendation.js +32 -0
  18. package/build/api/order-management/dispute.js +69 -0
  19. package/build/api/order-management/fulfillment.js +89 -0
  20. package/build/api/other/compliance.js +47 -0
  21. package/build/api/other/edelivery.js +219 -0
  22. package/build/api/other/identity.js +24 -0
  23. package/build/api/other/translation.js +22 -0
  24. package/build/api/other/vero.js +48 -0
  25. package/build/api/trading/trading.js +78 -0
  26. package/build/auth/kv-store.js +40 -0
  27. package/build/auth/multi-user-store.js +120 -0
  28. package/build/auth/oauth-metadata.js +59 -0
  29. package/build/auth/oauth-middleware.js +99 -0
  30. package/build/auth/oauth-types.js +4 -0
  31. package/build/auth/oauth.js +235 -0
  32. package/build/auth/scope-utils.js +304 -0
  33. package/build/auth/token-store.js +46 -0
  34. package/build/auth/token-verifier.js +172 -0
  35. package/build/config/environment.js +297 -0
  36. package/build/index.d.ts +1 -0
  37. package/build/index.js +129 -0
  38. package/build/schemas/account-management/account.js +375 -0
  39. package/build/schemas/analytics/analytics.js +191 -0
  40. package/build/schemas/communication/messages.js +345 -0
  41. package/build/schemas/fulfillment/orders.js +338 -0
  42. package/build/schemas/index.js +68 -0
  43. package/build/schemas/inventory-management/inventory.js +471 -0
  44. package/build/schemas/marketing/marketing.js +1103 -0
  45. package/build/schemas/metadata/metadata.js +618 -0
  46. package/build/schemas/other/other-apis.js +390 -0
  47. package/build/schemas/taxonomy/taxonomy.js +575 -0
  48. package/build/scripts/auto-setup.js +364 -0
  49. package/build/scripts/dev-sync.js +512 -0
  50. package/build/scripts/diagnostics.js +301 -0
  51. package/build/scripts/download-specs.js +116 -0
  52. package/build/scripts/interactive-setup.js +757 -0
  53. package/build/scripts/setup.js +1515 -0
  54. package/build/scripts/update-api-status-doc.js +44 -0
  55. package/build/server-http.d.ts +1 -0
  56. package/build/server-http.js +581 -0
  57. package/build/tools/definitions/account-with-schemas.js +170 -0
  58. package/build/tools/definitions/account.js +428 -0
  59. package/build/tools/definitions/analytics.js +66 -0
  60. package/build/tools/definitions/communication.js +394 -0
  61. package/build/tools/definitions/developer.js +195 -0
  62. package/build/tools/definitions/fulfillment.js +326 -0
  63. package/build/tools/definitions/index.js +41 -0
  64. package/build/tools/definitions/inventory.js +464 -0
  65. package/build/tools/definitions/marketing.js +1486 -0
  66. package/build/tools/definitions/metadata.js +188 -0
  67. package/build/tools/definitions/other.js +309 -0
  68. package/build/tools/definitions/taxonomy.js +64 -0
  69. package/build/tools/definitions/token-management.js +148 -0
  70. package/build/tools/definitions/trading.js +71 -0
  71. package/build/tools/index.js +1200 -0
  72. package/build/tools/schemas.js +667 -0
  73. package/build/tools/tool-definitions.js +3534 -0
  74. package/build/types/application-settings/developerAnalyticsV1BetaOas3.js +5 -0
  75. package/build/types/application-settings/developerClientRegistrationV1Oas3.js +5 -0
  76. package/build/types/application-settings/developerKeyManagementV1Oas3.js +5 -0
  77. package/build/types/ebay-enums.js +1330 -0
  78. package/build/types/ebay.js +123 -0
  79. package/build/types/index.js +10 -0
  80. package/build/types/sell-apps/account-management/sellAccountV1Oas3.js +5 -0
  81. package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.js +5 -0
  82. package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.js +5 -0
  83. package/build/types/sell-apps/communication/commerceMessageV1Oas3.js +5 -0
  84. package/build/types/sell-apps/communication/commerceNotificationV1Oas3.js +5 -0
  85. package/build/types/sell-apps/communication/sellNegotiationV1Oas3.js +5 -0
  86. package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.js +5 -0
  87. package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.js +5 -0
  88. package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.js +5 -0
  89. package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.js +5 -0
  90. package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.js +5 -0
  91. package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.js +5 -0
  92. package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.js +5 -0
  93. package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.js +5 -0
  94. package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.js +5 -0
  95. package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.js +5 -0
  96. package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.js +5 -0
  97. package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.js +5 -0
  98. package/build/utils/account-management/account.js +831 -0
  99. package/build/utils/api-status-feed.js +83 -0
  100. package/build/utils/communication/feedback.js +216 -0
  101. package/build/utils/communication/message.js +242 -0
  102. package/build/utils/communication/negotiation.js +150 -0
  103. package/build/utils/communication/notification.js +369 -0
  104. package/build/utils/date-converter.js +160 -0
  105. package/build/utils/llm-client-detector.js +758 -0
  106. package/build/utils/logger.js +198 -0
  107. package/build/utils/oauth-helper.js +315 -0
  108. package/build/utils/order-management/dispute.js +369 -0
  109. package/build/utils/order-management/fulfillment.js +205 -0
  110. package/build/utils/other/compliance.js +76 -0
  111. package/build/utils/other/edelivery.js +241 -0
  112. package/build/utils/other/identity.js +13 -0
  113. package/build/utils/other/translation.js +41 -0
  114. package/build/utils/other/vero.js +90 -0
  115. package/build/utils/scope-helper.js +207 -0
  116. package/build/utils/security-checker.js +248 -0
  117. package/build/utils/setup-validator.js +305 -0
  118. package/build/utils/token-utils.js +40 -0
  119. package/build/utils/version.js +56 -0
  120. package/docs/auth/production_scopes.json +111 -0
  121. package/docs/auth/sandbox_scopes.json +142 -0
  122. package/package.json +122 -0
  123. package/public/icons/1024x1024.png +0 -0
  124. package/public/icons/128x128.png +0 -0
  125. package/public/icons/16x16.png +0 -0
  126. package/public/icons/256x256.png +0 -0
  127. package/public/icons/32x32.png +0 -0
  128. package/public/icons/48x48.png +0 -0
  129. package/public/icons/512x512.png +0 -0
package/README.md ADDED
@@ -0,0 +1,755 @@
1
+ # eBay API MCP Server (Remote Edition) (`ebay-mcp-remote-edition`)
2
+
3
+ <div align="center">
4
+
5
+ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server providing AI assistants with comprehensive access to eBay's Sell APIs. Includes **325+ tools** for inventory management, order fulfillment, marketing campaigns, analytics, developer tools, and more.
6
+
7
+ **API Coverage:** 100% (270+ unique eBay API endpoints)
8
+
9
+ [![npm version](https://img.shields.io/npm/v/ebay-mcp-remote-edition.svg)](https://www.npmjs.com/package/ebay-mcp-remote-edition)
10
+ [![Socket Badge](https://socket.dev/api/badge/npm/package/ebay-mcp-remote-edition)](https://socket.dev/npm/package/ebay-mcp-remote-edition)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
12
+
13
+ </div>
14
+
15
+ ---
16
+
17
+ ## Fork additions in this deployment-focused version
18
+
19
+ This fork preserves the original local/STDIO workflow while adding hosted multi-user support for a [Render](https://www.google.com/search?q=render.com&sourceid=chrome&ie=UTF-8) or similar remote server instance.
20
+
21
+ ### Added in this fork
22
+
23
+ - Hosted HTTP MCP deployment mode for Render
24
+ - Multi-user server-side eBay OAuth for both production and sandbox
25
+ - Cloudflare KV-backed storage for:
26
+ - OAuth state
27
+ - user token records
28
+ - session records
29
+ - Session-token based MCP auth:
30
+ - `Authorization: Bearer <session-token>`
31
+ - Render Secret File support for environment-specific credentials
32
+ - Admin session inspection/revocation endpoints
33
+ - `GET /whoami` endpoint for session-bound identity lookup
34
+ - Optional `OAUTH_START_KEY` protection for `/oauth/start`
35
+ - **MCP OAuth 2.1 authorization server** — Cline and other MCP clients that support OAuth discovery (`/.well-known/oauth-authorization-server`, `POST /register`, `GET /authorize`, `POST /token`) can authenticate fully automatically via browser eBay OAuth with no manual token pasting
36
+
37
+ ---
38
+
39
+ ## One-Click AI Setup
40
+
41
+ > **Let your AI assistant set this up for you!** Copy the prompt below and paste it into Claude, ChatGPT, or any AI assistant with MCP support.
42
+
43
+ <details>
44
+ <summary><strong>Click to copy the AI setup prompt</strong></summary>
45
+
46
+ ```text
47
+ I want to set up the eBay MCP Server for my AI assistant. Please help me:
48
+
49
+ 1. Install the eBay MCP server:
50
+ git clone https://github.com/mrnajiboy/ebay-mcp-remote-edition.git
51
+ cd ebay-mcp-remote-edition
52
+ pnpm install
53
+ pnpm run build
54
+
55
+ 2. I need to configure it for [Claude Desktop / Cursor / Cline / Zed / Continue.dev / Windsurf / Claude Code CLI / Amazon Q] (choose one)
56
+
57
+ 3. My eBay credentials are:
58
+ - Client ID: [YOUR_CLIENT_ID]
59
+ - Client Secret: [YOUR_CLIENT_SECRET]
60
+ - Environment: [sandbox / production]
61
+ - Redirect URI (RuName): [YOUR_REDIRECT_URI]
62
+
63
+ Please:
64
+ - Create the appropriate config file for my MCP client
65
+ - Set up the environment variables
66
+ - Help me complete the OAuth flow to get a refresh token for higher rate limits
67
+ - Test that the connection works
68
+
69
+ If I don't have eBay credentials yet, guide me through creating a developer account at https://developer.ebay.com/
70
+ ```
71
+
72
+ </details>
73
+
74
+ ---
75
+
76
+ ## ⚠️ Disclaimer
77
+
78
+ **IMPORTANT: Please read this disclaimer carefully before using this software.**
79
+
80
+ This is an **open-source project** provided "as is" without warranty of any kind, either express or implied. By using this software, you acknowledge and agree to the following:
81
+
82
+ - **No Liability:** The authors, contributors, and maintainers of this project accept **NO responsibility or liability** for any damages, losses, or issues that may arise from using this software.
83
+ - **eBay API Usage:** This project is an unofficial third-party implementation and is **NOT affiliated with, endorsed by, or sponsored by eBay Inc.**
84
+ - **Use at Your Own Risk:** Test thoroughly in eBay's sandbox before production use.
85
+ - **Security:** You are responsible for securing API credentials, session tokens, and hosted endpoints.
86
+
87
+ For official eBay API support, please refer to the [eBay Developer Program](https://developer.ebay.com/).
88
+
89
+ ---
90
+
91
+ ## Table of Contents
92
+
93
+ - [Fork additions in this deployment-focused version](#fork-additions-in-this-deployment-focused-version)
94
+ - [⚠️ Disclaimer](#️-disclaimer)
95
+ - [Features](#features)
96
+ - [Quick Start](#quick-start)
97
+ - [Local MCP Client Configuration](#local-mcp-client-configuration)
98
+ - [Hosted Render Deployment](#hosted-render-deployment)
99
+ - [Hosted MCP Client Configuration](#hosted-mcp-client-configuration)
100
+ - [Configuration](#configuration)
101
+ - [Available Tools](#available-tools)
102
+ - [Development](#development)
103
+ - [Logging](#logging)
104
+ - [Troubleshooting](#troubleshooting)
105
+ - [Resources](#resources)
106
+ - [License](#license)
107
+
108
+ ## Features
109
+
110
+ - **325+ eBay API Tools** - 100% coverage of eBay Sell APIs across inventory, orders, marketing, analytics, developer tools, and more
111
+ - **9 AI Clients Supported** - Auto-configuration for Claude Desktop, Cursor, Zed, Cline, Continue.dev, Windsurf, Roo Code, Claude Code CLI, and Amazon Q
112
+ - **OAuth 2.0 Support** - Full user token management with automatic refresh
113
+ - **Type Safety** - Built with TypeScript, Zod validation, and OpenAPI-generated types
114
+ - **MCP Integration** - STDIO transport for local integration and HTTP transport for hosted deployment
115
+ - **Smart Authentication** - Automatic fallback from user tokens to client credentials where applicable
116
+ - **Hosted Multi-User Mode** - Server-side OAuth + session-token auth for hosted MCP access
117
+ - **Well Tested** - Comprehensive typecheck/build/deploy validation
118
+ - **Interactive Setup Wizard** - Run `pnpm run setup` for guided local configuration
119
+ - **Developer Analytics** - Rate limit monitoring and signing key management
120
+
121
+ ## Quick Start
122
+
123
+ ### 1. Get eBay Credentials
124
+
125
+ 1. Create a free [eBay Developer Account](https://developer.ebay.com/)
126
+ 2. Generate application keys in the [Developer Portal](https://developer.ebay.com/my/keys)
127
+ 3. Save your **Client ID** and **Client Secret**
128
+ 4. Configure environment-specific RuNames for production and sandbox as needed
129
+
130
+ ### 2. Install
131
+
132
+ **Option A — npm (easiest, no build step required):**
133
+
134
+ ```bash
135
+ npm install -g ebay-mcp-remote-edition
136
+ # or
137
+ pnpm add -g ebay-mcp-remote-edition
138
+ ```
139
+
140
+ Then run the setup wizard:
141
+
142
+ ```bash
143
+ ebay-mcp-remote-edition --setup
144
+ ```
145
+
146
+ **Option B — clone and build (for contributors or if you want to self-host the HTTP server):**
147
+
148
+ ```bash
149
+ git clone https://github.com/mrnajiboy/ebay-mcp-remote-edition.git
150
+ cd ebay-mcp-remote-edition
151
+ pnpm install
152
+ pnpm run build
153
+ ```
154
+
155
+ ### 3. Run Local Setup Wizard
156
+
157
+ For local/STDIO usage after cloning:
158
+
159
+ ```bash
160
+ pnpm run setup
161
+ ```
162
+
163
+ ### 4. Hosted Mode
164
+
165
+ For hosted Render usage, see the next section.
166
+
167
+ ---
168
+
169
+ ## Local MCP Client Configuration
170
+
171
+ Two ways to configure your MCP client for local (STDIO) usage:
172
+
173
+ - **Option A — `npx` (no clone needed):** Use `npx -y ebay-mcp-remote-edition` as the command. npm downloads and runs the latest published version automatically.
174
+ - **Option B — local build:** Clone the repo, run `pnpm run build` and `pnpm run setup`, then point at `/absolute/path/to/ebay-mcp-remote-edition/build/index.js`.
175
+
176
+ The configs below show both. Supply your eBay credentials either as `env` fields in the config or via a `.env` file in the working directory.
177
+
178
+ > **Getting your credentials:** Run `pnpm run setup` in the cloned repo — it completes the OAuth flow and writes `EBAY_USER_REFRESH_TOKEN` to `.env`.
179
+
180
+ ### Cline
181
+
182
+ Config file location:
183
+ `~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json`
184
+
185
+ **Using npx (no clone needed):**
186
+
187
+ ```json
188
+ {
189
+ "mcpServers": {
190
+ "ebay": {
191
+ "command": "npx",
192
+ "args": ["-y", "ebay-mcp-remote-edition"],
193
+ "env": {
194
+ "EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
195
+ "EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
196
+ "EBAY_ENVIRONMENT": "sandbox",
197
+ "EBAY_REDIRECT_URI": "YOUR_RUNAME",
198
+ "EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
199
+ }
200
+ }
201
+ }
202
+ }
203
+ ```
204
+
205
+ **Using local build:**
206
+
207
+ ```json
208
+ {
209
+ "mcpServers": {
210
+ "ebay": {
211
+ "command": "node",
212
+ "args": ["/absolute/path/to/ebay-mcp-remote-edition/build/index.js"],
213
+ "env": {
214
+ "EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
215
+ "EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
216
+ "EBAY_ENVIRONMENT": "sandbox",
217
+ "EBAY_REDIRECT_URI": "YOUR_RUNAME",
218
+ "EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
219
+ }
220
+ }
221
+ }
222
+ }
223
+ ```
224
+
225
+ ### Claude Desktop
226
+
227
+ Config file location:
228
+ - **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
229
+ - **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
230
+
231
+ **Using npx:**
232
+
233
+ ```json
234
+ {
235
+ "mcpServers": {
236
+ "ebay": {
237
+ "command": "npx",
238
+ "args": ["-y", "ebay-mcp-remote-edition"],
239
+ "env": {
240
+ "EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
241
+ "EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
242
+ "EBAY_ENVIRONMENT": "sandbox",
243
+ "EBAY_REDIRECT_URI": "YOUR_RUNAME",
244
+ "EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
245
+ }
246
+ }
247
+ }
248
+ }
249
+ ```
250
+
251
+ **Using local build:**
252
+
253
+ ```json
254
+ {
255
+ "mcpServers": {
256
+ "ebay": {
257
+ "command": "node",
258
+ "args": ["/absolute/path/to/ebay-mcp-remote-edition/build/index.js"],
259
+ "env": {
260
+ "EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
261
+ "EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
262
+ "EBAY_ENVIRONMENT": "sandbox",
263
+ "EBAY_REDIRECT_URI": "YOUR_RUNAME",
264
+ "EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
265
+ }
266
+ }
267
+ }
268
+ }
269
+ ```
270
+
271
+ ### Cursor
272
+
273
+ Global config: `~/.cursor/mcp.json`
274
+ Project config: `.cursor/mcp.json` (in your project root)
275
+
276
+ **Using npx:**
277
+
278
+ ```json
279
+ {
280
+ "mcpServers": {
281
+ "ebay": {
282
+ "command": "npx",
283
+ "args": ["-y", "ebay-mcp-remote-edition"],
284
+ "env": {
285
+ "EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
286
+ "EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
287
+ "EBAY_ENVIRONMENT": "sandbox",
288
+ "EBAY_REDIRECT_URI": "YOUR_RUNAME",
289
+ "EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
290
+ }
291
+ }
292
+ }
293
+ }
294
+ ```
295
+
296
+ **Using local build:**
297
+
298
+ ```json
299
+ {
300
+ "mcpServers": {
301
+ "ebay": {
302
+ "command": "node",
303
+ "args": ["/absolute/path/to/ebay-mcp-remote-edition/build/index.js"],
304
+ "env": {
305
+ "EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
306
+ "EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
307
+ "EBAY_ENVIRONMENT": "sandbox",
308
+ "EBAY_REDIRECT_URI": "YOUR_RUNAME",
309
+ "EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
310
+ }
311
+ }
312
+ }
313
+ }
314
+ ```
315
+
316
+ ### Other STDIO clients (Zed, Windsurf, Continue.dev, Roo Code, Amazon Q)
317
+
318
+ All STDIO-based clients use the same pattern. Use `npx -y ebay-mcp-remote-edition` for zero-install, or point `command` at `node` with `build/index.js` for a local build.
319
+
320
+ **Using npx:**
321
+
322
+ ```json
323
+ {
324
+ "mcpServers": {
325
+ "ebay": {
326
+ "command": "npx",
327
+ "args": ["-y", "ebay-mcp-remote-edition"],
328
+ "env": {
329
+ "EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
330
+ "EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
331
+ "EBAY_ENVIRONMENT": "sandbox",
332
+ "EBAY_REDIRECT_URI": "YOUR_RUNAME",
333
+ "EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
334
+ }
335
+ }
336
+ }
337
+ }
338
+ ```
339
+
340
+ ---
341
+
342
+ ## Hosted Render Deployment
343
+
344
+ ### Build command
345
+
346
+ ```bash
347
+ pnpm install && pnpm run build
348
+ ```
349
+
350
+ ### Start command
351
+
352
+ ```bash
353
+ pnpm run start:http
354
+ ```
355
+
356
+ ### Recommended Render environment variables
357
+
358
+ ```bash
359
+ PORT=
360
+ NODE_VERSION=
361
+ PUBLIC_BASE_URL=https://your-server.com
362
+ EBAY_CONFIG_FILE=/etc/secrets/ebay-config.json
363
+ EBAY_DEFAULT_ENVIRONMENT=sandbox|production
364
+ EBAY_TOKEN_STORE_BACKEND=cloudflare-kv
365
+ CLOUDFLARE_ACCOUNT_ID=ID
366
+ CLOUDFLARE_KV_NAMESPACE_ID=ID
367
+ CLOUDFLARE_API_TOKEN=your-cloudflare-api-token
368
+ ADMIN_API_KEY=your-admin-api-key
369
+ OAUTH_START_KEY=optional-shared-secret-for-oauth-start
370
+ EBAY_MARKETPLACE_ID=EBAY_COUNTRY
371
+ EBAY_CONTENT_LANGUAGE=lang-COUNTRY
372
+ EBAY_LOG_LEVEL=info
373
+ ```
374
+
375
+ ### Render secret file
376
+
377
+ Filename:
378
+
379
+ ```text
380
+ ebay-config.json
381
+ ```
382
+
383
+ Example contents:
384
+
385
+ ```json
386
+ {
387
+ "production": {
388
+ "clientId": "PROD_CLIENT_ID",
389
+ "clientSecret": "PROD_CLIENT_SECRET",
390
+ "redirectUri": "YOUR_PRODUCTION_RUNAME"
391
+ },
392
+ "sandbox": {
393
+ "clientId": "SANDBOX_CLIENT_ID",
394
+ "clientSecret": "SANDBOX_CLIENT_SECRET",
395
+ "redirectUri": "YOUR_SANDBOX_RUNAME"
396
+ }
397
+ }
398
+ ```
399
+
400
+ Render mounts it at:
401
+
402
+ ```text
403
+ /etc/secrets/ebay-config.json
404
+ ```
405
+
406
+ ### OAuth flows
407
+
408
+ Start production OAuth:
409
+
410
+ ```text
411
+ /oauth/start?env=production
412
+ ```
413
+
414
+ Start sandbox OAuth:
415
+
416
+ ```text
417
+ /oauth/start?env=sandbox
418
+ ```
419
+
420
+ If `OAUTH_START_KEY` is configured, include either:
421
+
422
+ ```text
423
+ /oauth/start?env=production&key=YOUR_OAUTH_START_KEY
424
+ ```
425
+
426
+ or send:
427
+
428
+ ```text
429
+ X-OAuth-Start-Key: YOUR_OAUTH_START_KEY
430
+ ```
431
+
432
+ ### Hosted session token usage
433
+
434
+ After successful callback, the app issues a session token and displays it in a copy-friendly callback page.
435
+
436
+ Use it in your MCP client:
437
+
438
+ ```text
439
+ Authorization: Bearer <session-token>
440
+ ```
441
+
442
+ For Make/Zapier/TypingMind anywhere where Remote MCP is accepted, the practical supported flow is:
443
+
444
+ 1. complete browser OAuth via the hosted server
445
+ 2. copy the returned session token from the callback page
446
+ 3. paste it into the platform's API Key / Access token field
447
+
448
+ Normal MCP usage should not open a browser window once a valid hosted session token already exists.
449
+
450
+ ### Admin endpoints
451
+
452
+ Require:
453
+
454
+ ```text
455
+ X-Admin-API-Key: <ADMIN_API_KEY>
456
+ ```
457
+
458
+ Endpoints:
459
+
460
+ - `GET /admin/session/:sessionToken`
461
+ - `POST /admin/session/:sessionToken/revoke`
462
+ - `DELETE /admin/session/:sessionToken`
463
+
464
+ ### Session introspection
465
+
466
+ ```text
467
+ GET /whoami
468
+ Authorization: Bearer <session-token>
469
+ ```
470
+
471
+ ### MCP endpoint
472
+
473
+ ```text
474
+ POST /mcp
475
+ GET /mcp
476
+ DELETE /mcp
477
+ ```
478
+
479
+ #### Initial auth behavior
480
+
481
+ - `GET /mcp` without a valid Bearer token redirects into browser OAuth
482
+ - default environment is production
483
+ - sandbox can be requested with `?env=sandbox`
484
+ - `POST /mcp` without a valid Bearer token returns an auth-required JSON response
485
+
486
+ This means browser-driven onboarding works cleanly, while protocol clients can still receive a structured auth response.
487
+
488
+ ### Privacy recommendations
489
+
490
+ If you want the service URL to be less exposed:
491
+
492
+ - protect `/oauth/start` with `OAUTH_START_KEY`
493
+ - protect `/admin/*` with `ADMIN_API_KEY`
494
+ - keep `/oauth/callback` reachable by eBay
495
+ - optionally place `/`, `/oauth/start`, and `/admin/*` behind Cloudflare Access
496
+ - keep `/health` available if needed by Render health checks
497
+
498
+ ---
499
+
500
+ ## Hosted MCP Client Configuration
501
+
502
+ The hosted server implements a full **MCP OAuth 2.1 authorization server** (RFC 8414 / RFC 7591 / RFC 6749 + PKCE). MCP clients that support OAuth discovery — such as Cline — will handle the full browser-based eBay login flow automatically with no manual token pasting required.
503
+
504
+ Replace `https://your-server.com` with your actual `PUBLIC_BASE_URL`.
505
+
506
+ ### Cline (recommended — full OAuth auto-discovery)
507
+
508
+ Cline supports OAuth 2.1 discovery natively. Just point it at the MCP endpoint and it handles everything:
509
+
510
+ ```json
511
+ {
512
+ "mcpServers": {
513
+ "ebay": {
514
+ "url": "https://your-server.com/mcp"
515
+ }
516
+ }
517
+ }
518
+ ```
519
+
520
+ **What happens automatically:**
521
+ 1. Cline fetches `/.well-known/oauth-authorization-server` to discover the auth server.
522
+ 2. It registers itself at `POST /register` (Dynamic Client Registration).
523
+ 3. Your browser opens `GET /authorize`, which redirects to eBay's login page.
524
+ 4. After you grant access, eBay redirects to `/oauth/callback`, which issues an MCP auth code and sends it back to Cline.
525
+ 5. Cline exchanges the code at `POST /token` for a session token and stores it.
526
+ 6. All subsequent `/mcp` requests are authenticated automatically.
527
+
528
+ > **`OAUTH_START_KEY` note:** If your server has `OAUTH_START_KEY` set, the `/authorize` endpoint also requires it. You can temporarily disable it for first-time client setup, or consult your server operator for the key.
529
+
530
+ ### Claude Desktop (HTTP remote with pre-obtained session token)
531
+
532
+ Claude Desktop's remote MCP support requires an explicit `Authorization` header. Complete the browser OAuth flow at `https://your-server.com/oauth/start` first to get your session token, then configure:
533
+
534
+ ```json
535
+ {
536
+ "mcpServers": {
537
+ "ebay": {
538
+ "url": "https://your-server.com/mcp",
539
+ "headers": {
540
+ "Authorization": "Bearer YOUR_SESSION_TOKEN"
541
+ }
542
+ }
543
+ }
544
+ }
545
+ ```
546
+
547
+ ### Cursor (HTTP remote with pre-obtained session token)
548
+
549
+ ```json
550
+ {
551
+ "mcpServers": {
552
+ "ebay": {
553
+ "url": "https://your-server.com/mcp",
554
+ "headers": {
555
+ "Authorization": "Bearer YOUR_SESSION_TOKEN"
556
+ }
557
+ }
558
+ }
559
+ }
560
+ ```
561
+
562
+ ### Make / Zapier / TypingMind and similar platforms
563
+
564
+ These platforms use a fixed token field. To connect:
565
+
566
+ 1. Open `https://your-server.com/oauth/start?env=production` in a browser.
567
+ 2. Complete the eBay login flow.
568
+ 3. Copy the session token from the confirmation page.
569
+ 4. Paste it as your **API Key / Bearer token** in the platform's MCP connector settings.
570
+ 5. Set the MCP endpoint URL to `https://your-server.com/mcp`.
571
+
572
+ ---
573
+
574
+ ## Configuration
575
+
576
+ ### Environment Variables
577
+
578
+ Local mode still supports the classic environment-variable model:
579
+
580
+ ```bash
581
+ EBAY_CLIENT_ID=your_client_id
582
+ EBAY_CLIENT_SECRET=your_client_secret
583
+ EBAY_ENVIRONMENT=sandbox|production
584
+ EBAY_REDIRECT_URI=your_runame
585
+ EBAY_MARKETPLACE_ID=EBAY_COUNTRY
586
+ EBAY_CONTENT_LANGUAGE=lang_COUNTRY
587
+ EBAY_USER_REFRESH_TOKEN=your_refresh_token
588
+ ```
589
+
590
+ ### OAuth Authentication
591
+
592
+ **Client Credentials:** lower-rate, application-level access.
593
+
594
+ **User Tokens:** higher-rate access for seller/member-specific operations.
595
+
596
+ For hosted mode, OAuth is handled server-side by the Render deployment.
597
+
598
+ ## Available Tools
599
+
600
+ The server provides **325+ tools** across:
601
+
602
+ - Account Management
603
+ - Inventory Management
604
+ - Order Fulfillment
605
+ - Marketing & Promotions
606
+ - Analytics
607
+ - Communication
608
+ - Metadata & Taxonomy
609
+ - Developer Tools
610
+ - Token / Auth-related helper tools
611
+
612
+ For the complete tool list, see [src/tools/definitions/](src/tools/definitions/).
613
+
614
+ ## Development
615
+
616
+ ### Prerequisites
617
+
618
+ - Node.js >= 24.0.0
619
+ - [pnpm](https://pnpm.io/) (`npm install -g pnpm`)
620
+ - eBay Developer Account
621
+
622
+ ### Quick Start for Contributors
623
+
624
+ ```bash
625
+ git clone https://github.com/mrnajiboy/ebay-mcp-remote-edition.git
626
+ cd ebay-mcp-remote-edition
627
+ pnpm install
628
+ pnpm run build
629
+ pnpm run typecheck
630
+ pnpm test
631
+ ```
632
+
633
+ ### Commands Reference
634
+
635
+ | Command | Description |
636
+ | ------------------------ | -------------------------------------------------- |
637
+ | `pnpm run build` | Compile TypeScript to JavaScript |
638
+ | `pnpm start` | Run local STDIO MCP server |
639
+ | `pnpm run start:http` | Run hosted HTTP MCP server |
640
+ | `pnpm run dev` | Run local server with hot reload |
641
+ | `pnpm run dev:http` | Run hosted HTTP server with hot reload |
642
+ | `pnpm test` | Run test suite |
643
+ | `pnpm run setup` | Interactive setup wizard |
644
+ | `pnpm run sync` | Sync specs, generate types, find missing endpoints |
645
+ | `pnpm run diagnose` | Check configuration and connectivity |
646
+ | `pnpm run check` | Run typecheck + lint + format check |
647
+ | `pnpm run fix` | Auto-fix lint and format issues |
648
+
649
+ ### About `pnpm run sync`
650
+
651
+ This command is a spec/type regeneration workflow. It is **not** an upstream git sync.
652
+
653
+ It will:
654
+
655
+ 1. Download latest OpenAPI specs from eBay
656
+ 2. Generate TypeScript types from specs
657
+ 3. Analyze implemented vs missing endpoints
658
+ 4. Produce a sync report
659
+
660
+ Run it intentionally when you want to refresh generated artifacts.
661
+
662
+ ### Manual sync workflow
663
+
664
+ This fork treats sync as a repo-side maintenance workflow, not a live server feature.
665
+
666
+ Recommended manual flow:
667
+
668
+ ```bash
669
+ pnpm install
670
+ pnpm run sync
671
+ pnpm run typecheck
672
+ pnpm run build
673
+ ```
674
+
675
+ Then review the diff, commit the generated changes you want to keep, and deploy from Git.
676
+
677
+ ## Dependency policy
678
+
679
+ This fork uses normal semver-compatible dependency ranges so fresh installs can pick up newer compatible versions automatically. The MCP SDK dependency has been bumped to a newer range so patched transitive dependencies can be resolved during install rather than requiring users to perform a manual update after cloning.
680
+
681
+ After dependency changes, validate with:
682
+
683
+ ```bash
684
+ pnpm run typecheck
685
+ pnpm run build
686
+ ```
687
+
688
+ ## Logging
689
+
690
+ The server includes Winston-based logging for easier debugging.
691
+
692
+ ### Log Levels
693
+
694
+ ```bash
695
+ EBAY_LOG_LEVEL=debug
696
+ ```
697
+
698
+ ### File Logging
699
+
700
+ ```bash
701
+ EBAY_ENABLE_FILE_LOGGING=true
702
+ ```
703
+
704
+ ## Troubleshooting
705
+
706
+ ### Hosted MCP returns 406
707
+
708
+ If your MCP test client gets `406 Not Acceptable`, include:
709
+
710
+ ```text
711
+ Accept: application/json, text/event-stream
712
+ ```
713
+
714
+ ### OAuth browser flow
715
+
716
+ In hosted mode, browser OAuth is needed for:
717
+
718
+ - first-time account connection
719
+ - re-authorization after token expiry/revocation
720
+
721
+ For Make and TypingMind, the server currently expects users to complete browser OAuth first and then paste the issued session token into the platform's token field. The server then takes over token refresh and ongoing eBay access.
722
+
723
+ Normal MCP usage should rely on the issued session token.
724
+
725
+ ### Security reminders
726
+
727
+ - Do not paste session tokens publicly
728
+ - Revoke any exposed session tokens with the admin endpoint
729
+ - Rotate exposed eBay client secrets and update your Render secret file
730
+
731
+ ## Cloudflare Access recommendation
732
+
733
+ If you want browser/admin surfaces to be private to only you:
734
+
735
+ - protect `/`
736
+ - protect `/oauth/start`
737
+ - protect `/admin/*`
738
+ - keep `/oauth/callback` reachable by eBay
739
+ - keep `/mcp` outside Cloudflare Access unless your MCP client is verified to work through Cloudflare Access
740
+ - keep `/health` reachable if Render uses it for health checks
741
+
742
+ This is the recommended way to make the hosted URL effectively private without breaking OAuth callback or MCP compatibility.
743
+
744
+ ## Resources
745
+
746
+ - [eBay Developer Portal](https://developer.ebay.com/)
747
+ - [MCP Documentation](https://modelcontextprotocol.io/)
748
+ - [OAuth Setup Guide](docs/auth/)
749
+ - [Contributing Guidelines](CONTRIBUTING.md)
750
+ - [Security Policy](SECURITY.md)
751
+ - [Changelog](CHANGELOG.md)
752
+
753
+ ## License
754
+
755
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.