MCP: Model Context ProtocolBeginnerModule 04 — MCP protocol lifecycle
What is the purpose of the initialized notification in supported revisions?
Question 33 of 43 · Updated
On this page
- Direct answer
- 1. Why a separate completion signal is useful
- 2. Notification format and direction
- 3. The final part of the initialization sequence
- 4. Separate client and server readiness states
- 5. Message ordering and concurrent initialization
- 6. Historical pre-initialization restrictions
- 7. Transport acknowledgments are not JSON-RPC responses
- 8. Premature and duplicate notifications
- 9. Delivery failures and ambiguous outcomes
- 10. Tested practical example: separate send and receive transitions
- What was actually tested
- Deliberate limitations
- 11. Practical defensive lifecycle management
- 12. Common mistakes and interview distinctions
- Interview-ready answer
Direct answer#
In historical session-oriented MCP revisions that define it, notifications/initialized is a client-to-server JSON-RPC notification that tells the server the client has successfully completed its side of the initialization exchange. In the 2025-06-18 specification, after receiving and accepting the initialize result, the client must send this notification to indicate that it is ready to begin normal operations.
The notification closes the initial lifecycle sequence. It is not another initialize request, a response to the server's result, a tool invocation, an authentication credential or a second round of capability negotiation. It carries no top-level request ID and receives no JSON-RPC response.
Its purpose becomes particularly clear when the client and server run independently: the server may already have sent a valid initialization result, but it cannot conclude merely from that fact that the client accepted the selected protocol revision and completed its side of the handshake.
Learning continuity: Q28 introduced notification semantics; Q36 described the entire handshake; Q37–39 covered version selection, safe incompatibility handling and capability declarations. Q40 examines the last lifecycle signal, separate local readiness states, ordering and failure ambiguity. Q41 develops method-by-method capability gating, while Q42–43 address termination and connection interruption. The focus here is the notification's specific role rather than repeating the full initialization schema or general request validation.
Verification scope: Prepared under the authorized offline research and changelog exceptions using the historical MCP 2025-06-18 specification as a reference baseline. This is not a claim about the latest revision or newer lifecycle designs. Official reference links were not checked live. The standard-library Python fixture was syntax-compiled and executed on Python 3.13.5 with warnings treated as errors; all 12 named unit tests passed. It models independent client and server state transitions and synthetic delivery outcomes. No actual network, stdio connection or MCP SDK was used. The local MCP SDK and Mermaid CLI were unavailable; live interoperability, Mermaid parsing and website rendering remain unverified.
1. Why a separate completion signal is useful#
Imagine a retail support host connecting to an inventory MCP server. The server receives initialize, selects a protocol revision that it implements and sends the result containing its capabilities and implementation information.
At that instant, several things can still go wrong on the client side:
- The result may be delayed or lost before the client receives it.
- The selected revision may not be implemented by the client.
- The result may fail schema or correlation validation.
- A locally implemented revision may be disallowed for that integration.
- The client may terminate before completing its setup.
The server's act of sending the result cannot establish the client's acceptance of that result. The initialized notification gives the client a defined way to signal that it has completed the applicable validation and initialization process.
This is not a distributed transaction commit or a proof that both processes have identical internal state. It is a protocol lifecycle signal. A host must still maintain its own trusted connection ownership, admission policy and operation-specific authorization.
Consider the difference between three events:
| Event | Meaning |
|---|---|
| Server sends initialize result | Server has supplied its selected contract and declarations |
| Client accepts result | Client has validated the applicable result and compatible contract locally |
| Server receives notifications/initialized | Server has received the defined client completion signal |
The three events occur at different times. Keeping them separate prevents premature discovery and server-initiated ordinary requests.
2. Notification format and direction#
A minimal historical initialized notification is:
JSON{ "jsonrpc": "2.0", "method": "notifications/initialized" }
The method string must be the defined method name, not initialize, initialized or initialize/complete.
The message has no top-level id. It does not allocate a request ID or complete an unrelated pending request. Where the applicable schema permits optional notification parameters or metadata, those must follow that schema; no such fields are needed for the minimal example.
A message like the following is not a valid initialized notification:
JSON{ "jsonrpc": "2.0", "id": null, "method": "notifications/initialized" }
The member id is present even though its value is null. Omitting the member is different from assigning null or zero. Q28 and Q29 explain the general notification and identifier contracts.
The intended sender in this historical lifecycle is the client, and the receiver is the server. The server does not send the same notification back to acknowledge readiness. It does not use a JSON-RPC result containing an arbitrary ID to answer this message.
A malformed method-bearing object that has an ID needs to be handled according to its actual classification and applicable error rules; it must not be silently accepted as the initialized notification.
3. The final part of the initialization sequence#
The example assumes a successful historical initialization, a transport that provides the relevant sequencing guarantees, and a server that supports tools. The later tools/list result belongs to request 1. It is not a response to the notification.
The initialize result has already completed the initial request-response exchange. The initialized notification signals the next lifecycle milestone. The client does not need to await a nonexistent JSON-RPC acknowledgment of initialized before progressing through the supported SDK's lifecycle.
A successful initialized send also does not eliminate the need to validate every later response. The client must retain the selected revision, capabilities and trusted relationship association and continue to check the actual operations it performs.
4. Separate client and server readiness states#
A distributed connection has two state machines, even if both are wrapped by a single library abstraction. They do not share an instantaneous ready flag.
The diagram uses illustrative application states. It does not prescribe standardized MCP state names or imply that transport acknowledgment is proof of server processing. The exact SDK and transport determine how local completion is represented.
For a client, accepting the initialization result is a precondition for sending the notification. An application should not expose the relationship to ordinary dispatch while its required local initialization procedure remains incomplete.
For a server, the completion signal is processed within the correct relationship's lifecycle. Receiving it on a different connection or generation cannot complete the wrong initialization attempt.
A server may process the notification before the client receives an HTTP acknowledgment. Conversely, acceptance at a transport boundary may be observed before an asynchronous internal handler has completed. A real implementation must preserve the applicable sequencing and admission semantics across these boundaries. Neither side should infer the other's entire internal state merely from a local send or receive event.
5. Message ordering and concurrent initialization#
In historical stdio, messages travel through UTF-8 newline-delimited JSON streams. A client using an ordered writer should place the initialized message before its subsequent ordinary requests. The server should process the relevant lifecycle transition before dispatching those dependent requests. Reading bytes in order does not automatically make concurrently scheduled handlers finish in order.
In Streamable HTTP, requests may be carried in separate HTTP exchanges. The host should use the supported SDK's initialization procedure, including the appropriate completion of the notification send, instead of independently launching ordinary discovery and the initialized POST in competing tasks.
For example, the following conceptual scheduling is unsafe:
Task A: send notifications/initialized
Task B: immediately send tools/list without waiting for applicable readinessTask B can become visible to the receiver before Task A has established the required lifecycle state. Simply starting Task A first does not establish a happens-before relationship between their relevant effects.
A better application structure is:
1. Await the SDK's successful initialization procedure.
2. Admit the initialized relationship to normal operation.
3. Begin supported ordinary discovery or execution.These are conceptual steps, not concrete SDK method signatures. A server implementation should likewise serialize the lifecycle transition and dependent admission check within its ownership model. It may use an event loop, lock, ordered dispatcher or another suitable mechanism.
Do not solve the ordering problem by sleeping for an arbitrary number of milliseconds. A delay is not proof of successful initialization and can fail under slow scheduling or network conditions.
6. Historical pre-initialization restrictions#
The historical 2025-06-18 lifecycle distinguishes pre-initialization behavior from normal operation. Initialization is the first interaction. Before receiving the server's initialize response, the client SHOULD NOT send requests other than pings. Before receiving the initialized notification, the server SHOULD NOT send requests other than pings and logging as expressed in the historical lifecycle guidance; logging itself is a notification mechanism.
These rules have different normative strengths. The requirement to send initialized following successful initialization is not the same as an absolute prohibition on every possible message before it. In particular, a ping can have an applicable lifecycle allowance. Do not turn the SHOULD NOT language into a blanket MUST NOT for all traffic.
The following table separates the historical guidance from a useful local policy.
| Interaction | Interpretation |
|---|---|
| initialize | Establishes the initial protocol contract |
| ping during setup | Has an applicable historical lifecycle allowance |
| Ordinary client discovery | Defer until the supported initialization procedure has completed |
| Ordinary server-initiated requests | Defer until the server receives the required completion signal and relevant checks pass |
| Logging notifications | Apply their specific historical allowance and capability semantics |
| notifications/initialized | Required client completion signal after accepting initialization in this baseline |
The strict discovery checks in the example below are application-level admission policies. They do not implement the full pre-initialization exception matrix.
A successful ping does not make an uninitialized session ready. A successful initialize result also does not permit arbitrary server-to-client requests without the applicable notification and capability requirements.
7. Transport acknowledgments are not JSON-RPC responses#
In the historical 2025-06-18 Streamable HTTP transport, a client can send an MCP notification in an HTTP POST. If the server accepts the notification, the transport specifies an HTTP 202 Accepted response with no body.
An illustrative request/response fragment is:
HTTPPOST /mcp HTTP/1.1 Content-Type: application/json Accept: application/json, text/event-stream MCP-Protocol-Version: 2025-06-18 {"jsonrpc":"2.0","method":"notifications/initialized"}
HTTPHTTP/1.1 202 Accepted
These fragments omit the host, body framing, any required authorization and any applicable assigned MCP-Session-Id. The endpoint is fictional. They illustrate the distinction between the message and the transport status, not a complete runnable HTTP exchange.
The status acknowledges acceptance under the historical transport contract. It is not a JSON-RPC result, and by itself it is not a universal guarantee of completed asynchronous application handling, durable storage or the success of later business operations. A receiver must implement lifecycle sequencing so ordinary operations do not bypass the required transition.
In historical stdio, there is no corresponding HTTP 202. A successful local write or flush does not prove that the server processed the notification. No JSON-RPC response is expected to the valid notification.
| Evidence | What it can establish |
|---|---|
| Client constructed a notification | The local message was created |
| Local write or supported send returned successfully | The applicable local send step completed |
| HTTP 202 for an accepted notification | Historical HTTP transport accepted the notification |
| Server actually processed initialized | Server-side lifecycle transition occurred |
| Later valid response to a supported request | Evidence for that separate request's outcome |
The last event cannot retrospectively prove all aspects of earlier processing or authorization. Each guarantee has its own scope.
8. Premature and duplicate notifications#
A premature initialized notification is one that arrives without the corresponding accepted lifecycle context. For instance, the server might receive it before it has processed an initialize request and sent an appropriate result.
A defensive server should not blindly set its readiness flag in response to an arbitrary message with the right method name. It needs the correct connection/session association and the expected local state.
Similarly, an implementation should not use a duplicate initialized signal to rerun one-time setup, reset correlation counters, republish a catalog or reopen a closed session.
An example local policy is to accept the expected transition once and treat a duplicate on an already ready relationship as a no-op with a bounded diagnostic. Another implementation may take a different appropriate action under its protocol and SDK policy. The historical notification contract does not itself establish a universal duplicate-delivery guarantee or prescribe a general retransmission algorithm.
For a valid notification, do not invent a JSON-RPC error response just because local handling is unsuccessful. The lack of a reply is part of notification semantics. Local rejection, safe diagnostics and applicable transport error or connection handling remain separate.
A client should not deliberately send duplicates as a readiness probe. Use the supported lifecycle procedure rather than treating initialized as an idempotent ping.
9. Delivery failures and ambiguous outcomes#
Consider a transport interruption after the client begins sending the notification.
| Observed situation | Possible actual state |
|---|---|
| Send fails before delivery | Server may still await initialized |
| Server processes notification, then transport acknowledgment is lost | Server may be ready although the client reports failure |
| Client receives transport acceptance before internal processing finishes | Server's application handler may still be completing |
| Connection ends while server awaits notification | Incomplete relationship requires appropriate cleanup |
The key insight is that a local send failure does not always prove that the server never received the message. Nor does successful acceptance prove that the two participants share identical state.
A safe application keeps an unsuccessful or uncertain initialization out of its ready pool, records the failure, and follows the applicable SDK and transport cleanup or recovery rules. If the relationship is genuinely replaced, ensure that a stale notification from the old generation cannot admit the new one.
Do not blindly resend initialized or issue initialize again on an existing relationship without checking the applicable lifecycle rules. A transient physical reconnection may not equal creation of a new logical session. Q38 covers safe failure admission; Q42 and Q43 examine actual termination and interruption in more detail.
A readiness timeout is a local operational policy, not a fixed timeout duration mandated by the historical initialized notification. Bound incomplete state and queued work so a peer that never finishes initialization cannot keep resources allocated forever.
10. Tested practical example: separate send and receive transitions#
The following standard-library Python example focuses only on the final lifecycle signal. A Client starts waiting for a previously issued initialize request's result; a Server starts before issuing a result. Boolean acceptance and send outcomes are injected by tests, representing decisions that a real SDK must establish through validation and transport behavior.
The generation argument is a trusted synthetic association supplied by the test harness, not a field in the notification or a standardized session header. The fixture permits one transition on the server and treats duplicates after readiness as a no-op. It models ordinary discovery with a local gate and a fictional empty catalog.
Save as mcp_q40.py:
PYTHONimport json import unittest NOTICE = {'jsonrpc': '2.0', 'method': 'notifications/initialized'} class Client: def __init__(self): self.state = 'waiting_result' def accept_result(self, accepted): if self.state != 'waiting_result': raise ValueError('Unexpected result') self.state = 'accepted' if accepted else 'failed' def begin_notice(self): if self.state != 'accepted': raise ValueError('Cannot send initialized') self.state = 'sending' return json.dumps(NOTICE) def finish_send(self, accepted): if self.state != 'sending': raise ValueError('Unexpected send outcome') self.state = 'ready' if accepted else 'failed' def discover(self): if self.state != 'ready': raise ValueError('Client not ready') return {'jsonrpc': '2.0', 'id': 1, 'method': 'tools/list'} class Server: def __init__(self, generation): self.generation = generation self.state = 'new' self.transitions = 0 def result_sent(self): if self.state != 'new': raise ValueError('Unexpected initialize') self.state = 'awaiting_notice' def receive_notice(self, raw, generation): if generation != self.generation or json.loads(raw) != NOTICE: raise ValueError('Invalid fixture notification') if self.state == 'ready': return None # Local duplicate policy, not a protocol reply. if self.state != 'awaiting_notice': raise ValueError('Unexpected initialized') self.state = 'ready' self.transitions += 1 return None def discover(self): if self.state != 'ready': raise ValueError('Server not ready') return {'tools': []} def close(self): self.state = 'closed' class Tests(unittest.TestCase): def pair(self): c, s = Client(), Server(1) s.result_sent() c.accept_result(True) return c, s def test_success(self): c, s = self.pair() raw = c.begin_notice() self.assertIsNone(s.receive_notice(raw, 1)) c.finish_send(True) self.assertEqual(c.discover()['id'], 1) self.assertEqual(s.discover(), {'tools': []}) def test_no_id(self): c, _ = self.pair() self.assertNotIn('id', json.loads(c.begin_notice())) def test_early_client(self): with self.assertRaises(ValueError): Client().begin_notice() def test_rejected_result(self): c = Client() c.accept_result(False) with self.assertRaises(ValueError): c.begin_notice() def test_early_server(self): s = Server(1) with self.assertRaises(ValueError): s.receive_notice(json.dumps(NOTICE), 1) self.assertEqual(s.state, 'new') def test_discovery_before_notice(self): c, s = self.pair() for discover in (c.discover, s.discover): with self.assertRaises(ValueError): discover() def test_ack_before_processing(self): c, s = self.pair() raw = c.begin_notice() c.finish_send(True) self.assertEqual(c.state, 'ready') with self.assertRaises(ValueError): s.discover() s.receive_notice(raw, 1) self.assertEqual(s.discover(), {'tools': []}) def test_duplicate(self): c, s = self.pair() raw = c.begin_notice() s.receive_notice(raw, 1) self.assertIsNone(s.receive_notice(raw, 1)) self.assertEqual(s.transitions, 1) def test_failure_before_delivery(self): c, s = self.pair() c.begin_notice() c.finish_send(False) self.assertEqual(s.state, 'awaiting_notice') with self.assertRaises(ValueError): c.discover() def test_failure_after_delivery(self): c, s = self.pair() s.receive_notice(c.begin_notice(), 1) c.finish_send(False) self.assertEqual(s.state, 'ready') with self.assertRaises(ValueError): c.discover() s.close() self.assertEqual(s.state, 'closed') def test_wrong_generation(self): c, _ = self.pair() s = Server(2) s.result_sent() with self.assertRaises(ValueError): s.receive_notice(c.begin_notice(), 1) self.assertEqual(s.state, 'awaiting_notice') def test_id_and_closed_rejected(self): c, s = self.pair() with self.assertRaises(ValueError): s.receive_notice(json.dumps({**NOTICE, 'id': None}), 1) s.close() with self.assertRaises(ValueError): s.receive_notice(c.begin_notice(), 1) if __name__ == '__main__': unittest.main(verbosity=2)
Run:
BASHpython -m py_compile mcp_q40.py python -W error mcp_q40.py
Actual local output summary on Python 3.13.5:
Ran 12 tests in 0.000s
OKWhat was actually tested#
| Test group | Tests | Observation |
|---|---|---|
| Successful completion and absence of ID | 2 | Both local gates can open after appropriate events; notification has no ID |
| Early client, rejected result, early server and early discovery | 4 | Initialization cannot be bypassed in the fixture |
| Local acknowledgment before server processing | 1 | Client-local completion does not establish server readiness |
| Duplicate notification | 1 | Server's successful transition count remains one |
| Failure before and after delivery | 2 | Same client failure can coexist with different server states |
| Wrong generation | 1 | Stale signal cannot admit replacement fixture |
| Null ID and closed state | 1 | Neither is accepted as a valid completion event |
All 12 named tests ran with the standard-library unittest runner. The reported duration is the local fixture test time, not a transport performance measurement.
The most useful case is test_ack_before_processing: finish_send(True) advances the client-local state, but the server still denies ordinary discovery until receive_notice runs. This intentionally demonstrates a state difference, not a recommendation to send ordinary traffic while the server is unready. Actual transport and SDK ordering must ensure the applicable lifecycle semantics.
The two delivery failure tests show why recovery cannot assume a single server outcome. In one, the server remains awaiting_notice; in the other, it is already ready while the client rejects its own admission. The test explicitly closes that server fixture to demonstrate local cleanup state, not real remote shutdown.
The server's transitions counter makes the duplicate policy observable. receive_notice returns None to represent no RPC reply. ValueError represents a local test failure category, not an outgoing JSON-RPC error message.
Deliberate limitations#
This program is a synchronous in-memory teaching fixture. It does not implement the actual initialize request or response, negotiated version validation, authentication, real session association, an SDK, a transport writer, concurrency, genuine HTTP acknowledgments, network errors, deadlines or recovery. The booleans used for acceptance are assumed to be trusted local decisions.
The exact notification equality check is a deliberately narrow fixture policy; a real revision-specific schema may permit optional parameters or metadata. It is not a full defensive JSON parser, does not reject all duplicate members, and does not validate direction or session identity from actual transport state.
The discover functions are illustrative gates, not full tools/list implementations. The client returns a fixed ID and must not be used as a reusable allocator; repeated actual requests would require new IDs under historical MCP's non-reuse rule. The server returns a fictional result fragment and assumes tools support for this demonstration. No real capability or authorization checks are implemented.
The synthetic generation number is passed by the trusted harness, not authenticated over the wire. The state transitions are sequential; no real races, out-of-order network packets or thread safety are tested. The tests establish the stated local properties only. Use a compatible MCP SDK and actual transport integration tests before deployment.
11. Practical defensive lifecycle management#
In a production host, bind each initialization attempt to an owned client session. Use the SDK's supported initialization API and determine whether it already sends notifications/initialized. Do not add a second manual notification merely because a low-level example includes one.
Maintain an admission gate for model-facing tool catalogs and ordinary dispatch. Only admit a relationship after the applicable successful lifecycle procedure. Check the originating connection and its generation whenever asynchronous work may outlive the attempt.
On the server, distinguish waiting for initialize from waiting for the completion signal. Apply the lifecycle transition once, serialize the transition with dependent operation admission, and ensure a stale or closed connection cannot reenter the ready state through a late notification.
For scalability, bound the number of incomplete sessions, initialization queue size and waiting time. Measure the time from connection establishment to usable local readiness separately from tool execution latency. Consider a deployment with 100 simultaneous setup attempts: if each holds an owned transport and a pending catalog task, an unbounded wait can keep those resources occupied indefinitely. Use measured limits appropriate to the real deployment rather than treating this example as a required protocol timeout.
For security, do not turn the initialized notification into proof of user identity, approval or resource entitlement. Even a correctly completed lifecycle only establishes the applicable protocol relationship. Check feature support, the actual catalog, arguments, user consent and server-side resource permissions separately.
Useful integration diagnostics include trusted relationship identity, accepted revision, time of result acceptance, local notification send outcome, server lifecycle transition where observable and a controlled failure category. Avoid logging raw credentials, server instructions and arbitrary private payloads.
12. Common mistakes and interview distinctions#
| Mistake | Correct approach |
|---|---|
| Mark both sides ready when the server sends initialize result | Keep client acceptance and server notification processing distinct |
| Send initialized before validating the result | Send only after successful applicable initialization checks |
| Add an ID or await a JSON-RPC response to initialized | Use the defined one-way notification |
| Treat HTTP 202 as proof of every downstream state change | Distinguish transport acceptance from processing and business success |
| Launch dependent discovery in parallel with initialization | Use an explicit lifecycle ordering/admission boundary |
| Repeat the notification to reset a session | Follow the actual lifecycle and local duplicate policy |
| Treat notification receipt as permission to access resources | Enforce independent authorization |
| Accept stale notifications on a replacement relationship | Bind events to the correct trusted session and generation |
| Apply the historical sequence to an unverified newer revision | Consult the actual selected revision and SDK |
For actual compatibility testing, exercise valid initialization, malformed notification shapes, wrong direction, early and duplicate notifications, transport acceptance, interruptions before and after delivery, ordinary request ordering, and stale connection callbacks. Confirm the real SDK does not generate a JSON-RPC reply to a valid initialized notification and that neither client nor server exposes unauthorized work.
The historical 2025-06-18 lifecycle is the basis of the protocol examples here. Newer specification designs may use different lifecycle mechanisms; no particular newer change is asserted without verification. The general engineering distinction between local send, peer processing and authorized application readiness remains useful.
Interview-ready answer#
In historical MCP revisions such as 2025-06-18, notifications/initialized is the client's mandatory completion signal after it accepts the initialize result. It tells the server that the client has completed the applicable initialization procedure. It has no top-level request ID and receives no JSON-RPC response. The client and server maintain separate readiness states, so message ordering, correct session association and controlled admission are important. HTTP 202 is a transport acknowledgment, not a JSON-RPC reply or proof of business success. Premature, duplicate, delayed and failed delivery must be handled according to the selected lifecycle and local defensive policy. The notification does not negotiate new capabilities, authenticate users or grant resource permissions.
Next lesson: Q41 explains how clients gate individual MCP methods using the negotiated server capability families and optional feature flags, while preserving independent lifecycle and authorization checks.
References
- 1.MCP historical specification (2025-06-18)modelcontextprotocol.io
- 2.MCP lifecyclemodelcontextprotocol.io
- 3.MCP base protocolmodelcontextprotocol.io
- 4.MCP transportsmodelcontextprotocol.io
- 5.MCP pingmodelcontextprotocol.io
- 6.MCP loggingmodelcontextprotocol.io
- 7.JSON-RPC 2.0 specificationjsonrpc.org
- 8.HTTP Semantics RFC 9110 section 15.3.3rfc-editor.org
- 9.Official MCP Python SDKgithub.com
- 10.Python unittest documentationdocs.python.org
Related questions
Explore other topics:Forward Deployed EngineeringAI AgentsLarge Language ModelsRetrieval-Augmented Generation