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

    Class InMemorySessionStore

    Built-in in-memory session store using a Map.

    Suitable for single-instance deployments. For horizontal scaling, implement the SessionStore interface with a shared backend.

    Responsibilities:

    • Create, get, close, and query sessions
    • Enforce capacity limits
    • Track statistics (created, peak, by transport type)
    • Broadcast notifications to all connected clients

    Does NOT manage timers or background tasks.

    const store = new InMemorySessionStore(100);

    const session = store.create({ transportType: 'http', transport, mcpSession });
    const found = store.get(session.id);
    store.broadcastToolListChanged();
    await store.close(session.id, SESSION_CLOSE_REASONS.CLIENT_DISCONNECT);

    Implements

    Index

    Constructors

    Accessors

    Methods

    • Sends a resource updated notification to sessions subscribed to the given URI.

      Unlike list-changed broadcasts (sent to all sessions), this only notifies sessions that have subscribed to the specific resource URI via resources/subscribe.

      Parameters

      • uri: string

      Returns void