ebay-mcp-remote-edition 3.1.0 → 3.1.2
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 +366 -615
- package/build/auth/multi-user-store.js +32 -6
- package/build/config/environment.js +47 -14
- package/build/server-http.js +254 -9
- 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,321 +12,205 @@ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server providi
|
|
|
11
12
|
|
|
12
13
|
</div>
|
|
13
14
|
|
|
14
|
-
----
|
|
15
|
-
|
|
16
|
-
## Fork differences
|
|
17
|
-
|
|
18
|
-
This fork of [Yosef Hayim's eBay MCP](https://github.com/YosefHayim/ebay-mcp) preserves the original local/STDIO workflow up to v1.7.5, while expanding and focusing on adding hosted multi-user support for both ephemeral and persistant remote server instances. For all intents and purposes, any changes made to the original project from that version on is completely independent of any changes made here, and may be considered a wholly separate project.
|
|
19
|
-
|
|
20
|
-
### Added in this fork
|
|
21
|
-
|
|
22
|
-
- Hosted Streamable HTTP MCP deployment mode for remote server deployment
|
|
23
|
-
- Multi-user server-side eBay OAuth for both production and sandbox
|
|
24
|
-
- Cloudflare KV / Upstash Redis-backed storage for:
|
|
25
|
-
- OAuth state
|
|
26
|
-
- user token records
|
|
27
|
-
- session records
|
|
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`
|
|
37
|
-
|
|
38
15
|
---
|
|
39
16
|
|
|
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.
|
|
17
|
+
## Overview
|
|
43
18
|
|
|
44
|
-
|
|
45
|
-
<summary><strong>Click to copy the AI setup prompt</strong></summary>
|
|
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:
|
|
46
20
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
pnpm install
|
|
54
|
-
pnpm run build
|
|
55
|
-
|
|
56
|
-
2. I need to configure it for [Claude Desktop / Cursor / Cline / Zed / Continue.dev / Windsurf / Claude Code CLI / Amazon Q] (choose one)
|
|
57
|
-
|
|
58
|
-
3. My eBay credentials are:
|
|
59
|
-
- Client ID: [YOUR_CLIENT_ID]
|
|
60
|
-
- Client Secret: [YOUR_CLIENT_SECRET]
|
|
61
|
-
- Environment: [sandbox / production]
|
|
62
|
-
- Redirect URI (RuName): [YOUR_REDIRECT_URI]
|
|
63
|
-
|
|
64
|
-
Please:
|
|
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
|
|
69
|
-
|
|
70
|
-
If I don't have eBay credentials yet, guide me through creating a developer account at https://developer.ebay.com/
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
</details>
|
|
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
|
|
74
27
|
|
|
75
28
|
---
|
|
76
29
|
|
|
77
30
|
## ⚠️ Disclaimer
|
|
78
31
|
|
|
79
|
-
**
|
|
80
|
-
|
|
81
|
-
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:
|
|
82
|
-
|
|
83
|
-
- **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.
|
|
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.
|
|
87
|
-
|
|
88
|
-
For official eBay API support, please refer to the [eBay Developer Program](https://developer.ebay.com/).
|
|
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.
|
|
89
33
|
|
|
90
34
|
---
|
|
91
35
|
|
|
92
36
|
## Table of Contents
|
|
93
37
|
|
|
94
|
-
- [
|
|
95
|
-
- [
|
|
96
|
-
- [
|
|
97
|
-
- [
|
|
98
|
-
- [
|
|
99
|
-
- [
|
|
100
|
-
- [
|
|
101
|
-
- [
|
|
102
|
-
- [
|
|
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)
|
|
103
53
|
- [Development](#development)
|
|
104
|
-
- [
|
|
54
|
+
- [Testing & validation](#testing--validation)
|
|
105
55
|
- [Troubleshooting](#troubleshooting)
|
|
106
56
|
- [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):**
|
|
159
57
|
|
|
160
|
-
|
|
161
|
-
npm install -g ebay-mcp-remote-edition
|
|
162
|
-
# or
|
|
163
|
-
pnpm add -g ebay-mcp-remote-edition
|
|
164
|
-
```
|
|
58
|
+
---
|
|
165
59
|
|
|
166
|
-
|
|
60
|
+
## Choose a runtime mode
|
|
167
61
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
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 |
|
|
171
66
|
|
|
172
|
-
|
|
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.
|
|
173
68
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
pnpm install
|
|
178
|
-
pnpm run build
|
|
179
|
-
```
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Prerequisites
|
|
180
72
|
|
|
181
|
-
|
|
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/)
|
|
182
77
|
|
|
183
|
-
|
|
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
|
|
184
82
|
|
|
185
|
-
|
|
186
|
-
For local development, the standard runtime scripts automatically load `.env`
|
|
187
|
-
through dotenvx unless a hosted environment is detected.
|
|
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).
|
|
188
84
|
|
|
189
|
-
|
|
85
|
+
### HTTPS callback URL (required by eBay)
|
|
86
|
+
|
|
87
|
+
eBay requires an HTTPS callback URL for OAuth. For local development, use [mkcert](https://github.com/FiloSottile/mkcert):
|
|
190
88
|
|
|
191
89
|
```bash
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
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
|
|
195
94
|
```
|
|
196
95
|
|
|
197
|
-
|
|
198
|
-
encrypted env files for sharing or deployment workflows.
|
|
96
|
+
Register `https://ebay-local.test:3000/oauth/callback` in the eBay Developer Portal as your Accept URL. Then add to `.env`:
|
|
199
97
|
|
|
200
|
-
|
|
98
|
+
```bash
|
|
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
|
|
102
|
+
```
|
|
201
103
|
|
|
202
|
-
|
|
203
|
-
- hosted platform (for example `RENDER=true`) → use platform-provided env vars directly
|
|
104
|
+
#### ⚠️ Trust the mkcert CA in Node.js (required for MCP clients like Cline)
|
|
204
105
|
|
|
205
|
-
|
|
106
|
+
VS Code's extension host (where Cline runs) uses Node.js for outbound HTTPS requests. Node.js does **not** automatically read macOS's system keychain, so the `ebay-local.test` certificate is not trusted by default. This causes the OAuth token exchange (`POST /sandbox/token`) to fail silently — the browser flow completes, the "Open in VS Code" page appears, but Cline never receives a session token.
|
|
206
107
|
|
|
207
|
-
|
|
108
|
+
**Fix — run these two commands once, then fully quit and reopen VS Code:**
|
|
208
109
|
|
|
209
110
|
```bash
|
|
210
|
-
|
|
111
|
+
# 1. Set for the current macOS session (affects all Dock/Spotlight-launched apps):
|
|
112
|
+
launchctl setenv NODE_EXTRA_CA_CERTS "$(mkcert -CAROOT)/rootCA.pem"
|
|
113
|
+
|
|
114
|
+
# 2. Create a LaunchAgent so it persists across reboots:
|
|
115
|
+
cat > ~/Library/LaunchAgents/com.local.mkcert-node-trust.plist <<'EOF'
|
|
116
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
117
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
118
|
+
<plist version="1.0">
|
|
119
|
+
<dict>
|
|
120
|
+
<key>Label</key><string>com.local.mkcert-node-trust</string>
|
|
121
|
+
<key>ProgramArguments</key>
|
|
122
|
+
<array>
|
|
123
|
+
<string>launchctl</string><string>setenv</string>
|
|
124
|
+
<string>NODE_EXTRA_CA_CERTS</string>
|
|
125
|
+
<string>/Users/YOUR_USERNAME/Library/Application Support/mkcert/rootCA.pem</string>
|
|
126
|
+
</array>
|
|
127
|
+
<key>RunAtLoad</key><true/>
|
|
128
|
+
</dict>
|
|
129
|
+
</plist>
|
|
130
|
+
EOF
|
|
131
|
+
launchctl load ~/Library/LaunchAgents/com.local.mkcert-node-trust.plist
|
|
132
|
+
|
|
133
|
+
# 3. For terminal-launched VS Code — add to ~/.zshrc:
|
|
134
|
+
echo 'export NODE_EXTRA_CA_CERTS="$(mkcert -CAROOT)/rootCA.pem"' >> ~/.zshrc
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
> Replace `YOUR_USERNAME` with your actual macOS username in the plist, or use the full path printed by `mkcert -CAROOT`.
|
|
138
|
+
|
|
139
|
+
After running these commands and **fully quitting VS Code (Cmd+Q on macOS)** and reopening it, Cline's extension host will trust the `ebay-local.test` certificate and the MCP OAuth flow will complete successfully.
|
|
140
|
+
|
|
141
|
+
**Verify the fix works (without restarting VS Code):**
|
|
142
|
+
```bash
|
|
143
|
+
NODE_EXTRA_CA_CERTS="$(mkcert -CAROOT)/rootCA.pem" node -e "
|
|
144
|
+
require('https').get('https://ebay-local.test:3000/health', r => console.log('TLS OK — status:', r.statusCode)).on('error', e => console.error('TLS FAIL:', e.message));
|
|
145
|
+
"
|
|
146
|
+
# Expected: TLS OK — status: 200
|
|
211
147
|
```
|
|
212
148
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
For hosted Render usage, see the next section.
|
|
149
|
+
For hosted deployments, register your server's public HTTPS URL instead (e.g. `https://your-server.com/oauth/callback`).
|
|
216
150
|
|
|
217
151
|
---
|
|
218
152
|
|
|
219
|
-
## Local
|
|
153
|
+
## Local mode setup
|
|
220
154
|
|
|
221
|
-
|
|
155
|
+
### Install
|
|
222
156
|
|
|
223
|
-
|
|
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`.
|
|
157
|
+
**Option A — npm global install (no build step):**
|
|
225
158
|
|
|
226
|
-
|
|
159
|
+
```bash
|
|
160
|
+
npm install -g ebay-mcp-remote-edition
|
|
161
|
+
```
|
|
227
162
|
|
|
228
|
-
|
|
163
|
+
**Option B — clone and build (for contributors or self-hosting):**
|
|
229
164
|
|
|
230
|
-
|
|
165
|
+
```bash
|
|
166
|
+
git clone https://github.com/mrnajiboy/ebay-mcp-remote-edition.git
|
|
167
|
+
cd ebay-mcp-remote-edition
|
|
168
|
+
pnpm install
|
|
169
|
+
pnpm run build
|
|
170
|
+
```
|
|
231
171
|
|
|
232
|
-
###
|
|
172
|
+
### Configure credentials
|
|
233
173
|
|
|
234
|
-
|
|
235
|
-
`~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json`
|
|
174
|
+
Create a `.env` file in the project root (see `.env.example`):
|
|
236
175
|
|
|
237
|
-
|
|
176
|
+
```bash
|
|
177
|
+
EBAY_CLIENT_ID=your_client_id
|
|
178
|
+
EBAY_CLIENT_SECRET=your_client_secret
|
|
179
|
+
EBAY_RUNAME=your_runame_string
|
|
180
|
+
EBAY_ENVIRONMENT=sandbox # or production
|
|
181
|
+
EBAY_MARKETPLACE_ID=EBAY_US # optional, defaults to EBAY_US
|
|
182
|
+
EBAY_CONTENT_LANGUAGE=en-US # optional, defaults to en-US
|
|
238
183
|
|
|
239
|
-
|
|
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
|
-
}
|
|
184
|
+
# Populated by the setup wizard:
|
|
185
|
+
EBAY_USER_REFRESH_TOKEN=
|
|
255
186
|
```
|
|
256
187
|
|
|
257
|
-
**
|
|
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
|
-
```
|
|
188
|
+
**Authentication tiers:**
|
|
276
189
|
|
|
277
|
-
|
|
190
|
+
| Method | Rate limit | How |
|
|
191
|
+
|--------|-----------|-----|
|
|
192
|
+
| Client credentials (default) | 1,000 req/day | Just set `EBAY_CLIENT_ID` + `EBAY_CLIENT_SECRET` |
|
|
193
|
+
| User tokens (recommended) | 10,000–50,000 req/day | Run the setup wizard to complete OAuth and populate `EBAY_USER_REFRESH_TOKEN` |
|
|
278
194
|
|
|
279
|
-
|
|
280
|
-
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
281
|
-
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
195
|
+
### Run the setup wizard
|
|
282
196
|
|
|
283
|
-
|
|
197
|
+
The interactive wizard guides you through environment selection, credential entry, OAuth login, and MCP client configuration:
|
|
284
198
|
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
"mcpServers": {
|
|
288
|
-
"ebay": {
|
|
289
|
-
"command": "npx",
|
|
290
|
-
"args": ["-y", "ebay-mcp-remote-edition"],
|
|
291
|
-
"env": {
|
|
292
|
-
"EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
|
|
293
|
-
"EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
|
|
294
|
-
"EBAY_ENVIRONMENT": "sandbox",
|
|
295
|
-
"EBAY_REDIRECT_URI": "YOUR_RUNAME",
|
|
296
|
-
"EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
199
|
+
```bash
|
|
200
|
+
pnpm run setup
|
|
301
201
|
```
|
|
302
202
|
|
|
303
|
-
|
|
203
|
+
Options:
|
|
204
|
+
- `--quick` — skip optional steps
|
|
205
|
+
- `--diagnose` — run connectivity and token checks only
|
|
304
206
|
|
|
305
|
-
|
|
306
|
-
{
|
|
307
|
-
"mcpServers": {
|
|
308
|
-
"ebay": {
|
|
309
|
-
"command": "node",
|
|
310
|
-
"args": ["/absolute/path/to/ebay-mcp-remote-edition/build/index.js"],
|
|
311
|
-
"env": {
|
|
312
|
-
"EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
|
|
313
|
-
"EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
|
|
314
|
-
"EBAY_ENVIRONMENT": "sandbox",
|
|
315
|
-
"EBAY_REDIRECT_URI": "YOUR_RUNAME",
|
|
316
|
-
"EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
```
|
|
207
|
+
After completing OAuth, the wizard writes `EBAY_USER_REFRESH_TOKEN` to `.env` and optionally configures Claude Desktop automatically.
|
|
322
208
|
|
|
323
|
-
###
|
|
209
|
+
### Local client configuration
|
|
324
210
|
|
|
325
|
-
|
|
326
|
-
Project config: `.cursor/mcp.json` (in your project root)
|
|
211
|
+
For direct STDIO usage, configure your MCP client to launch the server as a subprocess. All clients use the same JSON pattern:
|
|
327
212
|
|
|
328
|
-
**Using
|
|
213
|
+
**Using npm (no clone needed):**
|
|
329
214
|
|
|
330
215
|
```json
|
|
331
216
|
{
|
|
@@ -337,7 +222,7 @@ Project config: `.cursor/mcp.json` (in your project root)
|
|
|
337
222
|
"EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
|
|
338
223
|
"EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
|
|
339
224
|
"EBAY_ENVIRONMENT": "sandbox",
|
|
340
|
-
"
|
|
225
|
+
"EBAY_RUNAME": "YOUR_RUNAME",
|
|
341
226
|
"EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
|
|
342
227
|
}
|
|
343
228
|
}
|
|
@@ -345,7 +230,7 @@ Project config: `.cursor/mcp.json` (in your project root)
|
|
|
345
230
|
}
|
|
346
231
|
```
|
|
347
232
|
|
|
348
|
-
**Using local build:**
|
|
233
|
+
**Using a local build:**
|
|
349
234
|
|
|
350
235
|
```json
|
|
351
236
|
{
|
|
@@ -357,7 +242,7 @@ Project config: `.cursor/mcp.json` (in your project root)
|
|
|
357
242
|
"EBAY_CLIENT_ID": "YOUR_CLIENT_ID",
|
|
358
243
|
"EBAY_CLIENT_SECRET": "YOUR_CLIENT_SECRET",
|
|
359
244
|
"EBAY_ENVIRONMENT": "sandbox",
|
|
360
|
-
"
|
|
245
|
+
"EBAY_RUNAME": "YOUR_RUNAME",
|
|
361
246
|
"EBAY_USER_REFRESH_TOKEN": "YOUR_REFRESH_TOKEN"
|
|
362
247
|
}
|
|
363
248
|
}
|
|
@@ -365,80 +250,68 @@ Project config: `.cursor/mcp.json` (in your project root)
|
|
|
365
250
|
}
|
|
366
251
|
```
|
|
367
252
|
|
|
368
|
-
|
|
253
|
+
**Config file locations by client:**
|
|
369
254
|
|
|
370
|
-
|
|
255
|
+
| Client | Config file |
|
|
256
|
+
|--------|-------------|
|
|
257
|
+
| Cline | `~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json` |
|
|
258
|
+
| Claude Desktop (macOS) | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
259
|
+
| Claude Desktop (Windows) | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
260
|
+
| Cursor (global) | `~/.cursor/mcp.json` |
|
|
261
|
+
| Cursor (project) | `.cursor/mcp.json` |
|
|
371
262
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
```json
|
|
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
|
-
```
|
|
263
|
+
Zed, Windsurf, Continue.dev, Roo Code, and Amazon Q follow the same `mcpServers` JSON shape.
|
|
391
264
|
|
|
392
265
|
---
|
|
393
266
|
|
|
394
|
-
## Hosted
|
|
267
|
+
## Hosted mode setup
|
|
395
268
|
|
|
396
|
-
|
|
269
|
+
The hosted HTTP server exposes environment-scoped MCP and OAuth endpoints, handles eBay OAuth server-side, and issues session tokens to MCP clients.
|
|
270
|
+
|
|
271
|
+
### Hosted environment variables
|
|
397
272
|
|
|
398
273
|
```bash
|
|
399
|
-
|
|
400
|
-
|
|
274
|
+
# Server
|
|
275
|
+
PORT=3000
|
|
276
|
+
MCP_HOST=0.0.0.0
|
|
277
|
+
PUBLIC_BASE_URL=https://your-server.com
|
|
401
278
|
|
|
402
|
-
|
|
279
|
+
# eBay credentials (prefer secret file below instead of raw env)
|
|
280
|
+
EBAY_DEFAULT_ENVIRONMENT=production # sandbox or production
|
|
403
281
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
```
|
|
282
|
+
# Persistent token/session storage backend (required for multi-user hosted mode)
|
|
283
|
+
EBAY_TOKEN_STORE_BACKEND=cloudflare-kv # cloudflare-kv | upstash-redis | memory
|
|
407
284
|
|
|
408
|
-
|
|
285
|
+
# Cloudflare KV (when EBAY_TOKEN_STORE_BACKEND=cloudflare-kv)
|
|
286
|
+
CLOUDFLARE_ACCOUNT_ID=
|
|
287
|
+
CLOUDFLARE_KV_NAMESPACE_ID=
|
|
288
|
+
CLOUDFLARE_API_TOKEN=
|
|
409
289
|
|
|
410
|
-
|
|
290
|
+
# Upstash Redis (when EBAY_TOKEN_STORE_BACKEND=upstash-redis)
|
|
291
|
+
UPSTASH_REDIS_REST_URL=
|
|
292
|
+
UPSTASH_REDIS_REST_TOKEN=
|
|
411
293
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
NODE_VERSION=
|
|
416
|
-
PUBLIC_BASE_URL=https://your-server.com
|
|
417
|
-
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
|
-
```
|
|
294
|
+
# Security
|
|
295
|
+
ADMIN_API_KEY= # required for admin session endpoints
|
|
296
|
+
OAUTH_START_KEY= # optional; protects /oauth/start with a shared secret
|
|
432
297
|
|
|
433
|
-
|
|
298
|
+
# Session TTL (optional; default 30 days)
|
|
299
|
+
SESSION_TTL_SECONDS=2592000
|
|
434
300
|
|
|
435
|
-
|
|
301
|
+
# Logging
|
|
302
|
+
EBAY_LOG_LEVEL=info
|
|
303
|
+
EBAY_MARKETPLACE_ID=EBAY_US
|
|
304
|
+
EBAY_CONTENT_LANGUAGE=en-US
|
|
436
305
|
|
|
437
|
-
|
|
438
|
-
ebay-config.json
|
|
306
|
+
# Path to secret file (see below)
|
|
307
|
+
EBAY_CONFIG_FILE=/etc/secrets/ebay-config.json
|
|
439
308
|
```
|
|
440
309
|
|
|
441
|
-
|
|
310
|
+
> Use `EBAY_TOKEN_STORE_BACKEND=memory` only for local development or tests. All OAuth state, session tokens, and user tokens are lost on restart.
|
|
311
|
+
|
|
312
|
+
### Secret file
|
|
313
|
+
|
|
314
|
+
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
315
|
|
|
443
316
|
```json
|
|
444
317
|
{
|
|
@@ -455,144 +328,111 @@ Example contents:
|
|
|
455
328
|
}
|
|
456
329
|
```
|
|
457
330
|
|
|
458
|
-
|
|
331
|
+
### Deploy to Render
|
|
459
332
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
```
|
|
333
|
+
1. Connect your repo to Render as a **Web Service**
|
|
334
|
+
2. Set **Build command:**
|
|
335
|
+
```bash
|
|
336
|
+
pnpm install && pnpm run build
|
|
337
|
+
```
|
|
338
|
+
3. Set **Start command:**
|
|
339
|
+
```bash
|
|
340
|
+
pnpm run start:http
|
|
341
|
+
```
|
|
342
|
+
4. Add the environment variables listed above
|
|
343
|
+
5. Add the `ebay-config.json` secret file
|
|
463
344
|
|
|
464
|
-
|
|
345
|
+
The server starts on the port Render assigns via `$PORT` and logs the active KV backend on startup.
|
|
465
346
|
|
|
466
|
-
|
|
347
|
+
### OAuth flows
|
|
467
348
|
|
|
468
|
-
|
|
469
|
-
/sandbox/oauth/start # always sandbox
|
|
470
|
-
/production/oauth/start # always production
|
|
471
|
-
```
|
|
349
|
+
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
350
|
|
|
473
|
-
**
|
|
351
|
+
**Start an OAuth flow (browser):**
|
|
474
352
|
|
|
475
|
-
```text
|
|
476
|
-
/oauth/start?env=sandbox
|
|
477
|
-
/oauth/start?env=production
|
|
478
353
|
```
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
```text
|
|
483
|
-
/sandbox/oauth/start?key=YOUR_OAUTH_START_KEY
|
|
484
|
-
/production/oauth/start?key=YOUR_OAUTH_START_KEY
|
|
354
|
+
GET /sandbox/oauth/start # always sandbox
|
|
355
|
+
GET /production/oauth/start # always production
|
|
485
356
|
```
|
|
486
357
|
|
|
487
|
-
or
|
|
488
|
-
|
|
489
|
-
```text
|
|
490
|
-
X-OAuth-Start-Key: YOUR_OAUTH_START_KEY
|
|
358
|
+
If `OAUTH_START_KEY` is set, include it as a query parameter or header:
|
|
491
359
|
```
|
|
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>
|
|
360
|
+
GET /sandbox/oauth/start?key=YOUR_OAUTH_START_KEY
|
|
361
|
+
# or header: X-OAuth-Start-Key: YOUR_OAUTH_START_KEY
|
|
501
362
|
```
|
|
502
363
|
|
|
503
|
-
|
|
364
|
+
After a successful login, the callback page displays your **session token**, **eBay access token**, and **eBay refresh token** with one-click copy buttons.
|
|
504
365
|
|
|
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
|
|
366
|
+
**Session token TTL schedule:**
|
|
508
367
|
|
|
509
|
-
|
|
368
|
+
| Record | `expiresAt` field | Backend TTL |
|
|
369
|
+
|--------|-------------------|-------------|
|
|
370
|
+
| OAuth state | 15 minutes | 15 minutes |
|
|
371
|
+
| MCP auth code | 10 minutes | 10 minutes |
|
|
372
|
+
| Session | 30 days (configurable) | Matches `SESSION_TTL_SECONDS` |
|
|
373
|
+
| User token record | eBay refresh token expiry (fallback: 18 months) | Matches token expiry |
|
|
510
374
|
|
|
511
|
-
###
|
|
375
|
+
### MCP endpoints
|
|
512
376
|
|
|
513
|
-
|
|
377
|
+
**Environment-scoped (recommended):**
|
|
514
378
|
|
|
515
|
-
```text
|
|
516
|
-
X-Admin-API-Key: <ADMIN_API_KEY>
|
|
517
379
|
```
|
|
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>
|
|
380
|
+
POST/GET/DELETE /sandbox/mcp
|
|
381
|
+
POST/GET/DELETE /production/mcp
|
|
530
382
|
```
|
|
531
383
|
|
|
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
|
|
384
|
+
Each scoped path includes its own OAuth 2.1 discovery document:
|
|
539
385
|
```
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
**Legacy — auto-resolves environment from `?env=` or `EBAY_ENVIRONMENT`:**
|
|
544
|
-
|
|
545
|
-
```text
|
|
546
|
-
POST/GET/DELETE /mcp
|
|
386
|
+
GET /sandbox/.well-known/oauth-authorization-server
|
|
387
|
+
GET /production/.well-known/oauth-authorization-server
|
|
547
388
|
```
|
|
548
389
|
|
|
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
|
|
390
|
+
**Legacy auto-detect (backward-compatible):**
|
|
391
|
+
```
|
|
392
|
+
POST/GET/DELETE /mcp # resolves environment from ?env= or EBAY_DEFAULT_ENVIRONMENT
|
|
393
|
+
```
|
|
558
394
|
|
|
559
|
-
|
|
395
|
+
**Authentication behavior:**
|
|
396
|
+
- `GET /mcp` (or scoped variant) without a valid Bearer token redirects the browser to the matching `oauth/start` URL
|
|
397
|
+
- `POST /mcp` without a valid Bearer token returns a structured `401` JSON with an `authorization_url` field
|
|
398
|
+
- All requests supply a session token via `Authorization: Bearer <session-token>`
|
|
560
399
|
|
|
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
|
|
400
|
+
**Other utility endpoints:**
|
|
566
401
|
|
|
567
|
-
|
|
402
|
+
```
|
|
403
|
+
GET /health # Server health check (no auth required)
|
|
404
|
+
GET /whoami # Session identity; requires Bearer token
|
|
405
|
+
GET /admin/session/:sessionToken # View session; requires X-Admin-API-Key
|
|
406
|
+
POST /admin/session/:sessionToken/revoke # Revoke session
|
|
407
|
+
DELETE /admin/session/:sessionToken # Delete session
|
|
408
|
+
```
|
|
568
409
|
|
|
569
|
-
|
|
410
|
+
`/whoami` response:
|
|
411
|
+
```json
|
|
412
|
+
{
|
|
413
|
+
"userId": "...",
|
|
414
|
+
"environment": "sandbox",
|
|
415
|
+
"createdAt": "2026-03-23T08:00:00.000Z",
|
|
416
|
+
"expiresAt": "2026-04-22T08:00:00.000Z",
|
|
417
|
+
"lastUsedAt": "2026-03-23T09:30:00.000Z",
|
|
418
|
+
"revokedAt": null
|
|
419
|
+
}
|
|
420
|
+
```
|
|
570
421
|
|
|
571
|
-
|
|
422
|
+
### Remote client configuration
|
|
572
423
|
|
|
573
424
|
Replace `https://your-server.com` with your actual `PUBLIC_BASE_URL`.
|
|
574
425
|
|
|
575
|
-
|
|
426
|
+
#### Cline (automatic OAuth — no manual token needed)
|
|
576
427
|
|
|
577
|
-
Cline supports OAuth 2.1 discovery natively.
|
|
578
|
-
|
|
579
|
-
**Sandbox:**
|
|
428
|
+
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
429
|
|
|
581
430
|
```json
|
|
582
431
|
{
|
|
583
432
|
"mcpServers": {
|
|
584
433
|
"ebay-sandbox": {
|
|
585
434
|
"url": "https://your-server.com/sandbox/mcp"
|
|
586
|
-
}
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
```
|
|
590
|
-
|
|
591
|
-
**Production:**
|
|
592
|
-
|
|
593
|
-
```json
|
|
594
|
-
{
|
|
595
|
-
"mcpServers": {
|
|
435
|
+
},
|
|
596
436
|
"ebay-production": {
|
|
597
437
|
"url": "https://your-server.com/production/mcp"
|
|
598
438
|
}
|
|
@@ -600,53 +440,23 @@ Cline supports OAuth 2.1 discovery natively. Point it at an environment-scoped M
|
|
|
600
440
|
}
|
|
601
441
|
```
|
|
602
442
|
|
|
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
|
|
443
|
+
What Cline does automatically:
|
|
444
|
+
1. Fetches `/.well-known/oauth-authorization-server` for the scoped path
|
|
445
|
+
2. Registers at `POST /sandbox/register` (or `/production/register`)
|
|
446
|
+
3. Your browser opens `GET /sandbox/authorize`, which redirects to eBay login
|
|
447
|
+
4. After you grant access, eBay redirects to `/oauth/callback`, which issues an auth code
|
|
448
|
+
5. Cline exchanges the code at `POST /sandbox/token` for a session token and stores it
|
|
449
|
+
6. All subsequent `/sandbox/mcp` requests authenticate automatically
|
|
610
450
|
|
|
611
|
-
|
|
451
|
+
#### Claude Desktop and Cursor (Bearer token)
|
|
612
452
|
|
|
613
|
-
|
|
453
|
+
Claude Desktop and most other remote MCP clients require a pre-obtained session token. Complete the browser OAuth flow first:
|
|
614
454
|
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
**Sandbox:**
|
|
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
|
-
```
|
|
455
|
+
1. Open `https://your-server.com/sandbox/oauth/start` (or `/production/oauth/start`) in a browser
|
|
456
|
+
2. Log in with your eBay account
|
|
457
|
+
3. Copy the session token from the confirmation page
|
|
648
458
|
|
|
649
|
-
|
|
459
|
+
Then configure your client:
|
|
650
460
|
|
|
651
461
|
```json
|
|
652
462
|
{
|
|
@@ -661,228 +471,169 @@ Claude Desktop's remote MCP support requires an explicit `Authorization` header.
|
|
|
661
471
|
}
|
|
662
472
|
```
|
|
663
473
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
These platforms use a fixed token field. To connect:
|
|
474
|
+
#### Make / Zapier / TypingMind and similar platforms
|
|
667
475
|
|
|
668
|
-
1. Open `https://your-server.com/
|
|
669
|
-
2.
|
|
670
|
-
3.
|
|
671
|
-
4.
|
|
672
|
-
5. Set the MCP endpoint URL to `https://your-server.com/production/mcp` (or `/sandbox/mcp`).
|
|
476
|
+
1. Open `https://your-server.com/sandbox/oauth/start` in a browser and complete eBay login
|
|
477
|
+
2. Copy the session token from the confirmation page
|
|
478
|
+
3. Paste it as the **API Key / Bearer token** in the platform's MCP connector settings
|
|
479
|
+
4. Set the MCP endpoint URL to `https://your-server.com/sandbox/mcp`
|
|
673
480
|
|
|
674
481
|
---
|
|
675
482
|
|
|
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:
|
|
483
|
+
## Available tools
|
|
717
484
|
|
|
718
|
-
|
|
719
|
-
- `EBAY_TOKEN_STORE_BACKEND=upstash-redis` → Upstash Redis
|
|
720
|
-
|
|
721
|
-
If the selected backend is missing required credentials, the server now fails loudly at startup instead of silently appearing to use the wrong store.
|
|
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:
|
|
485
|
+
325+ tools across all eBay Sell API categories:
|
|
734
486
|
|
|
735
487
|
- Account Management
|
|
736
488
|
- Inventory Management
|
|
737
489
|
- Order Fulfillment
|
|
738
490
|
- Marketing & Promotions
|
|
739
|
-
- Analytics
|
|
740
|
-
- Communication
|
|
491
|
+
- Analytics & Reporting
|
|
492
|
+
- Communication (messages, feedback, notifications, negotiation)
|
|
741
493
|
- Metadata & Taxonomy
|
|
742
|
-
- Developer Tools
|
|
743
|
-
-
|
|
494
|
+
- Developer Tools (key management, analytics)
|
|
495
|
+
- Auth / Token helper tools
|
|
744
496
|
|
|
745
|
-
|
|
497
|
+
Full tool source: [`src/tools/definitions/`](src/tools/definitions/)
|
|
498
|
+
|
|
499
|
+
---
|
|
746
500
|
|
|
747
501
|
## Development
|
|
748
502
|
|
|
749
|
-
###
|
|
503
|
+
### Commands reference
|
|
750
504
|
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
505
|
+
| Command | Description |
|
|
506
|
+
|---------|-------------|
|
|
507
|
+
| `pnpm run build` | Compile TypeScript to JavaScript |
|
|
508
|
+
| `pnpm start` | Run local STDIO MCP server |
|
|
509
|
+
| `pnpm run start:http` | Run hosted HTTP MCP server |
|
|
510
|
+
| `pnpm run dev` | Local STDIO server with hot reload |
|
|
511
|
+
| `pnpm run dev:http` | Hosted HTTP server with hot reload |
|
|
512
|
+
| `pnpm test` | Run test suite |
|
|
513
|
+
| `pnpm run setup` | Interactive local setup wizard |
|
|
514
|
+
| `pnpm run sync` | Download latest eBay OpenAPI specs and regenerate types |
|
|
515
|
+
| `pnpm run diagnose` | Check configuration and connectivity |
|
|
516
|
+
| `pnpm run typecheck` | Run TypeScript type checking |
|
|
517
|
+
| `pnpm run check` | Typecheck + lint + format check |
|
|
518
|
+
| `pnpm run fix` | Auto-fix lint and format issues |
|
|
754
519
|
|
|
755
|
-
###
|
|
520
|
+
### `pnpm run sync`
|
|
521
|
+
|
|
522
|
+
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
523
|
|
|
757
524
|
```bash
|
|
758
|
-
|
|
759
|
-
cd ebay-mcp-remote-edition
|
|
760
|
-
pnpm install
|
|
761
|
-
pnpm run build
|
|
525
|
+
pnpm run sync
|
|
762
526
|
pnpm run typecheck
|
|
763
|
-
pnpm
|
|
527
|
+
pnpm run build
|
|
764
528
|
```
|
|
765
529
|
|
|
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 |
|
|
530
|
+
Review the diff, commit the generated changes you want to keep, and deploy.
|
|
781
531
|
|
|
782
|
-
###
|
|
532
|
+
### Local env management
|
|
783
533
|
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
It will:
|
|
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:
|
|
534
|
+
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
535
|
|
|
801
536
|
```bash
|
|
802
|
-
pnpm
|
|
803
|
-
pnpm run
|
|
804
|
-
pnpm run typecheck
|
|
805
|
-
pnpm run build
|
|
537
|
+
pnpm run env:encrypt # encrypt .env for safe sharing
|
|
538
|
+
pnpm run env:decrypt # decrypt
|
|
806
539
|
```
|
|
807
540
|
|
|
808
|
-
|
|
541
|
+
### Logging
|
|
809
542
|
|
|
810
|
-
|
|
543
|
+
```bash
|
|
544
|
+
EBAY_LOG_LEVEL=debug # error | warn | info | debug
|
|
545
|
+
EBAY_ENABLE_FILE_LOGGING=true # write logs to files
|
|
546
|
+
```
|
|
811
547
|
|
|
812
|
-
|
|
548
|
+
---
|
|
813
549
|
|
|
814
|
-
|
|
550
|
+
## Testing & validation
|
|
815
551
|
|
|
816
552
|
```bash
|
|
817
|
-
|
|
553
|
+
# Build and type check
|
|
818
554
|
pnpm run build
|
|
819
|
-
|
|
555
|
+
pnpm run typecheck
|
|
820
556
|
|
|
821
|
-
|
|
557
|
+
# Run the test suite
|
|
558
|
+
pnpm test
|
|
822
559
|
|
|
823
|
-
|
|
560
|
+
# Check connectivity and token status
|
|
561
|
+
pnpm run diagnose
|
|
824
562
|
|
|
825
|
-
|
|
563
|
+
# Verify hosted server health
|
|
564
|
+
curl https://your-server.com/health
|
|
826
565
|
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
```
|
|
566
|
+
# Verify a session token
|
|
567
|
+
curl -H "Authorization: Bearer <session-token>" https://your-server.com/whoami
|
|
830
568
|
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
569
|
+
# Test MCP endpoint returns auth challenge when no token is provided
|
|
570
|
+
curl -X POST https://your-server.com/sandbox/mcp \
|
|
571
|
+
-H "Content-Type: application/json" \
|
|
572
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
|
|
573
|
+
# → should return 401 with authorization_url
|
|
835
574
|
```
|
|
836
575
|
|
|
576
|
+
---
|
|
577
|
+
|
|
837
578
|
## Troubleshooting
|
|
838
579
|
|
|
839
580
|
### Hosted MCP returns 406
|
|
840
581
|
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
```text
|
|
582
|
+
Include the correct `Accept` header in your MCP client:
|
|
583
|
+
```
|
|
844
584
|
Accept: application/json, text/event-stream
|
|
845
585
|
```
|
|
846
586
|
|
|
847
|
-
### OAuth
|
|
587
|
+
### OAuth callback: "Invalid or expired OAuth state"
|
|
848
588
|
|
|
849
|
-
|
|
589
|
+
OAuth state records expire in 15 minutes. If you see this error, restart the browser OAuth flow.
|
|
850
590
|
|
|
851
|
-
|
|
852
|
-
- re-authorization after token expiry/revocation
|
|
591
|
+
### Token verification fails on existing refresh token
|
|
853
592
|
|
|
854
|
-
|
|
593
|
+
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:
|
|
594
|
+
```bash
|
|
595
|
+
pnpm run setup
|
|
596
|
+
```
|
|
855
597
|
|
|
856
|
-
|
|
598
|
+
In hosted mode, start a new browser OAuth flow at `/sandbox/oauth/start` or `/production/oauth/start`.
|
|
857
599
|
|
|
858
|
-
###
|
|
600
|
+
### Session token no longer works in hosted mode
|
|
859
601
|
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
-
|
|
602
|
+
Check whether the session was revoked or expired:
|
|
603
|
+
```bash
|
|
604
|
+
curl -H "Authorization: Bearer <token>" https://your-server.com/whoami
|
|
605
|
+
```
|
|
863
606
|
|
|
864
|
-
|
|
607
|
+
Revoke exposed session tokens via the admin endpoint:
|
|
608
|
+
```bash
|
|
609
|
+
curl -X POST https://your-server.com/admin/session/<token>/revoke \
|
|
610
|
+
-H "X-Admin-API-Key: YOUR_ADMIN_API_KEY"
|
|
611
|
+
```
|
|
865
612
|
|
|
866
|
-
|
|
613
|
+
### Security checklist
|
|
867
614
|
|
|
868
|
-
-
|
|
869
|
-
-
|
|
870
|
-
-
|
|
871
|
-
-
|
|
872
|
-
-
|
|
873
|
-
-
|
|
615
|
+
- Do not commit `.env` or session tokens to version control
|
|
616
|
+
- Protect `/oauth/start` and `/admin/*` with `OAUTH_START_KEY` and `ADMIN_API_KEY`
|
|
617
|
+
- Keep `/oauth/callback` publicly reachable (eBay redirects to it after login)
|
|
618
|
+
- Keep `/health` reachable if Render uses it for health checks
|
|
619
|
+
- For production-grade isolation, optionally place `/`, `/oauth/start`, and `/admin/*` behind Cloudflare Access
|
|
620
|
+
- Rotate exposed eBay client secrets and update your secret file
|
|
874
621
|
|
|
875
|
-
|
|
622
|
+
---
|
|
876
623
|
|
|
877
624
|
## Resources
|
|
878
625
|
|
|
879
626
|
- [eBay Developer Portal](https://developer.ebay.com/)
|
|
880
627
|
- [MCP Documentation](https://modelcontextprotocol.io/)
|
|
881
|
-
- [
|
|
628
|
+
- [Auth Configuration Guide](docs/auth/CONFIGURATION.md)
|
|
629
|
+
- [OAuth Quick Reference](docs/auth/OAUTH_QUICK_REFERENCE.md)
|
|
630
|
+
- [API Status](docs/API_STATUS.md)
|
|
631
|
+
- [Changelog](CHANGELOG.md)
|
|
882
632
|
- [Contributing Guidelines](CONTRIBUTING.md)
|
|
883
633
|
- [Security Policy](SECURITY.md)
|
|
884
|
-
|
|
634
|
+
|
|
635
|
+
---
|
|
885
636
|
|
|
886
637
|
## License
|
|
887
638
|
|
|
888
|
-
|
|
639
|
+
MIT — see [LICENSE](LICENSE)
|