Expand description
Detects tool-profile config changes at runtime and notifies MCP clients.
When the user changes tool_profile, tools_enabled, or disabled_tools
via the dashboard, CLI, or manual config edit, the MCP client (Cursor,
Claude Code, etc.) needs a notifications/tools/list_changed to re-fetch
tools/list. Without this, the client serves a stale tool surface until
the next IDE restart.
The watcher computes a lightweight hash of the config fields that affect
tool visibility. Dispatch checks it on every tool call — a miss costs one
Config::load() (already cached by content-hash) plus a u64 comparison.
Functions§
- current_
hash - Returns the current tools-config hash (loads config from disk).
- has_
changed - Checks whether the tools-relevant config has changed since the last
snapshot. If it has, atomically updates the stored hash and returns
true. The first call after initialization always returnsfalse(the hash is seeded in the constructor). - tools_
config_ hash - Computes a stable hash of the config fields that determine the
tools/listresponse:tool_profile,tools_enabled,disabled_tools. Two configs with the same hash produce the same advertised tool set.