Dev.to AI 🤖 Ai 👁 0 📖 1 min read

MCP Initialization and Handshake - Deprecated

The MCP initialization phase is a strict 3-step JSON-RPC handshake that negotiates the protocol version, exchanges supported capabilities, and establishes session state before any normal operations (tools/list, resources

The MCP initialization phase is a strict 3-step JSON-RPC handshake that negotiates the protocol version, exchanges supported capabilities, and establishes session state before any normal operations (tools/list, resources/read, etc.) can run.

The 3-Step Handshake Sequence

Initialize Request (Client → Server)

The client initiates the connection as the very first message. It declares the highest protocolVersion it supports, its capabilities (e.g., roots, elicitation), and its clientInfo (name/version).

{
   "jsonrpc":"2.0",
   "id":1,
   "method":"initialize",
   "params":{
      "protocolVersion":"2025-11-25",
      "capabilities":{
         "roots":{
            "listChanged":true
         },
         "elicitation":{

         }
      },
      "clientInfo":{
         "name":"client-name",
         "version":"1.0.0"
      }
   }
}

Initialize Response (Server → Client)

The server responds with the negotiated protocolVersion (either matching the client's version or falling back to a supported one), its capabilities (tools, resources, prompts, logging, completions), serverInfo, and optional instructions (system-level hints for the host LLM on how to use the server).

{
   "jsonrpc":"2.0",
   "id":1,
   "result":{
      "protocolVersion":"2025-11-25",
      "capabilities":{
         "tools":{
            "listChanged":true
         },
         "resources":{
            "subscribe":true,
            "listChanged":true
         },
         "prompts":{
            "listChanged":false
         },
         "logging":{

         }
      },
      "serverInfo":{
         "name":"internal-knowledge-server",
         "version":"2.1.0"
      },
      "instructions":"Use search_docs before querying raw database resources."
   }
}

notifications/initialized Notification (Client → Server)

Once the client validates the server's response and confirms it supports the negotiated protocol version, it sends a one-way JSON-RPC notification (notifications/initialized, with no id field) to signal that the session is ready.

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

What Happens Immediately After Initialization?

The initialize response only tells the client which capability categories exist (e.g., "tools": {}); it does not return the actual tool schemas, resource URIs, or prompt definitions.

Immediately after sending notifications/initialized, the client fires discovery requests (tools/list, resources/list, prompts/list) for whichever capabilities the server advertised.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.