ebay-mcp-remote-edition 3.1.0 → 3.1.1
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 +324 -618
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
# eBay MCP
|
|
1
|
+
# eBay MCP — Remote Edition
|
|
2
|
+
|
|
2
3
|
<div align="center">
|
|
3
4
|
|
|
4
|
-
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server providing AI assistants with comprehensive access to eBay's Sell APIs.
|
|
5
|
+
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server providing AI assistants with comprehensive access to eBay's Sell APIs. **325+ tools** covering inventory management, order fulfillment, marketing campaigns, analytics, developer tools, and more.
|
|
5
6
|
|
|
6
|
-
**API Coverage:** 100% (270+ unique
|
|
7
|
+
**API Coverage:** 100% of eBay Sell APIs (270+ unique endpoints)
|
|
7
8
|
|
|
8
9
|
[](https://www.npmjs.com/package/ebay-mcp-remote-edition)
|
|
9
10
|
[](https://socket.dev/npm/package/ebay-mcp-remote-edition)
|
|
@@ -11,165 +12,110 @@ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server providi
|
|
|
11
12
|
|
|
12
13
|
</div>
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
## Fork differences
|
|
15
|
+
---
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
## Overview
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
This project extends [Yosef Hayim's eBay MCP](https://github.com/YosefHayim/ebay-mcp) with a full hosted, multi-user deployment mode while keeping the original local STDIO mode intact. The key additions are:
|
|
21
20
|
|
|
22
|
-
- Hosted Streamable HTTP
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- Session-token based MCP auth:
|
|
29
|
-
- `Authorization: Bearer <session-token>`
|
|
30
|
-
- Render Secret File support for environment-specific credentials
|
|
31
|
-
- Admin session inspection/revocation endpoints
|
|
32
|
-
- `GET /whoami` endpoint for session-bound identity lookup
|
|
33
|
-
- Optional `OAUTH_START_KEY` protection for `/oauth/start`
|
|
34
|
-
- **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
|
|
35
|
-
- **Environment-scoped route trees** — `/sandbox/mcp` and `/production/mcp` hard-bind their eBay environment; no `?env=` query param needed. Matching scoped discovery, register, authorize, token, and oauth/start endpoints included. Legacy `/mcp` kept for backward compatibility
|
|
36
|
-
- **TTL-aligned session and token records** — Every stored record (`OAuthState`, `AuthCode`, `Session`, `UserToken`) now includes an `expiresAt` ISO timestamp and passes the matching TTL to the KV/Redis backend so application expiry and Redis key expiry are always in sync. Session TTL defaults to 30 days and is configurable via `SESSION_TTL_SECONDS`
|
|
21
|
+
- **Hosted Streamable HTTP mode** — deploy to Render (or any Node.js host) and serve multiple users from one instance
|
|
22
|
+
- **MCP OAuth 2.1 authorization server** — full browser-based eBay login with automatic token management; Cline and other OAuth-aware clients connect with zero manual token pasting
|
|
23
|
+
- **Environment-scoped route trees** — `/sandbox/mcp` and `/production/mcp` hard-bind their eBay environment; no query param needed
|
|
24
|
+
- **Cloudflare KV / Upstash Redis** token and session storage for persistent multi-user auth
|
|
25
|
+
- **Admin session management** — inspect, revoke, or delete sessions via authenticated endpoints
|
|
26
|
+
- **TTL-aligned records** — every stored record (OAuth state, auth code, session, user token) carries an `expiresAt` timestamp and a matching KV/Redis TTL so storage and application expiry are always in sync
|
|
37
27
|
|
|
38
28
|
---
|
|
39
29
|
|
|
40
|
-
##
|
|
41
|
-
|
|
42
|
-
> **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.
|
|
30
|
+
## ⚠️ Disclaimer
|
|
43
31
|
|
|
44
|
-
|
|
45
|
-
<summary><strong>Click to copy the AI setup prompt</strong></summary>
|
|
32
|
+
This is an open-source project provided "as is" without warranty of any kind. The authors accept **no responsibility or liability** for any damages arising from use of this software. This project is **not affiliated with, endorsed by, or sponsored by eBay Inc.** Test thoroughly in eBay's sandbox before using in production.
|
|
46
33
|
|
|
47
|
-
|
|
48
|
-
I want to set up the eBay MCP Server for my AI assistant. Please help me:
|
|
34
|
+
---
|
|
49
35
|
|
|
50
|
-
|
|
51
|
-
git clone https://github.com/mrnajiboy/ebay-mcp-remote-edition.git
|
|
52
|
-
cd ebay-mcp-remote-edition
|
|
53
|
-
pnpm install
|
|
54
|
-
pnpm run build
|
|
36
|
+
## Table of Contents
|
|
55
37
|
|
|
56
|
-
|
|
38
|
+
- [Choose a runtime mode](#choose-a-runtime-mode)
|
|
39
|
+
- [Prerequisites](#prerequisites)
|
|
40
|
+
- [Local mode setup](#local-mode-setup)
|
|
41
|
+
- [Install](#install)
|
|
42
|
+
- [Configure credentials](#configure-credentials)
|
|
43
|
+
- [Run the setup wizard](#run-the-setup-wizard)
|
|
44
|
+
- [Local client configuration](#local-client-configuration)
|
|
45
|
+
- [Hosted mode setup](#hosted-mode-setup)
|
|
46
|
+
- [Environment variables](#hosted-environment-variables)
|
|
47
|
+
- [Secret file](#secret-file)
|
|
48
|
+
- [Deploy to Render](#deploy-to-render)
|
|
49
|
+
- [OAuth flows](#oauth-flows)
|
|
50
|
+
- [MCP endpoints](#mcp-endpoints)
|
|
51
|
+
- [Remote client configuration](#remote-client-configuration)
|
|
52
|
+
- [Available tools](#available-tools)
|
|
53
|
+
- [Development](#development)
|
|
54
|
+
- [Testing & validation](#testing--validation)
|
|
55
|
+
- [Troubleshooting](#troubleshooting)
|
|
56
|
+
- [Resources](#resources)
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
- Client ID: [YOUR_CLIENT_ID]
|
|
60
|
-
- Client Secret: [YOUR_CLIENT_SECRET]
|
|
61
|
-
- Environment: [sandbox / production]
|
|
62
|
-
- Redirect URI (RuName): [YOUR_REDIRECT_URI]
|
|
58
|
+
---
|
|
63
59
|
|
|
64
|
-
|
|
65
|
-
- Create the appropriate config file for my MCP client
|
|
66
|
-
- Set up the environment variables
|
|
67
|
-
- Help me complete the OAuth flow to get a refresh token for higher rate limits
|
|
68
|
-
- Test that the connection works
|
|
60
|
+
## Choose a runtime mode
|
|
69
61
|
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
| Mode | Transport | Best for |
|
|
63
|
+
|------|-----------|----------|
|
|
64
|
+
| **Local STDIO** | stdin/stdout | Single-user local AI client (Claude Desktop, Cline, Cursor, etc.) |
|
|
65
|
+
| **Hosted HTTP** | Streamable HTTP | Multi-user server deployment; remote MCP clients |
|
|
72
66
|
|
|
73
|
-
|
|
67
|
+
Both modes use the same eBay tools. The local mode reads credentials from environment variables or a `.env` file. The hosted mode handles multi-user OAuth server-side and authenticates clients with session tokens.
|
|
74
68
|
|
|
75
69
|
---
|
|
76
70
|
|
|
77
|
-
##
|
|
71
|
+
## Prerequisites
|
|
78
72
|
|
|
79
|
-
**
|
|
73
|
+
**All modes:**
|
|
74
|
+
- Node.js ≥ 18.0.0
|
|
75
|
+
- [pnpm](https://pnpm.io/) (or npm — `npm install -g pnpm`)
|
|
76
|
+
- An [eBay Developer Account](https://developer.ebay.com/)
|
|
80
77
|
|
|
81
|
-
|
|
78
|
+
**Getting eBay credentials:**
|
|
79
|
+
1. Log in to the [eBay Developer Portal](https://developer.ebay.com/my/keys)
|
|
80
|
+
2. Create an application and copy your **App ID (Client ID)** and **Cert ID (Client Secret)**
|
|
81
|
+
3. Under **User Tokens → Add RuName**, register your OAuth callback URL and copy the generated **RuName** string
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
- **eBay API Usage:** This project is an unofficial third-party implementation and is **NOT affiliated with, endorsed by, or sponsored by eBay Inc.**
|
|
85
|
-
- **Use at Your Own Risk:** Test thoroughly in eBay's sandbox before production use.
|
|
86
|
-
- **Security:** You are responsible for securing API credentials, session tokens, and hosted endpoints.
|
|
83
|
+
> **`EBAY_RUNAME` is the RuName string eBay generates, not the callback URL itself.** It looks like `YourApp-YourApp-SBX-abcdefghi`. The callback URL is set separately (see below).
|
|
87
84
|
|
|
88
|
-
|
|
85
|
+
### HTTPS callback URL (required by eBay)
|
|
89
86
|
|
|
90
|
-
|
|
87
|
+
eBay requires an HTTPS callback URL for OAuth. For local development, use [mkcert](https://github.com/FiloSottile/mkcert):
|
|
91
88
|
|
|
92
|
-
|
|
89
|
+
```bash
|
|
90
|
+
brew install mkcert nss
|
|
91
|
+
mkcert -install
|
|
92
|
+
mkcert ebay-local.test
|
|
93
|
+
echo "127.0.0.1 ebay-local.test" | sudo tee -a /etc/hosts
|
|
94
|
+
```
|
|
93
95
|
|
|
94
|
-
-
|
|
95
|
-
- [⚠️ Disclaimer](#️-disclaimer)
|
|
96
|
-
- [Features](#features)
|
|
97
|
-
- [Quick Start](#quick-start)
|
|
98
|
-
- [Local MCP Client Configuration](#local-mcp-client-configuration)
|
|
99
|
-
- [Hosted Render Deployment](#hosted-render-deployment)
|
|
100
|
-
- [Hosted MCP Client Configuration](#hosted-mcp-client-configuration)
|
|
101
|
-
- [Configuration](#configuration)
|
|
102
|
-
- [Available Tools](#available-tools)
|
|
103
|
-
- [Development](#development)
|
|
104
|
-
- [Logging](#logging)
|
|
105
|
-
- [Troubleshooting](#troubleshooting)
|
|
106
|
-
- [Resources](#resources)
|
|
107
|
-
- [License](#license)
|
|
108
|
-
|
|
109
|
-
## Features
|
|
110
|
-
|
|
111
|
-
- **325+ eBay API Tools** - 100% coverage of eBay Sell APIs across inventory, orders, marketing, analytics, developer tools, and more
|
|
112
|
-
- **9 AI Clients Supported** - Auto-configuration for Claude Desktop, Cursor, Zed, Cline, Continue.dev, Windsurf, Roo Code, Claude Code CLI, and Amazon Q
|
|
113
|
-
- **OAuth 2.0 Support** - Full user token management with automatic refresh
|
|
114
|
-
- **Type Safety** - Built with TypeScript, Zod validation, and OpenAPI-generated types
|
|
115
|
-
- **MCP Integration** - STDIO transport for local integration and HTTP transport for hosted deployment
|
|
116
|
-
- **Smart Authentication** - Automatic fallback from user tokens to client credentials where applicable
|
|
117
|
-
- **Hosted Multi-User Mode** - Server-side OAuth + session-token auth for hosted MCP access
|
|
118
|
-
- **Well Tested** - Comprehensive typecheck/build/deploy validation
|
|
119
|
-
- **Interactive Setup Wizard** - Run `pnpm run setup` for guided local configuration
|
|
120
|
-
- **Developer Analytics** - Rate limit monitoring and signing key management
|
|
121
|
-
|
|
122
|
-
## Quick Start
|
|
123
|
-
|
|
124
|
-
### 1. Get eBay Credentials
|
|
125
|
-
|
|
126
|
-
1. Create a free [eBay Developer Account](https://developer.ebay.com/)
|
|
127
|
-
2. Generate application keys in the [Developer Portal](https://developer.ebay.com/my/keys)
|
|
128
|
-
3. Save your **Client ID** and **Client Secret**
|
|
129
|
-
4. Configure a **RuName** (Redirect URL Name) for each environment you plan to use
|
|
130
|
-
|
|
131
|
-
> **Local HTTPS callback URL (required by eBay)**
|
|
132
|
-
>
|
|
133
|
-
> eBay requires an **HTTPS** callback URL. For local development, use [mkcert](https://github.com/FiloSottile/mkcert) to create a locally-trusted certificate so your dev machine can serve HTTPS.
|
|
134
|
-
>
|
|
135
|
-
> **One-time mkcert setup (macOS):**
|
|
136
|
-
> ```bash
|
|
137
|
-
> brew install mkcert nss # nss adds Firefox trust support
|
|
138
|
-
> mkcert -install # installs local CA into system trust store
|
|
139
|
-
> mkcert ebay-local.test # creates ebay-local.test.pem + ebay-local.test-key.pem
|
|
140
|
-
> echo "127.0.0.1 ebay-local.test" | sudo tee -a /etc/hosts
|
|
141
|
-
> ```
|
|
142
|
-
>
|
|
143
|
-
> In the eBay Developer Portal, register **`https://ebay-local.test:3000/oauth/callback`** as the callback URL under **User Tokens → Add RuName**. eBay will generate a RuName string (e.g. `YourApp-YourApp-SBX-abcdefg`). Copy that RuName into `EBAY_RUNAME` (or `EBAY_SANDBOX_RUNAME` / `EBAY_PRODUCTION_RUNAME`).
|
|
144
|
-
>
|
|
145
|
-
> Then add to your `.env`:
|
|
146
|
-
> ```
|
|
147
|
-
> PUBLIC_BASE_URL=https://ebay-local.test:3000
|
|
148
|
-
> EBAY_LOCAL_TLS_CERT_PATH=/path/to/ebay-local.test.pem
|
|
149
|
-
> EBAY_LOCAL_TLS_KEY_PATH=/path/to/ebay-local.test-key.pem
|
|
150
|
-
> ```
|
|
151
|
-
>
|
|
152
|
-
> The server automatically starts an HTTPS callback listener when `PUBLIC_BASE_URL` begins with `https://`.
|
|
153
|
-
>
|
|
154
|
-
> **Note:** `EBAY_RUNAME` is an eBay-generated string (the RuName), **not** the callback URL itself. The callback URL is set via `PUBLIC_BASE_URL`. If your eBay app was previously configured only with a hosted callback URL, you will need to add the local URL as an additional RuName in the portal — eBay currently only allows one OAuth-enabled RuName per app at a time.
|
|
155
|
-
|
|
156
|
-
### 2. Install
|
|
157
|
-
|
|
158
|
-
**Option A — npm (easiest, no build step required):**
|
|
96
|
+
Register `https://ebay-local.test:3000/oauth/callback` in the eBay Developer Portal as your Accept URL. Then add to `.env`:
|
|
159
97
|
|
|
160
98
|
```bash
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
99
|
+
PUBLIC_BASE_URL=https://ebay-local.test:3000
|
|
100
|
+
EBAY_LOCAL_TLS_CERT_PATH=/path/to/ebay-local.test.pem
|
|
101
|
+
EBAY_LOCAL_TLS_KEY_PATH=/path/to/ebay-local.test-key.pem
|
|
164
102
|
```
|
|
165
103
|
|
|
166
|
-
|
|
104
|
+
For hosted deployments, register your server's public HTTPS URL instead (e.g. `https://your-server.com/oauth/callback`).
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Local mode setup
|
|
109
|
+
|
|
110
|
+
### Install
|
|
111
|
+
|
|
112
|
+
**Option A — npm global install (no build step):**
|
|
167
113
|
|
|
168
114
|
```bash
|
|
169
|
-
ebay-mcp-remote-edition
|
|
115
|
+
npm install -g ebay-mcp-remote-edition
|
|
170
116
|
```
|
|
171
117
|
|
|
172
|
-
**Option B — clone and build (for contributors or
|
|
118
|
+
**Option B — clone and build (for contributors or self-hosting):**
|
|
173
119
|
|
|
174
120
|
```bash
|
|
175
121
|
git clone https://github.com/mrnajiboy/ebay-mcp-remote-edition.git
|
|
@@ -178,109 +124,48 @@ pnpm install
|
|
|
178
124
|
pnpm run build
|
|
179
125
|
```
|
|
180
126
|
|
|
181
|
-
###
|
|
182
|
-
|
|
183
|
-
`dotenvx` is for local env workflows only.
|
|
184
|
-
|
|
185
|
-
Hosted/server platforms should provide environment variables directly.
|
|
186
|
-
For local development, the standard runtime scripts automatically load `.env`
|
|
187
|
-
through dotenvx unless a hosted environment is detected.
|
|
127
|
+
### Configure credentials
|
|
188
128
|
|
|
189
|
-
|
|
129
|
+
Create a `.env` file in the project root (see `.env.example`):
|
|
190
130
|
|
|
191
131
|
```bash
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
132
|
+
EBAY_CLIENT_ID=your_client_id
|
|
133
|
+
EBAY_CLIENT_SECRET=your_client_secret
|
|
134
|
+
EBAY_RUNAME=your_runame_string
|
|
135
|
+
EBAY_ENVIRONMENT=sandbox # or production
|
|
136
|
+
EBAY_MARKETPLACE_ID=EBAY_US # optional, defaults to EBAY_US
|
|
137
|
+
EBAY_CONTENT_LANGUAGE=en-US # optional, defaults to en-US
|
|
196
138
|
|
|
197
|
-
|
|
198
|
-
|
|
139
|
+
# Populated by the setup wizard:
|
|
140
|
+
EBAY_USER_REFRESH_TOKEN=
|
|
141
|
+
```
|
|
199
142
|
|
|
200
|
-
|
|
143
|
+
**Authentication tiers:**
|
|
201
144
|
|
|
202
|
-
|
|
203
|
-
|
|
145
|
+
| Method | Rate limit | How |
|
|
146
|
+
|--------|-----------|-----|
|
|
147
|
+
| Client credentials (default) | 1,000 req/day | Just set `EBAY_CLIENT_ID` + `EBAY_CLIENT_SECRET` |
|
|
148
|
+
| User tokens (recommended) | 10,000–50,000 req/day | Run the setup wizard to complete OAuth and populate `EBAY_USER_REFRESH_TOKEN` |
|
|
204
149
|
|
|
205
|
-
###
|
|
150
|
+
### Run the setup wizard
|
|
206
151
|
|
|
207
|
-
|
|
152
|
+
The interactive wizard guides you through environment selection, credential entry, OAuth login, and MCP client configuration:
|
|
208
153
|
|
|
209
154
|
```bash
|
|
210
155
|
pnpm run setup
|
|
211
156
|
```
|
|
212
157
|
|
|
213
|
-
|
|
158
|
+
Options:
|
|
159
|
+
- `--quick` — skip optional steps
|
|
160
|
+
- `--diagnose` — run connectivity and token checks only
|
|
214
161
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
|
-
## Local MCP Client Configuration
|
|
220
|
-
|
|
221
|
-
Two ways to configure your MCP client for local (STDIO) usage:
|
|
222
|
-
|
|
223
|
-
- **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.
|
|
224
|
-
- **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`.
|
|
225
|
-
|
|
226
|
-
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.
|
|
227
|
-
|
|
228
|
-
> **Getting your credentials:** Run `pnpm run setup` in the cloned repo — it completes the OAuth flow and writes `EBAY_USER_REFRESH_TOKEN` to `.env`.
|
|
229
|
-
|
|
230
|
-
> **`EBAY_RUNAME` is a RuName string, not a URL.** It looks like `YourApp-YourApp-SBX-abcdefg`. To obtain one, register your HTTPS callback URL in the [eBay Developer Portal](https://developer.ebay.com/my/auth) under **User Tokens → Add RuName**, then copy the generated string. See [Step 1](#1-get-ebay-credentials) for the full setup guide including mkcert local HTTPS. `EBAY_REDIRECT_URI` is still accepted as a legacy alias for `EBAY_RUNAME`.
|
|
231
|
-
|
|
232
|
-
### Cline
|
|
233
|
-
|
|
234
|
-
Config file location:
|
|
235
|
-
`~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json`
|
|
236
|
-
|
|
237
|
-
**Using npx (no clone needed):**
|
|
238
|
-
|
|
239
|
-
```json
|
|
240
|
-
{
|
|
241
|
-
"mcpServers": {
|
|
242
|
-
"ebay": {
|
|
243
|
-
"command": "npx",
|
|
244
|
-
"args": ["-y", "ebay-mcp-remote-edition"],
|
|
245
|
-
"env": {
|
|
246
|
-
"EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
|
|
247
|
-
"EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
|
|
248
|
-
"EBAY_ENVIRONMENT": "sandbox",
|
|
249
|
-
"EBAY_REDIRECT_URI": "YOUR_RUNAME",
|
|
250
|
-
"EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
**Using local build:**
|
|
258
|
-
|
|
259
|
-
```json
|
|
260
|
-
{
|
|
261
|
-
"mcpServers": {
|
|
262
|
-
"ebay": {
|
|
263
|
-
"command": "node",
|
|
264
|
-
"args": ["/absolute/path/to/ebay-mcp-remote-edition/build/index.js"],
|
|
265
|
-
"env": {
|
|
266
|
-
"EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
|
|
267
|
-
"EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
|
|
268
|
-
"EBAY_ENVIRONMENT": "sandbox",
|
|
269
|
-
"EBAY_REDIRECT_URI": "YOUR_RUNAME",
|
|
270
|
-
"EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
```
|
|
162
|
+
After completing OAuth, the wizard writes `EBAY_USER_REFRESH_TOKEN` to `.env` and optionally configures Claude Desktop automatically.
|
|
276
163
|
|
|
277
|
-
###
|
|
164
|
+
### Local client configuration
|
|
278
165
|
|
|
279
|
-
|
|
280
|
-
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
281
|
-
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
166
|
+
For direct STDIO usage, configure your MCP client to launch the server as a subprocess. All clients use the same JSON pattern:
|
|
282
167
|
|
|
283
|
-
**Using
|
|
168
|
+
**Using npm (no clone needed):**
|
|
284
169
|
|
|
285
170
|
```json
|
|
286
171
|
{
|
|
@@ -292,7 +177,7 @@ Config file location:
|
|
|
292
177
|
"EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
|
|
293
178
|
"EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
|
|
294
179
|
"EBAY_ENVIRONMENT": "sandbox",
|
|
295
|
-
"
|
|
180
|
+
"EBAY_RUNAME": "YOUR_RUNAME",
|
|
296
181
|
"EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
|
|
297
182
|
}
|
|
298
183
|
}
|
|
@@ -300,7 +185,7 @@ Config file location:
|
|
|
300
185
|
}
|
|
301
186
|
```
|
|
302
187
|
|
|
303
|
-
**Using local build:**
|
|
188
|
+
**Using a local build:**
|
|
304
189
|
|
|
305
190
|
```json
|
|
306
191
|
{
|
|
@@ -312,7 +197,7 @@ Config file location:
|
|
|
312
197
|
"EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
|
|
313
198
|
"EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
|
|
314
199
|
"EBAY_ENVIRONMENT": "sandbox",
|
|
315
|
-
"
|
|
200
|
+
"EBAY_RUNAME": "YOUR_RUNAME",
|
|
316
201
|
"EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
|
|
317
202
|
}
|
|
318
203
|
}
|
|
@@ -320,125 +205,68 @@ Config file location:
|
|
|
320
205
|
}
|
|
321
206
|
```
|
|
322
207
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
Global config: `~/.cursor/mcp.json`
|
|
326
|
-
Project config: `.cursor/mcp.json` (in your project root)
|
|
208
|
+
**Config file locations by client:**
|
|
327
209
|
|
|
328
|
-
|
|
210
|
+
| Client | Config file |
|
|
211
|
+
|--------|-------------|
|
|
212
|
+
| Cline | `~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` |
|
|
213
|
+
| Claude Desktop (macOS) | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
214
|
+
| Claude Desktop (Windows) | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
215
|
+
| Cursor (global) | `~/.cursor/mcp.json` |
|
|
216
|
+
| Cursor (project) | `.cursor/mcp.json` |
|
|
329
217
|
|
|
330
|
-
|
|
331
|
-
{
|
|
332
|
-
"mcpServers": {
|
|
333
|
-
"ebay": {
|
|
334
|
-
"command": "npx",
|
|
335
|
-
"args": ["-y", "ebay-mcp-remote-edition"],
|
|
336
|
-
"env": {
|
|
337
|
-
"EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
|
|
338
|
-
"EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
|
|
339
|
-
"EBAY_ENVIRONMENT": "sandbox",
|
|
340
|
-
"EBAY_REDIRECT_URI": "YOUR_RUNAME",
|
|
341
|
-
"EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
```
|
|
347
|
-
|
|
348
|
-
**Using local build:**
|
|
349
|
-
|
|
350
|
-
```json
|
|
351
|
-
{
|
|
352
|
-
"mcpServers": {
|
|
353
|
-
"ebay": {
|
|
354
|
-
"command": "node",
|
|
355
|
-
"args": ["/absolute/path/to/ebay-mcp-remote-edition/build/index.js"],
|
|
356
|
-
"env": {
|
|
357
|
-
"EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
|
|
358
|
-
"EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
|
|
359
|
-
"EBAY_ENVIRONMENT": "sandbox",
|
|
360
|
-
"EBAY_REDIRECT_URI": "YOUR_RUNAME",
|
|
361
|
-
"EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
```
|
|
218
|
+
Zed, Windsurf, Continue.dev, Roo Code, and Amazon Q follow the same `mcpServers` JSON shape.
|
|
367
219
|
|
|
368
|
-
|
|
220
|
+
---
|
|
369
221
|
|
|
370
|
-
|
|
222
|
+
## Hosted mode setup
|
|
371
223
|
|
|
372
|
-
|
|
224
|
+
The hosted HTTP server exposes environment-scoped MCP and OAuth endpoints, handles eBay OAuth server-side, and issues session tokens to MCP clients.
|
|
373
225
|
|
|
374
|
-
|
|
375
|
-
{
|
|
376
|
-
"mcpServers": {
|
|
377
|
-
"ebay": {
|
|
378
|
-
"command": "npx",
|
|
379
|
-
"args": ["-y", "ebay-mcp-remote-edition"],
|
|
380
|
-
"env": {
|
|
381
|
-
"EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
|
|
382
|
-
"EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
|
|
383
|
-
"EBAY_ENVIRONMENT": "sandbox",
|
|
384
|
-
"EBAY_REDIRECT_URI": "YOUR_RUNAME",
|
|
385
|
-
"EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
```
|
|
226
|
+
### Hosted environment variables
|
|
391
227
|
|
|
392
|
-
|
|
228
|
+
```bash
|
|
229
|
+
# Server
|
|
230
|
+
PORT=3000
|
|
231
|
+
MCP_HOST=0.0.0.0
|
|
232
|
+
PUBLIC_BASE_URL=https://your-server.com
|
|
393
233
|
|
|
394
|
-
|
|
234
|
+
# eBay credentials (prefer secret file below instead of raw env)
|
|
235
|
+
EBAY_DEFAULT_ENVIRONMENT=production # sandbox or production
|
|
395
236
|
|
|
396
|
-
|
|
237
|
+
# Persistent token/session storage backend (required for multi-user hosted mode)
|
|
238
|
+
EBAY_TOKEN_STORE_BACKEND=cloudflare-kv # cloudflare-kv | upstash-redis | memory
|
|
397
239
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
240
|
+
# Cloudflare KV (when EBAY_TOKEN_STORE_BACKEND=cloudflare-kv)
|
|
241
|
+
CLOUDFLARE_ACCOUNT_ID=
|
|
242
|
+
CLOUDFLARE_KV_NAMESPACE_ID=
|
|
243
|
+
CLOUDFLARE_API_TOKEN=
|
|
401
244
|
|
|
402
|
-
|
|
245
|
+
# Upstash Redis (when EBAY_TOKEN_STORE_BACKEND=upstash-redis)
|
|
246
|
+
UPSTASH_REDIS_REST_URL=
|
|
247
|
+
UPSTASH_REDIS_REST_TOKEN=
|
|
403
248
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
249
|
+
# Security
|
|
250
|
+
ADMIN_API_KEY= # required for admin session endpoints
|
|
251
|
+
OAUTH_START_KEY= # optional; protects /oauth/start with a shared secret
|
|
407
252
|
|
|
408
|
-
|
|
253
|
+
# Session TTL (optional; default 30 days)
|
|
254
|
+
SESSION_TTL_SECONDS=2592000
|
|
409
255
|
|
|
410
|
-
|
|
256
|
+
# Logging
|
|
257
|
+
EBAY_LOG_LEVEL=info
|
|
258
|
+
EBAY_MARKETPLACE_ID=EBAY_US
|
|
259
|
+
EBAY_CONTENT_LANGUAGE=en-US
|
|
411
260
|
|
|
412
|
-
|
|
413
|
-
PORT=
|
|
414
|
-
MCP_HOST=0.0.0.0
|
|
415
|
-
NODE_VERSION=
|
|
416
|
-
PUBLIC_BASE_URL=https://your-server.com
|
|
261
|
+
# Path to secret file (see below)
|
|
417
262
|
EBAY_CONFIG_FILE=/etc/secrets/ebay-config.json
|
|
418
|
-
EBAY_DEFAULT_ENVIRONMENT=sandbox|production
|
|
419
|
-
EBAY_TOKEN_STORE_BACKEND=cloudflare-kv|upstash-redis
|
|
420
|
-
CLOUDFLARE_ACCOUNT_ID=ID
|
|
421
|
-
CLOUDFLARE_KV_NAMESPACE_ID=ID
|
|
422
|
-
CLOUDFLARE_API_TOKEN=your-cloudflare-api-token
|
|
423
|
-
UPSTASH_REDIS_REST_URL=https://...upstash.io
|
|
424
|
-
UPSTASH_REDIS_REST_TOKEN=your-upstash-rest-token
|
|
425
|
-
ADMIN_API_KEY=your-admin-api-key
|
|
426
|
-
OAUTH_START_KEY=optional-shared-secret-for-oauth-start
|
|
427
|
-
SESSION_TTL_SECONDS=2592000 # optional, default 30 days (2592000 s)
|
|
428
|
-
EBAY_MARKETPLACE_ID=EBAY_COUNTRY
|
|
429
|
-
EBAY_CONTENT_LANGUAGE=lang-COUNTRY
|
|
430
|
-
EBAY_LOG_LEVEL=info
|
|
431
263
|
```
|
|
432
264
|
|
|
433
|
-
|
|
265
|
+
> Use `EBAY_TOKEN_STORE_BACKEND=memory` only for local development or tests. All OAuth state, session tokens, and user tokens are lost on restart.
|
|
434
266
|
|
|
435
|
-
|
|
267
|
+
### Secret file
|
|
436
268
|
|
|
437
|
-
|
|
438
|
-
ebay-config.json
|
|
439
|
-
```
|
|
440
|
-
|
|
441
|
-
Example contents:
|
|
269
|
+
Store eBay credentials in a mounted secret file rather than raw environment variables. On Render, create a **Secret File** named `ebay-config.json` mounted at `/etc/secrets/ebay-config.json`:
|
|
442
270
|
|
|
443
271
|
```json
|
|
444
272
|
{
|
|
@@ -455,144 +283,111 @@ Example contents:
|
|
|
455
283
|
}
|
|
456
284
|
```
|
|
457
285
|
|
|
458
|
-
|
|
286
|
+
### Deploy to Render
|
|
459
287
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
```
|
|
288
|
+
1. Connect your repo to Render as a **Web Service**
|
|
289
|
+
2. Set **Build command:**
|
|
290
|
+
```bash
|
|
291
|
+
pnpm install && pnpm run build
|
|
292
|
+
```
|
|
293
|
+
3. Set **Start command:**
|
|
294
|
+
```bash
|
|
295
|
+
pnpm run start:http
|
|
296
|
+
```
|
|
297
|
+
4. Add the environment variables listed above
|
|
298
|
+
5. Add the `ebay-config.json` secret file
|
|
463
299
|
|
|
464
|
-
|
|
300
|
+
The server starts on the port Render assigns via `$PORT` and logs the active KV backend on startup.
|
|
465
301
|
|
|
466
|
-
|
|
302
|
+
### OAuth flows
|
|
467
303
|
|
|
468
|
-
|
|
469
|
-
/sandbox/oauth/start # always sandbox
|
|
470
|
-
/production/oauth/start # always production
|
|
471
|
-
```
|
|
304
|
+
eBay requires a single registered callback URL per application. The hosted server registers `/oauth/callback` at the root and recovers the environment from the stored OAuth state record.
|
|
472
305
|
|
|
473
|
-
**
|
|
306
|
+
**Start an OAuth flow (browser):**
|
|
474
307
|
|
|
475
|
-
```text
|
|
476
|
-
/oauth/start?env=sandbox
|
|
477
|
-
/oauth/start?env=production
|
|
478
308
|
```
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
```text
|
|
483
|
-
/sandbox/oauth/start?key=YOUR_OAUTH_START_KEY
|
|
484
|
-
/production/oauth/start?key=YOUR_OAUTH_START_KEY
|
|
309
|
+
GET /sandbox/oauth/start # always sandbox
|
|
310
|
+
GET /production/oauth/start # always production
|
|
485
311
|
```
|
|
486
312
|
|
|
487
|
-
or
|
|
488
|
-
|
|
489
|
-
```text
|
|
490
|
-
X-OAuth-Start-Key: YOUR_OAUTH_START_KEY
|
|
313
|
+
If `OAUTH_START_KEY` is set, include it as a query parameter or header:
|
|
491
314
|
```
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
After successful callback, the app issues a session token and stores it in the configured persistent backend (Cloudflare KV or Upstash Redis), then displays it in a copy-friendly callback page.
|
|
496
|
-
|
|
497
|
-
Use it in your MCP client:
|
|
498
|
-
|
|
499
|
-
```text
|
|
500
|
-
Authorization: Bearer <session-token>
|
|
315
|
+
GET /sandbox/oauth/start?key=YOUR_OAUTH_START_KEY
|
|
316
|
+
# or header: X-OAuth-Start-Key: YOUR_OAUTH_START_KEY
|
|
501
317
|
```
|
|
502
318
|
|
|
503
|
-
|
|
319
|
+
After a successful login, the callback page displays your **session token**, **eBay access token**, and **eBay refresh token** with one-click copy buttons.
|
|
504
320
|
|
|
505
|
-
|
|
506
|
-
2. copy the returned session token from the callback page
|
|
507
|
-
3. paste it into the platform's API Key / Access token field
|
|
321
|
+
**Session token TTL schedule:**
|
|
508
322
|
|
|
509
|
-
|
|
323
|
+
| Record | `expiresAt` field | Backend TTL |
|
|
324
|
+
|--------|-------------------|-------------|
|
|
325
|
+
| OAuth state | 15 minutes | 15 minutes |
|
|
326
|
+
| MCP auth code | 10 minutes | 10 minutes |
|
|
327
|
+
| Session | 30 days (configurable) | Matches `SESSION_TTL_SECONDS` |
|
|
328
|
+
| User token record | eBay refresh token expiry (fallback: 18 months) | Matches token expiry |
|
|
510
329
|
|
|
511
|
-
###
|
|
330
|
+
### MCP endpoints
|
|
512
331
|
|
|
513
|
-
|
|
332
|
+
**Environment-scoped (recommended):**
|
|
514
333
|
|
|
515
|
-
```text
|
|
516
|
-
X-Admin-API-Key: <ADMIN_API_KEY>
|
|
517
334
|
```
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
- `GET /admin/session/:sessionToken`
|
|
522
|
-
- `POST /admin/session/:sessionToken/revoke`
|
|
523
|
-
- `DELETE /admin/session/:sessionToken`
|
|
524
|
-
|
|
525
|
-
### Session introspection
|
|
526
|
-
|
|
527
|
-
```text
|
|
528
|
-
GET /whoami
|
|
529
|
-
Authorization: Bearer <session-token>
|
|
335
|
+
POST/GET/DELETE /sandbox/mcp
|
|
336
|
+
POST/GET/DELETE /production/mcp
|
|
530
337
|
```
|
|
531
338
|
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
**Preferred — environment-scoped (hard-binds the eBay environment):**
|
|
535
|
-
|
|
536
|
-
```text
|
|
537
|
-
POST/GET/DELETE /sandbox/mcp # always sandbox
|
|
538
|
-
POST/GET/DELETE /production/mcp # always production
|
|
339
|
+
Each scoped path includes its own OAuth 2.1 discovery document:
|
|
539
340
|
```
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
**Legacy — auto-resolves environment from `?env=` or `EBAY_ENVIRONMENT`:**
|
|
544
|
-
|
|
545
|
-
```text
|
|
546
|
-
POST/GET/DELETE /mcp
|
|
341
|
+
GET /sandbox/.well-known/oauth-authorization-server
|
|
342
|
+
GET /production/.well-known/oauth-authorization-server
|
|
547
343
|
```
|
|
548
344
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
- Scoped paths return their hard-bound environment in every error response so the client can pre-fill the correct OAuth start URL
|
|
554
|
-
|
|
555
|
-
This means browser-driven onboarding works cleanly, while protocol clients can still receive a structured auth response.
|
|
556
|
-
|
|
557
|
-
### Privacy recommendations
|
|
345
|
+
**Legacy auto-detect (backward-compatible):**
|
|
346
|
+
```
|
|
347
|
+
POST/GET/DELETE /mcp # resolves environment from ?env= or EBAY_DEFAULT_ENVIRONMENT
|
|
348
|
+
```
|
|
558
349
|
|
|
559
|
-
|
|
350
|
+
**Authentication behavior:**
|
|
351
|
+
- `GET /mcp` (or scoped variant) without a valid Bearer token redirects the browser to the matching `oauth/start` URL
|
|
352
|
+
- `POST /mcp` without a valid Bearer token returns a structured `401` JSON with an `authorization_url` field
|
|
353
|
+
- All requests supply a session token via `Authorization: Bearer <session-token>`
|
|
560
354
|
|
|
561
|
-
|
|
562
|
-
- protect `/admin/*` with `ADMIN_API_KEY`
|
|
563
|
-
- keep `/oauth/callback` reachable by eBay
|
|
564
|
-
- optionally place `/`, `/oauth/start`, and `/admin/*` behind Cloudflare Access
|
|
565
|
-
- keep `/health` available if needed by Render health checks
|
|
355
|
+
**Other utility endpoints:**
|
|
566
356
|
|
|
567
|
-
|
|
357
|
+
```
|
|
358
|
+
GET /health # Server health check (no auth required)
|
|
359
|
+
GET /whoami # Session identity; requires Bearer token
|
|
360
|
+
GET /admin/session/:sessionToken # View session; requires X-Admin-API-Key
|
|
361
|
+
POST /admin/session/:sessionToken/revoke # Revoke session
|
|
362
|
+
DELETE /admin/session/:sessionToken # Delete session
|
|
363
|
+
```
|
|
568
364
|
|
|
569
|
-
|
|
365
|
+
`/whoami` response:
|
|
366
|
+
```json
|
|
367
|
+
{
|
|
368
|
+
"userId": "...",
|
|
369
|
+
"environment": "sandbox",
|
|
370
|
+
"createdAt": "2026-03-23T08:00:00.000Z",
|
|
371
|
+
"expiresAt": "2026-04-22T08:00:00.000Z",
|
|
372
|
+
"lastUsedAt": "2026-03-23T09:30:00.000Z",
|
|
373
|
+
"revokedAt": null
|
|
374
|
+
}
|
|
375
|
+
```
|
|
570
376
|
|
|
571
|
-
|
|
377
|
+
### Remote client configuration
|
|
572
378
|
|
|
573
379
|
Replace `https://your-server.com` with your actual `PUBLIC_BASE_URL`.
|
|
574
380
|
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
Cline supports OAuth 2.1 discovery natively. Point it at an environment-scoped MCP endpoint and it handles everything automatically — including fetching the correct discovery document, registering itself, opening the eBay browser login, and storing the session token.
|
|
381
|
+
#### Cline (automatic OAuth — no manual token needed)
|
|
578
382
|
|
|
579
|
-
|
|
383
|
+
Cline supports MCP OAuth 2.1 discovery natively. It fetches the discovery document, registers itself, opens the eBay browser login, exchanges the auth code for a session token, and stores it — all automatically.
|
|
580
384
|
|
|
581
385
|
```json
|
|
582
386
|
{
|
|
583
387
|
"mcpServers": {
|
|
584
388
|
"ebay-sandbox": {
|
|
585
389
|
"url": "https://your-server.com/sandbox/mcp"
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
```
|
|
590
|
-
|
|
591
|
-
**Production:**
|
|
592
|
-
|
|
593
|
-
```json
|
|
594
|
-
{
|
|
595
|
-
"mcpServers": {
|
|
390
|
+
},
|
|
596
391
|
"ebay-production": {
|
|
597
392
|
"url": "https://your-server.com/production/mcp"
|
|
598
393
|
}
|
|
@@ -600,53 +395,23 @@ Cline supports OAuth 2.1 discovery natively. Point it at an environment-scoped M
|
|
|
600
395
|
}
|
|
601
396
|
```
|
|
602
397
|
|
|
603
|
-
|
|
604
|
-
1.
|
|
605
|
-
2.
|
|
606
|
-
3. Your browser opens `GET /sandbox/authorize`, which redirects to eBay
|
|
607
|
-
4. After you grant access, eBay redirects to `/oauth/callback`, which issues an
|
|
608
|
-
5. Cline exchanges the code at `POST /sandbox/token` for a session token and stores it
|
|
609
|
-
6. All subsequent `/sandbox/mcp` requests
|
|
610
|
-
|
|
611
|
-
> **Legacy `?env=` URL** — If you prefer a single endpoint, `https://your-server.com/mcp` still works with environment auto-detection, but the env-scoped paths are recommended for unambiguous behaviour.
|
|
398
|
+
What Cline does automatically:
|
|
399
|
+
1. Fetches `/.well-known/oauth-authorization-server` for the scoped path
|
|
400
|
+
2. Registers at `POST /sandbox/register` (or `/production/register`)
|
|
401
|
+
3. Your browser opens `GET /sandbox/authorize`, which redirects to eBay login
|
|
402
|
+
4. After you grant access, eBay redirects to `/oauth/callback`, which issues an auth code
|
|
403
|
+
5. Cline exchanges the code at `POST /sandbox/token` for a session token and stores it
|
|
404
|
+
6. All subsequent `/sandbox/mcp` requests authenticate automatically
|
|
612
405
|
|
|
613
|
-
|
|
406
|
+
#### Claude Desktop and Cursor (Bearer token)
|
|
614
407
|
|
|
615
|
-
|
|
408
|
+
Claude Desktop and most other remote MCP clients require a pre-obtained session token. Complete the browser OAuth flow first:
|
|
616
409
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
```json
|
|
622
|
-
{
|
|
623
|
-
"mcpServers": {
|
|
624
|
-
"ebay-sandbox": {
|
|
625
|
-
"url": "https://your-server.com/sandbox/mcp",
|
|
626
|
-
"headers": {
|
|
627
|
-
"Authorization": "Bearer YOUR_SESSION_TOKEN"
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
```
|
|
633
|
-
|
|
634
|
-
**Production:**
|
|
635
|
-
|
|
636
|
-
```json
|
|
637
|
-
{
|
|
638
|
-
"mcpServers": {
|
|
639
|
-
"ebay-production": {
|
|
640
|
-
"url": "https://your-server.com/production/mcp",
|
|
641
|
-
"headers": {
|
|
642
|
-
"Authorization": "Bearer YOUR_SESSION_TOKEN"
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
}
|
|
647
|
-
```
|
|
410
|
+
1. Open `https://your-server.com/sandbox/oauth/start` (or `/production/oauth/start`) in a browser
|
|
411
|
+
2. Log in with your eBay account
|
|
412
|
+
3. Copy the session token from the confirmation page
|
|
648
413
|
|
|
649
|
-
|
|
414
|
+
Then configure your client:
|
|
650
415
|
|
|
651
416
|
```json
|
|
652
417
|
{
|
|
@@ -661,228 +426,169 @@ Claude Desktop's remote MCP support requires an explicit `Authorization` header.
|
|
|
661
426
|
}
|
|
662
427
|
```
|
|
663
428
|
|
|
664
|
-
|
|
429
|
+
#### Make / Zapier / TypingMind and similar platforms
|
|
665
430
|
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
3. Copy the session token from the confirmation page.
|
|
671
|
-
4. Paste it as your **API Key / Bearer token** in the platform's MCP connector settings.
|
|
672
|
-
5. Set the MCP endpoint URL to `https://your-server.com/production/mcp` (or `/sandbox/mcp`).
|
|
431
|
+
1. Open `https://your-server.com/sandbox/oauth/start` in a browser and complete eBay login
|
|
432
|
+
2. Copy the session token from the confirmation page
|
|
433
|
+
3. Paste it as the **API Key / Bearer token** in the platform's MCP connector settings
|
|
434
|
+
4. Set the MCP endpoint URL to `https://your-server.com/sandbox/mcp`
|
|
673
435
|
|
|
674
436
|
---
|
|
675
437
|
|
|
676
|
-
##
|
|
677
|
-
|
|
678
|
-
### Environment Variables
|
|
679
|
-
|
|
680
|
-
Local mode still supports the classic environment-variable model:
|
|
681
|
-
|
|
682
|
-
```bash
|
|
683
|
-
EBAY_CLIENT_ID=your_client_id
|
|
684
|
-
EBAY_CLIENT_SECRET=your_client_secret
|
|
685
|
-
EBAY_ENVIRONMENT=sandbox|production
|
|
686
|
-
EBAY_REDIRECT_URI=your_runame
|
|
687
|
-
EBAY_MARKETPLACE_ID=EBAY_COUNTRY
|
|
688
|
-
EBAY_CONTENT_LANGUAGE=lang_COUNTRY
|
|
689
|
-
EBAY_USER_REFRESH_TOKEN=your_refresh_token
|
|
690
|
-
```
|
|
691
|
-
|
|
692
|
-
Other supported env vars used by the current runtime:
|
|
693
|
-
|
|
694
|
-
```bash
|
|
695
|
-
MCP_HOST=0.0.0.0 # optional HTTP bind host
|
|
696
|
-
EBAY_TOKEN_STORE_PATH=.ebay-user-tokens.json # legacy single-user file token store path
|
|
697
|
-
SESSION_TTL_SECONDS=2592000 # hosted mode: session token TTL (default 30 days)
|
|
698
|
-
```
|
|
699
|
-
|
|
700
|
-
Notes:
|
|
701
|
-
- `EBAY_TOKEN_STORE_PATH` is part of the older local file-token-store path and is **not** used by the hosted multi-user KV/Redis auth flow.
|
|
702
|
-
|
|
703
|
-
Token env vars such as `EBAY_USER_REFRESH_TOKEN`, `EBAY_USER_ACCESS_TOKEN`, and `EBAY_APP_ACCESS_TOKEN`
|
|
704
|
-
should be treated as local single-user inputs or explicit manual override flows.
|
|
705
|
-
In hosted multi-user mode, OAuth state, user tokens, and session tokens are persisted in the configured
|
|
706
|
-
remote store (Cloudflare KV or Upstash Redis), not in environment variables.
|
|
707
|
-
|
|
708
|
-
For multi-user local or hosted deployments, use a persistent auth store:
|
|
709
|
-
|
|
710
|
-
- `EBAY_TOKEN_STORE_BACKEND=cloudflare-kv`, or
|
|
711
|
-
- `EBAY_TOKEN_STORE_BACKEND=upstash-redis`
|
|
712
|
-
|
|
713
|
-
Use `memory` only for tests or throwaway dev sessions, since all OAuth state,
|
|
714
|
-
user tokens, and session tokens are lost on restart.
|
|
715
|
-
|
|
716
|
-
Backend selection is driven by `EBAY_TOKEN_STORE_BACKEND` explicitly. Credentials alone do not select the backend:
|
|
717
|
-
|
|
718
|
-
- `EBAY_TOKEN_STORE_BACKEND=cloudflare-kv` → Cloudflare KV
|
|
719
|
-
- `EBAY_TOKEN_STORE_BACKEND=upstash-redis` → Upstash Redis
|
|
438
|
+
## Available tools
|
|
720
439
|
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
### OAuth Authentication
|
|
724
|
-
|
|
725
|
-
**Client Credentials:** lower-rate, application-level access.
|
|
726
|
-
|
|
727
|
-
**User Tokens:** higher-rate access for seller/member-specific operations.
|
|
728
|
-
|
|
729
|
-
For hosted mode, OAuth is handled server-side by the Render deployment.
|
|
730
|
-
|
|
731
|
-
## Available Tools
|
|
732
|
-
|
|
733
|
-
The server provides **325+ tools** across:
|
|
440
|
+
325+ tools across all eBay Sell API categories:
|
|
734
441
|
|
|
735
442
|
- Account Management
|
|
736
443
|
- Inventory Management
|
|
737
444
|
- Order Fulfillment
|
|
738
445
|
- Marketing & Promotions
|
|
739
|
-
- Analytics
|
|
740
|
-
- Communication
|
|
446
|
+
- Analytics & Reporting
|
|
447
|
+
- Communication (messages, feedback, notifications, negotiation)
|
|
741
448
|
- Metadata & Taxonomy
|
|
742
|
-
- Developer Tools
|
|
743
|
-
-
|
|
449
|
+
- Developer Tools (key management, analytics)
|
|
450
|
+
- Auth / Token helper tools
|
|
451
|
+
|
|
452
|
+
Full tool source: [`src/tools/definitions/`](src/tools/definitions/)
|
|
744
453
|
|
|
745
|
-
|
|
454
|
+
---
|
|
746
455
|
|
|
747
456
|
## Development
|
|
748
457
|
|
|
749
|
-
###
|
|
458
|
+
### Commands reference
|
|
459
|
+
|
|
460
|
+
| Command | Description |
|
|
461
|
+
|---------|-------------|
|
|
462
|
+
| `pnpm run build` | Compile TypeScript to JavaScript |
|
|
463
|
+
| `pnpm start` | Run local STDIO MCP server |
|
|
464
|
+
| `pnpm run start:http` | Run hosted HTTP MCP server |
|
|
465
|
+
| `pnpm run dev` | Local STDIO server with hot reload |
|
|
466
|
+
| `pnpm run dev:http` | Hosted HTTP server with hot reload |
|
|
467
|
+
| `pnpm test` | Run test suite |
|
|
468
|
+
| `pnpm run setup` | Interactive local setup wizard |
|
|
469
|
+
| `pnpm run sync` | Download latest eBay OpenAPI specs and regenerate types |
|
|
470
|
+
| `pnpm run diagnose` | Check configuration and connectivity |
|
|
471
|
+
| `pnpm run typecheck` | Run TypeScript type checking |
|
|
472
|
+
| `pnpm run check` | Typecheck + lint + format check |
|
|
473
|
+
| `pnpm run fix` | Auto-fix lint and format issues |
|
|
750
474
|
|
|
751
|
-
|
|
752
|
-
- [pnpm](https://pnpm.io/) (`npm install -g pnpm`)
|
|
753
|
-
- eBay Developer Account
|
|
475
|
+
### `pnpm run sync`
|
|
754
476
|
|
|
755
|
-
|
|
477
|
+
Downloads the latest eBay OpenAPI specs, regenerates TypeScript types, and reports implemented vs missing endpoints. Run this when you want to pick up new eBay API surface:
|
|
756
478
|
|
|
757
479
|
```bash
|
|
758
|
-
|
|
759
|
-
cd ebay-mcp-remote-edition
|
|
760
|
-
pnpm install
|
|
761
|
-
pnpm run build
|
|
480
|
+
pnpm run sync
|
|
762
481
|
pnpm run typecheck
|
|
763
|
-
pnpm
|
|
482
|
+
pnpm run build
|
|
764
483
|
```
|
|
765
484
|
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
| Command | Description |
|
|
769
|
-
| ------------------------ | -------------------------------------------------- |
|
|
770
|
-
| `pnpm run build` | Compile TypeScript to JavaScript |
|
|
771
|
-
| `pnpm start` | Run local STDIO MCP server |
|
|
772
|
-
| `pnpm run start:http` | Run hosted HTTP MCP server |
|
|
773
|
-
| `pnpm run dev` | Run local server with hot reload |
|
|
774
|
-
| `pnpm run dev:http` | Run hosted HTTP server with hot reload |
|
|
775
|
-
| `pnpm test` | Run test suite |
|
|
776
|
-
| `pnpm run setup` | Interactive setup wizard |
|
|
777
|
-
| `pnpm run sync` | Sync specs, generate types, find missing endpoints |
|
|
778
|
-
| `pnpm run diagnose` | Check configuration and connectivity |
|
|
779
|
-
| `pnpm run check` | Run typecheck + lint + format check |
|
|
780
|
-
| `pnpm run fix` | Auto-fix lint and format issues |
|
|
781
|
-
|
|
782
|
-
### About `pnpm run sync`
|
|
485
|
+
Review the diff, commit the generated changes you want to keep, and deploy.
|
|
783
486
|
|
|
784
|
-
|
|
487
|
+
### Local env management
|
|
785
488
|
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
1. Download latest OpenAPI specs from eBay
|
|
789
|
-
2. Generate TypeScript types from specs
|
|
790
|
-
3. Analyze implemented vs missing endpoints
|
|
791
|
-
4. Produce a sync report
|
|
792
|
-
|
|
793
|
-
Run it intentionally when you want to refresh generated artifacts.
|
|
794
|
-
|
|
795
|
-
### Manual sync workflow
|
|
796
|
-
|
|
797
|
-
This fork treats sync as a repo-side maintenance workflow, not a live server feature.
|
|
798
|
-
|
|
799
|
-
Recommended manual flow:
|
|
489
|
+
For local development, standard runtime scripts automatically load `.env` via dotenvx. Hosted platforms should provide environment variables directly — the server detects hosted environments (e.g. `RENDER=true`) and skips local file loading.
|
|
800
490
|
|
|
801
491
|
```bash
|
|
802
|
-
pnpm
|
|
803
|
-
pnpm run
|
|
804
|
-
pnpm run typecheck
|
|
805
|
-
pnpm run build
|
|
492
|
+
pnpm run env:encrypt # encrypt .env for safe sharing
|
|
493
|
+
pnpm run env:decrypt # decrypt
|
|
806
494
|
```
|
|
807
495
|
|
|
808
|
-
|
|
496
|
+
### Logging
|
|
809
497
|
|
|
810
|
-
|
|
498
|
+
```bash
|
|
499
|
+
EBAY_LOG_LEVEL=debug # error | warn | info | debug
|
|
500
|
+
EBAY_ENABLE_FILE_LOGGING=true # write logs to files
|
|
501
|
+
```
|
|
811
502
|
|
|
812
|
-
|
|
503
|
+
---
|
|
813
504
|
|
|
814
|
-
|
|
505
|
+
## Testing & validation
|
|
815
506
|
|
|
816
507
|
```bash
|
|
817
|
-
|
|
508
|
+
# Build and type check
|
|
818
509
|
pnpm run build
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
## Logging
|
|
510
|
+
pnpm run typecheck
|
|
822
511
|
|
|
823
|
-
|
|
512
|
+
# Run the test suite
|
|
513
|
+
pnpm test
|
|
824
514
|
|
|
825
|
-
|
|
515
|
+
# Check connectivity and token status
|
|
516
|
+
pnpm run diagnose
|
|
826
517
|
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
```
|
|
518
|
+
# Verify hosted server health
|
|
519
|
+
curl https://your-server.com/health
|
|
830
520
|
|
|
831
|
-
|
|
521
|
+
# Verify a session token
|
|
522
|
+
curl -H "Authorization: Bearer <session-token>" https://your-server.com/whoami
|
|
832
523
|
|
|
833
|
-
|
|
834
|
-
|
|
524
|
+
# Test MCP endpoint returns auth challenge when no token is provided
|
|
525
|
+
curl -X POST https://your-server.com/sandbox/mcp \
|
|
526
|
+
-H "Content-Type: application/json" \
|
|
527
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
|
|
528
|
+
# → should return 401 with authorization_url
|
|
835
529
|
```
|
|
836
530
|
|
|
531
|
+
---
|
|
532
|
+
|
|
837
533
|
## Troubleshooting
|
|
838
534
|
|
|
839
535
|
### Hosted MCP returns 406
|
|
840
536
|
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
```text
|
|
537
|
+
Include the correct `Accept` header in your MCP client:
|
|
538
|
+
```
|
|
844
539
|
Accept: application/json, text/event-stream
|
|
845
540
|
```
|
|
846
541
|
|
|
847
|
-
### OAuth
|
|
542
|
+
### OAuth callback: "Invalid or expired OAuth state"
|
|
848
543
|
|
|
849
|
-
|
|
544
|
+
OAuth state records expire in 15 minutes. If you see this error, restart the browser OAuth flow.
|
|
850
545
|
|
|
851
|
-
|
|
852
|
-
- re-authorization after token expiry/revocation
|
|
546
|
+
### Token verification fails on existing refresh token
|
|
853
547
|
|
|
854
|
-
|
|
548
|
+
Refresh tokens expire after ~18 months or can be revoked by eBay (password changes, etc.). Run the setup wizard again to obtain a new one:
|
|
549
|
+
```bash
|
|
550
|
+
pnpm run setup
|
|
551
|
+
```
|
|
855
552
|
|
|
856
|
-
|
|
553
|
+
In hosted mode, start a new browser OAuth flow at `/sandbox/oauth/start` or `/production/oauth/start`.
|
|
857
554
|
|
|
858
|
-
###
|
|
555
|
+
### Session token no longer works in hosted mode
|
|
859
556
|
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
-
|
|
557
|
+
Check whether the session was revoked or expired:
|
|
558
|
+
```bash
|
|
559
|
+
curl -H "Authorization: Bearer <token>" https://your-server.com/whoami
|
|
560
|
+
```
|
|
863
561
|
|
|
864
|
-
|
|
562
|
+
Revoke exposed session tokens via the admin endpoint:
|
|
563
|
+
```bash
|
|
564
|
+
curl -X POST https://your-server.com/admin/session/<token>/revoke \
|
|
565
|
+
-H "X-Admin-API-Key: YOUR_ADMIN_API_KEY"
|
|
566
|
+
```
|
|
865
567
|
|
|
866
|
-
|
|
568
|
+
### Security checklist
|
|
867
569
|
|
|
868
|
-
-
|
|
869
|
-
-
|
|
870
|
-
-
|
|
871
|
-
-
|
|
872
|
-
-
|
|
873
|
-
-
|
|
570
|
+
- Do not commit `.env` or session tokens to version control
|
|
571
|
+
- Protect `/oauth/start` and `/admin/*` with `OAUTH_START_KEY` and `ADMIN_API_KEY`
|
|
572
|
+
- Keep `/oauth/callback` publicly reachable (eBay redirects to it after login)
|
|
573
|
+
- Keep `/health` reachable if Render uses it for health checks
|
|
574
|
+
- For production-grade isolation, optionally place `/`, `/oauth/start`, and `/admin/*` behind Cloudflare Access
|
|
575
|
+
- Rotate exposed eBay client secrets and update your secret file
|
|
874
576
|
|
|
875
|
-
|
|
577
|
+
---
|
|
876
578
|
|
|
877
579
|
## Resources
|
|
878
580
|
|
|
879
581
|
- [eBay Developer Portal](https://developer.ebay.com/)
|
|
880
582
|
- [MCP Documentation](https://modelcontextprotocol.io/)
|
|
881
|
-
- [
|
|
583
|
+
- [Auth Configuration Guide](docs/auth/CONFIGURATION.md)
|
|
584
|
+
- [OAuth Quick Reference](docs/auth/OAUTH_QUICK_REFERENCE.md)
|
|
585
|
+
- [API Status](docs/API_STATUS.md)
|
|
586
|
+
- [Changelog](CHANGELOG.md)
|
|
882
587
|
- [Contributing Guidelines](CONTRIBUTING.md)
|
|
883
588
|
- [Security Policy](SECURITY.md)
|
|
884
|
-
|
|
589
|
+
|
|
590
|
+
---
|
|
885
591
|
|
|
886
592
|
## License
|
|
887
593
|
|
|
888
|
-
|
|
594
|
+
MIT — see [LICENSE](LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ebay-mcp-remote-edition",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Remote + Local MCP server for eBay APIs - provides access to eBay developer functionality through MCP (Model Context Protocol)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|