Is it possible to implement SSE (Server-Sent Events) using only Next.js API routes without a separate backend server?
Yep, SSE works well on Vercel
Server-Sent Events are old technology and essentially just mean responding to a GET request with a keep-alive header and streaming chunks of data as events. They will work on pretty much every web server nowadays as long as it doesn’t buffer responses.
On Vercel (and other serverless hosts) this used to be impractical because of short timeouts, but now as long as you have Fluid Compute enabled, which is the default for all new projects now, timeouts are much longer
Here’s an example MCP server running in Next.js on Vercel using an SSE route handler
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.