Repository navigation
Resolve MCP deployment headers from cluster metadata - #34
Merged
Merged
Conversation
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.
Session and OAuth MCP requests now discover the selected cluster through the existing
/v1/clusters?organization=<name>endpoint and send both gateway headers automatically. All tool inputs and existing cluster endpoints remain unchanged.The headers come from nullable
deployment_idandcloud_regioncluster metadata. Missing or invalid metadata omits both headers for the default public region fallback. API keys retain embedded routing and skip data-request discovery. Metadata is cached per client for 30 seconds; discovery honors cancellation and cache invalidation after mutations.Prepares MCP
0.4.0; publication is deferred. The organization-scoped endpoint migration is outside this PR.Companions: Platform https://github.com/rawtreedb/rawtree-platform/pull/1524 (cluster metadata and hosted MCP pin) and CLI rawtreedb/rawtree-cli#83. The client works against existing responses without routing metadata by omitting the headers.
Validation: 215 tests, TypeScript build and Biome pass. Tests cover actual MCP tool calls, unchanged cluster paths, scope separation, fallback, cancellation and cache races. A live MCP tool call against the rebuilt backend passes with both headers. P3 autoreview and thermonuclear maintainability review are clean.