Skip to content

Commit 2dda87e

Browse files
committed
Merge branch 'main' into ihrpr/resumability-server
2 parents 67a899c + 9dfc925 commit 2dda87e

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/mcp/server/lowlevel/server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,11 +479,11 @@ async def run(
479479
# but also make tracing exceptions much easier during testing and when using
480480
# in-process servers.
481481
raise_exceptions: bool = False,
482-
# When True, the server runs in standalone mode for stateless deployments where
482+
# When True, the server as stateless deployments where
483483
# clients can perform initialization with any node. The client must still follow
484484
# the initialization lifecycle, but can do so with any available node
485485
# rather than requiring initialization for each connection.
486-
standalone_mode: bool = False,
486+
stateless: bool = False,
487487
):
488488
async with AsyncExitStack() as stack:
489489
lifespan_context = await stack.enter_async_context(self.lifespan(self))
@@ -492,7 +492,7 @@ async def run(
492492
read_stream,
493493
write_stream,
494494
initialization_options,
495-
standalone_mode=standalone_mode,
495+
stateless=stateless,
496496
)
497497
)
498498

src/mcp/server/session.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,17 @@ def __init__(
8585
read_stream: MemoryObjectReceiveStream[types.JSONRPCMessage | Exception],
8686
write_stream: MemoryObjectSendStream[types.JSONRPCMessage],
8787
init_options: InitializationOptions,
88-
standalone_mode: bool = False,
88+
stateless: bool = False,
8989
) -> None:
9090
super().__init__(
9191
read_stream, write_stream, types.ClientRequest, types.ClientNotification
9292
)
93-
if standalone_mode:
94-
self._initialization_state = InitializationState.Initialized
95-
else:
96-
self._initialization_state = InitializationState.NotInitialized
93+
self._initialization_state = (
94+
InitializationState.Initialized
95+
if stateless
96+
else InitializationState.NotInitialized
97+
)
98+
9799
self._init_options = init_options
98100
self._incoming_message_stream_writer, self._incoming_message_stream_reader = (
99101
anyio.create_memory_object_stream[ServerRequestResponder](0)

0 commit comments

Comments
 (0)