MCP: Model Context ProtocolBeginnerModule 03 — MCP messages and JSON-RPC

What are MCP notifications, and how are they different from requests?

Question 22 of 43 · Updated

On this page

Direct answer#

An MCP notification is a one-way JSON-RPC 2.0 method message that informs the receiving participant about an event or state change without asking for a JSON-RPC response. Unlike a request, a notification has no top-level id member. It contains jsonrpc, method and, when applicable, a params object.

For example, a server that supports tool-list change notifications can tell its client that the available tool catalog has changed:

JSON
{ "jsonrpc": "2.0", "method": "notifications/tools/list_changed" }

The client can invalidate its cached catalog and arrange to discover the updated tools. It must not send a JSON-RPC result or error in reply to that notification. A later tools/list request is a new request with its own identifier and response.

Notifications can travel from client to server or server to client when the applicable MCP lifecycle, capability and transport rules allow the particular notification. Common uses include lifecycle signaling, catalog invalidation, progress updates and cancellation.

Learning continuity: Q26 and Q27 examined request and response envelopes. This lesson completes the basic message categories by concentrating on notification semantics and their relationship to outstanding requests. Q29 covers identifiers, Q34 concurrent correlation, Q40 the initialized notification and Q155–164 individual notification types, progress, cancellation and UI integration. The detailed implementations of those features are reserved for their own lessons.

Verification scope: Prepared under the authorized offline research and changelog exceptions. The historical MCP 2025-06-18 specification is used as a reference baseline, not asserted to be the latest revision. Official links were not live-verified. The standard-library Python fixture was syntax-compiled and executed on Python 3.13.5: all 13 checks passed. It models selected incoming events in memory, not a conformant MCP implementation. The local MCP SDK and Mermaid parser were unavailable; actual transport behavior, SDK interoperability and Mermaid parsing/frontend rendering remain unverified.

1. Why a notification is useful#

Imagine a retailer's support application connected to an inventory MCP server. The application has previously discovered a tool called stock. Later the inventory team enables a new capability, warehouse_availability.

Without an event mechanism, the host might periodically request the entire tool catalog just to discover whether it changed. A supported notification allows the server to signal that the cached catalog may be stale. The client can then arrange an appropriate refresh instead of relying exclusively on polling.

This separates two intentions:

  • A request asks the peer to perform an operation and provide a response.
  • A notification informs the peer that an event occurred or asks it to process a one-way signal according to the defined method semantics.

The receiver may still perform meaningful work after a notification. For example, it can mark data stale or update a progress display. One-way does not mean that the receiver does nothing; it means that the message does not establish a JSON-RPC request-response exchange of its own.

2. The notification envelope#

The three parts of a notification are:

FieldRequired?Meaning
jsonrpcYesExact string "2.0"
methodYesName of the supported notification method
paramsMethod-dependentNotification-specific data in the applicable MCP object shape
idMust be absentNo JSON-RPC response is expected

For a notification without parameters:

JSON
{"jsonrpc":"2.0","method":"notifications/tools/list_changed"}

For a notification with parameters:

JSON
{ "jsonrpc": "2.0", "method": "notifications/progress", "params": { "progressToken": "scan-1", "progress": 5, "total": 10 } }

The second example represents a progress observation associated with an appropriate previously supplied token. It is not an entire task result. The fields shown belong to the notification-specific contract, and the token is not a top-level request identifier.

The method name must be supported by the applicable MCP specification and participants. A valid JSON-RPC notification is not automatically a valid MCP notification. A client cannot remove the ID from an ordinary tools/call request and assume that the server supports it as a notification.

Missing ID versus null ID#

This is not a correct MCP notification:

JSON
{ "jsonrpc": "2.0", "id": null, "method": "notifications/tools/list_changed" }

The id member is present. Assigning null to it does not turn the message into a notification. Historical MCP requires ordinary request IDs to be strings or integers and does not allow null as an ordinary request ID.

An ID of numeric zero is also present, not absent. A dispatcher that checks whether the ID is truthy rather than whether the member exists can misclassify requests.

