Complete MCP initialization and capability negotiation
Check version, capabilities, the initialized notification and shutdown against the 2025-06-18 spec in an acceptance sheet.
Prerequisites and input · Engineering checks · 1. Check the initialize request
At a glance
This note is for engineers who need an MCP client and server to interoperate. Its only basis is the supplied Lifecycle page of the 2025-06-18 specification: a connection has initialization, operation and shutdown phases, and initialization must be the first interaction between the two sides. The deliverable is an acceptance sheet that records whether versions agree, which capabilities were declared, when initialized was sent, how the connection ends, and where each check stops.This sheet distinguishes MUST violations from SHOULD deviations. Stricter disconnect, timeout or shutdown gates for SHOULD provisions are this workflow’s local acceptance policy, not universal protocol mandates.
Runtime and applicability
- Article type
- Engineering practice
- Verified
- Applies to
- MCP Complete MCP initialization and capability negotiation
Execution locations and responsibilities
- MCP client and server Use the workflow below to distinguish responsibilities of the caller, runtime, and external actions.
Arrows show the order of checks in the guide. Follow each step’s prerequisites, branches and stop conditions; unexecuted steps are not completed work.
When to use
- In the initialize request the client must send a protocol version it supports, and the specification suggests the latest one it supports. If the server supports that version it must answer with the same one; otherwise it answers with another version it supports. A client that does not support the returned version should disconnect. This layer only answers whether both sides agreed on one version.
When not to use
- This sheet covers only initialization, operation, shutdown, timeouts and errors from the Lifecycle page; it does not judge whether the content of tools or resources messages is correct.
- The page defines no dedicated shutdown message and gives no concrete timeout values, so grace periods and timeout seconds must be chosen by the team and recorded separately, not written up as specification requirements.
- The page describes experimental capabilities only as non-standard features without further detail, so record them when seen but do not use them to judge interoperability.
Prerequisites and input
- The transport between client and server, stdio or HTTP, is already decided, because shutdown behavior and the version header requirement depend on it.
- You can view the raw JSON-RPC messages from both sides, or at least the logs each side keeps.
Engineering checks
Version agreement layer — In the initialize request the client must send a protocol version it supports, and the specification suggests the latest one it supports. If the server supports that version it must answer with the same one; otherwise it answers with another version it supports. A client that does not support the returned version should disconnect. This layer only answers whether both sides agreed on one version.
Capability declaration layer — Client capabilities are roots, sampling, elicitation and experimental; server capabilities are prompts, resources, tools, logging, completions and experimental. The sub-capability listChanged applies to prompts, resources and tools, while subscribe applies to resources only. This layer answers which optional features may be used during operation.
Operation and termination layer — During operation both sides must respect the negotiated version and use only capabilities that were successfully negotiated. Requests should have timeouts, and after a timeout the sender issues a cancellation notification and stops waiting. There is no dedicated shutdown message; the transport signals it. With stdio the input stream is closed and signals escalate if needed, and with HTTP the connection is closed. This layer answers whether the connection stays controlled during failure and at the end.
1. Check the initialize request
Where: client initialization. Input: supported version, capabilities and clientInfo. initialize as the first interaction is MUST; sending no requests other than pings before its response is SHOULD NOT. Completion: record version, capability and request timing. Stop a wrong first interaction as a MUST violation. An early non-ping request is a SHOULD deviation; this local acceptance policy pauses for correction without reclassifying it as MUST.
2. Check the server response and version outcome
Where: the server initialize response and the way the client handles it. Input: the response protocol version, server capabilities, serverInfo and optional instructions. Action: compare the response version with the requested one; if they differ, decide whether the client supports the returned version. Over HTTP, also confirm that every later request carries the MCP-Protocol-Version header. Completion check: record one outcome: same version, server chose another version and the client accepted it, or the client disconnected. Stop condition: if the client does not support the returned version but keeps sending requests, record a failure and stop.Disconnecting on an unsupported returned version is SHOULD. Treating continued use as a failure is this local acceptance choice, not an additional protocol MUST.
3. Record the negotiated capability list
Where: the capability table in the sheet. Input: the capabilities in the client initialize request and the server initialize response. Action: list every declared capability and sub-capability, for example whether the server declared tools with listChanged or resources with subscribe. Completion check: every feature needed later has a matching declaration in the table. Stop condition: if a required capability was not declared, record negotiation failure and do not assume it is available in later steps.
4. Confirm timing of the initialized notification
Where: the notification the client sends after successful initialization. Input: the conclusion that initialization succeeded. Action: confirm the client sent notifications/initialized, and check that before receiving it the server sent no requests other than ping and logging. Completion check: in the logs the notification precedes any other server-initiated request. Stop condition: if the notification was sent without a successful initialization, or the server sent other requests early, record the deviation and do not move into operation.
5. Check operation constraints and timeouts
Where: the request logs for the operation phase and the timeout configuration of both senders. Input: the capability list, the negotiated version, and the send and response records for each request. Action: verify each request uses only negotiated capabilities and that client-initiated and server-initiated requests each have timeouts. When no response comes, the sender of that request sends a cancellation notification; if the implementation resets its clock on progress notifications, confirm a maximum timeout still applies regardless of progress. Completion check: no request used a capability beyond the negotiated set, and the timeout rule is written down. Stop condition: if a request used a non-negotiated capability, or any request has no timeout ceiling, stop and send it back for correction.Request timeouts, cancellation followed by stopping the wait, and a maximum timeout are source SHOULD recommendations. This workflow selects them as local deployment gates and pauses deviations under that policy.
6. Verify shutdown and error handling
Where: the transport layer and the initialization error branch. Input: the transport type and one reproducible version-mismatch case. Action: with stdio, confirm the client closes the child process input stream first, waits for exit, and if needed sends SIGTERM and then SIGKILL; with HTTP, confirm the end is signaled by closing the connection. Then check that version mismatch, failure to negotiate required capabilities and request timeouts each have handling. Completion check: every case has a clear end or error record. Stop condition: if the server has not exited after the grace period and the client does not escalate, or an error case has no handler, the sheet does not pass.The stdio waiting and signal escalation follow documented recommendations; strict closeout here is local policy, without an invented universal grace period.
Task example
This is an invented manual walkthrough; every observation below is a hypothetical expectation, not a verification that was run. Suppose the client sends initialize with version 2025-06-18 and declares roots and sampling. If the server answers with the same version and declares tools with listChanged, the sheet reads: version agreed, tools usable. The client then sends notifications/initialized. At the end, the reviewer expects to see the input stream closed and the process exit in a stdio setup. If the server is expected to answer with a version the client does not know, the sheet says the client should disconnect, and every later step is skipped.
Completion checks
- Check the initialize-first MUST and the pre-response non-ping-request SHOULD deviation, without banning every other message.
- Every feature in use maps to a negotiated capability declaration, with no feature assumed from habit.
- The shutdown path matches the chosen transport, and timeouts, cancellation and the maximum timeout are recorded.
Verification scope
Only the supplied Lifecycle page of the MCP 2025-06-18 specification was read as documentation. Installation, login, API execution and output were not tested; the example is an invented walkthrough and does not describe any product actual behavior. That version is the one read here and is not claimed to be the newest.
Sources
All links are official pages; verification dates are listed per source, and links point to the version checked.