feat: filter MCP tool inventory by negotiated client - #820
Conversation
🦋 Changeset detectedLatest commit: 57873e3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7cc498f40c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "agent-bundle": patch | ||
| --- | ||
|
|
||
| Add `ToolConfig.excludeClients` to hide generated MCP tools from matching negotiated client-name prefixes and reject direct calls while preserving other clients and CLI/browser projections. |
There was a problem hiding this comment.
Add the required PR suffix to the changeset
This publishable-package changeset does not end its summary with the required (#PR) suffix, so it violates the repository's mandatory changeset format and should be corrected before release processing.
AGENTS.md reference: AGENTS.md:L124-L125
Useful? React with 👍 / 👎.
| if (name !== undefined) for (const tool of clientTools) { | ||
| if (tool.prefixes.some(prefix => name.startsWith(prefix))) tool.disable(); |
There was a problem hiding this comment.
Reject excluded tools before task augmentation
For a client negotiating MCP 2025-11-25, an excluded tool with execution.taskSupport: 'optional' or 'required' can still receive a task-augmented tools/call: TaskAugmentedServer._wrapHandler creates and returns the task before its background invocation reaches the SDK handler affected by registered.disable(). The task later fails, but the original call succeeds with a task handle, contradicting the documented promise that excluded tools reject direct calls; the exclusion must also remove or block task support before task creation.
AGENTS.md reference: AGENTS.md:L96-L99
Useful? React with 👍 / 👎.
Generated MCP tools can declare
ToolConfig.excludeClients. After native initialization, tools matching case-insensitive client-name prefixes disappear fromtools/listand reject directtools/call. Unknown clients retain the tools; CLI and browser projections retain existing behavior.Uses the native SDK registration state. Includes English and Chinese authoring docs and a patch changeset.
Validation on a branch containing current main
e57c0ac9:Installed Gbot inventory and production Grok identity are separate integration work. Matching prefixes affect presentation and dispatch, and provide no authorization boundary.