Use the actual message shape, supported method and applicable schema, not a guess based on the method's name.

3. Requests, responses and notifications compared#

PropertyRequestResponseNotification
Contains methodYesNo in the ordinary response envelopeYes
Contains idYesMatching ID for an ordinary correlated responseNo
Contains paramsWhen applicableNo in the ordinary response envelopeWhen applicable
Contains result or errorNoExactly oneNo
Expects a JSON-RPC replyYesNoNo
PurposeInvoke an operationReport a request outcomeConvey a supported one-way event
Loading diagram…

The diagram assumes an initialized connection and a server that advertises the relevant list-change feature. It also assumes the client chooses to refresh immediately. A production client may schedule or coalesce refreshes according to its policy.

The second tools/list exchange is not the acknowledgment of the notification. It is a separate request-response exchange. A notification itself neither allocates a request ID nor completes an unrelated pending request.

4. Bidirectional does not mean unrestricted#

MCP's message framework supports interactions initiated by either participant. A server can send supported notifications to a client, and a client can send supported notifications to a server.

Examples in the historical baseline include:

NotificationTypical permitted direction and purpose
notifications/initializedClient to server; signal completion of the applicable initialization sequence
notifications/tools/list_changedServer to client; signal changed tool catalog when supported
notifications/resources/list_changedServer to client; signal changed resource catalog when supported
notifications/prompts/list_changedServer to client; signal changed prompt catalog when supported
notifications/resources/updatedServer to appropriately subscribed client; indicate a resource update
notifications/roots/list_changedClient to server; signal changed roots when the client supports that feature
notifications/progressRequest receiver to request sender; report associated progress
notifications/cancelledSender of a previously issued request to its receiver; signal cancellation under the applicable rules
notifications/messageServer to client; convey a supported protocol logging message

This table is an orientation to the historical methods, not a complete list or permission matrix. The specific lifecycle, capability declarations, subscriptions and request associations determine whether a particular notification is appropriate.

For example, a client should not assume that a server will send tool-list changes simply because it supports tools. The optional listChanged support is relevant. Similarly, a root-list notification concerns an advertised client feature; it does not authorize the server to access arbitrary files.

Bidirectional communication does not turn the connection into unrestricted access to the host, model, other servers or user context. Every supported interaction is still bounded by its contract and application policy.

A server-initiated request such as ping is different from a server-initiated notification. It contains an ID and expects a response even though the server initiated it.

5. Lifecycle notifications#

In the historical session-oriented MCP lifecycle, the client sends an initialize request and the server returns its initialization result. After successfully completing the applicable negotiation, the client sends notifications/initialized.

JSON
{ "jsonrpc": "2.0", "method": "notifications/initialized" }

The notification represents a defined lifecycle event rather than a fresh negotiation request. It does not expect a JSON-RPC response.

Do not use it as a shortcut around initialization. It belongs at the appropriate lifecycle point after the required compatibility checks. Sending an initialized notification cannot make incompatible revisions or unsupported features compatible.

The detailed lifecycle ordering, exceptions and state handling are reserved for Q36–44, especially Q40.

6. Capability changes are invalidation signals#

A list-change notification generally tells the receiving application that its cached view of a supported capability catalog may no longer be current. It does not necessarily include the full new list or describe each individual change.

For example, the host may have cached stock and search_inventory. After a supported tools/list_changed notification, it should reconsider the affected catalog and discover the current permitted tools according to its refresh policy.

A sensible application sequence is:

  1. Associate the event with the actual trusted server connection.
  2. Mark only the relevant catalog as stale.
  3. Refresh using the supported discovery method when appropriate.
  4. Validate the returned metadata and reevaluate host permissions.
  5. Update model-facing capabilities from the verified catalog.

A notification is not proof that newly advertised tools are authorized. A server's description or annotation is still external data. Q21 established connection isolation: a catalog-change event from the inventory server should not automatically invalidate or replace the customer-account server's catalog.

If the same invalidation signal arrives twice, marking the catalog stale again is usually harmless. That is an application-level design choice that makes cache invalidation more robust, not a general MCP guarantee of duplicate-free delivery.

