Disable proxy buffering for MCP SSE

Add X-Accel-Buffering: no headers to prevent Nginx/Dokploy from buffering SSE streams
This commit is contained in:
jjbrunton committed 2026-01-10 19:41:16 +00:00
1 parent 3c9a021f11
commit b2925daf4f
1 file changed
+6 -1
+6 -1
View File
@@ -16,7 +16,12 @@ const mcpServer = createMcpServer();
// Mount MCP server
app.all('/mcp', async (c) => {
return mcpServer.handleRequest(c);
// Add headers to prevent Nginx/proxy buffering for SSE
c.header('X-Accel-Buffering', 'no');
c.header('Cache-Control', 'no-cache');
c.header('Connection', 'keep-alive');
return mcpServer.handleRequest(c.req.raw);
});
const port = Number(process.env.PORT) || 3000;