Intermediate
Agents and tools

MCP end to end

The roles, the transport, and a server somebody else’s agent can use.

What you will be able to do

Expose a capability over MCP and connect a host to it.

Prerequisites
Writing an agent loop, or equivalent experience with tool calling.
Length
6 lessons · 35 min

Syllabus

  1. 1MCP in one sittingHosts, clients and servers, and the three primitives a server exposes: tools, resources and prompts. Includes a working TypeScript server in about forty lines, and the mistakes that make a server unusable in practice.9 min
  2. 2MCP HostThe six responsibilities the specification gives the host, why one client per server is the isolation boundary, and what happens when a server asks you for a completion.6 min
  3. 3MCP ServerTools are model-controlled, resources are application-controlled. That column decides which primitive a capability belongs to.4 min
  4. 4Transport Layerstdio or streamable HTTP, at revision 2026-07-28, which removed sessions, GET streams and resumability. What moving off stdio forces you to add.5 min
  5. 5Building an MCP ServerThe input schema tells the model what to send as well as validating what arrives. Returning tools in a stable order protects callers' prompt caches, and an error that names the rule lets the model correct itself.5 min
  6. 6Connect to a Local ServerConnecting over stdio is a process launch, not a connection. Absolute paths, the rule against printing to stdout, and where the logs are.6 min