Skip to content

Turn tool groups on and off at runtime - #15

Merged
Tom-R-Main merged 1 commit into
mainfrom
improve/dynamic-toolsets
Sep 24, 2026
Merged

Tom-R-Main merged 1 commit into
mainfrom
improve/dynamic-toolsets

Conversation

@Tom-R-Main

Copy link
Copy Markdown
Owner

Stacked on #14.

Why: 168 tools is a lot of context for every session. Fixed tool groups (#5) help, but you have to pick them before the session starts. This follows GitHub's MCP server: start small and let the model turn groups on when it needs them.

What

  • OBS_MCP_DYNAMIC_TOOLSETS=true (opt-in): every group is registered, but only the OBS_MCP_TOOLSETS groups (default general) and the OBS_MCP_TOOLS tools start enabled. That's under 30 tools at the start instead of 168.
  • obs-list-toolsets shows each group, what it covers, and how many of its tools are on. obs-enable-toolset / obs-disable-toolset switch groups for the session.
    • Uses the SDK's enable()/disable(), which send notifications/tools/list_changed.
    • Tools are disabled before the session connects, so startup sends no notification.
    • Each stdio session builds its own server, so groups are per session.
  • Read-only mode still applies: enabling a group adds only its read-only tools.
  • The startup log reports how many tools start enabled. The MCPB manifest gets a checkbox.
  • Tool count without the setting is unchanged (168).

Tests

  • npm run check passes: 182 unit, 12 e2e.
  • Unit tests: filter parsing; start small, enable (with a list-changed notification) and call, disable (a call is refused); read-only; off by default.
  • An e2e test runs the compiled server with the setting on.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vjn8uBEa4mJshaQU3pFuqX

With OBS_MCP_DYNAMIC_TOOLSETS=true every group is registered but only the
OBS_MCP_TOOLSETS groups (general by default) start enabled. obs-list-toolsets,
obs-enable-toolset, and obs-disable-toolset manage the rest per session; each
change sends notifications/tools/list_changed. Read-only mode still applies.
The MCPB manifest gets a matching option.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vjn8uBEa4mJshaQU3pFuqX
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 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-24T02:35:49.830894Z e7019f0 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: e7019f08c2

ℹ️ 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".

Comment on lines +42 to +43
if (enabled) tool.handle.enable();
else tool.handle.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 Batch tool-list notifications for group updates

When enabling or disabling a group containing multiple tools, this loop invokes an SDK handle once per tool; each enable() or disable() emits notifications/tools/list_changed. A client that responds by calling tools/list will therefore reload the full tool inventory dozens—and potentially up to 168—times for one obs-enable-toolset call. Batch or suppress these per-tool notifications and emit a single list-change notification after the entire update.

Useful? React with 👍 / 👎.

@Tom-R-Main
Tom-R-Main changed the base branch from improve/apply-scene to main September 24, 2026 05:12
@Tom-R-Main
Tom-R-Main merged commit 4582011 into main Sep 24, 2026
4 checks passed
@Tom-R-Main
Tom-R-Main deleted the improve/dynamic-toolsets branch September 24, 2026 05:13
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