Repository navigation
Share MCP proxy backend across agent sessions - #1395
Merged
sunishsheth2009 merged 4 commits intoNov 3, 2026
Merged
Conversation
sunishsheth2009
marked this pull request as ready for review
November 2, 2026 19:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Each agent/MCP registration currently loads a separate MCP/HTTP stack, increasing memory with every connection.
BEFORE: eight active local clients used 663 MiB aggregate RSS.
AFTER: lightweight stdio relays share one backend and use 218 MiB (67% less). Existing registrations work unchanged.
Each connection retains its own session, credentials, headers, and browser-login output. Different credential environments and selected workspaces use separate backends. The backend starts on demand, authenticates local relays, and exits after 60 seconds idle. A crash asks clients to reconnect; in-flight calls are never replayed.
Both CLI paths use the same option/default resolution. Customer documentation covers the benefit and reconnect action; implementation details stay in code. No new dependencies.
Validation: 1,098 relevant tests passed; 147 transport, header and shared-proxy tests passed after the final header cleanup. Ruff lint/format and ty passed. Subprocess tests cover concurrent startup, session/auth isolation, crash recovery, and idle shutdown against a local HTTP MCP peer. Memory figures include all relay/backend processes, excluding the driver/peer in both variants (PSS 500 → 124 MiB). Native Windows and live Databricks validation remain outstanding.