Skip to content

feat: filter MCP tool inventory by negotiated client - #820

Merged
ScriptedAlchemy merged 2 commits into
mainfrom
feat/mcp-client-tool-visibility
Sep 16, 2026
Merged

ScriptedAlchemy merged 2 commits into
mainfrom
feat/mcp-client-tool-visibility

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Generated MCP tools can declare ToolConfig.excludeClients. After native initialization, tools matching case-insensitive client-name prefixes disappear from tools/list and reject direct tools/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:

  • Build, typecheck, lint, and docs site build pass; zero broken documentation links.
  • Unit suite: 4,465 passed, zero failures.
  • Full integration pool: 1,181 passed, four skipped, zero failures.
  • Native SDK sessions cover Codex, Grok Bot, Cursor, and unknown clients.
  • Compiled stdio fixture proves metadata survives packaging and hidden tools reject direct calls.
  • Independent different-model review: PASS, no concrete merge blocker.

Installed Gbot inventory and production Grok identity are separate integration work. Matching prefixes affect presentation and dispatch, and provide no authorization boundary.

@changeset-bot

changeset-bot Bot commented Sep 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 57873e3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
agent-bundle Patch
create-agent-bundle Patch

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-16T23:40:49.316994Z 7cc498f PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment on lines +489 to +490
if (name !== undefined) for (const tool of clientTools) {
if (tool.prefixes.some(prefix => name.startsWith(prefix))) tool.disable();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@ScriptedAlchemy
ScriptedAlchemy merged commit 7c96689 into main Sep 16, 2026
0 of 3 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant