Skip to content

Commit 1ac7b63

Browse files
authored
Fix generate accurate session_uri for nested SSE paths
1 parent e6d5b00 commit 1ac7b63

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/mcp/server/sse.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ async def connect_sse(self, scope: Scope, receive: Receive, send: Send):
9494
read_stream_writer, read_stream = anyio.create_memory_object_stream(0)
9595
write_stream, write_stream_reader = anyio.create_memory_object_stream(0)
9696

97+
session_id = uuid4()
9798
request_path = scope["path"]
9899
match = re.match(r"^/([^/]+(?:/mcp)?)/sse$", request_path)
99100
mount_prefix = match.group(1) if match else ""

0 commit comments

Comments
 (0)