mcp-server-tester-sse-http-stdio
Version:
MCP Server Tester with SSE support - Test MCP servers using HTTP, SSE, and STDIO transports
162 lines (161 loc) • 4.59 kB
TypeScript
/**
* Type definitions for the Compliance framework
*/
import type { McpCapability } from './CapabilityDetector.js';
export declare const TEST_SEVERITY: {
readonly CRITICAL: "critical";
readonly WARNING: "warning";
readonly INFO: "info";
};
export type TestSeverity = (typeof TEST_SEVERITY)[keyof typeof TEST_SEVERITY];
/**
* Issue classification for enhanced reporting
*/
export declare const ISSUE_TYPE: {
readonly CRITICAL_FAILURE: "critical_failure";
readonly SPEC_WARNING: "spec_warning";
readonly OPTIMIZATION: "optimization";
readonly PERFORMANCE_ISSUE: "performance_issue";
};
export type IssueType = (typeof ISSUE_TYPE)[keyof typeof ISSUE_TYPE];
/**
* Protocol features - specific aspects of MCP that we test
*/
export type ProtocolFeature = 'transport' | 'json-rpc' | 'error-handling' | 'initialization' | 'capabilities' | 'version' | 'connection' | 'tools' | 'resources' | 'prompts' | 'ping' | 'progress' | 'cancellation' | 'completion' | 'logging' | 'pagination';
/**
* Protocol categories - groups of related protocol features
*/
export type ProtocolCategory = 'base-protocol' | 'lifecycle' | 'server-features' | 'utilities';
/**
* Test organization categories aligned with MCP specification structure
* @deprecated Use ProtocolCategory instead
*/
export type TestCategory = 'base-protocol' | 'lifecycle' | 'server-features' | 'security';
export interface DiagnosticResult {
testName: string;
category: TestCategory;
feature?: ProtocolFeature;
status: 'passed' | 'failed' | 'skipped';
message: string;
details?: unknown;
recommendations?: string[];
severity: TestSeverity;
duration: number;
requiredCapability?: McpCapability;
mcpSpecSection?: string;
issueType?: IssueType;
expected?: string;
actual?: string;
fixInstructions?: string[];
specLinks?: string[];
}
export interface TestCategorySummary {
name: string;
passed: number;
failed: number;
warnings: number;
total: number;
duration: number;
status: 'passed' | 'failed' | 'warning' | 'skipped';
}
export interface HealthScore {
overall: number;
categories: Record<string, number>;
weights: Record<string, number>;
}
export interface HealthReport {
serverInfo: {
name: string;
version?: string;
transport: string;
protocolVersion?: string;
};
serverCapabilities: Set<McpCapability>;
skippedCapabilities: McpCapability[];
metadata: {
timestamp: string;
duration: number;
testCount: number;
skippedTestCount: number;
};
summary: {
testResults: {
passed: number;
failed: number;
skipped: number;
total: number;
};
overallScore: number;
};
categories: TestCategorySummary[];
issues: DiagnosticResult[];
results: DiagnosticResult[];
categorizedIssues: {
criticalFailures: DiagnosticResult[];
specWarnings: DiagnosticResult[];
optimizations: DiagnosticResult[];
};
}
export interface ComplianceConfig {
timeouts: {
connection: number;
testExecution: number;
overall: number;
};
categories: {
enabled: string[];
disabled: string[];
};
output: {
format: 'console' | 'json';
file?: string;
};
experimental: {
useSdkErrorDetection: boolean;
};
}
export interface ComplianceOptions {
serverConfig: string;
serverName?: string;
categories?: string;
output?: string;
timeout?: string;
}
/**
* Information about a protocol feature and its tests
*/
export interface ProtocolFeatureInfo {
feature: ProtocolFeature;
category: ProtocolCategory;
displayName: string;
requiredCapability?: McpCapability;
tests: Array<{
new (): any;
}>;
}
/**
* Summary of test results for a protocol feature
*/
export interface ProtocolFeatureSummary {
feature: ProtocolFeature;
displayName: string;
passed: number;
failed: number;
skipped: number;
total: number;
duration: number;
status: 'passed' | 'failed' | 'warning' | 'skipped';
}
/**
* Summary of test results for a protocol category
*/
export interface ProtocolCategorySummary {
category: ProtocolCategory;
displayName: string;
features: Map<ProtocolFeature, ProtocolFeatureSummary>;
totalPassed: number;
totalFailed: number;
totalSkipped: number;
totalTests: number;
status: 'passed' | 'failed' | 'warning' | 'skipped';
}