@bryan-thompson/inspector-assessment-cli 1.24.1 → 1.24.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assess-full.js +17 -2
- package/package.json +1 -1
package/build/assess-full.js
CHANGED
|
@@ -410,8 +410,23 @@ async function runFullAssessment(options) {
|
|
|
410
410
|
console.log("✅ Connected to MCP server");
|
|
411
411
|
}
|
|
412
412
|
// Capture server info from initialization for protocol conformance checks
|
|
413
|
-
|
|
414
|
-
const
|
|
413
|
+
// Apply defensive null checks for protocol conformance validation
|
|
414
|
+
const rawServerInfo = client.getServerVersion();
|
|
415
|
+
const rawServerCapabilities = client.getServerCapabilities();
|
|
416
|
+
// Build serverInfo with safe fallbacks
|
|
417
|
+
const serverInfo = rawServerInfo
|
|
418
|
+
? {
|
|
419
|
+
name: rawServerInfo.name || "unknown",
|
|
420
|
+
version: rawServerInfo.version,
|
|
421
|
+
metadata: rawServerInfo.metadata,
|
|
422
|
+
}
|
|
423
|
+
: undefined;
|
|
424
|
+
// ServerCapabilities can be undefined - that's valid per MCP spec
|
|
425
|
+
const serverCapabilities = rawServerCapabilities ?? undefined;
|
|
426
|
+
// Log warning if server didn't provide initialization info
|
|
427
|
+
if (!serverInfo && !options.jsonOnly) {
|
|
428
|
+
console.log("⚠️ Server did not provide serverInfo during initialization");
|
|
429
|
+
}
|
|
415
430
|
const response = await client.listTools();
|
|
416
431
|
const tools = response.tools || [];
|
|
417
432
|
// Emit JSONL tool discovery events for audit-worker parsing
|
package/package.json
CHANGED