Skip to content

Commit 8bcb96e

Browse files
Update lib/mcp/server.js
Co-authored-by: Copilot <[email protected]>
1 parent 04d43b1 commit 8bcb96e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/mcp/server.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@ function createTransport(options = {}) {
334334
}
335335
});
336336

337+
// Set timeouts to protect against slow HTTP attacks
338+
httpServer.timeout = 120000; // 2 minutes
339+
httpServer.headersTimeout = 60000; // 1 minute
340+
httpServer.requestTimeout = 120000; // 2 minutes
337341
httpServer.listen(port, host, () => {
338342
if (process.env.PM2_MCP_DEBUG === 'true') {
339343
console.error('[pm2-mcp][debug] HTTP transport listening', `${host}:${port}${pathPart}`);

0 commit comments

Comments
 (0)