MCP Lifecycle — Conversation Simulator

Not a slide deck — press Play and watch the full protocol conversation happen, message by message. (This shows complete message bodies, the way Part 3's wiretap captures them — Claude Desktop's own log only shows a one-line summary of each message; see "Live capture command" for that exact, corrected command.)

Initialization
ClientServer

Deep Reference

Capability table
SideCapabilityMeaning
ClientrootsFilesystem directory access for the server
ClientsamplingServer can borrow the client's own AI model
ServertoolsCallable actions
ServerresourcesRead-only data
ServerpromptsRequest templates
ServerloggingStructured log messages to the client

roots, sampling, and logging are being deprecated in the newest spec revision (SEP-2577).

Error codes
CodeNameCause
-32700Parse errorUnreadable JSON
-32600Invalid requestWell-formed, not valid
-32601Method not foundNever advertised
-32602Invalid paramsWrong/missing args
-32603Internal errorServer logic failed
-32000+Server-definedCustom to that server
Transport comparison

stdio subprocess, stdin/stdout, newline-delimited, stderr free for logging, no auth layer.

Streamable HTTP one endpoint (/mcp), POST+GET, JSON or SSE, optional Mcp-Session-Id.

Real local servers (stdio)

npx -y @modelcontextprotocol/server-filesystem <dir>

npx -y @modelcontextprotocol/server-everything — all 3 primitives

uvx mcp-server-git

npx -y @modelcontextprotocol/server-memory

uvx mcp-server-fetch

uvx mcp-server-time

Real remote servers (HTTP)

DeepWiki (free, no auth)
https://mcp.deepwiki.com/mcp
also: /sse (legacy, same service — great for A/B transport demos)

Semgrep
https://mcp.semgrep.ai/mcp

Live capture command

Correction: Claude Desktop's log only shows a summary line (method/id/params-or-result present), not full JSON — no jq needed.

tail -n0 -f "$HOME/Library/Logs/Claude"/mcp-server-*.log
| awk '/Message from client:/ {...}
  /Message from server:/ {...}'

Full corrected script: watch-mcp-logs.sh, in the course files.