/** * NCP MCP Server - SDK-based Implementation * Uses official @modelcontextprotocol/sdk Server class */ import type { ElicitationServer } from '../utils/elicitation-helper.js'; export declare class MCPServer implements ElicitationServer { private server; private orchestrator; private initializationPromise; private isInitialized; private initializationError; private notifications; private elicitationSupported; private tokenTracker; private enableCodeMode; private capabilityDetector; constructor(profileName?: string, showProgress?: boolean, forceRetry?: boolean); private setupHandlers; private getToolDefinitions; initialize(): Promise; waitForInitialization(): Promise; /** * Public method for CLI to call tools programmatically * @param toolName - Name of the tool to call ('find', 'run', or 'code') * @param args - Tool arguments * @returns Tool result */ callTool(toolName: string, args: any): Promise; /** * Public method for tests to send JSON-RPC requests * @param request - JSON-RPC request object * @returns JSON-RPC response object */ handleRequest(request: any): Promise; /** * Public method for tests to call prompts/list * @param request - JSON-RPC request object * @returns JSON-RPC response with prompts list */ handleListPrompts(request: any): Promise; /** * Public method for tests to call prompts/get * @param request - JSON-RPC request object with params.name and params.arguments * @returns JSON-RPC response with prompt content */ handleGetPrompt(request: any): Promise; private handleGetPromptInternal; /** * Convert raw tool result to structured ToolResult */ private convertToStructuredTool; /** * Infer UI metadata for tools based on name and description * Used for rendering hints in Claude Desktop */ private inferToolUIMetadata; /** * Build structured find result */ private buildStructuredFindResult; /** * Build structured multi-query result */ private buildStructuredMultiQueryResult; private handleMultiQuery; private handleFind; /** * Handle no results case with registry fallback and installation instructions */ private handleNoResultsWithRegistryFallback; private handleRun; private handleCode; private parseParameters; private getSuggestions; /** * Estimate number of tool calls in code by counting await statements * This is a rough estimate - counts lines with "await namespace.method(" pattern */ private estimateToolCallsInCode; private levenshteinDistance; private generateDryRunPreview; /** * Send a progress notification to the client (MCP 2025-11-25) * Used for long-running operations like indexing */ sendProgressNotification(token: string, progress: number, total: number, message?: string): Promise; /** * MCP 2025-11-25: Send a logging notification to the client * Used to send debug logs to Claude Desktop, Cursor, etc. */ private sendLoggingNotification; /** * Check if client supports a specific capability */ supportsCapability(capability: string): boolean; /** * Get all client-supported capabilities */ getClientCapabilities(): string[]; connect(): Promise; run(): Promise; cleanup(): Promise; shutdown(): Promise; /** * Handle resources/list request */ private handleListResources; /** * MCP 2025-11-25: Handle roots/list request for file picker integration * Exposes filesystem boundaries that Claude Desktop uses for file selection UI */ private handleListRoots; /** * Handle resources/read request */ private handleReadResource; /** * Generate NCP-specific resource content */ private generateNCPResourceContent; /** * Generate getting started guide */ private generateGettingStartedGuide; /** * Generate health dashboard */ private generateHealthDashboard; /** * Generate auto-import summary */ private generateAutoImportSummary; /** * Elicitation API for credential collection * Implements the ElicitationServer interface to enable clipboard-based credential collection * * Note: Includes 5-second timeout to detect unsupported clients quickly */ elicitInput(params: { message: string; requestedSchema: { type: 'object'; properties: Record; required?: string[]; }; }): Promise<{ action: 'accept' | 'decline' | 'cancel'; content?: Record; }>; } export default MCPServer; //# sourceMappingURL=mcp-server.d.ts.map