ConduitMcp.Session.EtsStore (ConduitMCP v0.9.0)

Copy Markdown View Source

Default ETS-based session store. Zero-dependency, works out of the box.

Sessions are stored in a named ETS table (:conduit_mcp_sessions). Each session stores the protocol version, creation timestamp, and arbitrary metadata.

TTL Cleanup

The ETS store supports optional TTL-based cleanup. When configured, expired sessions are removed periodically. Configure via the :ttl option (default: 30 minutes).

Usage

# In your transport config
{ConduitMcp.Transport.StreamableHTTP,
  server_module: MyServer,
  session: [store: ConduitMcp.Session.EtsStore, ttl: :timer.minutes(60)]}

Summary

Functions

Removes sessions older than ttl_ms milliseconds.

Ensures the ETS table exists. Called automatically on first use.

Functions

cleanup(ttl_ms)

Removes sessions older than ttl_ms milliseconds.

ensure_table()

Ensures the ETS table exists. Called automatically on first use.