← Learn / Notebooks

Agents & MCPTechnicalStudy guide

MCP Servers: stdio and Legacy HTTP+SSE

Study the 2024-11-05 protocol architecture, stdio and legacy HTTP+SSE examples, with a link to current transport documentation.

Before you start: Experience reading TypeScript, JSON and HTTP examples. Some examples cover the older HTTP+SSE transport.

Imported AI-assisted study notebook · Added 13 Nov 2026. Source links are retained; the material has not passed ResearchNode’s article source-support review.

Version scope: 2024-11-05. This notebook teaches historical HTTP+SSE examples. For new implementations, consult the current stdio and Streamable HTTP specification. The examples below are not a current SDK compatibility guarantee.

Learning Goal: Coding, configuring, and security-testing custom MCP servers Exported Notebook Reference

Model Context Protocol Architecture, Lifecycle, Transports & Security Foundations

Wire Format
JSON-RPC 2.0
Session Model
1:1 Stateful
Transports
Stdio & HTTP+SSE
Self-Check
5 Practice Qs
Module 01

Protocol Specifications & Lifecycle

Why This Matters

Every Model Context Protocol (MCP) server relies on strict message framing and state management to safely bridge AI models with external data and tools, preventing malformed payloads, race conditions, and security vulnerabilities when building custom integrations.

Client-Host-Server Architecture

MCP decouples the AI application from external integrations using a stateful, three-part architecture connected over a transport layer (such as stdio or Streamable HTTP / SSE).

The Three-Phase Connection Lifecycle

Because MCP connections are stateful, both peers must strictly enforce a three-phase lifecycle. Select a phase below to inspect its rules and protocol invariants:

1. Initialization Handshake

Mandatory First Step

The Client sends an initialize request declaring its protocol version and supported capabilities (e.g., roots, sampling). The Server replies with its own protocol version and capabilities (e.g., tools, resources), and the Client confirms readiness by sending a notifications/initialized notification.

Protocol Violation Rule: Sending standard operational requests (like tools/call) before initialization completes is a strict protocol violation.

Worked Examples: JSON-RPC 2.0 Wire Payloads

Module 02

Transports & Communication Channels

While JSON-RPC 2.0 defines message semantics, transports determine how bytes move between client and server—shaping latency, concurrency, and network attack surfaces.

Worked Examples: TypeScript SDK & Host Setup

Module 03

Interactive Knowledge Check

Test your mastery of MCP transports, stream hygiene, HTTP+SSE routing, and security boundaries.

Score: 0 / 5
Action completed

References and source links

  1. Model Context Protocol maintainers (2024-11-05). Architecture: historical specification used by this notebook.https://modelcontextprotocol.io/specification/2024-11-05/architecture
  2. Model Context Protocol maintainers (2024-11-05). Transports: stdio and legacy HTTP+SSE.https://modelcontextprotocol.io/specification/2024-11-05/basic/transports
  3. Model Context Protocol maintainers (2026-07-28). Current transport documentation: consult this before building a new server.https://modelcontextprotocol.io/specification/2026-07-28/basic/transports

Reference list added during the visual refresh on 14 Nov 2026. It is a reading path, not a completed claim-by-claim audit of this imported notebook.