Search topics…
Tutorials
Explore
June 6 Offline Event →
Module 2 · Model Context Protocol

Module 2: The What - MCP Architecture Overview

Map out Host, Client, and Server responsibilities in Model Context Protocol layers, routed using standard JSON-RPC communications.

⏱ 18 Min Read Author: GenAIWallah Team Updated: May 2026
Day 3

MCP Host-Client-Server Architecture

Why this matters

Host-Client-Server: Host/client/server separation keeps security boundaries and lets you swap servers without rewriting the host.

MCP splits responsibilities across three roles:

  • Host — user-facing app (Claude Desktop, Cursor) that runs the model.
  • Client — protocol agent inside the host; routes JSON-RPC to servers.
  • Server — lightweight process exposing tools/resources (Git, DB, filesystem).
MCP Host-Client-Server Layout
AI Host Claude Desktop / Cursor MCP Client MCP Server

Request flow

User asks a question → model chooses a tool → host client sends tools/call to the server → server executes → result returns as structured content for the model.

Common mistakes

  • Confusing host with server (the host runs the client; the server is a separate process).
  • Hard-coding API keys inside tool implementations instead of env vars.
  • Using SSE locally when stdio is simpler and more secure.

Interview checkpoints

  • Q: What is host-client-server in MCP? A: One-sentence definition + when it runs in the lifecycle.
  • Q: One production pitfall? A: Name transport, auth, or schema mismatch.

Practice

  1. Basic: Sketch Host-Client-Server on a whiteboard.
  2. Intermediate: Find it in a real Claude Desktop or Cursor config.
  3. Advanced: Break it on purpose and document the error message.

Recap

  • You can explain host-client-server clearly.
  • You know host vs client vs server roles.
  • You see how this connects to the next part.

Next: JSON-RPC Layer

Day 4

The MCP Protocol Layer

Why this matters

JSON-RPC Layer: JSON-RPC is the wire format — every tool call is a structured request/response, not ad-hoc HTTP.

On the wire, MCP uses JSON-RPC 2.0. Messages are framed over stdio (local subprocess) or HTTP + SSE (remote).

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "add_values",
    "arguments": { "x": 2, "y": 3 }
  }
}

Why JSON-RPC

  • Language-agnostic — Python, TypeScript, Go servers are all valid.
  • Explicit request IDs for async hosts.
  • Methods like tools/list, resources/read are well-defined in the spec.

Common mistakes

  • Confusing host with server (the host runs the client; the server is a separate process).
  • Hard-coding API keys inside tool implementations instead of env vars.
  • Using SSE locally when stdio is simpler and more secure.

Interview checkpoints

  • Q: What is json-rpc layer in MCP? A: One-sentence definition + when it runs in the lifecycle.
  • Q: One production pitfall? A: Name transport, auth, or schema mismatch.

Practice

  1. Basic: Sketch JSON-RPC Layer on a whiteboard.
  2. Intermediate: Find it in a real Claude Desktop or Cursor config.
  3. Advanced: Break it on purpose and document the error message.

Recap

  • You can explain json-rpc layer clearly.
  • You know host vs client vs server roles.
  • You see how this connects to the next part.

Next: MCP Resources

← Module 1: The Why Module 3: Primitives →