Skip to content

feat: add per-session tool visibility - #94

Open
Prateep07 wants to merge 3 commits into
nitrocloudofficial:developfrom
Prateep07:feature/visibility-only-develop
Open

Prateep07 wants to merge 3 commits into
nitrocloudofficial:developfrom
Prateep07:feature/visibility-only-develop

Conversation

@Prateep07

Copy link
Copy Markdown
Collaborator

Summary
Adds per-session dynamic tool visibility, including hidden defaults, ExecutionContext.enable_tools() / disable_tools(), and a TTL/LRU session store. Visibility is isolated by transport session ID and verified subject; hidden tools are omitted from tools/list and rejected by tools/call. Visibility changes notify the current session when the transport supports it.

Dynamic changes require a sessionful transport. In sessionless auto, changes warn and do nothing.

Tests:
892 passed; 3 failed
due to environment limitations: bdist_wheel is unavailable for the wheel packaging test, and two regex transform tests cannot start their worker process (PermissionError).

closes #65

@jpsiddharth2008 jpsiddharth2008 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please fix these issues on 5bcb5ba:

  1. _visibility_session_key() reads attributes absent from real MCP sessions. Use the transport-validated session ID plus verified subject; test HTTP unlock/list/call across two sessions.
  2. search_tools exposes hidden names and schemas through the unfiltered registry. Apply per-request visibility filtering and test search results.
  3. default_visible shifts existing positional @tool arguments. Append it after existing parameters and add a compatibility test.

Resolve the develop conflict and rerun the full suite without exclusions. The current 895 passing tests miss these cases.

@jpsiddharth2008 jpsiddharth2008 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. The three previous findings are resolved, and regression tests and CI pass.

@AadarshM07 AadarshM07 linked an issue Oct 29, 2026 that may be closed by this pull request

This branch has not been deployed

No deployments
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.

[transforms] Per-session dynamic tool visibility

2 participants