Merged
Conversation
Base automatically changed from
followup/auth-tests-and-resource-defaulting
to
main
April 26, 2026 18:23
64f6dbb to
3730556
Compare
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.
Why
The client identity work lets mvmt know who is calling, but the MCP tool surface still needed to enforce what that client is allowed to see and call. This PR makes per-client policy load-bearing at the router
layer.
What changed
ToolRouterclient-aware for bothtools/listandtools/call.rawToolsEnabledclientIdanddeniedReason./healthreport the visible tool count for the authenticated client.clients[]policy is configured.How
Runtime connector loading now carries a policy source ID for each connector. The router infers a required action for each raw tool (
search,read,write, ormemory_write) and checks that against theresolved client identity.
When
clients[]is absent, the synthesized legacy client keeps the previous global tool behavior. Whenclients[]is configured, raw tools are visible and callable only if the client has raw tools enabled andthe matching source/action grant.
Changed files
src/server/router.ts- add policy-aware tool metadata, filtered listing, denied-call handling, and audit metadata.src/server/index.ts- pass resolved client identity into MCP server/session handling and health responses.src/cli/connector-loader.ts- carry stable policy source IDs for loaded connectors.src/cli/start.ts- construct the router with connector/source ID pairs.src/utils/audit.ts- add optionalclientIdanddeniedReasonfields.tests/router.test.ts- cover raw tool filtering, raw-tools-disabled denial, missing-permission denial, and client ID audit logging.tests/server.test.ts- cover MCP-level filtered listing and denied calls using resolved client identity.Verification