Core Concept 2: Protocol Lifecycle, Control Boundaries & Transports
Step up to the formal protocol mechanics: trace the 4-phase JSON-RPC 2.0 session lifecycle, control boundaries, bidirectional sampling/elicitation, and transport rules.
Zoom into the formal protocol mechanics underneath every MCP server: the 4-phase JSON-RPC 2.0 session lifecycle, who controls Tools vs. Resources vs. Prompts, bidirectional sampling & elicitation, and operational security pitfalls.
1. Visual Analogy · Air Traffic Control Handshake & Clear Cockpit Roles
What actually travels on the wire during an MCP session—and who controls Tools vs. Resources vs. Prompts?
Once you know how a tiny server works, the next step is understanding the formal session rules underneath it. Instead of ad-hoc messages, MCP uses JSON-RPC 2.0 with strict version negotiation, paginated capability discovery, explicit control boundaries, and structured isError: true diagnostics.
How this fits: This is Core Concept 2 (cloud-agnostic). Mastering JSON-RPC lifecycle phases and control boundaries prepares you for production engineering (C3) and stateless cloud scaling (Lab 1).
- A session starts with initialize -> server capabilities -> notifications/initialized before any tools/call runs.
- Model-controlled Tools, App-controlled Resources, and User-controlled Prompts keep authority boundaries explicit.
- Validate inputs at the boundary, return isError: true instead of crashing, and allowlist URIs to block SSRF.
Every flight begins with a strict radio handshake before takeoff, separates pilot controls from air-traffic advisories and passenger requests, and uses structured callsigns so transmissions never collide. MCP does the same over JSON-RPC 2.0.
In MCP control boundaries, which primitive is primarily application-controlled rather than silently invoked by the model?
Engineering Scratchpad
Auto-saved per lab in mcp_foundry_v1_scratchpads
0 chars saved
Engineering Scratchpad
Auto-saved per lab in mcp_foundry_v1_scratchpads