Repository navigation
Description
Part of #5743 (Workstream B: 2025-11-25 compliance). Follow-up to #5965 / #5748.
Context
#5965 landed backend list_changed propagation in vMCP for tools only: a persistent backend connection observes notifications/tools/list_changed, invalidates the capability cache, and re-syncs the session's advertised tool set so the per-session go-sdk server auto-emits tools/list_changed downstream. WithToolCapabilities(true) was flipped.
Resources/prompts were explicitly deferred (see pkg/vmcp/server/serve_list_changed.go file doc and docs/arch/10-virtual-mcp-architecture.md §"Scope: tools only"). Today:
- the backend connector (
pkg/vmcp/session/internal/backend) does not dispatchnotifications/resources/list_changed/notifications/prompts/list_changedto the resync sink; serve.gostill advertisesWithResourceCapabilities(true, false)and no promptlistChanged.
Proposed work
- Dispatch backend
notifications/resources/list_changedandnotifications/prompts/list_changedto the resync path (extend theListChangedSinkcontract / connector handler). - Extend the resync worker to re-derive and apply the session's advertised resources (and resource templates) and prompts, so the per-session go-sdk server emits the corresponding downstream
list_changed. - Flip
WithResourceCapabilities(true, true)and addWithPromptCapabilities(true). - Reuse the existing coalescing/liveness/shutdown machinery from Consume backend list_changed in vMCP and propagate to clients #5965 rather than a parallel implementation.
Known limitation (separate toolhive-core follow-up)
mcpcompat's per-session syncSessionResources/syncSessionResourceTemplates/syncSessionPrompts are add-only (unlike syncSessionTools, which reconciles adds+removes). So additions will propagate but removals will not, and advertising listChanged: true is honest for additions only. Making those sync paths reconciling (using go-sdk's RemoveResources/RemoveResourceTemplates/RemovePrompts) is a stacklok/toolhive-core (mcpcompat) change + version bump — track separately. This issue delivers the toolhive-side propagation + additions.
Priority: Medium.
Activity
Propagate backend resources/prompts list_changed in vMCP
Propagate backend resources/prompts list_changed in vMCP (#5971)