TanStack Start does not expose Node’s raw req/res
After upgrading from @tanstack/react-start 1.131.x to 1.132.10, getEvent() is no longer exported from @tanstack/react-start/server.
Previously there was getEvent() function to access Node req/res via event.node.req and event.node.res
7 Replies
sensitive-blue•2mo ago
use
getRequest and getResponse instead
you have access to (almost?) the entire API that getEvent had, but in dedicated functionsextended-salmonOP•2mo ago
Is there a way to get the raw Node req/res . I want the request of type http.IncomingMessage .
sensitive-blue•2mo ago
may i ask why you specifically need IncomingMessage ? This may be a case of an XY problem (you want something that can be solved in a better and simpler way)
extended-salmonOP•2mo ago
Because I’m integrating the MCP SDK’s Streamable HTTP transport, which requires Node’s IncomingMessage/ServerResponse. Its handleRequest signature explicitly takes Node types:
sensitive-blue•2mo ago
hmm
maybe you could get away with mocking the conversion
i dont think this works
extended-salmonOP•2mo ago
Hey @notKamui ,No problem. Implementing another way to make the MCP work. Thanks for helping.
conscious-sapphire•2mo ago
https://github.com/TanStack/create-tsrouter-app/blob/main/frameworks/react-cra/add-ons/mcp/assets/src/utils/mcp-handler.ts This will get you further down the road. But be warned that it's not good with asynchronous tools. You'll need to add more code in there to block after
clientTransport.send.GitHub
create-tsrouter-app/frameworks/react-cra/add-ons/mcp/assets/src/uti...
Create-tsrouter-app is drop-in replacement for create-react-app that builds TanStack Router based SPA applications - TanStack/create-tsrouter-app