mcp-use
Version:
Opinionated MCP Framework for TypeScript (@modelcontextprotocol/sdk compatible) - Build MCP Agents, Clients and Servers with support for ChatGPT Apps, Code Mode, OAuth, Notifications, Sampling, Observability and more.
25 lines • 1.09 kB
TypeScript
/**
* Session Notifications
*
* Utility functions for sending JSON-RPC notifications to MCP sessions.
*/
import type { SessionData } from "./session-manager.js";
/**
* Send a notification to all connected sessions
*
* @param sessions - Map of active sessions
* @param method - The notification method name
* @param params - Optional parameters to include in the notification
*/
export declare function sendNotificationToAll(sessions: Map<string, SessionData>, method: string, params?: Record<string, unknown>): Promise<void>;
/**
* Send a notification to a specific session
*
* @param sessions - Map of active sessions
* @param sessionId - The target session ID
* @param method - The notification method name
* @param params - Optional parameters to include in the notification
* @returns true if the notification was sent, false if session not found
*/
export declare function sendNotificationToSession(sessions: Map<string, SessionData>, sessionId: string, method: string, params?: Record<string, unknown>): Promise<boolean>;
//# sourceMappingURL=notifications.d.ts.map