Repository navigation
Conversation
This branch has not been deployed
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.
Problem / Why
Remote MCP clients are cached by transport, endpoint and query parameters, but request headers are omitted. Connecting to the same endpoint with a different authorization header therefore reuses the first client's transport and cached tool catalog. A local MCP server reproduces the second identity receiving the first identity's tools.
This revisits the stale-header case from closed, unmerged #890, with a regression test and a narrower scope.
Changes
Verification
Validated locally on Windows with Bun 1.3.14, using isolated test environment settings and fictitious authorization values. The branch is based on main
c5e985410d548fbf92803fc4e9d64a9142c926a8; the affected tests, probes, static checks and builds were rerun after updating the base.bun test common/src/mcp/__tests__/client-headers.test.ts: failed before the fix (expectedwho_beta, receivedwho_alpha), passed after it.bun test common/src/mcp/__tests__/: 47 passed, 0 failed.commonandsdk: passed.Notes / Scope
This changes remote cache identity only. It does not add client disposal, connection eviction, retry or replay behavior, or header-name/order canonicalization. No dependency changes. A fresh frozen-lockfile install, the full monorepo suite, Linux/macOS execution and hosted CI have not been run.