Model Context Protocol – Advanced Patterns for Production By the end of this lesson, students should be able to: What notifications are. MCP notifications are server-to-client messages that do not require a response. They inform the client that something has changed – a resource has been updated, the tool list has changed, a long-running operation has progressed. Clients can act on notifications or ignore them based on their implementation. When to use notifications vs. polling. Without notifications, clients poll the server for changes – sending list_resources or list_tools requests periodically to check for updates. For resources that change infrequently, polling wastes transport overhead. For resources that change frequently, polling may miss changes between intervals. Notifications are appropriate when: Resource change notifications. # Notify client that a resource has changed # Notify client that the resource list has changed Clients that receive a resource update notification can re-read the resource to get fresh content. Clients that receive a resource list changed notification can re-request the resource list. Tool list change notifications. # Notify client that the available tools have changed Use this when your server dynamically enables or disables tools based on state – for example, a tool that is only available after the user has authenticated, or a tool that is disabled when a dependent service is unavailable. Progress notifications for long-running tools. For tools that take significant time (database migrations, large file processing, report generation), progress notifications let the client track status without the tool call blocking: # Send progress update during a long tool execution Clients can surface progress to the user in real time. Verify current progress notification API at modelcontextprotocol.io. Enroll to continue this lesson. The preview above shows the lesson objectives and opening lesson content. Enroll to view the full lesson, complete the practice work, and take the lesson quiz.
Lesson 2: Notifications and Real-Time Updates
Lesson Objectives
Lesson Content
await app.notify_resource_updated("docs://api-reference")
await app.notify_resources_list_changed()
await app.notify_tools_list_changed()
await app.notify_progress(token, current=50, total=100)
