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.
- package/LICENSE +21 -0
- package/README.md +755 -0
- package/build/api/account-management/account.js +301 -0
- package/build/api/analytics-and-report/analytics.js +102 -0
- package/build/api/client-trading.js +96 -0
- package/build/api/client.js +173 -0
- package/build/api/communication/feedback.js +119 -0
- package/build/api/communication/message.js +131 -0
- package/build/api/communication/negotiation.js +97 -0
- package/build/api/communication/notification.js +373 -0
- package/build/api/developer/developer.js +81 -0
- package/build/api/index.js +109 -0
- package/build/api/listing-management/inventory.js +640 -0
- package/build/api/listing-metadata/metadata.js +485 -0
- package/build/api/listing-metadata/taxonomy.js +58 -0
- package/build/api/marketing-and-promotions/marketing.js +768 -0
- package/build/api/marketing-and-promotions/recommendation.js +32 -0
- package/build/api/order-management/dispute.js +69 -0
- package/build/api/order-management/fulfillment.js +89 -0
- package/build/api/other/compliance.js +47 -0
- package/build/api/other/edelivery.js +219 -0
- package/build/api/other/identity.js +24 -0
- package/build/api/other/translation.js +22 -0
- package/build/api/other/vero.js +48 -0
- package/build/api/trading/trading.js +78 -0
- package/build/auth/kv-store.js +40 -0
- package/build/auth/multi-user-store.js +120 -0
- package/build/auth/oauth-metadata.js +59 -0
- package/build/auth/oauth-middleware.js +99 -0
- package/build/auth/oauth-types.js +4 -0
- package/build/auth/oauth.js +235 -0
- package/build/auth/scope-utils.js +304 -0
- package/build/auth/token-store.js +46 -0
- package/build/auth/token-verifier.js +172 -0
- package/build/config/environment.js +297 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +129 -0
- package/build/schemas/account-management/account.js +375 -0
- package/build/schemas/analytics/analytics.js +191 -0
- package/build/schemas/communication/messages.js +345 -0
- package/build/schemas/fulfillment/orders.js +338 -0
- package/build/schemas/index.js +68 -0
- package/build/schemas/inventory-management/inventory.js +471 -0
- package/build/schemas/marketing/marketing.js +1103 -0
- package/build/schemas/metadata/metadata.js +618 -0
- package/build/schemas/other/other-apis.js +390 -0
- package/build/schemas/taxonomy/taxonomy.js +575 -0
- package/build/scripts/auto-setup.js +364 -0
- package/build/scripts/dev-sync.js +512 -0
- package/build/scripts/diagnostics.js +301 -0
- package/build/scripts/download-specs.js +116 -0
- package/build/scripts/interactive-setup.js +757 -0
- package/build/scripts/setup.js +1515 -0
- package/build/scripts/update-api-status-doc.js +44 -0
- package/build/server-http.d.ts +1 -0
- package/build/server-http.js +581 -0
- package/build/tools/definitions/account-with-schemas.js +170 -0
- package/build/tools/definitions/account.js +428 -0
- package/build/tools/definitions/analytics.js +66 -0
- package/build/tools/definitions/communication.js +394 -0
- package/build/tools/definitions/developer.js +195 -0
- package/build/tools/definitions/fulfillment.js +326 -0
- package/build/tools/definitions/index.js +41 -0
- package/build/tools/definitions/inventory.js +464 -0
- package/build/tools/definitions/marketing.js +1486 -0
- package/build/tools/definitions/metadata.js +188 -0
- package/build/tools/definitions/other.js +309 -0
- package/build/tools/definitions/taxonomy.js +64 -0
- package/build/tools/definitions/token-management.js +148 -0
- package/build/tools/definitions/trading.js +71 -0
- package/build/tools/index.js +1200 -0
- package/build/tools/schemas.js +667 -0
- package/build/tools/tool-definitions.js +3534 -0
- package/build/types/application-settings/developerAnalyticsV1BetaOas3.js +5 -0
- package/build/types/application-settings/developerClientRegistrationV1Oas3.js +5 -0
- package/build/types/application-settings/developerKeyManagementV1Oas3.js +5 -0
- package/build/types/ebay-enums.js +1330 -0
- package/build/types/ebay.js +123 -0
- package/build/types/index.js +10 -0
- package/build/types/sell-apps/account-management/sellAccountV1Oas3.js +5 -0
- package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.js +5 -0
- package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.js +5 -0
- package/build/types/sell-apps/communication/commerceMessageV1Oas3.js +5 -0
- package/build/types/sell-apps/communication/commerceNotificationV1Oas3.js +5 -0
- package/build/types/sell-apps/communication/sellNegotiationV1Oas3.js +5 -0
- package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.js +5 -0
- package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.js +5 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.js +5 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.js +5 -0
- package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.js +5 -0
- package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.js +5 -0
- package/build/utils/account-management/account.js +831 -0
- package/build/utils/api-status-feed.js +83 -0
- package/build/utils/communication/feedback.js +216 -0
- package/build/utils/communication/message.js +242 -0
- package/build/utils/communication/negotiation.js +150 -0
- package/build/utils/communication/notification.js +369 -0
- package/build/utils/date-converter.js +160 -0
- package/build/utils/llm-client-detector.js +758 -0
- package/build/utils/logger.js +198 -0
- package/build/utils/oauth-helper.js +315 -0
- package/build/utils/order-management/dispute.js +369 -0
- package/build/utils/order-management/fulfillment.js +205 -0
- package/build/utils/other/compliance.js +76 -0
- package/build/utils/other/edelivery.js +241 -0
- package/build/utils/other/identity.js +13 -0
- package/build/utils/other/translation.js +41 -0
- package/build/utils/other/vero.js +90 -0
- package/build/utils/scope-helper.js +207 -0
- package/build/utils/security-checker.js +248 -0
- package/build/utils/setup-validator.js +305 -0
- package/build/utils/token-utils.js +40 -0
- package/build/utils/version.js +56 -0
- package/docs/auth/production_scopes.json +111 -0
- package/docs/auth/sandbox_scopes.json +142 -0
- package/package.json +122 -0
- package/public/icons/1024x1024.png +0 -0
- package/public/icons/128x128.png +0 -0
- package/public/icons/16x16.png +0 -0
- package/public/icons/256x256.png +0 -0
- package/public/icons/32x32.png +0 -0
- package/public/icons/48x48.png +0 -0
- package/public/icons/512x512.png +0 -0
|
@@ -0,0 +1,758 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LLM Client Detection and Auto-Configuration
|
|
3
|
+
*
|
|
4
|
+
* Detects installed LLM clients and provides utilities to auto-configure them
|
|
5
|
+
* with the eBay MCP server settings.
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
8
|
+
import { join, dirname } from 'path';
|
|
9
|
+
import { homedir, platform } from 'os';
|
|
10
|
+
/**
|
|
11
|
+
* Get the config file path for Claude Desktop based on OS
|
|
12
|
+
*/
|
|
13
|
+
function getClaudeConfigPath() {
|
|
14
|
+
const os = platform();
|
|
15
|
+
const home = homedir();
|
|
16
|
+
switch (os) {
|
|
17
|
+
case 'darwin': // macOS
|
|
18
|
+
return join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json');
|
|
19
|
+
case 'win32': // Windows
|
|
20
|
+
return join(home, 'AppData', 'Roaming', 'Claude', 'claude_desktop_config.json');
|
|
21
|
+
case 'linux':
|
|
22
|
+
return join(home, '.config', 'Claude', 'claude_desktop_config.json');
|
|
23
|
+
default:
|
|
24
|
+
return join(home, '.config', 'Claude', 'claude_desktop_config.json');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get the config file path for Cline (VSCode extension)
|
|
29
|
+
*/
|
|
30
|
+
function getClineConfigPath() {
|
|
31
|
+
const home = homedir();
|
|
32
|
+
const os = platform();
|
|
33
|
+
switch (os) {
|
|
34
|
+
case 'darwin':
|
|
35
|
+
return join(home, 'Library', 'Application Support', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json');
|
|
36
|
+
case 'win32':
|
|
37
|
+
return join(home, 'AppData', 'Roaming', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json');
|
|
38
|
+
default:
|
|
39
|
+
return join(home, '.config', 'Code', 'User', 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get config path for Continue.dev
|
|
44
|
+
*/
|
|
45
|
+
function getContinueConfigPath() {
|
|
46
|
+
const home = homedir();
|
|
47
|
+
return join(home, '.continue', 'config.json');
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get config path for Zed editor
|
|
51
|
+
*/
|
|
52
|
+
function getZedConfigPath() {
|
|
53
|
+
const home = homedir();
|
|
54
|
+
const os = platform();
|
|
55
|
+
switch (os) {
|
|
56
|
+
case 'darwin':
|
|
57
|
+
return join(home, '.config', 'zed', 'settings.json');
|
|
58
|
+
case 'win32':
|
|
59
|
+
return join(home, 'AppData', 'Roaming', 'Zed', 'settings.json');
|
|
60
|
+
default:
|
|
61
|
+
return join(home, '.config', 'zed', 'settings.json');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Get config path for Cursor IDE
|
|
66
|
+
*/
|
|
67
|
+
function getCursorConfigPath() {
|
|
68
|
+
const home = homedir();
|
|
69
|
+
const os = platform();
|
|
70
|
+
switch (os) {
|
|
71
|
+
case 'darwin':
|
|
72
|
+
return join(home, '.cursor', 'mcp.json');
|
|
73
|
+
case 'win32':
|
|
74
|
+
return join(home, '.cursor', 'mcp.json');
|
|
75
|
+
default:
|
|
76
|
+
return join(home, '.cursor', 'mcp.json');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get config path for Windsurf (Codeium)
|
|
81
|
+
*/
|
|
82
|
+
function getWindsurfConfigPath() {
|
|
83
|
+
const home = homedir();
|
|
84
|
+
const os = platform();
|
|
85
|
+
switch (os) {
|
|
86
|
+
case 'darwin':
|
|
87
|
+
return join(home, '.codeium', 'windsurf', 'mcp_config.json');
|
|
88
|
+
case 'win32':
|
|
89
|
+
return join(home, '.codeium', 'windsurf', 'mcp_config.json');
|
|
90
|
+
default:
|
|
91
|
+
return join(home, '.codeium', 'windsurf', 'mcp_config.json');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get config path for Roo Code (VSCode extension)
|
|
96
|
+
*/
|
|
97
|
+
function getRooCodeConfigPath() {
|
|
98
|
+
const home = homedir();
|
|
99
|
+
const os = platform();
|
|
100
|
+
switch (os) {
|
|
101
|
+
case 'darwin':
|
|
102
|
+
return join(home, 'Library', 'Application Support', 'Code', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'mcp_settings.json');
|
|
103
|
+
case 'win32':
|
|
104
|
+
return join(home, 'AppData', 'Roaming', 'Code', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'mcp_settings.json');
|
|
105
|
+
default:
|
|
106
|
+
return join(home, '.config', 'Code', 'User', 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'mcp_settings.json');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Get config path for Claude Code CLI
|
|
111
|
+
*/
|
|
112
|
+
function getClaudeCodeConfigPath() {
|
|
113
|
+
const home = homedir();
|
|
114
|
+
return join(home, '.claude.json');
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Get config path for Amazon Q Developer
|
|
118
|
+
*/
|
|
119
|
+
function getAmazonQConfigPath() {
|
|
120
|
+
const home = homedir();
|
|
121
|
+
const os = platform();
|
|
122
|
+
switch (os) {
|
|
123
|
+
case 'darwin':
|
|
124
|
+
return join(home, '.aws', 'amazonq', 'mcp.json');
|
|
125
|
+
case 'win32':
|
|
126
|
+
return join(home, '.aws', 'amazonq', 'mcp.json');
|
|
127
|
+
default:
|
|
128
|
+
return join(home, '.aws', 'amazonq', 'mcp.json');
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Detect all available LLM clients
|
|
133
|
+
*/
|
|
134
|
+
export function detectLLMClients() {
|
|
135
|
+
const clients = [
|
|
136
|
+
{
|
|
137
|
+
name: 'claude',
|
|
138
|
+
displayName: 'Claude Desktop',
|
|
139
|
+
configPath: getClaudeConfigPath(),
|
|
140
|
+
detected: false,
|
|
141
|
+
configExists: false,
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'cline',
|
|
145
|
+
displayName: 'Cline (VSCode Extension)',
|
|
146
|
+
configPath: getClineConfigPath(),
|
|
147
|
+
detected: false,
|
|
148
|
+
configExists: false,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: 'continue',
|
|
152
|
+
displayName: 'Continue.dev',
|
|
153
|
+
configPath: getContinueConfigPath(),
|
|
154
|
+
detected: false,
|
|
155
|
+
configExists: false,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'zed',
|
|
159
|
+
displayName: 'Zed Editor',
|
|
160
|
+
configPath: getZedConfigPath(),
|
|
161
|
+
detected: false,
|
|
162
|
+
configExists: false,
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: 'cursor',
|
|
166
|
+
displayName: 'Cursor IDE',
|
|
167
|
+
configPath: getCursorConfigPath(),
|
|
168
|
+
detected: false,
|
|
169
|
+
configExists: false,
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: 'windsurf',
|
|
173
|
+
displayName: 'Windsurf (Codeium)',
|
|
174
|
+
configPath: getWindsurfConfigPath(),
|
|
175
|
+
detected: false,
|
|
176
|
+
configExists: false,
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: 'roocode',
|
|
180
|
+
displayName: 'Roo Code (VSCode Extension)',
|
|
181
|
+
configPath: getRooCodeConfigPath(),
|
|
182
|
+
detected: false,
|
|
183
|
+
configExists: false,
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: 'claudecode',
|
|
187
|
+
displayName: 'Claude Code CLI',
|
|
188
|
+
configPath: getClaudeCodeConfigPath(),
|
|
189
|
+
detected: false,
|
|
190
|
+
configExists: false,
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
name: 'amazonq',
|
|
194
|
+
displayName: 'Amazon Q Developer',
|
|
195
|
+
configPath: getAmazonQConfigPath(),
|
|
196
|
+
detected: false,
|
|
197
|
+
configExists: false,
|
|
198
|
+
},
|
|
199
|
+
];
|
|
200
|
+
// Check which clients exist
|
|
201
|
+
for (const client of clients) {
|
|
202
|
+
client.configExists = existsSync(client.configPath);
|
|
203
|
+
// Check if parent directory exists (indicates app is installed)
|
|
204
|
+
const parentDir = dirname(client.configPath);
|
|
205
|
+
client.detected = existsSync(parentDir);
|
|
206
|
+
}
|
|
207
|
+
return clients;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Read and parse JSON config file safely
|
|
211
|
+
*/
|
|
212
|
+
function readJSONConfig(path) {
|
|
213
|
+
try {
|
|
214
|
+
if (!existsSync(path)) {
|
|
215
|
+
return {};
|
|
216
|
+
}
|
|
217
|
+
const content = readFileSync(path, 'utf-8');
|
|
218
|
+
return JSON.parse(content);
|
|
219
|
+
}
|
|
220
|
+
catch {
|
|
221
|
+
return {};
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Write JSON config file safely
|
|
226
|
+
*/
|
|
227
|
+
function writeJSONConfig(path, config) {
|
|
228
|
+
// Ensure directory exists
|
|
229
|
+
const dir = dirname(path);
|
|
230
|
+
if (!existsSync(dir)) {
|
|
231
|
+
mkdirSync(dir, { recursive: true });
|
|
232
|
+
}
|
|
233
|
+
writeFileSync(path, JSON.stringify(config, null, 2), 'utf-8');
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Configure Claude Desktop with eBay MCP server
|
|
237
|
+
*/
|
|
238
|
+
export function configureClaudeDesktop(projectRoot) {
|
|
239
|
+
try {
|
|
240
|
+
const configPath = getClaudeConfigPath();
|
|
241
|
+
const config = readJSONConfig(configPath);
|
|
242
|
+
// Initialize mcpServers if it doesn't exist
|
|
243
|
+
if (!config.mcpServers || typeof config.mcpServers !== 'object') {
|
|
244
|
+
config.mcpServers = {};
|
|
245
|
+
}
|
|
246
|
+
const mcpServers = config.mcpServers;
|
|
247
|
+
// Add or update eBay MCP server configuration
|
|
248
|
+
mcpServers['ebay-mcp-server'] = {
|
|
249
|
+
command: 'node',
|
|
250
|
+
args: [join(projectRoot, 'build', 'index.js')],
|
|
251
|
+
};
|
|
252
|
+
config.mcpServers = mcpServers;
|
|
253
|
+
writeJSONConfig(configPath, config);
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
catch (error) {
|
|
257
|
+
console.error('Failed to configure Claude Desktop:', error);
|
|
258
|
+
return false;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Configure Cline (VSCode extension) with eBay MCP server
|
|
263
|
+
*/
|
|
264
|
+
export function configureCline(projectRoot) {
|
|
265
|
+
try {
|
|
266
|
+
const configPath = getClineConfigPath();
|
|
267
|
+
const config = readJSONConfig(configPath);
|
|
268
|
+
// Initialize mcpServers if it doesn't exist
|
|
269
|
+
if (!config.mcpServers || typeof config.mcpServers !== 'object') {
|
|
270
|
+
config.mcpServers = {};
|
|
271
|
+
}
|
|
272
|
+
const mcpServers = config.mcpServers;
|
|
273
|
+
// Add or update eBay MCP server configuration
|
|
274
|
+
mcpServers['ebay-mcp-server'] = {
|
|
275
|
+
command: 'node',
|
|
276
|
+
args: [join(projectRoot, 'build', 'index.js')],
|
|
277
|
+
};
|
|
278
|
+
config.mcpServers = mcpServers;
|
|
279
|
+
writeJSONConfig(configPath, config);
|
|
280
|
+
return true;
|
|
281
|
+
}
|
|
282
|
+
catch (error) {
|
|
283
|
+
console.error('Failed to configure Cline:', error);
|
|
284
|
+
return false;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Configure Continue.dev with eBay MCP server
|
|
289
|
+
*/
|
|
290
|
+
export function configureContinue(projectRoot) {
|
|
291
|
+
try {
|
|
292
|
+
const configPath = getContinueConfigPath();
|
|
293
|
+
const config = readJSONConfig(configPath);
|
|
294
|
+
// Initialize experimental.modelContextProtocolServers if it doesn't exist
|
|
295
|
+
if (!config.experimental || typeof config.experimental !== 'object') {
|
|
296
|
+
config.experimental = {};
|
|
297
|
+
}
|
|
298
|
+
const experimental = config.experimental;
|
|
299
|
+
if (!experimental.modelContextProtocolServers ||
|
|
300
|
+
!Array.isArray(experimental.modelContextProtocolServers)) {
|
|
301
|
+
experimental.modelContextProtocolServers = [];
|
|
302
|
+
}
|
|
303
|
+
const mcpServers = experimental.modelContextProtocolServers;
|
|
304
|
+
// Check if eBay server already exists
|
|
305
|
+
const existingIndex = mcpServers.findIndex((server) => server.command === 'node' && server.args?.[0]?.includes('ebay-mcp'));
|
|
306
|
+
const serverConfig = {
|
|
307
|
+
command: 'node',
|
|
308
|
+
args: [join(projectRoot, 'build', 'index.js')],
|
|
309
|
+
};
|
|
310
|
+
if (existingIndex >= 0) {
|
|
311
|
+
mcpServers[existingIndex] = serverConfig;
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
314
|
+
mcpServers.push(serverConfig);
|
|
315
|
+
}
|
|
316
|
+
experimental.modelContextProtocolServers = mcpServers;
|
|
317
|
+
config.experimental = experimental;
|
|
318
|
+
writeJSONConfig(configPath, config);
|
|
319
|
+
return true;
|
|
320
|
+
}
|
|
321
|
+
catch (error) {
|
|
322
|
+
console.error('Failed to configure Continue.dev:', error);
|
|
323
|
+
return false;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Configure Zed editor with eBay MCP server
|
|
328
|
+
* Zed uses context_servers in settings.json
|
|
329
|
+
*/
|
|
330
|
+
export function configureZed(projectRoot) {
|
|
331
|
+
try {
|
|
332
|
+
const configPath = getZedConfigPath();
|
|
333
|
+
const config = readJSONConfig(configPath);
|
|
334
|
+
// Initialize context_servers if it doesn't exist
|
|
335
|
+
if (!config.context_servers || typeof config.context_servers !== 'object') {
|
|
336
|
+
config.context_servers = {};
|
|
337
|
+
}
|
|
338
|
+
const contextServers = config.context_servers;
|
|
339
|
+
// Add or update eBay MCP server configuration
|
|
340
|
+
contextServers['ebay-mcp-server'] = {
|
|
341
|
+
command: {
|
|
342
|
+
path: 'node',
|
|
343
|
+
args: [join(projectRoot, 'build', 'index.js')],
|
|
344
|
+
},
|
|
345
|
+
settings: {},
|
|
346
|
+
};
|
|
347
|
+
config.context_servers = contextServers;
|
|
348
|
+
writeJSONConfig(configPath, config);
|
|
349
|
+
return true;
|
|
350
|
+
}
|
|
351
|
+
catch (error) {
|
|
352
|
+
console.error('Failed to configure Zed:', error);
|
|
353
|
+
return false;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Configure Cursor IDE with eBay MCP server
|
|
358
|
+
* Cursor uses mcpServers in mcp.json
|
|
359
|
+
*/
|
|
360
|
+
export function configureCursor(projectRoot) {
|
|
361
|
+
try {
|
|
362
|
+
const configPath = getCursorConfigPath();
|
|
363
|
+
const config = readJSONConfig(configPath);
|
|
364
|
+
// Initialize mcpServers if it doesn't exist
|
|
365
|
+
if (!config.mcpServers || typeof config.mcpServers !== 'object') {
|
|
366
|
+
config.mcpServers = {};
|
|
367
|
+
}
|
|
368
|
+
const mcpServers = config.mcpServers;
|
|
369
|
+
// Add or update eBay MCP server configuration
|
|
370
|
+
mcpServers['ebay-mcp-server'] = {
|
|
371
|
+
command: 'node',
|
|
372
|
+
args: [join(projectRoot, 'build', 'index.js')],
|
|
373
|
+
};
|
|
374
|
+
config.mcpServers = mcpServers;
|
|
375
|
+
writeJSONConfig(configPath, config);
|
|
376
|
+
return true;
|
|
377
|
+
}
|
|
378
|
+
catch (error) {
|
|
379
|
+
console.error('Failed to configure Cursor:', error);
|
|
380
|
+
return false;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Configure Windsurf (Codeium) with eBay MCP server
|
|
385
|
+
*/
|
|
386
|
+
export function configureWindsurf(projectRoot) {
|
|
387
|
+
try {
|
|
388
|
+
const configPath = getWindsurfConfigPath();
|
|
389
|
+
const config = readJSONConfig(configPath);
|
|
390
|
+
// Initialize mcpServers if it doesn't exist
|
|
391
|
+
if (!config.mcpServers || typeof config.mcpServers !== 'object') {
|
|
392
|
+
config.mcpServers = {};
|
|
393
|
+
}
|
|
394
|
+
const mcpServers = config.mcpServers;
|
|
395
|
+
// Add or update eBay MCP server configuration
|
|
396
|
+
mcpServers['ebay-mcp-server'] = {
|
|
397
|
+
command: 'node',
|
|
398
|
+
args: [join(projectRoot, 'build', 'index.js')],
|
|
399
|
+
};
|
|
400
|
+
config.mcpServers = mcpServers;
|
|
401
|
+
writeJSONConfig(configPath, config);
|
|
402
|
+
return true;
|
|
403
|
+
}
|
|
404
|
+
catch (error) {
|
|
405
|
+
console.error('Failed to configure Windsurf:', error);
|
|
406
|
+
return false;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Configure Roo Code (VSCode extension) with eBay MCP server
|
|
411
|
+
*/
|
|
412
|
+
export function configureRooCode(projectRoot) {
|
|
413
|
+
try {
|
|
414
|
+
const configPath = getRooCodeConfigPath();
|
|
415
|
+
const config = readJSONConfig(configPath);
|
|
416
|
+
// Initialize mcpServers if it doesn't exist
|
|
417
|
+
if (!config.mcpServers || typeof config.mcpServers !== 'object') {
|
|
418
|
+
config.mcpServers = {};
|
|
419
|
+
}
|
|
420
|
+
const mcpServers = config.mcpServers;
|
|
421
|
+
// Add or update eBay MCP server configuration
|
|
422
|
+
mcpServers['ebay-mcp-server'] = {
|
|
423
|
+
command: 'node',
|
|
424
|
+
args: [join(projectRoot, 'build', 'index.js')],
|
|
425
|
+
};
|
|
426
|
+
config.mcpServers = mcpServers;
|
|
427
|
+
writeJSONConfig(configPath, config);
|
|
428
|
+
return true;
|
|
429
|
+
}
|
|
430
|
+
catch (error) {
|
|
431
|
+
console.error('Failed to configure Roo Code:', error);
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Configure Claude Code CLI with eBay MCP server
|
|
437
|
+
* Claude Code CLI uses mcpServers in ~/.claude.json
|
|
438
|
+
*/
|
|
439
|
+
export function configureClaudeCode(projectRoot) {
|
|
440
|
+
try {
|
|
441
|
+
const configPath = getClaudeCodeConfigPath();
|
|
442
|
+
const config = readJSONConfig(configPath);
|
|
443
|
+
// Initialize mcpServers if it doesn't exist
|
|
444
|
+
if (!config.mcpServers || typeof config.mcpServers !== 'object') {
|
|
445
|
+
config.mcpServers = {};
|
|
446
|
+
}
|
|
447
|
+
const mcpServers = config.mcpServers;
|
|
448
|
+
// Add or update eBay MCP server configuration
|
|
449
|
+
mcpServers['ebay-mcp-server'] = {
|
|
450
|
+
command: 'node',
|
|
451
|
+
args: [join(projectRoot, 'build', 'index.js')],
|
|
452
|
+
};
|
|
453
|
+
config.mcpServers = mcpServers;
|
|
454
|
+
writeJSONConfig(configPath, config);
|
|
455
|
+
return true;
|
|
456
|
+
}
|
|
457
|
+
catch (error) {
|
|
458
|
+
console.error('Failed to configure Claude Code CLI:', error);
|
|
459
|
+
return false;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Configure Amazon Q Developer with eBay MCP server
|
|
464
|
+
*/
|
|
465
|
+
export function configureAmazonQ(projectRoot) {
|
|
466
|
+
try {
|
|
467
|
+
const configPath = getAmazonQConfigPath();
|
|
468
|
+
const config = readJSONConfig(configPath);
|
|
469
|
+
// Initialize mcpServers if it doesn't exist
|
|
470
|
+
if (!config.mcpServers || typeof config.mcpServers !== 'object') {
|
|
471
|
+
config.mcpServers = {};
|
|
472
|
+
}
|
|
473
|
+
const mcpServers = config.mcpServers;
|
|
474
|
+
// Add or update eBay MCP server configuration
|
|
475
|
+
mcpServers['ebay-mcp-server'] = {
|
|
476
|
+
command: 'node',
|
|
477
|
+
args: [join(projectRoot, 'build', 'index.js')],
|
|
478
|
+
};
|
|
479
|
+
config.mcpServers = mcpServers;
|
|
480
|
+
writeJSONConfig(configPath, config);
|
|
481
|
+
return true;
|
|
482
|
+
}
|
|
483
|
+
catch (error) {
|
|
484
|
+
console.error('Failed to configure Amazon Q:', error);
|
|
485
|
+
return false;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Configure specified LLM client
|
|
490
|
+
*/
|
|
491
|
+
export function configureLLMClient(clientName, _projectRoot) {
|
|
492
|
+
switch (clientName) {
|
|
493
|
+
case 'claude':
|
|
494
|
+
return configureClaudeDesktop(_projectRoot);
|
|
495
|
+
case 'cline':
|
|
496
|
+
return configureCline(_projectRoot);
|
|
497
|
+
case 'continue':
|
|
498
|
+
return configureContinue(_projectRoot);
|
|
499
|
+
case 'zed':
|
|
500
|
+
return configureZed(_projectRoot);
|
|
501
|
+
case 'cursor':
|
|
502
|
+
return configureCursor(_projectRoot);
|
|
503
|
+
case 'windsurf':
|
|
504
|
+
return configureWindsurf(_projectRoot);
|
|
505
|
+
case 'roocode':
|
|
506
|
+
return configureRooCode(_projectRoot);
|
|
507
|
+
case 'claudecode':
|
|
508
|
+
return configureClaudeCode(_projectRoot);
|
|
509
|
+
case 'amazonq':
|
|
510
|
+
return configureAmazonQ(_projectRoot);
|
|
511
|
+
default:
|
|
512
|
+
return false;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Get human-readable instructions for manual configuration
|
|
517
|
+
*/
|
|
518
|
+
export function getManualConfigInstructions(clientName, projectRoot) {
|
|
519
|
+
const buildPath = join(projectRoot, 'build', 'index.js');
|
|
520
|
+
switch (clientName) {
|
|
521
|
+
case 'claude':
|
|
522
|
+
return `
|
|
523
|
+
Add this to ${getClaudeConfigPath()}:
|
|
524
|
+
|
|
525
|
+
{
|
|
526
|
+
"mcpServers": {
|
|
527
|
+
"ebay-mcp-server": {
|
|
528
|
+
"command": "node",
|
|
529
|
+
"args": ["${buildPath}"]
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}`;
|
|
533
|
+
case 'cline':
|
|
534
|
+
return `
|
|
535
|
+
Add this to ${getClineConfigPath()}:
|
|
536
|
+
|
|
537
|
+
{
|
|
538
|
+
"mcpServers": {
|
|
539
|
+
"ebay-mcp-server": {
|
|
540
|
+
"command": "node",
|
|
541
|
+
"args": ["${buildPath}"]
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}`;
|
|
545
|
+
case 'continue':
|
|
546
|
+
return `
|
|
547
|
+
Add this to ${getContinueConfigPath()}:
|
|
548
|
+
|
|
549
|
+
{
|
|
550
|
+
"experimental": {
|
|
551
|
+
"modelContextProtocolServers": [
|
|
552
|
+
{
|
|
553
|
+
"command": "node",
|
|
554
|
+
"args": ["${buildPath}"]
|
|
555
|
+
}
|
|
556
|
+
]
|
|
557
|
+
}
|
|
558
|
+
}`;
|
|
559
|
+
case 'zed':
|
|
560
|
+
return `
|
|
561
|
+
Add this to ${getZedConfigPath()}:
|
|
562
|
+
|
|
563
|
+
{
|
|
564
|
+
"context_servers": {
|
|
565
|
+
"ebay-mcp-server": {
|
|
566
|
+
"command": {
|
|
567
|
+
"path": "node",
|
|
568
|
+
"args": ["${buildPath}"]
|
|
569
|
+
},
|
|
570
|
+
"settings": {}
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}`;
|
|
574
|
+
case 'cursor':
|
|
575
|
+
return `
|
|
576
|
+
Add this to ${getCursorConfigPath()}:
|
|
577
|
+
|
|
578
|
+
{
|
|
579
|
+
"mcpServers": {
|
|
580
|
+
"ebay-mcp-server": {
|
|
581
|
+
"command": "node",
|
|
582
|
+
"args": ["${buildPath}"]
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}`;
|
|
586
|
+
case 'windsurf':
|
|
587
|
+
return `
|
|
588
|
+
Add this to ${getWindsurfConfigPath()}:
|
|
589
|
+
|
|
590
|
+
{
|
|
591
|
+
"mcpServers": {
|
|
592
|
+
"ebay-mcp-server": {
|
|
593
|
+
"command": "node",
|
|
594
|
+
"args": ["${buildPath}"]
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}`;
|
|
598
|
+
case 'roocode':
|
|
599
|
+
return `
|
|
600
|
+
Add this to ${getRooCodeConfigPath()}:
|
|
601
|
+
|
|
602
|
+
{
|
|
603
|
+
"mcpServers": {
|
|
604
|
+
"ebay-mcp-server": {
|
|
605
|
+
"command": "node",
|
|
606
|
+
"args": ["${buildPath}"]
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}`;
|
|
610
|
+
case 'claudecode':
|
|
611
|
+
return `
|
|
612
|
+
Add this to ${getClaudeCodeConfigPath()}:
|
|
613
|
+
|
|
614
|
+
{
|
|
615
|
+
"mcpServers": {
|
|
616
|
+
"ebay-mcp-server": {
|
|
617
|
+
"command": "node",
|
|
618
|
+
"args": ["${buildPath}"]
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}`;
|
|
622
|
+
case 'amazonq':
|
|
623
|
+
return `
|
|
624
|
+
Add this to ${getAmazonQConfigPath()}:
|
|
625
|
+
|
|
626
|
+
{
|
|
627
|
+
"mcpServers": {
|
|
628
|
+
"ebay-mcp-server": {
|
|
629
|
+
"command": "node",
|
|
630
|
+
"args": ["${buildPath}"]
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
}`;
|
|
634
|
+
default:
|
|
635
|
+
return 'Manual configuration instructions not available for this client.';
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Verify client configuration is correct
|
|
640
|
+
*/
|
|
641
|
+
export function verifyClientConfiguration(clientName, _projectRoot) {
|
|
642
|
+
try {
|
|
643
|
+
switch (clientName) {
|
|
644
|
+
case 'claude': {
|
|
645
|
+
const configPath = getClaudeConfigPath();
|
|
646
|
+
if (!existsSync(configPath))
|
|
647
|
+
return false;
|
|
648
|
+
const config = readJSONConfig(configPath);
|
|
649
|
+
const mcpServers = config.mcpServers;
|
|
650
|
+
return !!mcpServers?.['ebay-mcp-server'];
|
|
651
|
+
}
|
|
652
|
+
case 'cline': {
|
|
653
|
+
const configPath = getClineConfigPath();
|
|
654
|
+
if (!existsSync(configPath))
|
|
655
|
+
return false;
|
|
656
|
+
const config = readJSONConfig(configPath);
|
|
657
|
+
const mcpServers = config.mcpServers;
|
|
658
|
+
return !!mcpServers?.['ebay-mcp-server'];
|
|
659
|
+
}
|
|
660
|
+
case 'continue': {
|
|
661
|
+
const configPath = getContinueConfigPath();
|
|
662
|
+
if (!existsSync(configPath))
|
|
663
|
+
return false;
|
|
664
|
+
const config = readJSONConfig(configPath);
|
|
665
|
+
const experimental = config.experimental;
|
|
666
|
+
const mcpServers = experimental?.modelContextProtocolServers;
|
|
667
|
+
return !!mcpServers?.some((server) => server.args?.[0]?.includes('ebay-mcp'));
|
|
668
|
+
}
|
|
669
|
+
case 'zed': {
|
|
670
|
+
const configPath = getZedConfigPath();
|
|
671
|
+
if (!existsSync(configPath))
|
|
672
|
+
return false;
|
|
673
|
+
const config = readJSONConfig(configPath);
|
|
674
|
+
const contextServers = config.context_servers;
|
|
675
|
+
return !!contextServers?.['ebay-mcp-server'];
|
|
676
|
+
}
|
|
677
|
+
case 'cursor': {
|
|
678
|
+
const configPath = getCursorConfigPath();
|
|
679
|
+
if (!existsSync(configPath))
|
|
680
|
+
return false;
|
|
681
|
+
const config = readJSONConfig(configPath);
|
|
682
|
+
const mcpServers = config.mcpServers;
|
|
683
|
+
return !!mcpServers?.['ebay-mcp-server'];
|
|
684
|
+
}
|
|
685
|
+
case 'windsurf': {
|
|
686
|
+
const configPath = getWindsurfConfigPath();
|
|
687
|
+
if (!existsSync(configPath))
|
|
688
|
+
return false;
|
|
689
|
+
const config = readJSONConfig(configPath);
|
|
690
|
+
const mcpServers = config.mcpServers;
|
|
691
|
+
return !!mcpServers?.['ebay-mcp-server'];
|
|
692
|
+
}
|
|
693
|
+
case 'roocode': {
|
|
694
|
+
const configPath = getRooCodeConfigPath();
|
|
695
|
+
if (!existsSync(configPath))
|
|
696
|
+
return false;
|
|
697
|
+
const config = readJSONConfig(configPath);
|
|
698
|
+
const mcpServers = config.mcpServers;
|
|
699
|
+
return !!mcpServers?.['ebay-mcp-server'];
|
|
700
|
+
}
|
|
701
|
+
case 'claudecode': {
|
|
702
|
+
const configPath = getClaudeCodeConfigPath();
|
|
703
|
+
if (!existsSync(configPath))
|
|
704
|
+
return false;
|
|
705
|
+
const config = readJSONConfig(configPath);
|
|
706
|
+
const mcpServers = config.mcpServers;
|
|
707
|
+
return !!mcpServers?.['ebay-mcp-server'];
|
|
708
|
+
}
|
|
709
|
+
case 'amazonq': {
|
|
710
|
+
const configPath = getAmazonQConfigPath();
|
|
711
|
+
if (!existsSync(configPath))
|
|
712
|
+
return false;
|
|
713
|
+
const config = readJSONConfig(configPath);
|
|
714
|
+
const mcpServers = config.mcpServers;
|
|
715
|
+
return !!mcpServers?.['ebay-mcp-server'];
|
|
716
|
+
}
|
|
717
|
+
default:
|
|
718
|
+
return false;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
catch {
|
|
722
|
+
return false;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Get all LLM clients (detected and undetected)
|
|
727
|
+
*/
|
|
728
|
+
export function getAllSupportedClients() {
|
|
729
|
+
return [
|
|
730
|
+
'claude',
|
|
731
|
+
'cline',
|
|
732
|
+
'continue',
|
|
733
|
+
'zed',
|
|
734
|
+
'cursor',
|
|
735
|
+
'windsurf',
|
|
736
|
+
'roocode',
|
|
737
|
+
'claudecode',
|
|
738
|
+
'amazonq',
|
|
739
|
+
];
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Check if client supports MCP protocol
|
|
743
|
+
*/
|
|
744
|
+
export function supportsNativeMCP(clientName) {
|
|
745
|
+
// All these clients support MCP (Model Context Protocol)
|
|
746
|
+
const supportedClients = [
|
|
747
|
+
'claude',
|
|
748
|
+
'cline',
|
|
749
|
+
'continue',
|
|
750
|
+
'zed',
|
|
751
|
+
'cursor',
|
|
752
|
+
'windsurf',
|
|
753
|
+
'roocode',
|
|
754
|
+
'claudecode',
|
|
755
|
+
'amazonq',
|
|
756
|
+
];
|
|
757
|
+
return supportedClients.includes(clientName.toLowerCase());
|
|
758
|
+
}
|