Property SessionId
SessionId
Gets the current session identifier for this MCP connection.
public string SessionId { get; }
Property Value
- string
The session ID as a string, or an empty string if no session has been established yet.
Remarks
The session ID is assigned by the MCP server during initialization and is used to maintain
stateful interactions across multiple requests. The server may provide this either via the
Mcp-Session-Id HTTP response header or within the initialization response payload.
This ID is automatically included in subsequent requests to help the server maintain session affinity and state tracking. You typically don't need to use this value directly, but it can be useful for logging and debugging connection issues.