Bug: fetch MCP server has hardcoded 30s timeout with no CLI/env/per-request override
Problem
The fetch MCP server has a hardcoded 30-second request timeout. This is:
- Too short for large file downloads (GitHub raw content > 10MB, PDF documentation sites, slow API endpoints)
- Too long for health checks and fast lookups where a 5s timeout would surface problems faster
- Not overridable — there is no CLI flag, environment variable, or per-request option to change the timeout
Agents that use fetch for slow operations (downloading a large WASM binary for inspection, fetching a paginated API with slow backend) hit the 30s wall and get a timeout error with no way to extend it for that specific call.
Expected behavior
Make the timeout configurable at three levels (most-specific wins):
- Per-request: include
timeout_ms in the tool call arguments
{ "url": "https://example.com/large-file.pdf", "timeout_ms": 120000 }
- Environment variable for server-wide default:
FETCH_TIMEOUT_MS=60000
- CLI flag:
--timeout 60000 when starting the server
The current 30s hardcoded value becomes the default if none of the above are set.
Why
Different use cases need different timeouts. Documentation lookups: 5-10s. File downloads: 60-300s. Streaming responses: potentially unlimited with streaming support. Hardcoding one value for all cases means either slow failures on legitimate long operations or slow detection of actually-down endpoints.
Environment
- MCP servers:
@modelcontextprotocol/server-fetch (latest)
- Runtime: Node.js v24.18.0, Windows 11 Enterprise
- Hit when: fetching large GitHub raw files and slow public API endpoints via
fetch MCP tool
Bug: fetch MCP server has hardcoded 30s timeout with no CLI/env/per-request override
Problem
The
fetchMCP server has a hardcoded 30-second request timeout. This is:Agents that use
fetchfor slow operations (downloading a large WASM binary for inspection, fetching a paginated API with slow backend) hit the 30s wall and get a timeout error with no way to extend it for that specific call.Expected behavior
Make the timeout configurable at three levels (most-specific wins):
timeout_msin the tool call arguments{ "url": "https://example.com/large-file.pdf", "timeout_ms": 120000 }FETCH_TIMEOUT_MS=60000--timeout 60000when starting the serverThe current 30s hardcoded value becomes the default if none of the above are set.
Why
Different use cases need different timeouts. Documentation lookups: 5-10s. File downloads: 60-300s. Streaming responses: potentially unlimited with streaming support. Hardcoding one value for all cases means either slow failures on legitimate long operations or slow detection of actually-down endpoints.
Environment
@modelcontextprotocol/server-fetch(latest)fetchMCP tool