Skip to content

fix: bound streamable HTTP memory usage#970

Open
DaleSeo wants to merge 2 commits into
mainfrom
fix/bound-streamable-http-memory
Open

fix: bound streamable HTTP memory usage#970
DaleSeo wants to merge 2 commits into
mainfrom
fix/bound-streamable-http-memory

Conversation

@DaleSeo

@DaleSeo DaleSeo commented Jul 10, 2026

Copy link
Copy Markdown
Member

Motivation and Context

The Streamable HTTP client previously allowed an SSE event to grow indefinitely while waiting for its terminating blank line. The server similarly buffered complete POST bodies without a size limit, allowing a peer to exhaust process memory.
This PR applies configurable limits of 16 MiB per SSE event and 4 MiB per POST body by default. Oversized SSE streams terminate with a typed error without reconnecting, and oversized POST bodies receive HTTP 413.

How Has This Been Tested?

Added regression coverage for unterminated and multi-line SSE events.

Breaking Changes

No source-level breaking changes are expected.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

@github-actions github-actions Bot added T-dependencies Dependencies related changes T-config Configuration file changes T-core Core library changes T-transport Transport layer changes labels Jul 10, 2026
@DaleSeo DaleSeo force-pushed the fix/bound-streamable-http-memory branch from fcc5928 to d3176f8 Compare July 10, 2026 20:31
@DaleSeo DaleSeo marked this pull request as ready for review July 10, 2026 21:06
@DaleSeo DaleSeo requested a review from a team as a code owner July 10, 2026 21:06
@DaleSeo DaleSeo self-assigned this Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-config Configuration file changes T-core Core library changes T-dependencies Dependencies related changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant