{"slug": "mcp-subscriptions-listen-change-notifications-without-the-surprises", "title": "MCP subscriptions/listen: change notifications without the surprises", "summary": "A developer published a practical walkthrough of the subscriptions/listen mechanism in the 2026 Model Context Protocol (MCP) specification, covering how clients open long-lived streams, how servers acknowledge subscriptions before sending notifications, and why missed events are not replayed on reconnect. The guide, which includes Python examples using the MCP Python SDK (mcp 2.3.0), advises treating subscriptions as change signals rather than durable event logs and notes that multi-instance servers need a shared pub/sub mechanism for fan-out. It also addresses stream shutdowns, idle timeouts, authentication expiry, and the difference between clean closes and unexpected disconnects.", "body_md": "Opening a stream is easy. Keeping it useful when connections drop and your server runs across multiple instances? That's where things get interesting. 😅\n\nI just published a practical walkthrough of subscriptions/listen in the 2026 Model Context Protocol (MCP) specification.\n\nWhat you'll learn\n\nHow subscriptions work: Open a long-lived stream and request the notification types you care about.\n\nWhy acknowledgements matter: The server acknowledges the subscription before sending notifications.\n\nWhat notifications actually tell you: They're signals that something changed, not the updated resource itself.\n\nHow reconnects work: Missed events aren't replayed, so clients need to subscribe again and refresh their state.\n\nWhat changes when you scale out: Multiple server instances need a shared pub/sub mechanism to keep their subscribers informed.\n\nA little Python, too\n\nThe article includes examples using the MCP Python SDK (mcp 2.3.0), including how to notify clients when a resource changes and how to think about implementing a subscription bus across multiple server instances.\n\nI also cover practical details like stream shutdowns, idle timeouts, authentication expiry, and the difference between a clean close and an unexpected disconnect.\n\nThe big takeaway\n\nDon't treat a subscription as a durable event log.\n\nIf a connection drops, assume you may have missed changes. Reconnect, subscribe again, and refresh whatever state you cached.\n\nAnd if you're running multiple instances, remember that a notification generated on one instance won't automatically reach a stream connected to another.\n\nDistributed systems: finding new ways to remind us that \"it works on my machine\" is not an architecture. 🙂\n\n👉 Read the full article: [https://pournasserian.com/writing/mcp-2026-subscriptions-listen](https://pournasserian.com/writing/mcp-2026-subscriptions-listen)\n\nIf you're building MCP servers, I'd love to hear how you're handling subscription fan-out and reconnect recovery in your own setups.", "url": "https://wpnews.pro/news/mcp-subscriptions-listen-change-notifications-without-the-surprises", "canonical_source": "https://dev.to/pournasserian/mcp-subscriptionslisten-change-notifications-without-the-surprises-355d", "published_at": "2026-10-23 16:05:26+00:00", "updated_at": "2026-10-23 16:12:45.947461+00:00", "lang": "en", "topics": ["agent-protocols", "ai-agents", "ai-tools", "developer-tools"], "entities": ["Model Context Protocol", "MCP Python SDK", "pournasserian.com"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/mcp-subscriptions-listen-change-notifications-without-the-surprises", "markdown": "https://wpnews.pro/news/mcp-subscriptions-listen-change-notifications-without-the-surprises.md", "text": "https://wpnews.pro/news/mcp-subscriptions-listen-change-notifications-without-the-surprises.txt", "jsonld": "https://wpnews.pro/news/mcp-subscriptions-listen-change-notifications-without-the-surprises.jsonld"}}