- Newest
- Most votes
- Most comments
Your assessment is largely accurate based on the current capabilities of API Gateway REST APIs with response streaming.
API Gateway REST APIs do have specific constraints for streaming workloads that are important to consider:
Streaming Duration and Timeout Limits: API Gateway supports streaming responses for up to 15 minutes maximum. Additionally, streams are subject to idle timeouts—5 minutes for Regional or private endpoints, and 30 seconds for edge-optimized endpoints. If your MCP workloads involve long-running tools that may have periods of inactivity or need to maintain connections beyond these timeframes, these timeouts could interrupt your streams.
Throughput Constraints: While the first 10MB of response payload streams without bandwidth restrictions, any data exceeding 10MB is throttled to 2MB/s. For MCP servers streaming incremental results over extended periods, this could impact performance depending on your data volume.
Connection Behavior: When connections close due to timeout (either between client and API Gateway, or between API Gateway and Lambda), the Lambda function may continue executing. This could lead to resource inefficiency or unexpected behavior in long-running scenarios.
Unsupported Features: Response streaming doesn't support endpoint caching, content encoding (compression must be handled in your integration), or response transformation with VTL. These limitations add complexity if you need these capabilities.
For long-running MCP workloads with extended streaming sessions, Lambda Function URLs would indeed avoid these structural constraints, offering more flexibility for duration and idle behavior. API Gateway REST APIs with streaming are better suited for scenarios where responses complete within 15 minutes and don't have extended idle periods, such as generative AI responses, large file transfers, or operations that stream continuously without long pauses.
There are no publicly announced upcoming improvements to these specific limitations at this time.
Sources
Building responsive APIs with Amazon API Gateway response streaming | AWS Compute Blog
Stream the integration response for your proxy integrations in API Gateway - Amazon API Gateway
Relevant content
asked a year ago
asked 9 months ago