The detailed tool, resource and prompt invalidation mechanisms are covered in Q156–158 and the cache design in Q208.

7. Progress notifications are not final results#

A request can include a supported progress token inside params._meta. For example, suppose a fictional scan_inventory tool performs a potentially long-running read.

JSON
{ "jsonrpc": "2.0", "id": 17, "method": "tools/call", "params": { "name": "scan_inventory", "arguments": {}, "_meta": { "progressToken": "scan-1" } } }

The request receiver may send associated progress notifications if it implements the supported mechanism:

JSON
{ "jsonrpc": "2.0", "method": "notifications/progress", "params": { "progressToken": "scan-1", "progress": 5, "total": 10 } }

The progress token associates an update with the appropriate ongoing operation. The request ID identifies the original request-response exchange. The notification does not need a new top-level ID.

Progress and total describe the operation's reporting units; five out of ten is illustrative. A total is optional under the historical contract, and a receiver should not invent a percentage when the total is unknown. A progress indication reaching its reported total is not proof that a final result has arrived or that a business write has committed.

Loading diagram…

The progress messages do not receive JSON-RPC responses. The final result resolves the original request, subject to its validation. The historical progress mechanism uses increasing progress values and imposes token-association rules. Full token management, throttling and UI synchronization are reserved for Q159, Q163 and Q164.

8. Cancellation is a signal, not a transaction receipt#

In the historical baseline, an applicable in-progress request may be cancelled using a cancellation notification. For example, the sender of request 17 may send:

JSON
{ "jsonrpc": "2.0", "method": "notifications/cancelled", "params": { "requestId": 17, "reason": "User cancelled the scan" } }

The requestId inside params identifies the earlier request to which the cancellation relates. It is not a top-level identifier for the notification. The optional reason describes why cancellation was requested.

The sender must follow the applicable cancellation rules, including the relationship to a previously issued request and the lifecycle restrictions. In the historical 2025-06-18 baseline, clients must not cancel the initialize request.

The receiver may already have completed the operation, may not recognize the request or may not be able to stop the work immediately. Cancellation is therefore not proof that a downstream business change was prevented or reversed.

For a read-only inventory scan, a cancellation can allow the server to release resources when possible. For a write, the host may need to reconcile authoritative state before reporting the outcome. Closing the connection or receiving an HTTP acknowledgment also does not roll back a committed transaction.

The detailed receiver behavior, races and cancellation policies are covered in Q161–162. The lesson here is that the cancellation signal itself does not create an additional JSON-RPC request-response exchange.

9. Transport acknowledgment versus JSON-RPC response#

The absence of a JSON-RPC response does not imply that the transport has no acknowledgment or that sending cannot fail.

Transport concernInterpretation
Local stdio writeA serialized message is written to the appropriate stream; local write success alone does not establish application processing
Streamable HTTP POSTIn the historical 2025-06-18 transport, an accepted notification sent by POST receives HTTP 202 Accepted with no body
Server-to-client SSE deliveryApplicable server messages may be carried over a supported event stream
JSON-RPC responseA result or error associated with a request ID; not generated as a reply to a valid notification

An HTTP 202 response is not a JSON-RPC response containing result. It acknowledges acceptance at the HTTP transport boundary, not necessarily successful completion of the event handler or a downstream business operation. A rejected HTTP request may instead receive the transport's appropriate failure status.

For historical stdio, the message is encoded using the applicable UTF-8 newline-delimited JSON framing. The receiver processes it according to its method without writing a JSON-RPC reply to that notification.

These details are revision-specific. Follow the selected MCP transport rather than assuming every deployment uses HTTP or that every HTTP POST returns the same status.

10. Delivery limits and safe application behavior#

JSON-RPC's notification pattern does not provide a durable application-level receipt. The supported transport may have its own delivery, reconnect or replay mechanisms, but the absence of a response means the sender cannot infer that the receiver completed its event handler.

Events can be delayed, lost during interruption or repeated in application recovery flows, depending on the transport and implementation. Do not claim that every MCP transport guarantees exactly-once notification delivery. Nor should an application assume that one event stream provides a globally ordered timeline across all server connections.

Practical consequences include:

  • Treat catalog events as invalidation hints and refresh authoritative state when needed.
  • Scope progress updates to the correct active operation and ignore obsolete updates safely.
  • Reinitialize and rediscover affected capabilities after a connection replacement when required.
  • Bound event-processing work so a burst of notifications does not exhaust the host.
  • Keep important business operations on supported request-response paths with authoritative status and appropriate idempotency.
  • Never treat absence of a reply as confirmation that an action succeeded.

For a valid but unsupported notification, apply the applicable protocol and local logging policy without sending a JSON-RPC reply to it. A malformed message is a separate validation problem: use the selected protocol and transport error rules rather than classifying arbitrary invalid JSON as a valid notification.

11. Tested Python example: separate events from requests#

The following standard-library exercise models a client's incoming method dispatcher. It handles two supported event types and a server-initiated ping request. A catalog event marks the catalog dirty; a progress event updates one known local token. The ping request returns a correlated result, but the notifications return None to represent no JSON-RPC reply.

The pending set represents an outstanding outgoing request. None of the incoming notifications should remove it.

Save as notifications_demo.py:

PYTHON
from dataclasses import dataclass, field import json @dataclass class ClientFixture: list_changed_supported: bool = True catalog_dirty: bool = False active_progress: dict = field(default_factory=lambda: {'scan-1': 0}) pending: set = field(default_factory=lambda: {1}) def receive(self, raw): msg = json.loads(raw) if type(msg) is not dict or msg.get('jsonrpc') != '2.0': raise ValueError('Invalid message') method = msg.get('method') if type(method) is not str or 'result' in msg or 'error' in msg: raise ValueError('Not a supported incoming method message') params = msg.get('params', {}) if type(params) is not dict: raise ValueError('Invalid params') if 'id' in msg: if type(msg['id']) not in (str, int): raise ValueError('Invalid ID') if method != 'ping': raise ValueError('Unsupported request in fixture') return {'jsonrpc': '2.0', 'id': msg['id'], 'result': {}} if method == 'notifications/tools/list_changed': if not self.list_changed_supported: raise ValueError('Unexpected catalog event') self.catalog_dirty = True elif method == 'notifications/progress': token, progress = params.get('progressToken'), params.get('progress') if (type(token) is not str or type(progress) is not int or progress < 0): raise ValueError('Invalid progress fixture') if token in self.active_progress and progress > self.active_progress[token]: self.active_progress[token] = progress # No reply to a notification; unknown events are ignored here. return None def rejects(fn): try: fn() except ValueError: return raise AssertionError('Expected rejection') if __name__ == '__main__': c = ClientFixture() def deliver(method, **fields): return c.receive(json.dumps({'jsonrpc': '2.0', 'method': method, **fields})) assert deliver('notifications/tools/list_changed') is None and c.catalog_dirty assert c.pending == {1} assert deliver('notifications/tools/list_changed') is None and c.catalog_dirty assert deliver('notifications/progress', params={'progressToken': 'scan-1', 'progress': 5}) is None and c.active_progress == {'scan-1': 5} assert deliver('notifications/progress', params={'progressToken': 'scan-1', 'progress': 3}) is None and c.active_progress == {'scan-1': 5} assert deliver('notifications/progress', params={'progressToken': 'other', 'progress': 9}) is None and c.active_progress == {'scan-1': 5} assert deliver('notifications/unknown') is None assert deliver('ping', id=0) == {'jsonrpc': '2.0', 'id': 0, 'result': {}} rejects(lambda: deliver('notifications/tools/list_changed', id=None)) rejects(lambda: deliver('notifications/tools/list_changed', id=2)) rejects(lambda: deliver('notifications/progress', params={'progressToken': 'scan-1', 'progress': True})) c.list_changed_supported = False rejects(lambda: deliver('notifications/tools/list_changed')) assert c.pending == {1} print('13 notification handling checks passed')

Run:

BASH
python -m py_compile notifications_demo.py python notifications_demo.py

