NexusMCP.Session (NexusMCP v0.3.0)

Copy Markdown View Source

GenServer representing a single MCP client session.

Each MCP client gets its own process. Tool calls execute concurrently via Tasks. SSE connections are monitored. Process death = session gone = 404.

Summary

Functions

Returns a specification to start this module under a supervisor.

Register an SSE connection with this session. The session will monitor the pid.

Send an RPC request to the session. Returns the response map.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

register_sse(pid, sse_pid)

Register an SSE connection with this session. The session will monitor the pid.

rpc(pid, request)

Send an RPC request to the session. Returns the response map.

start_link(opts)