@bryan-thompson/inspector-assessment-cli 1.43.3 ā 1.43.5
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 +21 -117
- package/build/lib/cli-parser.js +14 -1
- package/build/lib/cli-parserSchemas.js +1 -0
- package/build/lib/result-output.js +21 -0
- package/build/profiles.js +20 -0
- package/package.json +1 -1
package/build/assess-full.js
CHANGED
|
@@ -20,6 +20,8 @@ import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/
|
|
|
20
20
|
import { AssessmentOrchestrator, } from "../../client/lib/services/assessment/AssessmentOrchestrator.js";
|
|
21
21
|
import { DEFAULT_ASSESSMENT_CONFIG, } from "../../client/lib/lib/assessmentTypes.js";
|
|
22
22
|
import { FULL_CLAUDE_CODE_CONFIG } from "../../client/lib/services/assessment/lib/claudeCodeBridge.js";
|
|
23
|
+
// Use modular CLI parser with full flag support (30+ flags)
|
|
24
|
+
import { parseArgs, } from "./lib/cli-parser.js";
|
|
23
25
|
/**
|
|
24
26
|
* Load server configuration from Claude Code's MCP settings
|
|
25
27
|
*/
|
|
@@ -257,7 +259,17 @@ async function runFullAssessment(options) {
|
|
|
257
259
|
if (!options.jsonOnly) {
|
|
258
260
|
console.log(`\nš Starting full assessment for: ${options.serverName}`);
|
|
259
261
|
}
|
|
260
|
-
|
|
262
|
+
// Build server config from --http/--sse flags or config file
|
|
263
|
+
let serverConfig;
|
|
264
|
+
if (options.httpUrl) {
|
|
265
|
+
serverConfig = { transport: "http", url: options.httpUrl };
|
|
266
|
+
}
|
|
267
|
+
else if (options.sseUrl) {
|
|
268
|
+
serverConfig = { transport: "sse", url: options.sseUrl };
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
serverConfig = loadServerConfig(options.serverName, options.serverConfigPath);
|
|
272
|
+
}
|
|
261
273
|
if (!options.jsonOnly) {
|
|
262
274
|
console.log("ā
Server config loaded");
|
|
263
275
|
}
|
|
@@ -423,126 +435,13 @@ function displaySummary(results) {
|
|
|
423
435
|
}
|
|
424
436
|
console.log("\n" + "=".repeat(70));
|
|
425
437
|
}
|
|
426
|
-
/**
|
|
427
|
-
* Parse command-line arguments
|
|
428
|
-
*/
|
|
429
|
-
function parseArgs() {
|
|
430
|
-
const args = process.argv.slice(2);
|
|
431
|
-
const options = {};
|
|
432
|
-
for (let i = 0; i < args.length; i++) {
|
|
433
|
-
const arg = args[i];
|
|
434
|
-
if (!arg)
|
|
435
|
-
continue;
|
|
436
|
-
switch (arg) {
|
|
437
|
-
case "--server":
|
|
438
|
-
case "-s":
|
|
439
|
-
options.serverName = args[++i];
|
|
440
|
-
break;
|
|
441
|
-
case "--config":
|
|
442
|
-
case "-c":
|
|
443
|
-
options.serverConfigPath = args[++i];
|
|
444
|
-
break;
|
|
445
|
-
case "--output":
|
|
446
|
-
case "-o":
|
|
447
|
-
options.outputPath = args[++i];
|
|
448
|
-
break;
|
|
449
|
-
case "--source":
|
|
450
|
-
options.sourceCodePath = args[++i];
|
|
451
|
-
break;
|
|
452
|
-
case "--claude-enabled":
|
|
453
|
-
options.claudeEnabled = true;
|
|
454
|
-
break;
|
|
455
|
-
case "--full":
|
|
456
|
-
options.fullAssessment = true;
|
|
457
|
-
break;
|
|
458
|
-
case "--audit-mode":
|
|
459
|
-
options.auditMode = true;
|
|
460
|
-
break;
|
|
461
|
-
case "--verbose":
|
|
462
|
-
case "-v":
|
|
463
|
-
options.verbose = true;
|
|
464
|
-
break;
|
|
465
|
-
case "--json":
|
|
466
|
-
options.jsonOnly = true;
|
|
467
|
-
break;
|
|
468
|
-
case "--help":
|
|
469
|
-
case "-h":
|
|
470
|
-
printHelp();
|
|
471
|
-
options.helpRequested = true;
|
|
472
|
-
return options;
|
|
473
|
-
default:
|
|
474
|
-
if (!arg.startsWith("-")) {
|
|
475
|
-
if (!options.serverName) {
|
|
476
|
-
options.serverName = arg;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
else {
|
|
480
|
-
console.error(`Unknown argument: ${arg}`);
|
|
481
|
-
printHelp();
|
|
482
|
-
setTimeout(() => process.exit(1), 10);
|
|
483
|
-
options.helpRequested = true;
|
|
484
|
-
return options;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
if (!options.serverName) {
|
|
489
|
-
console.error("Error: --server is required");
|
|
490
|
-
printHelp();
|
|
491
|
-
setTimeout(() => process.exit(1), 10);
|
|
492
|
-
options.helpRequested = true;
|
|
493
|
-
return options;
|
|
494
|
-
}
|
|
495
|
-
return options;
|
|
496
|
-
}
|
|
497
|
-
/**
|
|
498
|
-
* Print help message
|
|
499
|
-
*/
|
|
500
|
-
function printHelp() {
|
|
501
|
-
console.log(`
|
|
502
|
-
Usage: mcp-assess-full [options] [server-name]
|
|
503
|
-
|
|
504
|
-
Run comprehensive MCP server assessment with all 11 assessor modules.
|
|
505
|
-
|
|
506
|
-
Options:
|
|
507
|
-
--server, -s <name> Server name (required, or pass as first positional arg)
|
|
508
|
-
--config, -c <path> Path to server config JSON
|
|
509
|
-
--output, -o <path> Output JSON path (default: /tmp/inspector-full-assessment-<server>.json)
|
|
510
|
-
--source <path> Source code path for deep analysis (AUP, portability, etc.)
|
|
511
|
-
--claude-enabled Enable Claude Code integration for intelligent analysis
|
|
512
|
-
--full Enable all assessment modules (default)
|
|
513
|
-
--audit-mode Run only high-value modules for automated MCP auditing
|
|
514
|
-
(Functionality, Security, ErrorHandling, MCPSpecCompliance, ToolAnnotations)
|
|
515
|
-
Reduces false positives and includes audit summary in output
|
|
516
|
-
--json Output only JSON (no console summary)
|
|
517
|
-
--verbose, -v Enable verbose logging
|
|
518
|
-
--help, -h Show this help message
|
|
519
|
-
|
|
520
|
-
Assessment Modules (11 total):
|
|
521
|
-
⢠Functionality - Tests all tools work correctly
|
|
522
|
-
⢠Security - Prompt injection & vulnerability testing
|
|
523
|
-
⢠Documentation - README completeness checks
|
|
524
|
-
⢠Error Handling - Validates error responses
|
|
525
|
-
⢠Usability - Input validation & UX
|
|
526
|
-
⢠MCP Spec - Protocol compliance
|
|
527
|
-
⢠AUP Compliance - Acceptable Use Policy checks
|
|
528
|
-
⢠Tool Annotations - readOnlyHint/destructiveHint validation
|
|
529
|
-
⢠Prohibited Libs - Dependency security checks
|
|
530
|
-
⢠Manifest - MCPB manifest.json validation
|
|
531
|
-
⢠Portability - Cross-platform compatibility
|
|
532
|
-
|
|
533
|
-
Examples:
|
|
534
|
-
mcp-assess-full my-server
|
|
535
|
-
mcp-assess-full --server broken-mcp --claude-enabled
|
|
536
|
-
mcp-assess-full --server my-server --source ./my-server --output ./results.json
|
|
537
|
-
`);
|
|
538
|
-
}
|
|
539
438
|
/**
|
|
540
439
|
* Main execution
|
|
541
440
|
*/
|
|
542
441
|
async function main() {
|
|
543
442
|
try {
|
|
544
443
|
const options = parseArgs();
|
|
545
|
-
if (options.helpRequested) {
|
|
444
|
+
if (options.helpRequested || options.versionRequested || options.listModules) {
|
|
546
445
|
return;
|
|
547
446
|
}
|
|
548
447
|
const results = await runFullAssessment(options);
|
|
@@ -550,8 +449,13 @@ async function main() {
|
|
|
550
449
|
displaySummary(results);
|
|
551
450
|
}
|
|
552
451
|
// Determine transport type for audit summary
|
|
553
|
-
const
|
|
554
|
-
|
|
452
|
+
const transportType = options.httpUrl
|
|
453
|
+
? "http"
|
|
454
|
+
: options.sseUrl
|
|
455
|
+
? "sse"
|
|
456
|
+
: loadServerConfig(options.serverName, options.serverConfigPath)
|
|
457
|
+
.transport || "stdio";
|
|
458
|
+
const outputPath = saveResults(options.serverName, results, options.outputPath, transportType);
|
|
555
459
|
if (options.jsonOnly) {
|
|
556
460
|
console.log(outputPath);
|
|
557
461
|
}
|
package/build/lib/cli-parser.js
CHANGED
|
@@ -316,6 +316,11 @@ export function parseArgs(argv) {
|
|
|
316
316
|
// Issue #137: Stage B enrichment for Claude semantic analysis
|
|
317
317
|
options.stageBVerbose = true;
|
|
318
318
|
break;
|
|
319
|
+
case "--audit-mode":
|
|
320
|
+
// Reduced false positives for automated MCP auditing
|
|
321
|
+
options.auditMode = true;
|
|
322
|
+
options.profile = "audit";
|
|
323
|
+
break;
|
|
319
324
|
case "--static-only":
|
|
320
325
|
// Issue #213: Static-only assessment without server connection
|
|
321
326
|
options.staticOnly = true;
|
|
@@ -417,6 +422,13 @@ export function parseArgs(argv) {
|
|
|
417
422
|
options.helpRequested = true;
|
|
418
423
|
return options;
|
|
419
424
|
}
|
|
425
|
+
// Validate mutual exclusivity of --audit-mode with --profile (audit-mode sets profile internally)
|
|
426
|
+
if (options.auditMode && options.profile && options.profile !== "audit") {
|
|
427
|
+
console.error("Error: --audit-mode cannot be used with --profile (audit mode sets its own profile)");
|
|
428
|
+
setTimeout(() => process.exit(1), 10);
|
|
429
|
+
options.helpRequested = true;
|
|
430
|
+
return options;
|
|
431
|
+
}
|
|
420
432
|
// Validate mutual exclusivity of --module with orchestrator options (Issue #184)
|
|
421
433
|
if (options.singleModule &&
|
|
422
434
|
(options.skipModules?.length ||
|
|
@@ -547,7 +559,8 @@ Options:
|
|
|
547
559
|
--claude-http Enable Claude Code via HTTP transport (connects to mcp-auditor proxy)
|
|
548
560
|
--mcp-auditor-url <url> mcp-auditor URL for HTTP transport (default: http://localhost:8085)
|
|
549
561
|
--full Enable all assessment modules (default)
|
|
550
|
-
--
|
|
562
|
+
--audit-mode Reduced false positives for automated MCP auditing (sets --profile audit)
|
|
563
|
+
--profile <name> Use predefined module profile (quick, security, compliance, full, dev, audit)
|
|
551
564
|
--temporal-invocations <n> Number of invocations per tool for rug pull detection (default: 3)
|
|
552
565
|
--skip-temporal Skip temporal/rug pull testing (faster assessment)
|
|
553
566
|
--conformance Enable official MCP conformance tests (experimental, requires HTTP/SSE transport)
|
|
@@ -303,6 +303,27 @@ export function displaySummary(results) {
|
|
|
303
303
|
console.log(` ⢠${rec}`);
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
+
// Audit mode summary
|
|
307
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
308
|
+
const auditAnalysis = security?.auditAnalysis;
|
|
309
|
+
if (auditAnalysis) {
|
|
310
|
+
console.log("\nš AUDIT ANALYSIS (reduced false positives):");
|
|
311
|
+
if (auditAnalysis.highConfidenceVulnerabilities?.length > 0) {
|
|
312
|
+
console.log(` šØ High-confidence vulnerabilities: ${auditAnalysis.highConfidenceVulnerabilities.length}`);
|
|
313
|
+
for (const vuln of auditAnalysis.highConfidenceVulnerabilities.slice(0, 5)) {
|
|
314
|
+
console.log(` ⢠${vuln}`);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
console.log(" ā
No high-confidence vulnerabilities detected");
|
|
319
|
+
}
|
|
320
|
+
if (auditAnalysis.needsReview?.length > 0) {
|
|
321
|
+
console.log(` ā ļø Needs manual review: ${auditAnalysis.needsReview.length}`);
|
|
322
|
+
for (const item of auditAnalysis.needsReview.slice(0, 3)) {
|
|
323
|
+
console.log(` ⢠${item}`);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
306
327
|
console.log("\n" + "=".repeat(70));
|
|
307
328
|
}
|
|
308
329
|
// ============================================================================
|
package/build/profiles.js
CHANGED
|
@@ -160,6 +160,20 @@ export const ASSESSMENT_PROFILES = {
|
|
|
160
160
|
* Includes: Tier 1-4 + opt-in (prohibitedLibraries, manifestValidation, etc.)
|
|
161
161
|
*/
|
|
162
162
|
all: [...ALL_MODULES],
|
|
163
|
+
/**
|
|
164
|
+
* Audit profile: Optimized for automated MCP auditing with reduced false positives
|
|
165
|
+
* Use when: --audit-mode flag, CI/CD pipeline audits
|
|
166
|
+
* Time: ~8-12 minutes
|
|
167
|
+
* Includes: Core security + compliance + capability + tool annotations
|
|
168
|
+
*/
|
|
169
|
+
audit: [
|
|
170
|
+
"functionality",
|
|
171
|
+
"security",
|
|
172
|
+
"errorHandling",
|
|
173
|
+
"protocolCompliance",
|
|
174
|
+
"aupCompliance",
|
|
175
|
+
"toolAnnotations",
|
|
176
|
+
],
|
|
163
177
|
};
|
|
164
178
|
export const PROFILE_METADATA = {
|
|
165
179
|
quick: {
|
|
@@ -214,6 +228,12 @@ export const PROFILE_METADATA = {
|
|
|
214
228
|
"Opt-In",
|
|
215
229
|
],
|
|
216
230
|
},
|
|
231
|
+
audit: {
|
|
232
|
+
description: "Automated MCP auditing with reduced false positives (--audit-mode)",
|
|
233
|
+
estimatedTime: "~8-12 minutes",
|
|
234
|
+
moduleCount: ASSESSMENT_PROFILES.audit.length,
|
|
235
|
+
tiers: ["Tier 1 (Core Security)", "Tier 2 (Compliance, partial)"],
|
|
236
|
+
},
|
|
217
237
|
};
|
|
218
238
|
/**
|
|
219
239
|
* Resolve module names, applying aliases for deprecated names.
|
package/package.json
CHANGED