mcpdog
Version:
MCPDog - Universal MCP Server Manager with Web Interface
56 lines • 1.46 kB
TypeScript
export interface ProtocolDetectionResult {
protocol: 'stdio' | 'http-sse' | 'streamable-http' | 'unknown';
confidence: number;
reason: string;
endpoint?: string;
features?: string[];
error?: string;
}
export interface ProtocolTestResult {
protocol: string;
supported: boolean;
responseTime: number;
features: string[];
error?: string;
}
export declare class ProtocolDetector {
private timeout;
private userAgent;
constructor(timeout?: number);
/**
* 自动检测端点支持的最佳协议
*/
detectBestProtocol(endpoint: string, options?: {
timeout?: number;
headers?: Record<string, string>;
}): Promise<ProtocolDetectionResult>;
/**
* 测试 Streamable HTTP 协议支持
*/
private testStreamableHttp;
/**
* 测试 HTTP+SSE 协议支持
*/
private testHttpSse;
/**
* 测试基础 HTTP 支持(作为后备)
*/
private testBasicHttp;
/**
* 选择最佳协议
*/
private selectBestProtocol;
/**
* 生成检测原因说明
*/
private generateReasonText;
/**
* 为 stdio 协议生成配置建议
*/
generateStdioSuggestion(command: string): ProtocolDetectionResult;
/**
* 批量检测多个端点
*/
detectMultipleEndpoints(endpoints: string[]): Promise<Map<string, ProtocolDetectionResult>>;
}
//# sourceMappingURL=protocol-detector.d.ts.map