mcp: add Session.ID (#67)

Support retrieving the session ID from client and server sessions.

Fixes #65.
This commit is contained in:
Jonathan Amsterdam 2025-07-01 13:49:23 -04:00 • committed by GitHub
commit 9b6327b3b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -36,6 +36,9 @@ type methodHandler any // MethodHandler[*ClientSession] | MethodHandler[*ServerS
// A Session is either a ClientSession or a ServerSession.
type Session interface {
*ClientSession | *ServerSession
// ID returns the session ID, or the empty string if there is none.
ID() string
sendingMethodInfos() map[string]methodInfo
receivingMethodInfos() map[string]methodInfo
sendingMethodHandler() methodHandler