Follow the connection lifecycle
Trace initialization, capability discovery, requests, and transport choices.
- Describe how an MCP client establishes a session and exchanges messages.
MCP uses JSON-RPC messages, but its lifecycle evolves across protocol revisions. In the 2026-07-28 revision, the core is stateless: peers use discovery and capability negotiation with requests instead of relying on the older initialize handshake and protocol session. Earlier revisions use initialization to negotiate protocol support and capabilities. Standard transports include stdio for local process communication and Streamable HTTP for networked communication; check the revision your client and server support.
A small example
steps = ["discover server", "negotiate capabilities", "send request", "receive response"]
for number, step in enumerate(steps, start=1):
print(number, step)1 discover server 2 negotiate capabilities 3 send request 4 receive response
Protocol version matters: do not mix lifecycle assumptions from different revisions. The 2026-07-28 revision uses stateless requests and server discovery; earlier revisions use initialize and capability negotiation at connection setup. In either case, messages have structured methods and parameters, and robust clients must surface errors rather than assuming every call succeeds.
Key takeaways
Describe how an MCP client establishes a session and exchanges messages.
Keep capability access explicit and handle results as untrusted input.
Lesson quiz
5 questions · pass with 4 correct · up to 50 XP
Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.
Questions about this lesson
Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.
Loading posts…