@defai.digital/ax-cli 3.15.10 → 3.15.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -2
- package/dist/agent/llm-agent.js +2 -2
- package/dist/agent/llm-agent.js.map +1 -1
- package/dist/analyzers/git/git-analyzer.js +17 -9
- package/dist/analyzers/git/git-analyzer.js.map +1 -1
- package/dist/commands/custom-commands.js +4 -2
- package/dist/commands/custom-commands.js.map +1 -1
- package/dist/commands/design.js +15 -4
- package/dist/commands/design.js.map +1 -1
- package/dist/commands/mcp.js +2 -2
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/memory.js +6 -4
- package/dist/commands/memory.js.map +1 -1
- package/dist/design/figma-tokens.js +3 -1
- package/dist/design/figma-tokens.js.map +1 -1
- package/dist/mcp/client-v2.js +14 -10
- package/dist/mcp/client-v2.js.map +1 -1
- package/dist/mcp/config-migrator.js +2 -2
- package/dist/mcp/config-migrator.js.map +1 -1
- package/dist/mcp/constants.d.ts +66 -0
- package/dist/mcp/constants.js +85 -0
- package/dist/mcp/constants.js.map +1 -0
- package/dist/mcp/content-length-transport.d.ts +2 -0
- package/dist/mcp/content-length-transport.js +18 -1
- package/dist/mcp/content-length-transport.js.map +1 -1
- package/dist/mcp/error-formatter.js +15 -218
- package/dist/mcp/error-formatter.js.map +1 -1
- package/dist/mcp/error-remediation.d.ts +45 -0
- package/dist/mcp/error-remediation.js +254 -0
- package/dist/mcp/error-remediation.js.map +1 -0
- package/dist/mcp/index.d.ts +16 -5
- package/dist/mcp/index.js +48 -17
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/resources.js +2 -2
- package/dist/mcp/resources.js.map +1 -1
- package/dist/mcp/ssrf-protection.js +1 -1
- package/dist/mcp/ssrf-protection.js.map +1 -1
- package/dist/mcp/templates.js +2 -2
- package/dist/mcp/templates.js.map +1 -1
- package/dist/mcp/type-safety.d.ts +5 -0
- package/dist/mcp/type-safety.js +8 -1
- package/dist/mcp/type-safety.js.map +1 -1
- package/dist/schemas/settings-schemas.d.ts +2 -2
- package/dist/sdk/testing.js +14 -4
- package/dist/sdk/testing.js.map +1 -1
- package/dist/tools/design-tool.js +7 -3
- package/dist/tools/design-tool.js.map +1 -1
- package/dist/ui/hooks/use-enhanced-input.js +5 -5
- package/dist/ui/hooks/use-enhanced-input.js.map +1 -1
- package/dist/utils/audit-logger.js +1 -1
- package/dist/utils/audit-logger.js.map +1 -1
- package/package.json +1 -1
- package/dist/mcp/client-mutex-patch.d.ts +0 -36
- package/dist/mcp/client-mutex-patch.js +0 -75
- package/dist/mcp/client-mutex-patch.js.map +0 -1
- package/dist/mcp/mutex.d.ts +0 -71
- package/dist/mcp/mutex.js +0 -137
- package/dist/mcp/mutex.js.map +0 -1
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* actionable, user-friendly messages with helpful hints and documentation links.
|
|
6
6
|
*/
|
|
7
7
|
import chalk from 'chalk';
|
|
8
|
+
import { matchErrorPattern, getTransportHints, getEnvVarHints } from './error-remediation.js';
|
|
8
9
|
/**
|
|
9
10
|
* Format a Zod validation error for MCP server config
|
|
10
11
|
*/
|
|
@@ -86,7 +87,10 @@ function getHintsForField(field, originalConfig) {
|
|
|
86
87
|
break;
|
|
87
88
|
default:
|
|
88
89
|
if (field.startsWith('transport.')) {
|
|
89
|
-
|
|
90
|
+
// BUG FIX: Validate split result before accessing index to prevent undefined access
|
|
91
|
+
const fieldParts = field.split('.');
|
|
92
|
+
const subField = fieldParts.length > 1 ? fieldParts[1] : field;
|
|
93
|
+
hints.push(`Check the ${subField} field in your transport configuration`);
|
|
90
94
|
}
|
|
91
95
|
}
|
|
92
96
|
return hints;
|
|
@@ -148,234 +152,27 @@ export function formatConnectionError(serverName, error, transportType) {
|
|
|
148
152
|
lines.push(chalk.red('╰────────────────────────────────────────────────╯'));
|
|
149
153
|
return lines.join('\n');
|
|
150
154
|
}
|
|
151
|
-
/**
|
|
152
|
-
* Comprehensive error code to remediation mapping
|
|
153
|
-
* Maps error codes/patterns to specific troubleshooting steps
|
|
154
|
-
*/
|
|
155
|
-
const ERROR_REMEDIATION = {
|
|
156
|
-
// Process/Command errors
|
|
157
|
-
'enoent': {
|
|
158
|
-
title: 'Command not found',
|
|
159
|
-
hints: [
|
|
160
|
-
'The MCP server command is not installed or not in PATH',
|
|
161
|
-
'Install the package: npm install -g <package-name>',
|
|
162
|
-
'Or use npx: npx <package-name>',
|
|
163
|
-
'Verify installation: which <command> or command -v <command>'
|
|
164
|
-
],
|
|
165
|
-
command: 'npm list -g --depth=0'
|
|
166
|
-
},
|
|
167
|
-
'eacces': {
|
|
168
|
-
title: 'Permission denied',
|
|
169
|
-
hints: [
|
|
170
|
-
'The command or file lacks execute permissions',
|
|
171
|
-
'Fix permissions: chmod +x <file>',
|
|
172
|
-
'Or install globally with proper permissions',
|
|
173
|
-
'Avoid using sudo with npm - fix npm permissions instead'
|
|
174
|
-
],
|
|
175
|
-
command: 'npm config set prefix ~/.npm-global'
|
|
176
|
-
},
|
|
177
|
-
'spawn': {
|
|
178
|
-
title: 'Failed to spawn process',
|
|
179
|
-
hints: [
|
|
180
|
-
'The command could not be started',
|
|
181
|
-
'Verify the command path is correct',
|
|
182
|
-
'Check if the binary is compatible with your system',
|
|
183
|
-
'Try running the command directly in terminal'
|
|
184
|
-
]
|
|
185
|
-
},
|
|
186
|
-
// Network errors
|
|
187
|
-
'econnrefused': {
|
|
188
|
-
title: 'Connection refused',
|
|
189
|
-
hints: [
|
|
190
|
-
'The MCP server is not running or not listening',
|
|
191
|
-
'Start the server first, then retry',
|
|
192
|
-
'Check if the port is correct',
|
|
193
|
-
'Verify no firewall is blocking the connection'
|
|
194
|
-
],
|
|
195
|
-
command: 'lsof -i :<port> # Check if port is in use'
|
|
196
|
-
},
|
|
197
|
-
'enotfound': {
|
|
198
|
-
title: 'Host not found',
|
|
199
|
-
hints: [
|
|
200
|
-
'The hostname could not be resolved',
|
|
201
|
-
'Check if the URL is spelled correctly',
|
|
202
|
-
'Verify your internet connection',
|
|
203
|
-
'Try using IP address instead of hostname'
|
|
204
|
-
],
|
|
205
|
-
command: 'nslookup <hostname>'
|
|
206
|
-
},
|
|
207
|
-
'econnreset': {
|
|
208
|
-
title: 'Connection reset',
|
|
209
|
-
hints: [
|
|
210
|
-
'The server closed the connection unexpectedly',
|
|
211
|
-
'The server may have crashed or restarted',
|
|
212
|
-
'Check server logs for errors',
|
|
213
|
-
'Retry the connection'
|
|
214
|
-
]
|
|
215
|
-
},
|
|
216
|
-
'etimedout': {
|
|
217
|
-
title: 'Connection timed out',
|
|
218
|
-
hints: [
|
|
219
|
-
'The server took too long to respond',
|
|
220
|
-
'Check if the server is overloaded',
|
|
221
|
-
'Verify network connectivity',
|
|
222
|
-
'Increase timeout in configuration if needed'
|
|
223
|
-
]
|
|
224
|
-
},
|
|
225
|
-
'esockettimedout': {
|
|
226
|
-
title: 'Socket timed out',
|
|
227
|
-
hints: [
|
|
228
|
-
'The connection was established but no response received',
|
|
229
|
-
'The server may be hanging or processing slowly',
|
|
230
|
-
'For stdio: ensure command has proper args (not a REPL)',
|
|
231
|
-
'Check if the MCP server is compatible with this client'
|
|
232
|
-
]
|
|
233
|
-
},
|
|
234
|
-
// SSL/TLS errors
|
|
235
|
-
'cert_': {
|
|
236
|
-
title: 'SSL Certificate error',
|
|
237
|
-
hints: [
|
|
238
|
-
'The server\'s SSL certificate is invalid or expired',
|
|
239
|
-
'For development: you can skip verification (not recommended)',
|
|
240
|
-
'For production: ensure valid certificate is installed',
|
|
241
|
-
'Check certificate chain: openssl s_client -connect <host>:443'
|
|
242
|
-
]
|
|
243
|
-
},
|
|
244
|
-
'unable_to_verify': {
|
|
245
|
-
title: 'SSL verification failed',
|
|
246
|
-
hints: [
|
|
247
|
-
'Cannot verify the server\'s SSL certificate',
|
|
248
|
-
'The certificate may be self-signed',
|
|
249
|
-
'CA certificates may need to be updated',
|
|
250
|
-
'Set NODE_TLS_REJECT_UNAUTHORIZED=0 for development only'
|
|
251
|
-
]
|
|
252
|
-
},
|
|
253
|
-
// Authentication errors
|
|
254
|
-
'401': {
|
|
255
|
-
title: 'Authentication failed',
|
|
256
|
-
hints: [
|
|
257
|
-
'The API key or token is invalid or expired',
|
|
258
|
-
'Check environment variable is set: echo $<VAR_NAME>',
|
|
259
|
-
'Regenerate the API key if expired',
|
|
260
|
-
'Verify the token has required permissions'
|
|
261
|
-
]
|
|
262
|
-
},
|
|
263
|
-
'403': {
|
|
264
|
-
title: 'Access forbidden',
|
|
265
|
-
hints: [
|
|
266
|
-
'You don\'t have permission to access this resource',
|
|
267
|
-
'Check if your API key has the required scopes',
|
|
268
|
-
'Verify the account has access to this feature',
|
|
269
|
-
'Contact the service provider for access'
|
|
270
|
-
]
|
|
271
|
-
},
|
|
272
|
-
// Server errors
|
|
273
|
-
'500': {
|
|
274
|
-
title: 'Server error',
|
|
275
|
-
hints: [
|
|
276
|
-
'The MCP server encountered an internal error',
|
|
277
|
-
'Check server logs for details',
|
|
278
|
-
'Try again later',
|
|
279
|
-
'Report the issue to the server maintainer'
|
|
280
|
-
]
|
|
281
|
-
},
|
|
282
|
-
'502': {
|
|
283
|
-
title: 'Bad gateway',
|
|
284
|
-
hints: [
|
|
285
|
-
'The server received an invalid response from upstream',
|
|
286
|
-
'The upstream server may be down',
|
|
287
|
-
'Try again later',
|
|
288
|
-
'Check if there are known outages'
|
|
289
|
-
]
|
|
290
|
-
},
|
|
291
|
-
'503': {
|
|
292
|
-
title: 'Service unavailable',
|
|
293
|
-
hints: [
|
|
294
|
-
'The server is temporarily unavailable',
|
|
295
|
-
'It may be overloaded or under maintenance',
|
|
296
|
-
'Wait a few minutes and retry',
|
|
297
|
-
'Check service status page'
|
|
298
|
-
]
|
|
299
|
-
},
|
|
300
|
-
// MCP-specific errors
|
|
301
|
-
'initialization failed': {
|
|
302
|
-
title: 'MCP initialization failed',
|
|
303
|
-
hints: [
|
|
304
|
-
'The MCP server failed to initialize properly',
|
|
305
|
-
'Check if all required environment variables are set',
|
|
306
|
-
'Verify the server version is compatible',
|
|
307
|
-
'Try running: ax-cli mcp test <server-name>'
|
|
308
|
-
]
|
|
309
|
-
},
|
|
310
|
-
'protocol error': {
|
|
311
|
-
title: 'MCP protocol error',
|
|
312
|
-
hints: [
|
|
313
|
-
'Invalid message format or unsupported protocol version',
|
|
314
|
-
'Ensure the server implements MCP protocol correctly',
|
|
315
|
-
'Check for server updates',
|
|
316
|
-
'Verify client and server versions are compatible'
|
|
317
|
-
]
|
|
318
|
-
},
|
|
319
|
-
'tool not found': {
|
|
320
|
-
title: 'MCP tool not found',
|
|
321
|
-
hints: [
|
|
322
|
-
'The requested tool is not available on the server',
|
|
323
|
-
'List available tools: ax-cli mcp tools <server-name>',
|
|
324
|
-
'The server may need to be restarted',
|
|
325
|
-
'Check if the tool requires additional configuration'
|
|
326
|
-
]
|
|
327
|
-
}
|
|
328
|
-
};
|
|
329
155
|
/**
|
|
330
156
|
* Get hints for connection errors
|
|
331
|
-
*
|
|
157
|
+
* Uses extracted error remediation module for pattern matching
|
|
332
158
|
*/
|
|
333
159
|
function getConnectionErrorHints(error, transportType) {
|
|
334
160
|
const hints = [];
|
|
335
|
-
|
|
336
|
-
const
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
hints.push(
|
|
342
|
-
if (remediation.command) {
|
|
343
|
-
hints.push(`Debug command: ${chalk.cyan(remediation.command)}`);
|
|
344
|
-
}
|
|
345
|
-
break;
|
|
161
|
+
// Check for specific error codes first using extracted module
|
|
162
|
+
const remediation = matchErrorPattern(error);
|
|
163
|
+
if (remediation) {
|
|
164
|
+
hints.push(`${chalk.bold(remediation.title)}`);
|
|
165
|
+
hints.push(...remediation.hints);
|
|
166
|
+
if (remediation.command) {
|
|
167
|
+
hints.push(`Debug command: ${chalk.cyan(remediation.command)}`);
|
|
346
168
|
}
|
|
347
169
|
}
|
|
348
170
|
// If no specific match, provide transport-specific hints
|
|
349
171
|
if (hints.length === 0) {
|
|
350
|
-
|
|
351
|
-
hints.push('For stdio transport:');
|
|
352
|
-
hints.push('• Verify command is installed: which <command>');
|
|
353
|
-
hints.push('• Ensure args include a script path (not just the runtime)');
|
|
354
|
-
hints.push('• Example: ["@modelcontextprotocol/server-github"]');
|
|
355
|
-
hints.push('• Commands like "node" without args start a REPL and hang');
|
|
356
|
-
}
|
|
357
|
-
else if (transportType === 'http' || transportType === 'sse') {
|
|
358
|
-
hints.push('For HTTP/SSE transport:');
|
|
359
|
-
hints.push('• Verify server is running: curl <url>/health');
|
|
360
|
-
hints.push('• Check URL is accessible from your network');
|
|
361
|
-
hints.push('• Verify SSL certificate if using HTTPS');
|
|
362
|
-
hints.push('• Check authentication headers are correct');
|
|
363
|
-
}
|
|
364
|
-
else {
|
|
365
|
-
hints.push('General troubleshooting:');
|
|
366
|
-
hints.push('• Check the server logs for more details');
|
|
367
|
-
hints.push('• Verify all required environment variables are set');
|
|
368
|
-
hints.push('• Try running ax-cli mcp test <server-name>');
|
|
369
|
-
}
|
|
172
|
+
hints.push(...getTransportHints(transportType));
|
|
370
173
|
}
|
|
371
174
|
// Add environment variable hints if relevant
|
|
372
|
-
|
|
373
|
-
hints.push('');
|
|
374
|
-
hints.push('Environment variable tips:');
|
|
375
|
-
hints.push('• Set in shell: export VAR_NAME=value');
|
|
376
|
-
hints.push('• Or in .env file in project root');
|
|
377
|
-
hints.push('• Verify: echo $VAR_NAME');
|
|
378
|
-
}
|
|
175
|
+
hints.push(...getEnvVarHints(error.message));
|
|
379
176
|
return hints;
|
|
380
177
|
}
|
|
381
178
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-formatter.js","sourceRoot":"","sources":["../../src/mcp/error-formatter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAe1B;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,UAAkB,EAClB,KAAiB,EACjB,cAAoB;IAEpB,MA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AAa,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Error Remediation Module
|
|
3
|
+
*
|
|
4
|
+
* Centralized error code to remediation mapping for MCP connection errors.
|
|
5
|
+
* Maps error codes/patterns to specific troubleshooting steps.
|
|
6
|
+
*
|
|
7
|
+
* Extracted from error-formatter.ts for better separation of concerns.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Remediation information for an error
|
|
11
|
+
*/
|
|
12
|
+
export interface Remediation {
|
|
13
|
+
/** Short title describing the error */
|
|
14
|
+
title: string;
|
|
15
|
+
/** List of troubleshooting hints */
|
|
16
|
+
hints: string[];
|
|
17
|
+
/** Optional debug command to run */
|
|
18
|
+
command?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Comprehensive error code to remediation mapping
|
|
22
|
+
* Maps error codes/patterns to specific troubleshooting steps
|
|
23
|
+
*/
|
|
24
|
+
export declare const ERROR_REMEDIATION: Record<string, Remediation>;
|
|
25
|
+
/**
|
|
26
|
+
* Match an error against known patterns and return remediation info
|
|
27
|
+
*
|
|
28
|
+
* @param error - The error to match
|
|
29
|
+
* @returns Remediation info if a pattern matches, null otherwise
|
|
30
|
+
*/
|
|
31
|
+
export declare function matchErrorPattern(error: Error): Remediation | null;
|
|
32
|
+
/**
|
|
33
|
+
* Get transport-specific troubleshooting hints when no specific error pattern matches
|
|
34
|
+
*
|
|
35
|
+
* @param transportType - The transport type (stdio, http, sse)
|
|
36
|
+
* @returns Array of troubleshooting hints
|
|
37
|
+
*/
|
|
38
|
+
export declare function getTransportHints(transportType?: string): string[];
|
|
39
|
+
/**
|
|
40
|
+
* Get environment variable hints if the error relates to credentials
|
|
41
|
+
*
|
|
42
|
+
* @param errorMessage - The error message to check
|
|
43
|
+
* @returns Array of environment variable hints, or empty array if not applicable
|
|
44
|
+
*/
|
|
45
|
+
export declare function getEnvVarHints(errorMessage: string): string[];
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Error Remediation Module
|
|
3
|
+
*
|
|
4
|
+
* Centralized error code to remediation mapping for MCP connection errors.
|
|
5
|
+
* Maps error codes/patterns to specific troubleshooting steps.
|
|
6
|
+
*
|
|
7
|
+
* Extracted from error-formatter.ts for better separation of concerns.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Comprehensive error code to remediation mapping
|
|
11
|
+
* Maps error codes/patterns to specific troubleshooting steps
|
|
12
|
+
*/
|
|
13
|
+
export const ERROR_REMEDIATION = {
|
|
14
|
+
// Process/Command errors
|
|
15
|
+
'enoent': {
|
|
16
|
+
title: 'Command not found',
|
|
17
|
+
hints: [
|
|
18
|
+
'The MCP server command is not installed or not in PATH',
|
|
19
|
+
'Install the package: npm install -g <package-name>',
|
|
20
|
+
'Or use npx: npx <package-name>',
|
|
21
|
+
'Verify installation: which <command> or command -v <command>'
|
|
22
|
+
],
|
|
23
|
+
command: 'npm list -g --depth=0'
|
|
24
|
+
},
|
|
25
|
+
'eacces': {
|
|
26
|
+
title: 'Permission denied',
|
|
27
|
+
hints: [
|
|
28
|
+
'The command or file lacks execute permissions',
|
|
29
|
+
'Fix permissions: chmod +x <file>',
|
|
30
|
+
'Or install globally with proper permissions',
|
|
31
|
+
'Avoid using sudo with npm - fix npm permissions instead'
|
|
32
|
+
],
|
|
33
|
+
command: 'npm config set prefix ~/.npm-global'
|
|
34
|
+
},
|
|
35
|
+
'spawn': {
|
|
36
|
+
title: 'Failed to spawn process',
|
|
37
|
+
hints: [
|
|
38
|
+
'The command could not be started',
|
|
39
|
+
'Verify the command path is correct',
|
|
40
|
+
'Check if the binary is compatible with your system',
|
|
41
|
+
'Try running the command directly in terminal'
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
// Network errors
|
|
45
|
+
'econnrefused': {
|
|
46
|
+
title: 'Connection refused',
|
|
47
|
+
hints: [
|
|
48
|
+
'The MCP server is not running or not listening',
|
|
49
|
+
'Start the server first, then retry',
|
|
50
|
+
'Check if the port is correct',
|
|
51
|
+
'Verify no firewall is blocking the connection'
|
|
52
|
+
],
|
|
53
|
+
command: 'lsof -i :<port> # Check if port is in use'
|
|
54
|
+
},
|
|
55
|
+
'enotfound': {
|
|
56
|
+
title: 'Host not found',
|
|
57
|
+
hints: [
|
|
58
|
+
'The hostname could not be resolved',
|
|
59
|
+
'Check if the URL is spelled correctly',
|
|
60
|
+
'Verify your internet connection',
|
|
61
|
+
'Try using IP address instead of hostname'
|
|
62
|
+
],
|
|
63
|
+
command: 'nslookup <hostname>'
|
|
64
|
+
},
|
|
65
|
+
'econnreset': {
|
|
66
|
+
title: 'Connection reset',
|
|
67
|
+
hints: [
|
|
68
|
+
'The server closed the connection unexpectedly',
|
|
69
|
+
'The server may have crashed or restarted',
|
|
70
|
+
'Check server logs for errors',
|
|
71
|
+
'Retry the connection'
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
'etimedout': {
|
|
75
|
+
title: 'Connection timed out',
|
|
76
|
+
hints: [
|
|
77
|
+
'The server took too long to respond',
|
|
78
|
+
'Check if the server is overloaded',
|
|
79
|
+
'Verify network connectivity',
|
|
80
|
+
'Increase timeout in configuration if needed'
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
'esockettimedout': {
|
|
84
|
+
title: 'Socket timed out',
|
|
85
|
+
hints: [
|
|
86
|
+
'The connection was established but no response received',
|
|
87
|
+
'The server may be hanging or processing slowly',
|
|
88
|
+
'For stdio: ensure command has proper args (not a REPL)',
|
|
89
|
+
'Check if the MCP server is compatible with this client'
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
// SSL/TLS errors
|
|
93
|
+
'cert_': {
|
|
94
|
+
title: 'SSL Certificate error',
|
|
95
|
+
hints: [
|
|
96
|
+
'The server\'s SSL certificate is invalid or expired',
|
|
97
|
+
'For development: you can skip verification (not recommended)',
|
|
98
|
+
'For production: ensure valid certificate is installed',
|
|
99
|
+
'Check certificate chain: openssl s_client -connect <host>:443'
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
'unable_to_verify': {
|
|
103
|
+
title: 'SSL verification failed',
|
|
104
|
+
hints: [
|
|
105
|
+
'Cannot verify the server\'s SSL certificate',
|
|
106
|
+
'The certificate may be self-signed',
|
|
107
|
+
'CA certificates may need to be updated',
|
|
108
|
+
'Set NODE_TLS_REJECT_UNAUTHORIZED=0 for development only'
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
// Authentication errors
|
|
112
|
+
'401': {
|
|
113
|
+
title: 'Authentication failed',
|
|
114
|
+
hints: [
|
|
115
|
+
'The API key or token is invalid or expired',
|
|
116
|
+
'Check environment variable is set: echo $<VAR_NAME>',
|
|
117
|
+
'Regenerate the API key if expired',
|
|
118
|
+
'Verify the token has required permissions'
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
'403': {
|
|
122
|
+
title: 'Access forbidden',
|
|
123
|
+
hints: [
|
|
124
|
+
'You don\'t have permission to access this resource',
|
|
125
|
+
'Check if your API key has the required scopes',
|
|
126
|
+
'Verify the account has access to this feature',
|
|
127
|
+
'Contact the service provider for access'
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
// Server errors
|
|
131
|
+
'500': {
|
|
132
|
+
title: 'Server error',
|
|
133
|
+
hints: [
|
|
134
|
+
'The MCP server encountered an internal error',
|
|
135
|
+
'Check server logs for details',
|
|
136
|
+
'Try again later',
|
|
137
|
+
'Report the issue to the server maintainer'
|
|
138
|
+
]
|
|
139
|
+
},
|
|
140
|
+
'502': {
|
|
141
|
+
title: 'Bad gateway',
|
|
142
|
+
hints: [
|
|
143
|
+
'The server received an invalid response from upstream',
|
|
144
|
+
'The upstream server may be down',
|
|
145
|
+
'Try again later',
|
|
146
|
+
'Check if there are known outages'
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
'503': {
|
|
150
|
+
title: 'Service unavailable',
|
|
151
|
+
hints: [
|
|
152
|
+
'The server is temporarily unavailable',
|
|
153
|
+
'It may be overloaded or under maintenance',
|
|
154
|
+
'Wait a few minutes and retry',
|
|
155
|
+
'Check service status page'
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
// MCP-specific errors
|
|
159
|
+
'initialization failed': {
|
|
160
|
+
title: 'MCP initialization failed',
|
|
161
|
+
hints: [
|
|
162
|
+
'The MCP server failed to initialize properly',
|
|
163
|
+
'Check if all required environment variables are set',
|
|
164
|
+
'Verify the server version is compatible',
|
|
165
|
+
'Try running: ax-cli mcp test <server-name>'
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
'protocol error': {
|
|
169
|
+
title: 'MCP protocol error',
|
|
170
|
+
hints: [
|
|
171
|
+
'Invalid message format or unsupported protocol version',
|
|
172
|
+
'Ensure the server implements MCP protocol correctly',
|
|
173
|
+
'Check for server updates',
|
|
174
|
+
'Verify client and server versions are compatible'
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
'tool not found': {
|
|
178
|
+
title: 'MCP tool not found',
|
|
179
|
+
hints: [
|
|
180
|
+
'The requested tool is not available on the server',
|
|
181
|
+
'List available tools: ax-cli mcp tools <server-name>',
|
|
182
|
+
'The server may need to be restarted',
|
|
183
|
+
'Check if the tool requires additional configuration'
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
/**
|
|
188
|
+
* Match an error against known patterns and return remediation info
|
|
189
|
+
*
|
|
190
|
+
* @param error - The error to match
|
|
191
|
+
* @returns Remediation info if a pattern matches, null otherwise
|
|
192
|
+
*/
|
|
193
|
+
export function matchErrorPattern(error) {
|
|
194
|
+
const message = error.message.toLowerCase();
|
|
195
|
+
const errorCode = error.code?.toLowerCase() || '';
|
|
196
|
+
for (const [pattern, remediation] of Object.entries(ERROR_REMEDIATION)) {
|
|
197
|
+
if (message.includes(pattern) || errorCode.includes(pattern)) {
|
|
198
|
+
return remediation;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Get transport-specific troubleshooting hints when no specific error pattern matches
|
|
205
|
+
*
|
|
206
|
+
* @param transportType - The transport type (stdio, http, sse)
|
|
207
|
+
* @returns Array of troubleshooting hints
|
|
208
|
+
*/
|
|
209
|
+
export function getTransportHints(transportType) {
|
|
210
|
+
if (transportType === 'stdio') {
|
|
211
|
+
return [
|
|
212
|
+
'For stdio transport:',
|
|
213
|
+
'• Verify command is installed: which <command>',
|
|
214
|
+
'• Ensure args include a script path (not just the runtime)',
|
|
215
|
+
'• Example: ["@modelcontextprotocol/server-github"]',
|
|
216
|
+
'• Commands like "node" without args start a REPL and hang'
|
|
217
|
+
];
|
|
218
|
+
}
|
|
219
|
+
if (transportType === 'http' || transportType === 'sse') {
|
|
220
|
+
return [
|
|
221
|
+
'For HTTP/SSE transport:',
|
|
222
|
+
'• Verify server is running: curl <url>/health',
|
|
223
|
+
'• Check URL is accessible from your network',
|
|
224
|
+
'• Verify SSL certificate if using HTTPS',
|
|
225
|
+
'• Check authentication headers are correct'
|
|
226
|
+
];
|
|
227
|
+
}
|
|
228
|
+
return [
|
|
229
|
+
'General troubleshooting:',
|
|
230
|
+
'• Check the server logs for more details',
|
|
231
|
+
'• Verify all required environment variables are set',
|
|
232
|
+
'• Try running ax-cli mcp test <server-name>'
|
|
233
|
+
];
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Get environment variable hints if the error relates to credentials
|
|
237
|
+
*
|
|
238
|
+
* @param errorMessage - The error message to check
|
|
239
|
+
* @returns Array of environment variable hints, or empty array if not applicable
|
|
240
|
+
*/
|
|
241
|
+
export function getEnvVarHints(errorMessage) {
|
|
242
|
+
const message = errorMessage.toLowerCase();
|
|
243
|
+
if (message.includes('api_key') || message.includes('token') || message.includes('secret')) {
|
|
244
|
+
return [
|
|
245
|
+
'',
|
|
246
|
+
'Environment variable tips:',
|
|
247
|
+
'• Set in shell: export VAR_NAME=value',
|
|
248
|
+
'• Or in .env file in project root',
|
|
249
|
+
'• Verify: echo $VAR_NAME'
|
|
250
|
+
];
|
|
251
|
+
}
|
|
252
|
+
return [];
|
|
253
|
+
}
|
|
254
|
+
//# sourceMappingURL=error-remediation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-remediation.js","sourceRoot":"","sources":["../../src/mcp/error-remediation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAcH;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAgC;IAC5D,yBAAyB;IACzB,QAAQ,EAAE;QACR,KAAK,EAAE,mBAAmB;QAC1B,KAAK,EAAE;YACL,wDAAwD;YACxD,oDAAoD;YACpD,gCAAgC;YAChC,8DAA8D;SAC/D;QACD,OAAO,EAAE,uBAAuB;KACjC;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,mBAAmB;QAC1B,KAAK,EAAE;YACL,+CAA+C;YAC/C,kCAAkC;YAClC,6CAA6C;YAC7C,yDAAyD;SAC1D;QACD,OAAO,EAAE,qCAAqC;KAC/C;IACD,OAAO,EAAE;QACP,KAAK,EAAE,yBAAyB;QAChC,KAAK,EAAE;YACL,kCAAkC;YAClC,oCAAoC;YACpC,oDAAoD;YACpD,8CAA8C;SAC/C;KACF;IAED,iBAAiB;IACjB,cAAc,EAAE;QACd,KAAK,EAAE,oBAAoB;QAC3B,KAAK,EAAE;YACL,gDAAgD;YAChD,oCAAoC;YACpC,8BAA8B;YAC9B,+CAA+C;SAChD;QACD,OAAO,EAAE,2CAA2C;KACrD;IACD,WAAW,EAAE;QACX,KAAK,EAAE,gBAAgB;QACvB,KAAK,EAAE;YACL,oCAAoC;YACpC,uCAAuC;YACvC,iCAAiC;YACjC,0CAA0C;SAC3C;QACD,OAAO,EAAE,qBAAqB;KAC/B;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,kBAAkB;QACzB,KAAK,EAAE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AK,EAAE,CAAC;QACxD,OAAO;YACL,yBAAyB;YACzB,+CAA+C;YAC/C,6CAA6C;YAC7C,yCAAyC;YACzC,4CAA4C;SAC7C,CAAC;IACJ,CAAC;IAED,OAAO;QACL,0BAA0B;QAC1B,0CAA0C;QAC1C,qDAAqD;QACrD,6CAA6C;KAC9C,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,YAAoB;IACjD,MAAM,OAAO,GAAG,YAAY,CAAC,WAAW,EAAE,CAAC;IAE3C,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3F,OAAO;YACL,EAAE;YACF,4BAA4B;YAC5B,uCAAuC;YACvC,mCAAmC;YACnC,0BAA0B;SAC3B,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
package/dist/mcp/index.d.ts
CHANGED
|
@@ -16,24 +16,35 @@
|
|
|
16
16
|
* All new code should use `MCPManagerV2` for better type safety.
|
|
17
17
|
* `MCPManager` is maintained for SDK backward compatibility.
|
|
18
18
|
*
|
|
19
|
+
* ## Export Organization
|
|
20
|
+
*
|
|
21
|
+
* Exports are grouped by domain:
|
|
22
|
+
* 1. Core API (v1 legacy + v2 recommended)
|
|
23
|
+
* 2. Configuration (loading, templates, migration)
|
|
24
|
+
* 3. Transports (stdio, HTTP, SSE)
|
|
25
|
+
* 4. Features (progress, cancellation, subscriptions, validation)
|
|
26
|
+
* 5. Utilities (type safety, resources, prompts)
|
|
27
|
+
* 6. Z.AI Integration (templates, detection)
|
|
28
|
+
*
|
|
19
29
|
* @packageDocumentation
|
|
20
30
|
*/
|
|
21
31
|
export { MCPManager } from "./client.js";
|
|
22
32
|
export type { MCPTool, MCPServerConfig, MCPTransportConfig } from "./client.js";
|
|
23
33
|
export { MCPManagerV2, createServerName, createToolName, type ConnectionState, type ReconnectionConfig, type MCPPrompt, } from "./client-v2.js";
|
|
24
34
|
export type { ServerName, ToolName } from "./client-v2.js";
|
|
25
|
-
export { parseMCPIdentifier, // Shared utility for parsing MCP identifiers
|
|
26
|
-
promptToSlashCommand, parsePromptCommand, formatPromptResult, getPromptDescription, } from "./prompts.js";
|
|
27
35
|
export { loadMCPConfig, addMCPServer, removeMCPServer, PREDEFINED_SERVERS, getTemplate, generateConfigFromTemplate, } from "./config.js";
|
|
28
36
|
export type { MCPConfig } from "./config.js";
|
|
29
|
-
export { createTransport, type MCPTransport, type TransportType, type TransportConfig, type StdioFraming, } from "./transports.js";
|
|
30
37
|
export { detectConfigFormat, detectMultipleConfigs, getDetectionSummary } from "./config-detector.js";
|
|
31
38
|
export { migrateConfig, batchMigrateConfigs, formatBatchMigrationResult } from "./config-migrator.js";
|
|
32
|
-
export {
|
|
33
|
-
export { resolveMCPReferences, extractMCPReferences } from "./resources.js";
|
|
39
|
+
export { createTransport, type MCPTransport, type TransportType, type TransportConfig, type StdioFraming, } from "./transports.js";
|
|
34
40
|
export { ProgressTracker, getProgressTracker, resetProgressTracker, formatProgress, formatElapsedTime, type ProgressUpdate, type ProgressCallback, } from "./progress.js";
|
|
35
41
|
export { CancellationManager, getCancellationManager, resetCancellationManager, isRequestCancelled, createCancellationError, CANCELLED_ERROR_CODE, type CancellableRequest, type CancellationResult, } from "./cancellation.js";
|
|
36
42
|
export { SubscriptionManager, getSubscriptionManager, resetSubscriptionManager, type ResourceSubscription, } from "./subscriptions.js";
|
|
37
43
|
export { ToolOutputValidator, getToolOutputValidator, resetToolOutputValidator, type SchemaValidationResult, type SchemaValidationStatus, } from "./schema-validator.js";
|
|
44
|
+
export { MCP_TIMEOUTS, MCP_LIMITS, MCP_ERROR_CODES, MCP_RECONNECTION, MCP_TRANSPORT_DEFAULTS, MCP_PATTERNS, } from "./constants.js";
|
|
45
|
+
export { Result, Ok, Err, toError } from "./type-safety.js";
|
|
46
|
+
export { matchErrorPattern, getTransportHints, getEnvVarHints, ERROR_REMEDIATION, type Remediation } from "./error-remediation.js";
|
|
47
|
+
export { resolveMCPReferences, extractMCPReferences } from "./resources.js";
|
|
48
|
+
export { parseMCPIdentifier, promptToSlashCommand, parsePromptCommand, formatPromptResult, getPromptDescription, } from "./prompts.js";
|
|
38
49
|
export { ZAI_SERVER_NAMES, ZAI_ENDPOINTS, ZAI_VISION_PACKAGE, ZAI_MCP_TEMPLATES, ZAI_QUOTA_LIMITS, generateZAIServerConfig, getAllZAIServerNames, isZAIServer, getZAITemplate, type ZAIServerName, type ZAIPlanTier, type ZAIMCPTemplate, } from "./zai-templates.js";
|
|
39
50
|
export { detectZAIServices, getEnabledZAIServers, validateZAIApiKey, getZAIApiKey, isZAIMCPConfigured, getRecommendedServers, isGLMModel, isZAIBaseURL, formatZAIStatus, type ZAIServiceStatus, } from "./zai-detector.js";
|