Actual local output on Python 3.13.5:

13 notification handling checks passed

The thirteen checks cover a catalog invalidation with no reply, preservation of pending work, repeated invalidation, an increasing progress update, an ignored regressive update, an ignored unknown token, a locally ignored unknown notification, a correlated ping result with ID zero, rejection of a null ID, rejection of a catalog event incorrectly carrying an ID, rejection of boolean progress, rejection when list-change support is absent and final preservation of pending work.

The distinction between member presence and truthiness is important. The ping has ID zero, which is false-like in Python but is still an ID. None is an internal sentinel here, not a JSON-RPC message to transmit.

Deliberate limitations#

This is an in-memory teaching fixture rather than an actual MCP client. It assumes trusted connection association and preconfigured lifecycle state. It handles only selected incoming method messages, not response dispatch, actual negotiation, authentication, transport framing, cancellation, durable delivery, logging or network I/O. The progress representation is intentionally restricted to nonnegative integers and string tokens; real historical MCP permits broader numeric progress values and token types subject to its schema and rules. It does not validate total, message or every method-specific field, detect duplicate JSON members, enforce bounds or handle concurrency. Ignoring regressive progress and unknown tokens is the fixture's defensive UI policy, not a claim about all mandatory SDK behavior. Unknown method messages without IDs are ignored by the fixture and are not thereby declared valid MCP methods.

Raised ValueError exceptions are local test outcomes, not outgoing JSON-RPC error responses. A real dispatcher must distinguish malformed messages from supported notifications and handle failures according to the applicable specification. The tested code does not prove delivery guarantees or real protocol conformance. Use a compatible SDK and test actual client-server behavior separately.

12. Common mistakes and practical debugging#

MistakeBetter approach
Adding id: null to a notificationOmit the id member entirely
Replying with result to a valid notificationProcess locally without a JSON-RPC reply
Completing a pending tool call when progress arrivesWait for the applicable final outcome
Assuming a changed catalog event contains the new catalogRediscover using the supported request
Assuming a cancellation signal undoes a writeCheck authoritative business state
Treating HTTP 202 as a tool resultSeparate transport acceptance from protocol response
Trusting events from another sessionBind event processing to the actual connection
Ignoring capability or lifecycle restrictionsValidate direction, method and applicable state

When debugging, log the sanitized method, trusted connection identity and whether the message has an ID. Track notification processing failures separately from request-response failures. Avoid logging private notification payloads, credentials or unrelated model context.

A practical test suite should include valid notifications interleaved with outstanding requests, duplicate or obsolete events, unsupported capabilities, reconnection, and transport failures. Integration tests should confirm that the actual SDK does not emit a JSON-RPC response to a valid notification and that real supported events produce the expected application behavior.

Interview-ready answer#

An MCP notification is a JSON-RPC 2.0 method message with no top-level ID and no corresponding JSON-RPC response. It differs from a request, which has an ID and expects a result or error. MCP participants use supported notifications for lifecycle events, capability changes, progress and cancellation, among other purposes. Notifications can travel in either direction according to negotiated features and protocol rules. A transport acknowledgment is not a JSON-RPC response, and a notification does not guarantee delivery, completion or rollback of an operation. Clients and servers must associate events with the correct connection and operation, validate their meaning, and keep notification handling separate from request correlation.

Next lesson: Q29 explains request identifiers, their types and uniqueness requirements, and why matching IDs matters to reliable communication.

References

  1. 1.
  2. 2.
  3. 3.
    MCP base protocolmodelcontextprotocol.io
  4. 4.
    MCP lifecyclemodelcontextprotocol.io
  5. 5.
    MCP transportsmodelcontextprotocol.io
  6. 6.
    MCP toolsmodelcontextprotocol.io
  7. 7.
    MCP progressmodelcontextprotocol.io
  8. 8.
    MCP cancellationmodelcontextprotocol.io
  9. 9.
    MCP rootsmodelcontextprotocol.io
  10. 10.

Related questions

Explore other topics:Forward Deployed EngineeringAI AgentsLarge Language ModelsRetrieval-Augmented Generation