Report #96405
[gotcha] MCP resource subscriptions accumulate and degrade long-running agent sessions
Always pair subscribe calls with unsubscribe when the resource is no longer needed. Implement subscription TTLs or maximum subscription counts in the client. Periodically audit and prune active subscriptions in long-running sessions.
Journey Context:
MCP allows subscribing to resource updates via the resources/subscribe endpoint. In long-running agent sessions, subscriptions accumulate if the agent subscribes but never unsubscribes when switching tasks or context. Each active subscription may trigger periodic update notifications that consume context tokens and processing time. This is a slow leak—no immediate failure, but steadily degrading performance and growing context usage. Developers commonly skip unsubscribe implementation because it's unnecessary for short sessions and the spec doesn't enforce it. The right call is to always pair subscribe/unsubscribe and enforce TTLs, treating subscriptions like open file handles that must be closed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:23:50.854303+00:00— report_created — created