MCP Server Framework - v1.0.0
    Preparing search index...

    Class SessionHousekeeper

    Manages periodic background tasks for session maintenance.

    Responsibilities:

    • Cleanup expired (idle) sessions at regular intervals
    • Send heartbeats and remove dead connections

    Timers are configured at construction and use .unref() to not prevent Node.js process exit.

    For stdio mode, pass cleanupIntervalMs: 0 and keepAliveIntervalMs: 0 to disable all background tasks.

    const housekeeper = new SessionHousekeeper(store, {
    timeoutMs: 30 * 60_000,
    cleanupIntervalMs: 60_000,
    keepAliveIntervalMs: 30_000,
    maxMissedHeartbeats: 3,
    });

    // Later during shutdown:
    housekeeper.dispose();
    Index

    Constructors

    Methods

    Constructors

    Methods