Agentic AI Notebook
Model Context Protocol
Phase 8Module 2 of 25

MCP Architecture

When a connection fails, you need to know which layer broke: the app, the connector, or the server process.

A restaurant: the dining room is the host, the waiter is the client, the kitchen is the server.

Visual Workflows

Start here — scroll inside each diagram frame to explore, then use + / to zoom up to 200% if needed.

Overview

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

First connection

100%
Loading diagram...

Scroll inside the frame to explore · use + / − to zoom up to 200%

Nothing works until initialize succeeds and the client learns what the server can do.

Key Takeaways

  • 1.Three layers: Host (the app), Client (the connector), Server (the capabilities) One client talks to one server — add more servers, add more clients.
  • 2.Startup handshake: initialize, then list tools, resources, and prompts. JSON-RPC carries every request and response on the chosen transport.
  • 3.The host owns the user session. Each client is a 1:1 session with one server.
  • 4.The server answers list_tools, call_tool, list_resources, and read_resource.

Learn elsewhere

  • stdio vs HTTP — covered in Transport
  • How to implement handlers — covered in MCP Server

Real Example

Scenario

Cursor (host) starts a client that spawns a Postgres MCP server. After initialize, the agent sees query and schema tools.

What you would do

In Model Context Protocol, apply MCP Architecture to this scenario: Cursor (host) starts a client that spawns a Postgres MCP server. Identify the inputs, run the technique, validate the output, and note one thing you would monitor in production.

Commands

Commands to Remember

  • Host = app the human uses
  • Client = one connection to one server
  • Server = exposes tools, resources, prompts
  • initialize must succeed before any tool call

Cheat Sheet

Quick recap

quick ref
  • Host / Client / Server
  • One client per server connection
  • initialize → list → operate
  • JSON-RPC is the message format

Common Mistakes

  • Calling the host the server
  • Sharing one client across many servers
  • Calling tools before initialize finishes