import type { McpServer } from '@modelcontextprotocol/server'; /** * Manages MCP resource subscriptions globally for the server. * Tracks which transport sessions are subscribed to which resource URIs, * and maintains references to the McpServer instances to broadcast notifications. */ export declare class SubscriptionManager { private static readonly MAX_TRACKED_SESSIONS; private static readonly MAX_SUBSCRIPTIONS_PER_SESSION; private servers; private subscriptions; /** * Register a server instance for a session to allow sending notifications. */ registerServer(sessionId: string, server: McpServer): void; /** * Unregister a server instance and clean up its subscriptions. */ unregisterServer(sessionId: string): void; /** * Subscribe a session to a resource URI. */ subscribe(uri: string, sessionId?: string): void; /** * Unsubscribe a session from a resource URI. */ unsubscribe(uri: string, sessionId?: string): void; /** * Unsubscribe a session from all resources (useful on transport disconnect). */ unsubscribeSession(sessionId: string): void; /** * Notifies all subscribed clients that a resource has changed. */ notifyResourceUpdated(uri: string): Promise; /** * Broadcasts a generic notification to all connected clients. */ broadcastNotification(method: string): Promise; /** * Check if there are any active subscribers for a specific URI. */ hasSubscribers(uri: string): boolean; } export declare const globalSubscriptionManager: SubscriptionManager; //# sourceMappingURL=subscription-manager.d.ts.map