Add reporting of the Proxy <-> Server sessionId. It's only possible to get the session id for this leg of the proxy if it is a StreamableHttp connection.

* In server/src/index.ts
  - slight format tweak of the Client <-> Proxy message so that the two messages will line up when displayed
* In server/src/mcpProxy.ts
  - add reportedServerSession boolean initialized to false
  - in transportToServer.onmessage,
    - if reportedServerSession isn't set yet, report the sessionId if present on the transport, and then set reportedServerSession to true
This commit is contained in:
cliffhall 2025-06-03 17:46:43 -04:00
commit c485e57a39

View file

@ -197,7 +197,7 @@ app.post("/mcp", async (req, res) => {
onsessioninitialized: (sessionId) => {
webAppTransports.set(sessionId, webAppTransport);
serverTransports.set(sessionId, serverTransport!);
console.log("New client <-> proxy server sessionId: " + sessionId);
console.log("Client <-> Proxy sessionId: " + sessionId);
},
});
console.log("Created StreamableHttp client transport");