ebay-mcp-remote-edition 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +755 -0
  3. package/build/api/account-management/account.js +301 -0
  4. package/build/api/analytics-and-report/analytics.js +102 -0
  5. package/build/api/client-trading.js +96 -0
  6. package/build/api/client.js +173 -0
  7. package/build/api/communication/feedback.js +119 -0
  8. package/build/api/communication/message.js +131 -0
  9. package/build/api/communication/negotiation.js +97 -0
  10. package/build/api/communication/notification.js +373 -0
  11. package/build/api/developer/developer.js +81 -0
  12. package/build/api/index.js +109 -0
  13. package/build/api/listing-management/inventory.js +640 -0
  14. package/build/api/listing-metadata/metadata.js +485 -0
  15. package/build/api/listing-metadata/taxonomy.js +58 -0
  16. package/build/api/marketing-and-promotions/marketing.js +768 -0
  17. package/build/api/marketing-and-promotions/recommendation.js +32 -0
  18. package/build/api/order-management/dispute.js +69 -0
  19. package/build/api/order-management/fulfillment.js +89 -0
  20. package/build/api/other/compliance.js +47 -0
  21. package/build/api/other/edelivery.js +219 -0
  22. package/build/api/other/identity.js +24 -0
  23. package/build/api/other/translation.js +22 -0
  24. package/build/api/other/vero.js +48 -0
  25. package/build/api/trading/trading.js +78 -0
  26. package/build/auth/kv-store.js +40 -0
  27. package/build/auth/multi-user-store.js +120 -0
  28. package/build/auth/oauth-metadata.js +59 -0
  29. package/build/auth/oauth-middleware.js +99 -0
  30. package/build/auth/oauth-types.js +4 -0
  31. package/build/auth/oauth.js +235 -0
  32. package/build/auth/scope-utils.js +304 -0
  33. package/build/auth/token-store.js +46 -0
  34. package/build/auth/token-verifier.js +172 -0
  35. package/build/config/environment.js +297 -0
  36. package/build/index.d.ts +1 -0
  37. package/build/index.js +129 -0
  38. package/build/schemas/account-management/account.js +375 -0
  39. package/build/schemas/analytics/analytics.js +191 -0
  40. package/build/schemas/communication/messages.js +345 -0
  41. package/build/schemas/fulfillment/orders.js +338 -0
  42. package/build/schemas/index.js +68 -0
  43. package/build/schemas/inventory-management/inventory.js +471 -0
  44. package/build/schemas/marketing/marketing.js +1103 -0
  45. package/build/schemas/metadata/metadata.js +618 -0
  46. package/build/schemas/other/other-apis.js +390 -0
  47. package/build/schemas/taxonomy/taxonomy.js +575 -0
  48. package/build/scripts/auto-setup.js +364 -0
  49. package/build/scripts/dev-sync.js +512 -0
  50. package/build/scripts/diagnostics.js +301 -0
  51. package/build/scripts/download-specs.js +116 -0
  52. package/build/scripts/interactive-setup.js +757 -0
  53. package/build/scripts/setup.js +1515 -0
  54. package/build/scripts/update-api-status-doc.js +44 -0
  55. package/build/server-http.d.ts +1 -0
  56. package/build/server-http.js +581 -0
  57. package/build/tools/definitions/account-with-schemas.js +170 -0
  58. package/build/tools/definitions/account.js +428 -0
  59. package/build/tools/definitions/analytics.js +66 -0
  60. package/build/tools/definitions/communication.js +394 -0
  61. package/build/tools/definitions/developer.js +195 -0
  62. package/build/tools/definitions/fulfillment.js +326 -0
  63. package/build/tools/definitions/index.js +41 -0
  64. package/build/tools/definitions/inventory.js +464 -0
  65. package/build/tools/definitions/marketing.js +1486 -0
  66. package/build/tools/definitions/metadata.js +188 -0
  67. package/build/tools/definitions/other.js +309 -0
  68. package/build/tools/definitions/taxonomy.js +64 -0
  69. package/build/tools/definitions/token-management.js +148 -0
  70. package/build/tools/definitions/trading.js +71 -0
  71. package/build/tools/index.js +1200 -0
  72. package/build/tools/schemas.js +667 -0
  73. package/build/tools/tool-definitions.js +3534 -0
  74. package/build/types/application-settings/developerAnalyticsV1BetaOas3.js +5 -0
  75. package/build/types/application-settings/developerClientRegistrationV1Oas3.js +5 -0
  76. package/build/types/application-settings/developerKeyManagementV1Oas3.js +5 -0
  77. package/build/types/ebay-enums.js +1330 -0
  78. package/build/types/ebay.js +123 -0
  79. package/build/types/index.js +10 -0
  80. package/build/types/sell-apps/account-management/sellAccountV1Oas3.js +5 -0
  81. package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.js +5 -0
  82. package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.js +5 -0
  83. package/build/types/sell-apps/communication/commerceMessageV1Oas3.js +5 -0
  84. package/build/types/sell-apps/communication/commerceNotificationV1Oas3.js +5 -0
  85. package/build/types/sell-apps/communication/sellNegotiationV1Oas3.js +5 -0
  86. package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.js +5 -0
  87. package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.js +5 -0
  88. package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.js +5 -0
  89. package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.js +5 -0
  90. package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.js +5 -0
  91. package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.js +5 -0
  92. package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.js +5 -0
  93. package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.js +5 -0
  94. package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.js +5 -0
  95. package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.js +5 -0
  96. package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.js +5 -0
  97. package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.js +5 -0
  98. package/build/utils/account-management/account.js +831 -0
  99. package/build/utils/api-status-feed.js +83 -0
  100. package/build/utils/communication/feedback.js +216 -0
  101. package/build/utils/communication/message.js +242 -0
  102. package/build/utils/communication/negotiation.js +150 -0
  103. package/build/utils/communication/notification.js +369 -0
  104. package/build/utils/date-converter.js +160 -0
  105. package/build/utils/llm-client-detector.js +758 -0
  106. package/build/utils/logger.js +198 -0
  107. package/build/utils/oauth-helper.js +315 -0
  108. package/build/utils/order-management/dispute.js +369 -0
  109. package/build/utils/order-management/fulfillment.js +205 -0
  110. package/build/utils/other/compliance.js +76 -0
  111. package/build/utils/other/edelivery.js +241 -0
  112. package/build/utils/other/identity.js +13 -0
  113. package/build/utils/other/translation.js +41 -0
  114. package/build/utils/other/vero.js +90 -0
  115. package/build/utils/scope-helper.js +207 -0
  116. package/build/utils/security-checker.js +248 -0
  117. package/build/utils/setup-validator.js +305 -0
  118. package/build/utils/token-utils.js +40 -0
  119. package/build/utils/version.js +56 -0
  120. package/docs/auth/production_scopes.json +111 -0
  121. package/docs/auth/sandbox_scopes.json +142 -0
  122. package/package.json +122 -0
  123. package/public/icons/1024x1024.png +0 -0
  124. package/public/icons/128x128.png +0 -0
  125. package/public/icons/16x16.png +0 -0
  126. package/public/icons/256x256.png +0 -0
  127. package/public/icons/32x32.png +0 -0
  128. package/public/icons/48x48.png +0 -0
  129. package/public/icons/512x512.png +0 -0
@@ -0,0 +1,148 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Token Management & Authentication Tools
4
+ *
5
+ * These tools handle OAuth token management, including:
6
+ * - Generating OAuth authorization URLs
7
+ * - Setting and clearing user tokens
8
+ * - Token status monitoring
9
+ * - Token expiry validation
10
+ * - Date/timestamp conversion utilities
11
+ */
12
+ export const tokenManagementTools = [
13
+ {
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\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',
36
+ inputSchema: {
37
+ redirectUri: z
38
+ .string()
39
+ .optional()
40
+ .describe('Optional redirect URI registered with your eBay application (RuName). If not provided, will use EBAY_REDIRECT_URI from .env file.'),
41
+ scopes: z
42
+ .array(z.string())
43
+ .optional()
44
+ .describe('Optional array of OAuth scopes. If not provided, uses environment-specific default scopes (production or sandbox based on EBAY_ENVIRONMENT). Custom scopes will be validated against the environment.'),
45
+ state: z.string().optional().describe('Optional state parameter for CSRF protection'),
46
+ },
47
+ },
48
+ {
49
+ name: 'ebay_set_user_tokens',
50
+ description: 'Set the user access token and refresh token for authenticated API requests. These tokens should be obtained through the OAuth authorization code flow. Tokens will be persisted to disk and automatically refreshed when needed. User tokens provide higher rate limits (10,000-50,000 requests/day) compared to client credentials (1,000 requests/day).',
51
+ inputSchema: {
52
+ accessToken: z.string().describe('The user access token obtained from OAuth flow'),
53
+ refreshToken: z.string().describe('The refresh token obtained from OAuth flow'),
54
+ },
55
+ },
56
+ {
57
+ name: 'ebay_set_user_tokens_with_expiry',
58
+ description: "Set user access and refresh tokens with custom expiry times. This is an enhanced version of ebay_set_user_tokens that accepts expiry times and can automatically refresh the access token if it's expired but the refresh token is valid. Useful when user provides tokens that may already be partially expired.",
59
+ inputSchema: {
60
+ accessToken: z.string().min(1).describe('eBay user access token'),
61
+ refreshToken: z.string().min(1).describe('eBay user refresh token'),
62
+ accessTokenExpiry: z
63
+ .union([z.string(), z.number()])
64
+ .optional()
65
+ .describe('Optional: Access token expiry time. If not provided, defaults to 2 hours from now. Can be ISO date string, Unix timestamp, or relative time (e.g., "in 7200 seconds")'),
66
+ refreshTokenExpiry: z
67
+ .union([z.string(), z.number()])
68
+ .optional()
69
+ .describe('Optional: Refresh token expiry time. If not provided, defaults to 18 months from now. Can be ISO date string, Unix timestamp, or relative time'),
70
+ autoRefresh: z
71
+ .boolean()
72
+ .optional()
73
+ .default(true)
74
+ .describe('If true and access token is expired but refresh token is valid, automatically refresh the access token. Default: true'),
75
+ },
76
+ },
77
+ {
78
+ name: 'ebay_get_token_status',
79
+ description: 'Check the current OAuth token status. Returns information about whether user tokens or client credentials are being used, and whether tokens are valid.',
80
+ inputSchema: {},
81
+ },
82
+ {
83
+ name: 'ebay_clear_tokens',
84
+ description: 'Clear all stored OAuth tokens (both user tokens and client credentials). This will require re-authentication for subsequent API calls.',
85
+ inputSchema: {},
86
+ },
87
+ {
88
+ name: 'ebay_validate_token_expiry',
89
+ description: 'Validate token expiry times and get recommendations. Checks if access/refresh tokens are expired or expiring soon, and provides actionable recommendations (e.g., refresh access token, re-authorize user).',
90
+ inputSchema: {
91
+ accessTokenExpiry: z
92
+ .union([z.string(), z.number()])
93
+ .describe('Access token expiry time. Can be ISO date string, Unix timestamp (seconds or milliseconds), or relative time'),
94
+ refreshTokenExpiry: z
95
+ .union([z.string(), z.number()])
96
+ .describe('Refresh token expiry time. Can be ISO date string, Unix timestamp (seconds or milliseconds), or relative time'),
97
+ },
98
+ },
99
+ {
100
+ name: 'ebay_convert_date_to_timestamp',
101
+ description: 'Convert a date string or number to Unix timestamp (milliseconds). Supports ISO 8601 dates, Unix timestamps (seconds or milliseconds), and relative time (e.g., "in 2 hours", "in 7200 seconds"). Useful when setting token expiry times from user input.',
102
+ inputSchema: {
103
+ dateInput: z
104
+ .union([z.string(), z.number()])
105
+ .describe('Date to convert. Supports ISO 8601 strings (e.g., "2025-01-15T10:30:00Z"), Unix timestamps (seconds or milliseconds), or relative time (e.g., "in 2 hours")'),
106
+ },
107
+ },
108
+ {
109
+ name: 'ebay_display_credentials',
110
+ description: 'Display all eBay API credentials and current token information. Shows client ID, client secret (masked), environment (production/sandbox), redirect URI, and current token status including access token (masked), refresh token (masked), app token (masked), and their expiry times. Useful for debugging authentication issues and verifying configuration.',
111
+ inputSchema: {},
112
+ },
113
+ {
114
+ name: 'ebay_refresh_access_token',
115
+ description: 'Manually refresh the user access token using the stored refresh token. This is useful when you want to proactively refresh an access token before it expires, or when recovering from authentication errors. Requires that user tokens are already set (either via EBAY_USER_REFRESH_TOKEN in .env or via ebay_set_user_tokens_with_expiry). Returns the new access token and expiry time.',
116
+ inputSchema: {},
117
+ outputSchema: {
118
+ type: 'object',
119
+ properties: {},
120
+ description: 'Success response',
121
+ },
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 (your RuName Accept URL): https://your-redirect-uri?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
+ },
148
+ ];
@@ -0,0 +1,71 @@
1
+ import { z } from 'zod';
2
+ export const tradingTools = [
3
+ {
4
+ name: 'ebay_get_active_listings',
5
+ description: 'Get all active fixed-price listings with SKU, quantity, price, and watch count.\n\nUses the Trading API (GetMyeBaySelling). Returns listings created via any method (UI, Trading API, or REST API).\n\nRequired: User OAuth token.',
6
+ inputSchema: {
7
+ page: z.number().optional().describe('Page number (default 1)'),
8
+ entriesPerPage: z.number().optional().describe('Items per page, max 200 (default 50)'),
9
+ },
10
+ annotations: { readOnlyHint: true },
11
+ },
12
+ {
13
+ name: 'ebay_get_listing',
14
+ description: 'Get full details for a single listing by item ID.\n\nUses the Trading API (GetItem). Returns all listing fields including description, specifics, shipping, and images.\n\nRequired: User OAuth token.',
15
+ inputSchema: {
16
+ itemId: z.string().describe('The eBay item ID (e.g., "167382780779")'),
17
+ },
18
+ annotations: { readOnlyHint: true },
19
+ },
20
+ {
21
+ name: 'ebay_create_listing',
22
+ description: 'Create a new fixed-price listing.\n\nUses the Trading API (AddFixedPriceItem). Requires complete item details.\n\nRequired: User OAuth token.',
23
+ inputSchema: {
24
+ item: z
25
+ .record(z.unknown())
26
+ .describe('Item details object. Required fields: Title, PrimaryCategory.CategoryID, StartPrice, ConditionID, Country, Currency, DispatchTimeMax, ListingDuration, ListingType ("FixedPriceItem"), Quantity, SKU.'),
27
+ },
28
+ annotations: { readOnlyHint: false },
29
+ },
30
+ {
31
+ name: 'ebay_revise_listing',
32
+ description: 'Revise an existing fixed-price listing. Update quantity, price, title, description, or any other field.\n\nUses the Trading API (ReviseFixedPriceItem). Only send the fields you want to change.\n\nExamples:\n- Update quantity: { "Quantity": 10 }\n- Update price: { "StartPrice": 14.99 }\n- Update title: { "Title": "New Title" }\n- Multiple fields: { "Quantity": 10, "StartPrice": 14.99 }\n\nRequired: User OAuth token.',
33
+ inputSchema: {
34
+ itemId: z.string().describe('The eBay item ID to revise'),
35
+ fields: z
36
+ .record(z.unknown())
37
+ .describe('Fields to update (e.g., { "Quantity": 10, "StartPrice": 14.99 })'),
38
+ },
39
+ annotations: { readOnlyHint: false },
40
+ },
41
+ {
42
+ name: 'ebay_end_listing',
43
+ description: 'End/remove an active fixed-price listing.\n\nUses the Trading API (EndFixedPriceItem).\n\nRequired: User OAuth token.',
44
+ inputSchema: {
45
+ itemId: z.string().describe('The eBay item ID to end'),
46
+ reason: z
47
+ .enum([
48
+ 'NotAvailable',
49
+ 'Incorrect',
50
+ 'LostOrBroken',
51
+ 'OtherListingError',
52
+ 'SellToHighBidder',
53
+ ])
54
+ .optional()
55
+ .describe('Reason for ending (default: NotAvailable)'),
56
+ },
57
+ annotations: { readOnlyHint: false, destructiveHint: true },
58
+ },
59
+ {
60
+ name: 'ebay_relist_item',
61
+ description: 'Relist an ended fixed-price listing, optionally with modifications.\n\nUses the Trading API (RelistFixedPriceItem).\n\nRequired: User OAuth token.',
62
+ inputSchema: {
63
+ itemId: z.string().describe('The eBay item ID to relist'),
64
+ modifications: z
65
+ .record(z.unknown())
66
+ .optional()
67
+ .describe('Optional fields to change when relisting (e.g., { "Quantity": 20 })'),
68
+ },
69
+ annotations: { readOnlyHint: false },
70
+ },
71
+ ];