You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While writing regression tests for the mcp-go → go-sdk migration (#5742), two shim limitations were discovered in github.com/stacklok/toolhive-core/mcpcompat v0.0.27:
Finding 1: Client shim drops progress and logging notifications
The mcpcompat client shim's installNotificationHandlers (client.go:417-429) only wires the three *_list_changed handlers. It does NOT install ProgressNotificationHandler or LoggingMessageHandler (both exist in go-sdk v1.6.1 ClientOptions).
Impact:notifications/progress and notifications/message from an upstream backend are silently dropped at the shim boundary. The ToolHive stdio bridge's OnNotification handler never sees them, so they can never be forwarded to stdio clients.
The shim's SendNotificationToAllClients (notifications.go:32-76) only forwards notifications/progress and notifications/message. All other methods (including notifications/tools/list_changed, notifications/resources/list_changed, notifications/prompts/list_changed) hit the default branch and are dropped.
Impact: Even though the bridge's OnNotification handler re-runs forwardAll on *_list_changed (the fix in #5742), the notification itself is never forwarded to the stdio client. The client doesn't know to re-issue tools/list — it only sees the updated set when it happens to list again.
TestBridge_ToolsListChanged_TriggersReSync in pkg/transport/bridge_test.go — verifies the forwardAll re-sync works (the bridge's local server picks up the new tools)
TestBridge_ProgressAndLoggingNotifications_DroppedByShim — skipped test documenting both findings as regression anchors
Acceptance criteria
When the shim is fixed (toolhive-core#156 items 1a and 1b):
The skipped test should be un-skipped and pass
Progress and logging notifications should be forwarded end-to-end through the bridge
*_list_changed notifications should be forwarded to stdio clients
Finding 1a (client drops progress/logging) — Fixed in toolhive-core via issue #156 (commit a302089, wave 2): the mcpcompat client now wires go-sdk's ProgressNotificationHandler and LoggingMessageHandler into installNotificationHandlers (mcpcompat/client/client.go:735-738) and routes them to OnNotification. ToolHive runs against toolhive-core v0.0.37, which includes the fix.
Finding 1b (SendNotificationToAllClients drops list_changed) — Fixed shim-side: the mcpcompat server now emits notifications/{tools,prompts,resources}/list_changed automatically via go-sdk's per-session AddTool/RemoveTools reconciliation (syncSessionTools, mcpcompat/server/session.go:384), so the bridge's local server notifies downstream stdio clients when its mirrored feature set changes. The broadcast path intentionally drops them to avoid double-delivery (documented in mcpcompat/server/notifications.go).
Regression tests (all passing, none skipped):
TestBridge_ToolsListChanged_TriggersReSync, TestBridge_ResourcesListChanged_TriggersReSync, TestBridge_PromptsListChanged_TriggersReSync in pkg/transport/bridge_test.go — verify the forwardAll re-sync on each list_changed notification (the bridge's downstream client gets the list_changed via go-sdk's automatic emission when forwardAll re-adds the new features).
TestBridge_ProgressAndLoggingNotifications_ForwardedByShim — the un-skipped regression anchor verifying progress + logging notifications flow through the shim to OnNotification.
Verified locally with go test -race -run TestBridge ./pkg/transport/ — all green.
Activity
JAORMX commentedon Aug 3, 2026
Both findings are fixed and verified:
Finding 1a (client drops progress/logging) — Fixed in toolhive-core via issue #156 (commit a302089, wave 2): the mcpcompat client now wires go-sdk's
ProgressNotificationHandlerandLoggingMessageHandlerintoinstallNotificationHandlers(mcpcompat/client/client.go:735-738) and routes them toOnNotification. ToolHive runs against toolhive-core v0.0.37, which includes the fix.Finding 1b (SendNotificationToAllClients drops list_changed) — Fixed shim-side: the mcpcompat server now emits
notifications/{tools,prompts,resources}/list_changedautomatically via go-sdk's per-sessionAddTool/RemoveToolsreconciliation (syncSessionTools, mcpcompat/server/session.go:384), so the bridge's local server notifies downstream stdio clients when its mirrored feature set changes. The broadcast path intentionally drops them to avoid double-delivery (documented in mcpcompat/server/notifications.go).Regression tests (all passing, none skipped):
TestBridge_ToolsListChanged_TriggersReSync,TestBridge_ResourcesListChanged_TriggersReSync,TestBridge_PromptsListChanged_TriggersReSyncinpkg/transport/bridge_test.go— verify theforwardAllre-sync on each list_changed notification (the bridge's downstream client gets the list_changed via go-sdk's automatic emission when forwardAll re-adds the new features).TestBridge_ProgressAndLoggingNotifications_ForwardedByShim— the un-skipped regression anchor verifying progress + logging notifications flow through the shim toOnNotification.Verified locally with
go test -race -run TestBridge ./pkg/transport/— all green.