Phase 5 — MCP and Tool Ecosystems
The Model Context Protocol (MCP) is how agents connect to the outside world in a standard way. Instead of every agent framework inventing its own tool format, MCP defines one: a server exposes tools, resources, and prompts; a client discovers them and calls them; a host (the app the user runs) brokers the connection and enforces trust.
Before MCP, giving an agent a new capability meant writing glue code for one framework. With MCP, a capability is written once and works across hosts and frameworks. That is the whole point, and it is why MCP became the default tool ecosystem for agentic AI.
What you will be able to do
By the end of this phase you should be able to:
- Explain MCP and its architecture: hosts, clients, servers, and transports.
- Work with the three primitives: tools, resources, and prompts.
- Implement discovery, schemas, and validation for tools and capabilities.
- Secure MCP with authentication, authorization, and permission boundaries.
- Handle sessions and choose between stateful and stateless servers.
- Build MCP servers and clients, including database, GitHub, filesystem, browser, and internal-API integrations.
- Operate an enterprise MCP gateway with registries, versioning, observability, and audit logging.
- Explain agent-to-agent communication and A2A, capability discovery, and interoperability.
Where MCP sits
flowchart TD
H["Host<br/>(app the user runs)"] --> C1["Client A"]
H --> C2["Client B"]
C1 <-->|"transport: stdio or HTTP"| S1["MCP server<br/>filesystem"]
C2 <-->|"transport: HTTP"| S2["MCP server<br/>database"]
S1 --> R1["tools · resources · prompts"]
S2 --> R2["tools · resources · prompts"]
H -.->|"enforces trust"| G["Permissions · auth · audit"]
G -.-> C1
G -.-> C2
The host is the application. Each client is one connection managed by the host. Each server is a capability provider. The transport is how bytes move — local (stdio) or remote (HTTP). Security is enforced by the host and the gateway, not by the server’s good intentions.
Topic order
- MCP fundamentals — the problem MCP solves.
- MCP architecture — hosts, clients, and servers.
- MCP transports — stdio, HTTP, local, and remote.
- MCP tools, resources, and prompts — the three primitives.
- Tool and capability discovery — schemas and validation.
- MCP authentication and authorization — identity and scopes.
- Sessions and stateful vs stateless servers — connection lifecycle.
- Building MCP servers — exposing capabilities correctly.
- Building MCP clients — connecting and calling.
- Database MCP servers — queries, safety, and read-only modes.
- GitHub MCP integration — issues, PRs, and repositories.
- Filesystem MCP integration — scoped file access.
- Browser MCP integration — web automation as a tool.
- Internal API MCP integration — wrapping your own services.
- Enterprise MCP gateways — one front door for many servers.
- MCP security and permission boundaries — least privilege for tools.
- MCP observability and audit logging — seeing and proving what happened.
- MCP tool versioning and registries — evolving tools safely.
- Agent-to-agent communication and A2A — agents calling agents.
- Agent capability discovery and interoperability — finding and trusting peers.
Tip:
How to study this phase. MCP is a protocol, so the exam is about the contract: who owns what, what crosses the boundary, and what can go wrong. Ask of every design: if this server is malicious or compromised, what can it do? If this tool changes, who breaks?
Checkpoint project
At the end of the phase, build Project 6 — Enterprise MCP Gateway: a gateway in front of several MCP servers with authentication, authorization, tool allowlists, versioning, audit logging, and monitoring. The exact scope lives in the projects part of the book.