ConduitMcp.Session (ConduitMCP v0.9.5)

Copy Markdown View Source

Session management facade for MCP protocol sessions.

MCP sessions track the negotiated protocol version and client state across requests. The session store is pluggable via the ConduitMcp.Session.Store behaviour.

Configuration

Session configuration is passed through the transport options:

{ConduitMcp.Transport.StreamableHTTP,
  server_module: MyServer,
  session: [
    store: ConduitMcp.Session.EtsStore,  # default
    ttl: :timer.minutes(30)              # default
  ]}

Set session: false to disable session management entirely.

Summary

Functions

create(session_id, metadata, store \\ ConduitMcp.Session.EtsStore)

Creates a new session.

delete(session_id, store \\ ConduitMcp.Session.EtsStore)

Deletes a session.

generate_id()

Generates a unique session ID.

get(session_id, store \\ ConduitMcp.Session.EtsStore)

Retrieves a session by ID.

update(session_id, metadata, store \\ ConduitMcp.Session.EtsStore)

Updates session metadata.