/** * Auto-detect authentication requirements from HTTP/SSE MCP servers * * Analyzes server responses to determine what authentication is needed: * - HTTP status codes (401, 403) * - WWW-Authenticate headers * - OAuth discovery endpoints * - MCP protocol error responses */ export interface AuthRequirements { type: 'bearer' | 'oauth' | 'apiKey' | 'basic' | 'none'; required: boolean; fields: AuthField[]; detected: { statusCode?: number; wwwAuthenticate?: string; errorMessage?: string; oauthEndpoints?: { deviceAuthUrl?: string; tokenUrl?: string; authorizationUrl?: string; }; }; } export interface AuthField { name: string; label: string; type: 'text' | 'password' | 'url'; required: boolean; description?: string; placeholder?: string; } export declare class AuthDetector { /** * Detect authentication requirements by probing the endpoint */ detect(url: string): Promise; /** * Analyze authentication response to determine requirements */ private analyzeAuthResponse; /** * Parse WWW-Authenticate header to determine auth scheme */ private parseWWWAuthenticate; /** * Try to discover OAuth endpoints using common patterns */ private tryOAuthDiscovery; /** * Get field definitions for bearer token auth */ private getBearerTokenFields; /** * Get field definitions for API key auth */ private getApiKeyFields; /** * Get field definitions for basic auth */ private getBasicAuthFields; /** * Get field definitions for OAuth */ private getOAuthFields; /** * Auto-fill discovered OAuth endpoints */ fillDiscoveredOAuthEndpoints(fields: AuthField[], endpoints: AuthRequirements['detected']['oauthEndpoints']): AuthField[]; } //# sourceMappingURL=auth-detector.d.ts.map