Skip to content

Commit bab35c0

Browse files
committed
correcetd sessionId comment
1 parent 1c760e9 commit bab35c0

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

Explorer/Assets/DCL/McpServer/Core/McpHttpServer.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,11 @@ public class McpHttpServer : IDisposable
2525
private readonly McpJsonRpcDispatcher dispatcher;
2626
private readonly int port;
2727

28-
// Stateless single-session design: this localhost, single-user automation server exposes one logical MCP
29-
// session for the whole process lifetime. It therefore uses one id for its entire life and echoes it on
30-
// every response (including errors and before initialize) instead of minting one per handshake, and it does
31-
// not validate the incoming Mcp-Session-Id — there is no per-session state to bind a request to. This
32-
// deliberately departs from the Streamable HTTP session lifecycle; revisit if the server ever serves
33-
// multiple concurrent clients.
28+
// The session maps to the Explorer process, not to a client: this server is stateless and drives one
29+
// shared world, so every request operates on the same state and there is nothing session-scoped to isolate.
30+
// Multiple agents on one server intentionally share this id because they drive the same world; a separate
31+
// session means a separate Explorer instance (separate port, separate id). Hence one id for the process
32+
// lifetime, echoed on every response, and no need to validate the incoming Mcp-Session-Id.
3433
private readonly string sessionId = Guid.NewGuid().ToString("N");
3534

3635
private HttpListener? listener;

0 commit comments

Comments
 (0)