File tree Expand file tree Collapse file tree
Explorer/Assets/DCL/McpServer/Core Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments