* 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
* In server/index.js
- in createTransport()
- stringify query params to put them on one line
- remove logging of transport creation (done in callers)
- in /mcp POST handler
- report POST request if session id is present
- otherwise, report new StreamableHttp connection request
- report creation of server transport
- report creation of client transport
- in /stdio GET handler
- report new STDIO connection request
- report creation of server transport
- report creation of client transport
- report 401 as authentication error without stack
- in stderr data handler
- if it includes "MODULE_NOT_FOUND"
- report "Command not found"
- remove transports
- otherwise send to client as usual
- in /sse GET handler
- report SSE connection request
- report 401 as authentication error without stack
- report 404 as server that may not support SSE
- report error with "ECONNREFUSED" as "Connection refused" without stack
- only create, map, and proxy transports if serverTransport was successfully created
- in /message POST handler
- report received POST message
* In mcpProxy.ts
- in onServerError()
- if error message includes 404 OR error.cause includes ECONNREFUSED, report "Connection refused."
Express converts all header names to lowercase, which prevents custom headers with uppercase characters from being properly passed to the target service. This fix ensures that custom headers preserve their original capitalization when forwarded through the proxy.
* In server/src/index.ts
- add delete handler for /mcp endpoint
- gets the server transport for the sessionId
- calls terminateSession on it
- removes the webapp and server transports for the sessionId from the maps
- returns status 200 to the client.
* In client/src/lib/hooks/useConnection.ts
- import Transport
- add useState for clientTransport, type Transport or null initialized to null
- in connect() function
- move creation of client transport down a ways, just before calling client.connect with it
- immendiately efter calling client.connect, call setClientTransport with the connected transport (has to happen after, so that what's saved has the abort controller, etc. otherwise it doesn't work to save it prior.
- in disconnect() function
- immediately call clientTransport.terminateSession if transportType is "streamable-http"
- setClientTransport to null
* In server/src/index.ts
- add serverTransports map
- remove backingServerTransport var
- in /mcp POST handler, when a new connection is being made
- create a server transport
- map the server transport using the session id from the web app connection
- pass serverTransport to the mcpProxy instead of backingServerTransport
- in /stdio GET handler, when a new connection is being made
- create a server transport
- map the server transport using the session id from the web app connection
- pass serverTransport to the mcpProxy instead of backingServerTransport
- in /sse GET handler, when a new connection is being made
- create a server transport
- map the server transport using the session id from the web app connection
- pass serverTransport to the mcpProxy instead of backingServerTransport
* In index.ts,
- refactor transport webAppTransports to be a map with the session id as key and transport as value.
* Implement /mcp GET and POST endpoints using StreamableHTTPServerTransport and doing the new session in the POST (opposite from SSE) handler.
* In package.json
- update the SDK to 1.10.2
* In useConnection.ts
- import StreamableHTTPClientTransport
- NOTE: while we NEED to do this, it causes useConnection.test.ts to fail with " ReferenceError: TransformStream is not defined"
- in connect method
- instantiate the appropriate transport
* In server/index.js
- add get/post handlers for /mcp
- amend console log on SSE connect, with deprecation message
- add /stdio GET handler and refactored /sse GET handler to not also do stdio. Each transport has its own handler now
- add appropriate headers to streamable-http request
* In /client/src/lib/hooks/useConnection.ts
- in connect function
- create server url properly based on new transport type.
Changes the default ports used by the MCP Inspector client UI and the MCP Proxy server to avoid conflicts with common development ports and provide a memorable mnemonic based on T9 mapping.
* In bin/cli.js
- in the delay function, have the setTimeout return a true value.
- try the server's spawnPromise call and within the try block, use Promise.race to get the return value of the first promise to resolve. If the server is up, it will not resolve and the 2 second delay will resolve with true, telling us the server is ok. Any error will have been reported by the server startup process, so we will not pile on with more output in the catch block.
- If the server started ok, then we will await the spawnPromise call for starting the client. If the client fails to start it will report and exit, otherwise we are done and both servers are running and have reported as much. If an error is caught and it isn't SIGINT or if process.env.DEBUG is true then the error will be thrown before exiting.
* In client/bin/cli.js
- add a "listening" handler to the server, logging that the MCP inspector is up at the given port
- Add an "error" handler to the server that reports that the client port is in use if the error message includes "EADDRINUSE", otherwise throw the error so the entire contents can be seen.
* In server/src/index.ts
- add a "listening" handler to the server, logging that the Proxy server is up at the given port
- Add an "error" handler to the server that reports that the server port is in use if the error message includes "EADDRINUSE", otherwise throw the error so the entire contents can be seen.
* In package.json
- in preview script
- add --port 5173 to start the client on the proper port. This was useful in getting an instance of the client running before trying the start script. otherwise it starts on 4173