feat: Allow configuring the timeout #36
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds configurable request timeout support to prevent timeouts with slow MCP servers.
Some MCP servers like Perplexity's often require more than 60 seconds to respond, especially for research operations that need to search and analyze multiple sources.
Changes
Implementation Details
Testing
Run timeout tests
npm test -- proxyServer.test.ts
Manual testing
Default 5-minute timeout
npx mcp-proxy --port 8080 -- your-mcp-server
Custom 10-minute timeout for very slow operations
npx mcp-proxy --port 8080 --requestTimeout 600000 -- your-mcp-server
Using environment variable
MCP_PROXY_REQUEST_TIMEOUT=120000 npx mcp-proxy --port 8080 -- your-mcp-server
Test with slow fixture (2-second delay)
RESPONSE_DELAY=2000 npx tsx src/bin/mcp-proxy.ts --requestTimeout 3000 tsx src/fixtures/slow-stdio-server.ts
Breaking Changes