Skip to content

feat: Subscribe to notifications/tools/list_changed for automatic tool re-indexing #209

Closed

Description

@Dumbris

Problem

PR #208 added manual tool discovery via the Web UI button and differential update logic. However, if users don't manually trigger discovery, the tool index can become stale.

Scenario:

  1. MCP server v1 has tools [tool_a, tool_b] - indexed correctly
  2. Server updates to v2 with tools [tool_c, tool_d]
  3. User never opens Web UI
  4. retrieve_tools MCP call returns outdated results (old tools still in index, new tools missing)

The current 5-minute background refresh helps but isn't ideal - tools can be stale for up to 5 minutes, and it's wasteful when nothing changed.

Solution

The MCP spec supports notifications/tools/list_changed - servers can notify clients when their tool list changes. We should subscribe to this notification from upstream servers and trigger re-indexing automatically.

What needs to be done:

  1. Subscribe to upstream notifications - When connecting to upstream MCP servers, register a handler for notifications/tools/list_changed

  2. Trigger reactive re-indexing - When notification is received, call DiscoverAndIndexToolsForServer(ctx, serverName) (reuse existing logic from feat: Add tool cache invalidation with differential update logic and manual discovery trigger #208)

  3. Forward notifications downstream - Optionally notify connected MCP clients that tools changed

Technical Context

  • MCP spec defines this notification: servers declare capabilities.tools.listChanged: true
  • mcp-go library (v0.43.1) already supports MethodNotificationToolsListChanged and OnNotification() handlers
  • mcpproxy currently does NOT subscribe to this notification from upstream servers

References

Activity

  1. added a commit that references this issue on Dec 20, 2025
    f59786f
  2. added a commit that references this issue on Jan 6, 2026
    575dcaa
  3. added a commit that references this issue on Jan 21, 2026
    09a4359
  4. added a commit that references this issue on Jan 23, 2026
    9fee199
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions