LESSON 04 / 18·2 min readFoundation

Initialization, Lifecycle, and Capability Negotiation

Must knowConcept lesson
01 Understand02 Recall03 Prepare

Why it exists

Clients and servers may support different protocol versions and features. Initialization allows them to agree on a common contract before normal operations begin.

Lifecycle

  1. The client sends an initialize request containing the protocol version, client information, and capabilities.
  2. The server returns the selected version, server information, instructions, and capabilities.
  3. The client sends notifications/initialized.
  4. Normal operation begins.
  5. The connection ends through graceful shutdown or transport closure.
Architecture at a glanceFollow the arrows to see how the parts connect.

Preparing the architecture diagram…

Read the full diagram flow
stateDiagram-v2
  [*] --> Initializing
  Initializing --> Operating: initialize response + initialized notification
  Operating --> Closing: shutdown or transport close
  Closing --> [*]
  Initializing --> [*]: incompatible version

Capability negotiation

Capabilities are promises. A client should expect tool operations only when the server advertises the tools capability. Resources may advertise subscriptions, while list capabilities may advertise listChanged notifications. Calling an unsupported feature is a compatibility bug.

Interview point

A version number alone is not enough. Code should check negotiated capabilities because optional features are not available in every client/server pair.

PAUSE & RECALL

Can you explain it without the notes?

Initialization, Lifecycle, and Capability Negotiation

Use your own words. Explain an example and one limitation before checking the explanation.

Check your explanation

Why it exists

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

Practice this concept
YOUR NEXT STEP

Keep connecting the ideas.

Next lesson: Tools: Discovery, Schemas, Invocation, and Results

Adapted from 20_MCP_SERVER.md · “4. Initialization, Lifecycle, and Capability Negotiation”. Examples are study fragments; framework behavior can depend on your version.