Why does MCP elicitation time out with MCP error -32001? How to fix?
Using modelcontextprotocol/typescript-sdk 1.17.0, I set up elicitation on a multi-input tool. In the Inspector the elicitation request appears, but in an AI agent the prompt never reaches the agent and the call fails with 'MCP error -32001: Request timed out' after a couple of seconds. Is there a known timeout bug, or a timeout option for elicitInput?
Originally asked on GitHub: https://github.com/modelcontextprotocol/typescript-sdk/issues/903
6 answers
Status: explained. The issue is closed as completed; the maintainer could not confirm a bug with the standard Inspector + everything-server setup, and the thread points to server statefulness as the likely cause rather than the SDK timeout parameter.
On SDK 1.17.0, a user found that the request path in src/shared/protocol.ts reads a timeout from the options parameter and defaults to 60 seconds, yet later elicitation requests still failed after 2-3 seconds. Another user reported that overriding that timeout option still closed the connection within 2 or 3 seconds, so raising the timeout did not fix it. The workaround that worked for one reporter was switching from an http-streamable stateless server to a stateful server config: the same server worked over stdio, and the timeout only appeared on the stateless http-streamable transport. Their explanation is that elicitation and sampling need a session to correlate the later response; without session management the client gives up early. No explicit elicitInput timeout example was shared in the thread, though one comment said the latest SDK accepts an options parameter for the timeout.
The maintainer's working repro command was: npx -y @modelcontextprotocol/inspector npx -y --silent @modelcontextprotocol/server-everything. They closed the issue and offered to reopen it if a clearer repro showed a real SDK bug. If you are on a stateless server, migrating to a stateful server with session management is the workaround confirmed in this thread.
Did this work for you?What @psyfreak tried on GitHub (Worked)
A commenter hit the same timeout with sampling on an http-streamable stateless server, while the same server worked over stdio; switching to a stateful server config solved it.
Did this work for you?What @ochafik tried on GitHub (Worked)
Maintainer ran the Inspector against the everything server with 'npx -y @modelcontextprotocol/inspector npx -y --silent @modelcontextprotocol/server-everything' and said the setup works; closed the issue pending a clearer repro.
Did this work for you?What @garciasdos tried on GitHub (Didn't work)
Another user overrode the timeout option on the request, but the connection still closed within 2-3 seconds.
Did this work for you?What @yadav-prakhar tried on GitHub (Didn't work)
On SDK 1.17.0, checked src/shared/protocol.ts and saw the request method reads timeout from options with a 60-second default; subsequent elicitation requests still timed out after 2-3 seconds.
Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Implemented elicitation on a multi-input tool; in an AI agent the request was not surfaced, and after one Inspector response later requests failed with MCP error -32001 in one or two seconds.
Source: https://github.com/modelcontextprotocol/typescript-sdk/issues/903 (opens external site)
Did this work for you?
Related questions
- MCP TypeScript SDK StreamableHttp without sticky sessions in multi-replica deployments?
- MCP stdio server: SyntaxError Unexpected token in deserializeMessage when using console.log
- MCP typescript-sdk: tool inputSchema/outputSchema reject JSON Schema type 'array'?
- Use Zod union/intersection as MCP tool paramsSchema in typescript-sdk?
- MCP Inspector: "Invalid transport type: undefined" when connecting to an SSE server