UNPKG

@the_cfdude/productboard-mcp

Version:

Model Context Protocol server for Productboard REST API with dynamic tool loading

53 lines (52 loc) 1.68 kB
/** * Session management for ProductBoard MCP Server * Provides isolated state per connection to prevent conflicts between multiple clients */ export interface SessionState { sessionId: string; createdAt: Date; lastActivity: Date; clientInfo?: { userAgent?: string; clientId?: string; }; apiInstances: Map<string, any>; configCache: Map<string, any>; requestCount: number; activeRequests: Set<string>; } export interface SessionManager { createSession(sessionId?: string): SessionState; getSession(sessionId: string): SessionState | undefined; updateActivity(sessionId: string): void; removeSession(sessionId: string): void; cleanupInactiveSessions(): void; getActiveSessionCount(): number; getSessionStats(): SessionStats; } export interface SessionStats { totalSessions: number; activeSessions: number; totalRequests: number; averageRequestsPerSession: number; oldestSession?: Date; } declare class ProductBoardSessionManager implements SessionManager { private sessions; private cleanupInterval; private readonly sessionTimeout; private readonly cleanupIntervalMs; constructor(); createSession(sessionId?: string): SessionState; getSession(sessionId: string): SessionState | undefined; updateActivity(sessionId: string): void; removeSession(sessionId: string): void; cleanupInactiveSessions(): void; getActiveSessionCount(): number; getSessionStats(): SessionStats; private generateSessionId; private startCleanupTimer; shutdown(): void; } export declare const sessionManager: ProductBoardSessionManager; export {};