Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
- Development mode: `npm run dev` (use `npm run dev:windows` on Windows)
- Format code: `npm run prettier-fix`
- Client lint: `cd client && npm run lint`
- Run tests: `npm test` (464 passing, 100% pass rate)
- Run tests: `npm test` (696 total, 669 passing, 27 timeout failures)
- Run assessment tests: `npm test -- assessment` (208 assessment module tests)
- Note: 27 test failures are SecurityAssessor timeout issues (480s limit), not logic errors

## Code Style Guidelines

Expand Down Expand Up @@ -195,6 +196,7 @@ For detailed documentation on specific features, see:
- **Functionality Testing**: [README.md](README.md#2-optimized-progressive-complexity-testing) - Multi-scenario validation, progressive complexity
- **Security Assessment**: [README.md](README.md#4-context-aware-security-assessment-with-zero-false-positives) - Domain-specific patterns, zero false positives
- **Error Handling**: [README.md](README.md#assessment-categories) - MCP protocol compliance, validation quality
- **MCP Spec Reference**: [docs/mcp_spec_11-2025.md](docs/mcp_spec_11-2025.md) - Protocol revision 2025-11-25 (latest)
- **MCP Spec Compliance**: See PROJECT_STATUS.md timeline for latest enhancements
- **Recent Changes**: [PROJECT_STATUS.md](PROJECT_STATUS.md#development-timeline---october-2025)

Expand All @@ -217,7 +219,7 @@ For detailed documentation on specific features, see:

**Testing:**

- `client/src/services/__tests__/` - 464 total tests (100% passing)
- `client/src/services/__tests__/` - 696 total tests (669 passing, 27 timeout failures)
- `client/src/services/assessment/__tests__/` - 208 assessment module tests

## Development Workflow
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ Our enhanced MCP Inspector includes a comprehensive assessment system that valid
- Input validation and sanitization checks
- Authentication/authorization testing
- Sensitive data exposure detection
- Dual-mode testing: Reviewer mode (3 critical patterns) + Developer mode (all 17 patterns)
- Dual-mode testing: Reviewer mode (3 critical patterns) + Developer mode (all 13 patterns)

5. **Usability**
- Tool naming consistency analysis
Expand Down
2 changes: 1 addition & 1 deletion cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bryan-thompson/inspector-assessment-cli",
"version": "1.7.1",
"version": "1.8.0",
"description": "CLI for the Enhanced MCP Inspector with assessment capabilities",
"license": "MIT",
"author": "Bryan Thompson <bryan@triepod.ai>",
Expand Down
71 changes: 70 additions & 1 deletion cli/src/assess-full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ interface AssessmentOptions {
sourceCodePath?: string;
claudeEnabled?: boolean;
fullAssessment?: boolean;
auditMode?: boolean;
verbose?: boolean;
jsonOnly?: boolean;
helpRequested?: boolean;
Expand Down Expand Up @@ -286,7 +287,22 @@ function buildConfig(options: AssessmentOptions): AssessmentConfiguration {
testTimeout: 30000,
};

if (options.fullAssessment !== false) {
if (options.auditMode) {
// Audit mode: only HIGH-value modules for automated MCP auditing
config.assessmentCategories = {
functionality: true,
security: true,
documentation: false,
errorHandling: true,
usability: false,
mcpSpecCompliance: true,
aupCompliance: false,
toolAnnotations: true,
prohibitedLibraries: false,
manifestValidation: false,
portability: false,
};
} else if (options.fullAssessment !== false) {
config.assessmentCategories = {
functionality: true,
security: true,
Expand Down Expand Up @@ -376,6 +392,7 @@ async function runFullAssessment(
callTool: createCallToolWrapper(client),
config,
sourceCodePath: options.sourceCodePath,
transportType: serverConfig.transport || "stdio",
...sourceFiles,
};

Expand All @@ -400,13 +417,53 @@ function saveResults(
serverName: string,
results: MCPDirectoryAssessment,
outputPath?: string,
transportType?: string,
): string {
const defaultPath = `/tmp/inspector-full-assessment-${serverName}.json`;
const finalPath = outputPath || defaultPath;

// Build audit summary for automated consumption
const securityResult = results.security as {
auditAnalysis?: {
highConfidenceVulnerabilities: string[];
needsReview: string[];
falsePositiveLikelihood: Record<string, string>;
};
vulnerabilities?: string[];
};
const functionalityResult = results.functionality as {
workingTools?: number;
totalTools?: number;
};
const mcpResult = results.mcpSpecCompliance as {
metrics?: { overallScore?: number };
};
const errorResult = results.errorHandling as {
metrics?: { mcpComplianceScore?: number };
};

const auditSummary = {
highConfidenceVulnerabilities:
securityResult?.auditAnalysis?.highConfidenceVulnerabilities || [],
needsReview: securityResult?.auditAnalysis?.needsReview || [],
falsePositiveLikelihood:
securityResult?.auditAnalysis?.falsePositiveLikelihood || {},
functionalTools: functionalityResult?.workingTools || 0,
totalTools: functionalityResult?.totalTools || 0,
mcpComplianceScore: errorResult?.metrics?.mcpComplianceScore || 0,
transportType: transportType || "unknown",
recommendedAction:
results.overallStatus === "PASS"
? "APPROVE"
: results.overallStatus === "FAIL"
? "REJECT"
: "REVIEW",
};

const output = {
timestamp: new Date().toISOString(),
assessmentType: "full",
auditSummary,
...results,
};

Expand Down Expand Up @@ -563,6 +620,9 @@ function parseArgs(): AssessmentOptions {
case "--full":
options.fullAssessment = true;
break;
case "--audit-mode":
options.auditMode = true;
break;
case "--verbose":
case "-v":
options.verbose = true;
Expand Down Expand Up @@ -617,6 +677,9 @@ Options:
--source <path> Source code path for deep analysis (AUP, portability, etc.)
--claude-enabled Enable Claude Code integration for intelligent analysis
--full Enable all assessment modules (default)
--audit-mode Run only high-value modules for automated MCP auditing
(Functionality, Security, ErrorHandling, MCPSpecCompliance, ToolAnnotations)
Reduces false positives and includes audit summary in output
--json Output only JSON (no console summary)
--verbose, -v Enable verbose logging
--help, -h Show this help message
Expand Down Expand Up @@ -658,10 +721,16 @@ async function main() {
displaySummary(results);
}

// Determine transport type for audit summary
const serverConfig = loadServerConfig(
options.serverName,
options.serverConfigPath,
);
const outputPath = saveResults(
options.serverName,
results,
options.outputPath,
serverConfig.transport || "stdio",
);

if (options.jsonOnly) {
Expand Down
24 changes: 12 additions & 12 deletions cli/src/assess-security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ async function runSecurityAssessment(

const config: AssessmentConfiguration = {
...DEFAULT_ASSESSMENT_CONFIG,
securityPatternsToTest: 17,
securityPatternsToTest: 13,
reviewerMode: false,
testTimeout: 30000,
};
Expand All @@ -247,9 +247,10 @@ async function runSecurityAssessment(
tools,
callTool: createCallToolWrapper(client),
config,
transportType: serverConfig.transport || "stdio",
};

console.log(`🛡️ Running security assessment with 17 attack patterns...`);
console.log(`🛡️ Running security assessment with 13 attack patterns...`);
const assessor = new SecurityAssessor(config);
const results = await assessor.assess(context);

Expand Down Expand Up @@ -386,7 +387,7 @@ function printHelp() {
console.log(`
Usage: mcp-assess-security [options] [server-name]

Run security assessment against an MCP server with 17 attack patterns.
Run security assessment against an MCP server with 13 attack patterns.

Options:
--server, -s <name> Server name (required, or pass as first positional arg)
Expand All @@ -396,15 +397,14 @@ Options:
--verbose, -v Enable verbose logging
--help, -h Show this help message

Attack Patterns Tested (17 total):
• Direct prompt injection
• Indirect prompt injection
• Instruction override
• Role-playing attacks
• Encoding bypass
• Multi-turn manipulation
• Context poisoning
• And more...
Attack Patterns Tested (13 total):
• Command Injection • SQL Injection
• Calculator Injection • Path Traversal
• Type Safety • Boundary Testing
• Required Fields • MCP Error Format
• Timeout Handling • Indirect Prompt Injection
• Unicode Bypass • Nested Injection
• Package Squatting

Examples:
mcp-assess-security my-server
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bryan-thompson/inspector-assessment-client",
"version": "1.7.1",
"version": "1.8.0",
"description": "Client-side application for the Enhanced MCP Inspector with assessment capabilities",
"license": "MIT",
"author": "Bryan Thompson <bryan@triepod.ai>",
Expand Down
13 changes: 13 additions & 0 deletions client/src/lib/assessmentTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ export interface SecurityTestResult {
connectionError?: boolean; // True if test failed due to connection/server failure
errorType?: "connection" | "server" | "protocol"; // Classify error type
testReliability?: "completed" | "failed" | "retried"; // Test execution status
// Audit-mode fields for automated consumption
vulnerableHighConfidence?: boolean; // Only true when confidence === "high" AND vulnerable
toolCategory?: string; // Classified tool category (e.g., "search_retrieval", "calculator")
}

export interface CodeExample {
Expand Down Expand Up @@ -243,6 +246,16 @@ export interface SecurityAssessment {
overallRiskLevel: SecurityRiskLevel;
status: AssessmentStatus;
explanation: string;
// Audit-mode: pre-computed false positive analysis
auditAnalysis?: {
highConfidenceVulnerabilities: string[];
needsReview: string[];
falsePositiveLikelihood: Record<string, "HIGH" | "MEDIUM" | "LOW">;
responseUniformity: Record<
string,
{ uniqueResponses: number; totalTests: number }
>;
};
}

export interface DocumentationAssessment {
Expand Down
4 changes: 4 additions & 0 deletions client/src/services/assessment/AssessmentOrchestrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export interface AssessmentContext {
// MCPB manifest validation (optional)
manifestJson?: ManifestJsonSchema;
manifestRaw?: string; // Raw manifest.json content for parsing validation

// Transport type for context-aware security testing
// Used to skip irrelevant tests (e.g., path traversal on remote servers)
transportType?: "stdio" | "http" | "sse";
}

export class AssessmentOrchestrator {
Expand Down
Loading
Loading