mcp --http: no request timeout (tool calls can run for many minutes)
This commit is contained in:
parent
8068993917
commit
f2d7beb7ce
1 changed files with 3 additions and 0 deletions
|
|
@ -165,6 +165,9 @@ export function startHttp(o: HttpOptions): Promise<{ close: () => void; port: nu
|
|||
return r ? send(res, 200, r) : send(res, 202);
|
||||
} catch (e) { return send(res, 500, { jsonrpc: '2.0', id: (msg as { id?: unknown }).id ?? null, error: { code: -32603, message: String((e as Error).message) } }); }
|
||||
});
|
||||
// a tool call can run for many minutes (check on a big project, uploads): Node's 300 s request timeout would cut it
|
||||
server.requestTimeout = 0;
|
||||
server.timeout = 0;
|
||||
return new Promise((ok, fail) => {
|
||||
server.once('error', fail);
|
||||
server.listen(o.port, o.host, () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue