ebay-mcp 1.4.5 → 1.4.6
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/LICENSE +21 -201
- package/README.md +33 -3
- package/build/auth/oauth.js +6 -8
- package/build/tools/definitions/token-management.js +46 -1
- package/build/tools/index.js +30 -0
- package/package.json +115 -115
package/LICENSE
CHANGED
|
@@ -1,201 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright [2025] [Yosef hayim Sabag]
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Yosef Hayim Sabag
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# eBay API MCP Server
|
|
2
|
-
|
|
3
2
|
<div align="center">
|
|
4
3
|
|
|
5
4
|
[](https://www.npmjs.com/package/ebay-mcp)
|
|
@@ -7,6 +6,9 @@
|
|
|
7
6
|
[](tests/)
|
|
8
7
|
[](LICENSE)
|
|
9
8
|
|
|
9
|
+
[](https://mseep.ai/app/yosefhayim-ebay-api-mcp-server)
|
|
10
|
+
<a href="https://www.buymeacoffee.com/yosefhayim" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
|
|
11
|
+
|
|
10
12
|
A [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server providing AI assistants with comprehensive access to eBay's Sell APIs. Includes 230+ tools for inventory management, order fulfillment, marketing campaigns, analytics, and more.
|
|
11
13
|
|
|
12
14
|
**API Coverage:** 99.1% (~110 of 111 eBay Sell API endpoints)
|
|
@@ -30,9 +32,10 @@ This is an **open-source project** provided "as is" without warranty of any kind
|
|
|
30
32
|
- Any other direct or indirect damages
|
|
31
33
|
|
|
32
34
|
- **eBay API Usage:** This project is an unofficial third-party implementation and is **NOT affiliated with, endorsed by, or sponsored by eBay Inc.** You are solely responsible for:
|
|
33
|
-
- Complying with [eBay's API Terms of Use](https://developer.ebay.com/join/
|
|
35
|
+
- Complying with [eBay's API Terms of Use](https://developer.ebay.com/join/api-license-agreement)
|
|
34
36
|
- Ensuring your usage stays within eBay's rate limits and policies
|
|
35
37
|
- Managing your eBay Developer credentials securely
|
|
38
|
+
- Understanding and complying with [eBay's data handling requirements](https://developer.ebay.com/api-docs/static/data-handling-update.html)
|
|
36
39
|
- Any actions performed through the API
|
|
37
40
|
|
|
38
41
|
- **Use at Your Own Risk:** This software is provided for educational and development purposes. Users must:
|
|
@@ -126,6 +129,7 @@ Add this server to your MCP client configuration:
|
|
|
126
129
|
**Claude Desktop:**
|
|
127
130
|
|
|
128
131
|
Edit your Claude Desktop config file:
|
|
132
|
+
|
|
129
133
|
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
130
134
|
- Windows: `%APPDATA%/Claude/claude_desktop_config.json`
|
|
131
135
|
- Linux: `~/.config/Claude/claude_desktop_config.json`
|
|
@@ -175,6 +179,8 @@ Restart your MCP client (Claude Desktop, etc.) and start using eBay tools throug
|
|
|
175
179
|
|
|
176
180
|
## Configuration
|
|
177
181
|
|
|
182
|
+
> 📖 **For a comprehensive configuration guide with detailed explanations of all environment variables, OAuth flow steps, and troubleshooting, see [Configuration Documentation](docs/auth/CONFIGURATION.md).**
|
|
183
|
+
|
|
178
184
|
### Environment Variables
|
|
179
185
|
|
|
180
186
|
Create a `.env` file with your eBay credentials:
|
|
@@ -192,28 +198,32 @@ EBAY_USER_REFRESH_TOKEN=your_refresh_token
|
|
|
192
198
|
### OAuth Authentication
|
|
193
199
|
|
|
194
200
|
**Client Credentials (Automatic):**
|
|
201
|
+
|
|
195
202
|
- Default authentication method
|
|
196
203
|
- 1,000 requests/day
|
|
197
204
|
- No setup required beyond client ID and secret
|
|
198
205
|
|
|
199
206
|
**User Tokens (Recommended for Production):**
|
|
207
|
+
|
|
200
208
|
- 10,000-50,000 requests/day
|
|
201
209
|
- Use `ebay_get_oauth_url` tool to generate authorization URL
|
|
202
210
|
- Add `EBAY_USER_REFRESH_TOKEN` to `.env` after OAuth flow
|
|
203
211
|
- Tokens refresh automatically
|
|
204
212
|
|
|
205
|
-
For detailed OAuth setup, see the [
|
|
213
|
+
For detailed OAuth setup and comprehensive configuration guide, see the [Configuration Documentation](docs/auth/CONFIGURATION.md).
|
|
206
214
|
|
|
207
215
|
### MCP Client Compatibility
|
|
208
216
|
|
|
209
217
|
This server is compatible with any MCP client that supports STDIO transport:
|
|
210
218
|
|
|
211
219
|
**Tested and Supported:**
|
|
220
|
+
|
|
212
221
|
- ✅ **Claude Desktop** (macOS, Windows, Linux) - Full support
|
|
213
222
|
- ✅ **MCP Inspector** - For development and testing
|
|
214
223
|
- ✅ **Custom MCP Clients** - Via STDIO or HTTP transport
|
|
215
224
|
|
|
216
225
|
**Configuration Requirements:**
|
|
226
|
+
|
|
217
227
|
- MCP Protocol version: 1.0+
|
|
218
228
|
- Transport: STDIO (default) or HTTP
|
|
219
229
|
- Node.js runtime: 18.0.0 or higher
|
|
@@ -221,6 +231,7 @@ This server is compatible with any MCP client that supports STDIO transport:
|
|
|
221
231
|
**Other MCP Clients:**
|
|
222
232
|
|
|
223
233
|
While not specifically tested, the server should work with any MCP-compliant client including:
|
|
234
|
+
|
|
224
235
|
- Continue.dev
|
|
225
236
|
- Other editors with MCP support
|
|
226
237
|
- Custom implementations
|
|
@@ -232,21 +243,25 @@ If you successfully use this server with another MCP client, please let us know
|
|
|
232
243
|
Understanding eBay API rate limits is crucial for production use:
|
|
233
244
|
|
|
234
245
|
**Client Credentials (Default):**
|
|
246
|
+
|
|
235
247
|
- **Daily Limit:** 1,000 requests per day
|
|
236
248
|
- **Best For:** Development, testing, low-volume operations
|
|
237
249
|
- **Setup:** Automatic with just Client ID and Secret
|
|
238
250
|
|
|
239
251
|
**User Token (Recommended):**
|
|
252
|
+
|
|
240
253
|
- **Daily Limit:** 10,000-50,000 requests per day (varies by account type)
|
|
241
254
|
- **Best For:** Production, high-volume operations
|
|
242
255
|
- **Setup:** Requires OAuth flow (use `ebay_get_oauth_url` tool)
|
|
243
256
|
|
|
244
257
|
**Rate Limit Tiers by Account Type:**
|
|
258
|
+
|
|
245
259
|
- Individual Developer: 10,000 requests/day
|
|
246
260
|
- Commercial Developer: 25,000 requests/day
|
|
247
261
|
- Enterprise: 50,000+ requests/day (custom limits)
|
|
248
262
|
|
|
249
263
|
**Rate Limit Best Practices:**
|
|
264
|
+
|
|
250
265
|
1. Use user tokens for production workloads
|
|
251
266
|
2. Implement exponential backoff on rate limit errors
|
|
252
267
|
3. Cache responses when possible
|
|
@@ -257,6 +272,7 @@ Understanding eBay API rate limits is crucial for production use:
|
|
|
257
272
|
**Handling Rate Limits:**
|
|
258
273
|
|
|
259
274
|
When you hit a rate limit, the API returns a 429 status code. The server will:
|
|
275
|
+
|
|
260
276
|
- Automatically retry with exponential backoff
|
|
261
277
|
- Inform you of rate limit errors
|
|
262
278
|
- Suggest upgrading to user token authentication
|
|
@@ -279,6 +295,7 @@ The server provides 230+ tools organized into the following categories:
|
|
|
279
295
|
- **Token Management** - OAuth URL generation, token management
|
|
280
296
|
|
|
281
297
|
**Example Tools:**
|
|
298
|
+
|
|
282
299
|
- `ebay_get_inventory_items` - List all inventory items
|
|
283
300
|
- `ebay_get_orders` - Retrieve seller orders
|
|
284
301
|
- `ebay_create_offer` - Create new listing offer
|
|
@@ -402,6 +419,7 @@ docker-compose up -d
|
|
|
402
419
|
Environment variables should be configured in `.env` file before running Docker commands. The container will automatically use your `.env` configuration.
|
|
403
420
|
|
|
404
421
|
**Use Cases for Docker:**
|
|
422
|
+
|
|
405
423
|
- Production deployments
|
|
406
424
|
- Consistent development environments
|
|
407
425
|
- CI/CD pipelines
|
|
@@ -420,6 +438,7 @@ npm run start:http
|
|
|
420
438
|
```
|
|
421
439
|
|
|
422
440
|
**HTTP Mode Features:**
|
|
441
|
+
|
|
423
442
|
- RESTful API endpoints for all tools
|
|
424
443
|
- Interactive API documentation
|
|
425
444
|
- Useful for testing tools without an MCP client
|
|
@@ -427,6 +446,7 @@ npm run start:http
|
|
|
427
446
|
- Helmet security headers
|
|
428
447
|
|
|
429
448
|
**When to Use HTTP Mode:**
|
|
449
|
+
|
|
430
450
|
- Testing individual tools during development
|
|
431
451
|
- Building custom integrations
|
|
432
452
|
- Debugging API responses
|
|
@@ -464,6 +484,7 @@ Contributions are welcome! Here's how to get started:
|
|
|
464
484
|
6. Push to your fork and open a Pull Request
|
|
465
485
|
|
|
466
486
|
**Before submitting:**
|
|
487
|
+
|
|
467
488
|
- Ensure all tests pass
|
|
468
489
|
- Follow TypeScript best practices
|
|
469
490
|
- Update documentation as needed
|
|
@@ -480,6 +501,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
|
|
|
480
501
|
**Problem:** The eBay MCP server doesn't show up in your MCP client.
|
|
481
502
|
|
|
482
503
|
**Solutions:**
|
|
504
|
+
|
|
483
505
|
1. Verify the config file path is correct for your OS
|
|
484
506
|
2. Check JSON syntax is valid (use a JSON validator)
|
|
485
507
|
3. Ensure environment variables are properly set
|
|
@@ -491,6 +513,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
|
|
|
491
513
|
**Problem:** "Invalid credentials" or "Authentication failed" errors.
|
|
492
514
|
|
|
493
515
|
**Solutions:**
|
|
516
|
+
|
|
494
517
|
1. Verify your `EBAY_CLIENT_ID` and `EBAY_CLIENT_SECRET` are correct
|
|
495
518
|
2. Ensure you're using the right environment (sandbox vs production)
|
|
496
519
|
3. Check if your app keys are active in the eBay Developer Portal
|
|
@@ -502,6 +525,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
|
|
|
502
525
|
**Problem:** "Rate limit exceeded" errors.
|
|
503
526
|
|
|
504
527
|
**Solutions:**
|
|
528
|
+
|
|
505
529
|
1. Upgrade to user token authentication (10k-50k requests/day)
|
|
506
530
|
2. Implement request throttling in your usage
|
|
507
531
|
3. Check your current rate limit in the Developer Portal
|
|
@@ -512,6 +536,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
|
|
|
512
536
|
**Problem:** Tools return unexpected errors or empty results.
|
|
513
537
|
|
|
514
538
|
**Solutions:**
|
|
539
|
+
|
|
515
540
|
1. Verify you're using the correct environment (sandbox vs production)
|
|
516
541
|
2. Ensure you have proper permissions/scopes for the operation
|
|
517
542
|
3. Check eBay API status: https://developer.ebay.com/support/api-status
|
|
@@ -531,6 +556,7 @@ npm run diagnose:export
|
|
|
531
556
|
```
|
|
532
557
|
|
|
533
558
|
The diagnostic tool checks:
|
|
559
|
+
|
|
534
560
|
- Environment variable configuration
|
|
535
561
|
- eBay API connectivity
|
|
536
562
|
- Authentication status
|
|
@@ -554,7 +580,11 @@ If you're still experiencing issues:
|
|
|
554
580
|
### Documentation
|
|
555
581
|
|
|
556
582
|
- [eBay Developer Portal](https://developer.ebay.com/) - API documentation and credentials
|
|
583
|
+
- [eBay API License Agreement](https://developer.ebay.com/join/api-license-agreement) - Terms of use and compliance requirements
|
|
584
|
+
- [eBay Data Handling Requirements](https://developer.ebay.com/api-docs/static/data-handling-update.html) - Important data protection and privacy guidelines
|
|
585
|
+
- [eBay API Status](https://developer.ebay.com/support/api-status) - Real-time API health and status
|
|
557
586
|
- [MCP Documentation](https://modelcontextprotocol.io/) - Model Context Protocol specification
|
|
587
|
+
- [OAuth Quick Reference](docs/auth/OAUTH_QUICK_REFERENCE.md) - **Complete OAuth authentication guide with scopes, troubleshooting, and examples**
|
|
558
588
|
- [OAuth Setup Guide](docs/auth/) - Detailed authentication configuration
|
|
559
589
|
- [Contributing Guidelines](CONTRIBUTING.md) - How to contribute to this project
|
|
560
590
|
- [Code of Conduct](CODE_OF_CONDUCT.md) - Community guidelines and expectations
|
package/build/auth/oauth.js
CHANGED
|
@@ -25,11 +25,11 @@ function updateEnvFile(updates) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
writeFileSync(envPath, envContent, 'utf-8');
|
|
28
|
-
console
|
|
28
|
+
// Tokens updated silently - console output interferes with MCP JSON protocol
|
|
29
29
|
}
|
|
30
30
|
catch (error) {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
// Silent failure - error logging interferes with MCP JSON protocol
|
|
32
|
+
// If needed, check .env file manually
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
@@ -245,10 +245,8 @@ export class EbayOAuthClient {
|
|
|
245
245
|
userRefreshTokenExpiry: now + tokenData.refresh_token_expires_in * 1000,
|
|
246
246
|
scope: tokenData.scope,
|
|
247
247
|
};
|
|
248
|
-
//
|
|
249
|
-
console
|
|
250
|
-
console.log('To persist your authentication, add this to your .env file:');
|
|
251
|
-
console.log(`EBAY_USER_REFRESH_TOKEN="${tokenData.refresh_token}"\n`);
|
|
248
|
+
// Tokens are automatically saved to .env file by updateEnvFile()
|
|
249
|
+
// No console output needed here to avoid interfering with MCP JSON protocol
|
|
252
250
|
return tokenData;
|
|
253
251
|
}
|
|
254
252
|
catch (error) {
|
|
@@ -307,7 +305,7 @@ export class EbayOAuthClient {
|
|
|
307
305
|
// If eBay provided a new refresh token, update it too
|
|
308
306
|
if (tokenData.refresh_token && tokenData.refresh_token !== process.env.EBAY_USER_REFRESH_TOKEN) {
|
|
309
307
|
envUpdates.EBAY_USER_REFRESH_TOKEN = tokenData.refresh_token;
|
|
310
|
-
|
|
308
|
+
// New refresh token updated silently
|
|
311
309
|
}
|
|
312
310
|
// Write updates to .env file
|
|
313
311
|
updateEnvFile(envUpdates);
|
|
@@ -12,7 +12,27 @@ import { z } from 'zod';
|
|
|
12
12
|
export const tokenManagementTools = [
|
|
13
13
|
{
|
|
14
14
|
name: 'ebay_get_oauth_url',
|
|
15
|
-
description: 'Generate the eBay OAuth authorization URL for user consent. The user should open this URL in a browser to grant permissions to the application. This supports the OAuth 2.0 Authorization Code grant flow. The redirect URI can be provided as a parameter or will be read from EBAY_REDIRECT_URI environment variable.\n\
|
|
15
|
+
description: 'Generate the eBay OAuth authorization URL for user consent. The user should open this URL in a browser to grant permissions to the application. This supports the OAuth 2.0 Authorization Code grant flow. The redirect URI can be provided as a parameter or will be read from EBAY_REDIRECT_URI environment variable.\n\n' +
|
|
16
|
+
'IMPORTANT: eBay has different OAuth scopes available for production vs sandbox environments:\n' +
|
|
17
|
+
'- Sandbox includes additional Buy API scopes (e.g., buy.order.readonly, buy.guest.order, buy.shopping.cart) and extended Identity scopes\n' +
|
|
18
|
+
'- Production includes sell.edelivery, commerce.message (explicit), and commerce.shipping scopes not available in sandbox\n' +
|
|
19
|
+
'- If you provide custom scopes, they will be validated against the current environment (set via EBAY_ENVIRONMENT). Any scopes not valid for the environment will generate warnings.\n\n' +
|
|
20
|
+
'OAUTH FLOW INSTRUCTIONS:\n' +
|
|
21
|
+
'1. Generate OAuth URL with this tool (optionally specify scopes)\n' +
|
|
22
|
+
'2. User opens URL in browser, authorizes, and gets redirected with a code parameter\n' +
|
|
23
|
+
'3. Use ebay_exchange_authorization_code tool with the code (URL-encoded format accepted)\n' +
|
|
24
|
+
'4. Tokens are automatically stored and will auto-refresh every 2 hours\n\n' +
|
|
25
|
+
'COMMON SCOPES:\n' +
|
|
26
|
+
'- Basic (always included): https://api.ebay.com/oauth/api_scope\n' +
|
|
27
|
+
'- Inventory: https://api.ebay.com/oauth/api_scope/sell.inventory\n' +
|
|
28
|
+
'- Inventory (readonly): https://api.ebay.com/oauth/api_scope/sell.inventory.readonly\n' +
|
|
29
|
+
'- Account: https://api.ebay.com/oauth/api_scope/sell.account\n' +
|
|
30
|
+
'- Fulfillment: https://api.ebay.com/oauth/api_scope/sell.fulfillment\n\n' +
|
|
31
|
+
'TROUBLESHOOTING:\n' +
|
|
32
|
+
'- Authorization codes expire in ~5 minutes - get fresh code if "invalid grant" error\n' +
|
|
33
|
+
'- "Insufficient permissions" errors mean you need to re-authorize with additional scopes\n' +
|
|
34
|
+
'- OAuth URL format: Use + to separate scopes (e.g., scope=scope1+scope2), not %2B\n' +
|
|
35
|
+
'- Refresh tokens last 18 months and are saved to .env file for persistence',
|
|
16
36
|
inputSchema: {
|
|
17
37
|
redirectUri: z
|
|
18
38
|
.string()
|
|
@@ -100,4 +120,29 @@ export const tokenManagementTools = [
|
|
|
100
120
|
description: 'Success response',
|
|
101
121
|
},
|
|
102
122
|
},
|
|
123
|
+
{
|
|
124
|
+
name: 'ebay_exchange_authorization_code',
|
|
125
|
+
description: 'Exchange an OAuth authorization code for access and refresh tokens. This completes the OAuth 2.0 Authorization Code grant flow. After the user authorizes the application using the URL from ebay_get_oauth_url, eBay redirects back with an authorization code in the URL. Use this tool to exchange that code for tokens that can be used to make API calls. The tokens will be automatically stored and used for subsequent API requests.\n\n' +
|
|
126
|
+
'IMPORTANT NOTES:\n' +
|
|
127
|
+
'- Authorization codes expire in ~5 minutes - if you get "invalid grant" error, get a fresh code\n' +
|
|
128
|
+
'- Codes can be URL-encoded (e.g., v%5E1.1%23...) - this tool automatically decodes them\n' +
|
|
129
|
+
'- Extract the code parameter from the redirect URL: https://auth2.ebay.com/...&code=YOUR_CODE&expires_in=299\n' +
|
|
130
|
+
'- Tokens are saved to .env file and will auto-refresh every 2 hours\n' +
|
|
131
|
+
'- Refresh tokens last 18 months before requiring re-authorization\n\n' +
|
|
132
|
+
'COMMON ERRORS:\n' +
|
|
133
|
+
'- "invalid or was issued to another client": Code expired, get fresh code\n' +
|
|
134
|
+
'- "Insufficient permissions": Re-run OAuth flow with additional scopes in ebay_get_oauth_url\n\n' +
|
|
135
|
+
'For complete OAuth guide with scopes, troubleshooting, and examples, see: docs/auth/OAUTH_QUICK_REFERENCE.md',
|
|
136
|
+
inputSchema: {
|
|
137
|
+
code: z
|
|
138
|
+
.string()
|
|
139
|
+
.min(1)
|
|
140
|
+
.describe('The authorization code received from eBay after user authorization. This is the "code" parameter in the redirect URL.'),
|
|
141
|
+
},
|
|
142
|
+
outputSchema: {
|
|
143
|
+
type: 'object',
|
|
144
|
+
properties: {},
|
|
145
|
+
description: 'Token exchange response including access token, refresh token, and expiry times',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
103
148
|
];
|
package/build/tools/index.js
CHANGED
|
@@ -309,6 +309,36 @@ export async function executeTool(api, toolName, args) {
|
|
|
309
309
|
scopes: internalTokens?.scope ? internalTokens.scope.split(' ') : [],
|
|
310
310
|
};
|
|
311
311
|
}
|
|
312
|
+
case 'ebay_exchange_authorization_code': {
|
|
313
|
+
const code = args.code;
|
|
314
|
+
if (!code) {
|
|
315
|
+
throw new Error('Authorization code is required');
|
|
316
|
+
}
|
|
317
|
+
try {
|
|
318
|
+
// URL-decode the code if it's URL-encoded (contains % characters)
|
|
319
|
+
const decodedCode = code.includes('%') ? decodeURIComponent(code) : code;
|
|
320
|
+
// Get the OAuth client
|
|
321
|
+
const authClient = api.getAuthClient().getOAuthClient();
|
|
322
|
+
// Exchange the authorization code for tokens
|
|
323
|
+
const tokenData = await authClient.exchangeCodeForToken(decodedCode);
|
|
324
|
+
return {
|
|
325
|
+
success: true,
|
|
326
|
+
message: 'Authorization code successfully exchanged for tokens. Tokens have been stored and will be used for subsequent API requests.',
|
|
327
|
+
tokenData: {
|
|
328
|
+
accessToken: `${tokenData.access_token.substring(0, 20)}...${tokenData.access_token.slice(-10)}`,
|
|
329
|
+
refreshToken: `${tokenData.refresh_token.substring(0, 20)}...${tokenData.refresh_token.slice(-10)}`,
|
|
330
|
+
expiresIn: tokenData.expires_in,
|
|
331
|
+
refreshTokenExpiresIn: tokenData.refresh_token_expires_in,
|
|
332
|
+
tokenType: tokenData.token_type,
|
|
333
|
+
scope: tokenData.scope,
|
|
334
|
+
},
|
|
335
|
+
note: 'The refresh token has been saved to your .env file for future use.',
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
catch (error) {
|
|
339
|
+
throw new Error(`Failed to exchange authorization code: ${error instanceof Error ? error.message : String(error)}`);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
312
342
|
case 'ebay_refresh_access_token': {
|
|
313
343
|
const authClient = api.getAuthClient().getOAuthClient();
|
|
314
344
|
// Check if user tokens are available
|
package/package.json
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
2
|
+
"name": "ebay-mcp",
|
|
3
|
+
"version": "1.4.6",
|
|
4
|
+
"description": "MCP server for eBay APIs - provides access to eBay developer functionality through MCP (Model Context Protocol)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "build/index.js",
|
|
7
|
+
"types": "build/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"ebay-mcp": "build/index.js"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsc && tsc-alias",
|
|
13
|
+
"watch": "tsc --watch",
|
|
14
|
+
"dev": "tsx src/index.ts",
|
|
15
|
+
"dev:http": "tsx src/server-http.ts",
|
|
16
|
+
"start": "node build/index.js",
|
|
17
|
+
"start:http": "node build/server-http.js",
|
|
18
|
+
"clean": "rm -rf build",
|
|
19
|
+
"prepare": "npm run build",
|
|
20
|
+
"postinstall": "npm run auto-setup --if-present || true",
|
|
21
|
+
"setup": "tsx src/scripts/interactive-setup.ts",
|
|
22
|
+
"auto-setup": "node build/scripts/auto-setup.js",
|
|
23
|
+
"diagnose": "tsx src/scripts/diagnostics.ts",
|
|
24
|
+
"diagnose:export": "tsx src/scripts/diagnostics.ts --export",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:watch": "vitest",
|
|
28
|
+
"test:ui": "vitest --ui",
|
|
29
|
+
"test:coverage": "vitest run --coverage",
|
|
30
|
+
"test:integration": "vitest run tests/integration",
|
|
31
|
+
"download:specs": "tsx src/scripts/download-specs.ts",
|
|
32
|
+
"test:endpoints": "tsx src/scripts/test-endpoints.ts",
|
|
33
|
+
"generate:types": "bash src/scripts/generate-types.sh",
|
|
34
|
+
"lint": "eslint .",
|
|
35
|
+
"lint:fix": "eslint . --fix",
|
|
36
|
+
"format": "prettier --write \"src/**/*.{ts,js,json,md}\" \"tests/**/*.{ts,js,json}\"",
|
|
37
|
+
"format:check": "prettier --check \"src/**/*.{ts,js,json,md}\" \"tests/**/*.{ts,js,json}\"",
|
|
38
|
+
"check": "npm run typecheck && npm run lint && npm run format:check",
|
|
39
|
+
"docker:build": "docker-compose build",
|
|
40
|
+
"docker:up": "docker-compose up -d",
|
|
41
|
+
"docker:down": "docker-compose down",
|
|
42
|
+
"docker:logs": "docker-compose logs -f",
|
|
43
|
+
"docker:restart": "docker-compose restart"
|
|
44
|
+
},
|
|
45
|
+
"keywords": [
|
|
46
|
+
"mcp",
|
|
47
|
+
"ebay",
|
|
48
|
+
"ebay-api",
|
|
49
|
+
"model-context-protocol",
|
|
50
|
+
"ai-tools",
|
|
51
|
+
"ai",
|
|
52
|
+
"llm",
|
|
53
|
+
"mcp",
|
|
54
|
+
"documentation",
|
|
55
|
+
"api",
|
|
56
|
+
"ebay",
|
|
57
|
+
"server",
|
|
58
|
+
"backend"
|
|
59
|
+
],
|
|
60
|
+
"author": "Yosef Hayim Sabag",
|
|
61
|
+
"license": "MIT",
|
|
62
|
+
"files": [
|
|
63
|
+
"build/**/*.js",
|
|
64
|
+
"build/index.d.ts",
|
|
65
|
+
"build/server-http.d.ts",
|
|
66
|
+
"README.md"
|
|
67
|
+
],
|
|
68
|
+
"repository": {
|
|
69
|
+
"type": "git",
|
|
70
|
+
"url": "https://github.com/YosefHayim/ebay-mcp.git"
|
|
71
|
+
},
|
|
72
|
+
"homepage": "https://github.com/YosefHayim/ebay-mcp#readme",
|
|
73
|
+
"bugs": {
|
|
74
|
+
"url": "https://github.com/YosefHayim/ebay-mcp/issues"
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"@modelcontextprotocol/sdk": "^1.21.1",
|
|
78
|
+
"axios": "^1.7.9",
|
|
79
|
+
"chalk": "^5.6.2",
|
|
80
|
+
"cors": "^2.8.5",
|
|
81
|
+
"dotenv": "^17.2.3",
|
|
82
|
+
"express": "^5.1.0",
|
|
83
|
+
"helmet": "^8.1.0",
|
|
84
|
+
"jose": "^6.1.2",
|
|
85
|
+
"jsonwebtoken": "^9.0.2",
|
|
86
|
+
"prompts": "^2.4.2",
|
|
87
|
+
"zod": "3",
|
|
88
|
+
"zod-to-json-schema": "^3.25.0"
|
|
89
|
+
},
|
|
90
|
+
"devDependencies": {
|
|
91
|
+
"@eslint/js": "^9.39.1",
|
|
92
|
+
"@types/cors": "^2.8.19",
|
|
93
|
+
"@types/express": "^5.0.5",
|
|
94
|
+
"@types/jsonwebtoken": "^9.0.10",
|
|
95
|
+
"@types/node": "^24.10.1",
|
|
96
|
+
"@types/prompts": "^2.4.9",
|
|
97
|
+
"@types/supertest": "^6.0.3",
|
|
98
|
+
"@vitest/coverage-v8": "^4.0.13",
|
|
99
|
+
"@vitest/ui": "^4.0.8",
|
|
100
|
+
"eslint": "^9.39.1",
|
|
101
|
+
"eslint-config-prettier": "^10.1.8",
|
|
102
|
+
"eslint-plugin-n": "^17.23.1",
|
|
103
|
+
"eslint-plugin-vitest": "^0.5.4",
|
|
104
|
+
"nock": "^14.0.10",
|
|
105
|
+
"openapi-typescript": "^7.10.1",
|
|
106
|
+
"prettier": "^3.6.2",
|
|
107
|
+
"supertest": "^7.1.4",
|
|
108
|
+
"tsc-alias": "^1.8.16",
|
|
109
|
+
"tsx": "^4.19.2",
|
|
110
|
+
"typescript": "^5.9.3",
|
|
111
|
+
"typescript-eslint": "^8.47.0",
|
|
112
|
+
"vitest": "^4.0.8"
|
|
113
|
+
},
|
|
114
|
+
"engines": {
|
|
115
|
+
"node": ">=18.0.0"
|
|
116
|
+
}
|
|
117
117
|
}
|