INNER CODE UNIT · Python
_synthetic_initialized_notification
caiovicentino/polymarket-mcp-server · src/polymarket_mcp/server.py:109
def _synthetic_initialized_notification() -> SessionMessage:
"""Server-internal era bridge for the 2026-07-28 sessionless model.
The SDK-era session refuses ordinary requests before initialization
(mcp/server/session.py:203-205); the 2026-07-28 revision has no handshake
at all - the session concept is replaced by per-request versions. When a
request declares a servable version in _meta, this notification is
injected into the session's READ path (mcp/server/session.py:210-211 sets
the session to the initialized state on it) so the request is served. It
is never written to the client-bound stream, so the wire stays clean.
"""
return SessionMessage(
message=types.JSONRPCMessage(
types.JSONRPCNotification(jsonrpc="2.0", method="notifications/initialized")
)
)