UNPKG

@iriseller/mcp-server

Version:

Model Context Protocol (MCP) server providing access to IRISeller's AI sales intelligence platform with 7 AI agents, multi-CRM integration, advanced sales workflows, email automation (detection/sending/campaigns), and robust asynchronous agent execution h

87 lines (86 loc) 3.24 kB
import { APIResponse, AgentExecutionRequest, AgentExecutionResponse, WorkflowExecutionRequest, WorkflowExecutionResponse, CRMQuery, CompanyResearchRequest, PersonalizationRequest, Lead, Opportunity, Contact, MCPServerConfig } from '../types/index.js'; export declare class IRISellerAPIService { private backendApi; private crewaiApi; private crmConnectApi; private config; private userToken?; private tokenExpiry?; private tokenRefreshInProgress; private debugLog; private errorLog; constructor(config: MCPServerConfig); /** * Set user token for authenticated operations */ setUserToken(token: string): void; /** * Generic method to make HTTP requests to the backend API */ makeRequest(method: string, endpoint: string, options?: any): Promise<APIResponse>; /** * Generate system JWT token for internal API calls */ private generateSystemJwtToken; /** * Check if token is expired or will expire soon (within 5 minutes) */ private isTokenExpired; /** * Refresh the user token using system token generation */ private refreshUserToken; /** * Generate a user token for system operations using default credentials */ private generateUserTokenForSystem; /** * Ensure we have a valid token before making requests */ private ensureValidToken; private setupInterceptors; checkHealth(): Promise<{ backend: boolean; crewai: boolean; crmConnect: boolean; }>; queryCRM(query: CRMQuery, userToken?: string): Promise<APIResponse<Lead[] | Opportunity[] | Contact[]>>; executeAgent(request: AgentExecutionRequest): Promise<AgentExecutionResponse>; private waitForAgentCompletion; private pollForAgentCompletion; private getAgentExecutionResults; private completedExecutions; private storeCompletedExecution; getCompletedExecution(executionId: string): Promise<any>; executeWorkflow(request: WorkflowExecutionRequest): Promise<WorkflowExecutionResponse>; researchCompany(request: CompanyResearchRequest): Promise<APIResponse>; personalizeOutreach(request: PersonalizationRequest): Promise<APIResponse>; getAvailableAgents(): Promise<APIResponse>; getAvailableWorkflows(): Promise<APIResponse>; createAgentExecution({ userId, agentName, agentType, title, inputData, source }: { userId: string; agentName: string; agentType: string; title: string; inputData: any; source?: string; }): Promise<{ id: string; }>; completeAgentExecution(executionId: string, results: any, executionTime: number, confidence: number, resultSummary: string): Promise<void>; qualifyLead(leadData: { contact_name: string; company_name: string; title?: string; industry?: string; email?: string; phone?: string; additional_context?: string; execution_id?: string; }): Promise<AgentExecutionResponse>; getForecast(params?: { time_period?: string; include_scenarios?: boolean; filters?: Record<string, any>; }, userToken?: string): Promise<APIResponse>; }