Module 15.1 taught tool calling and function calling inside one app. Module 15.2 showed agents reading long-term memory and semantic stores. Those integrations are usually one-off plugins. Model Context Protocol (MCP) is an open, JSON-RPC-style protocol so hosts (IDEs, chat apps, agent runtimes) can talk to many servers that expose tools and resources the same way.
This lecture is the map for 15.3: next you will study the server, client, tools, and resources. Module 15.4 then uses MCP-shaped tools inside LangChain / LangGraph agents.
Learning Objectives
By the end of this lesson, students should be able to:
- Explain MCP as a standard protocol between AI hosts and context/tool servers.
- Name the roles: host, client, and server—and what each owns.
- Describe JSON-RPC-style messages over stdio, SSE, or HTTP transports.
- Contrast MCP with ad-hoc plugins and with in-process function calling.
- Preview tools vs resources vs prompts as first-class primitives.
- State the core security/trust problem: installing a server is installing capability.
The Model Context Protocol (MCP) is an open protocol (introduced by Anthropic and adopted across hosts) that standardizes how LLM applications discover and use external tools (invocable actions), resources (readable context), and prompts (reusable templates) via a client–server JSON-RPC interface.
Why a Protocol, Not Another SDK?
Without MCP, every agent framework invents its own GitHub tool, Slack tool, and Postgres tool. Vendors cannot ship one integration that works in Claude Desktop, Cursor, custom autonomous agents, and LangGraph alike. MCP makes the server reusable: write once, connect from any MCP-capable host. The host still runs the agent loop; MCP only standardizes the sockets to the outside world.
| Approach | Coupling | Reuse | Typical use |
|---|---|---|---|
| In-process functions | Hard-coded in your app | None across products | Tiny internal tools |
| Vendor plugin APIs | Per host (IDE/chat) | One ecosystem | Legacy IDE plugins |
| MCP | Protocol + capability handshake | Any MCP host/client | Shared tools & data planes |
Architecture: Host, Client, Server
Host
- The AI app (IDE, chat, agent runtime)
- Owns UX, model calls, HITL
- May embed one or more clients
Client
- Speaks MCP to a server
- Lists tools/resources, calls them
- Lives inside the host process
Server
- Exposes tools, resources, prompts
- Talks to APIs, DBs, files
- May run locally or remotely
JSON-RPC Style Messaging
MCP messages look like JSON-RPC 2.0: a method, params, and an id for requests; notifications omit the response. After initialize + capability negotiation, the client can tools/list, tools/call, resources/list, resources/read, and subscribe to updates. Transports include local stdio (spawn a process) and remote SSE / streamable HTTP.
Primitives Preview
Tools are actions (side effects possible)—search, create issue, run SQL. Resources are readable context addressed by URI—files, tickets, schema dumps—closer to semantic / long-term memory. Prompts are named templates the host can offer the user. Mixing them up is a security bug: a “resource” that silently mutates data is a tool in disguise.
Strengths
- Write-once servers, many hosts
- Clear capability negotiation
- Separates model loop from I/O
- Fits enterprise tool catalogs
Tradeoffs
- Another moving spec + SDKs
- Trust: servers are powerful
- Latency vs in-process functions
- Auth/ACL still your job
“MCP replaces LangChain / LangGraph / the agent loop.” MCP is a connectivity protocol, not a planner. The host still chooses models, memory, HITL, and multi-agent graphs. Think USB-C for tools and context—not the operating system.
Trust Boundary
Installing an MCP server grants whatever that process can do: read files, call APIs, run commands. Treat servers like browser extensions with extra teeth. Require allowlists, human approval for dangerous tools (see HITL), least privilege credentials, and logging. Never point a production agent at an unvetted community server.
Knowledge Check
- Short Answer: What problem does MCP standardize? Answer: How AI hosts discover/use external tools and resources via a common protocol.
- True/False: MCP is itself a multi-agent planning framework. Answer: False—it is a connectivity protocol.
- Multiple Choice: MCP message style is closest to: (a) JSON-RPC, (b) SMTP, (c) CSS Grid. Answer: (a).
- Short Answer: Name the three roles in the MCP architecture. Answer: Host, client, and server.
- True/False: The MCP client typically lives inside the host. Answer: True.
- Multiple Choice: A local MCP server is often spawned over: (a) stdio, (b) VGA, (c) ICMP only. Answer: (a).
- Short Answer: Contrast a tool vs a resource in one line. Answer: Tools are invocable actions; resources are readable context (URIs).
- True/False: Installing an MCP server is a trust decision equivalent to granting capabilities. Answer: True.
- Multiple Choice: In-process function calling vs MCP: MCP is better when you need: (a) reuse across hosts, (b) fewer network hops always, (c) convolution. Answer: (a).
- Short Answer: Which lecture implements the process that exposes tools/resources? Answer: MCP Server.
Key Takeaways
- MCP standardizes host↔server access to tools, resources, and prompts.
- JSON-RPC-style messages ride stdio or HTTP/SSE after a capability handshake.
- It does not replace agent loops, memory, or frameworks—it feeds them.
- Servers are a security boundary; allowlist and approve dangerous calls.
- Continue with MCP Server.
Lab: Draw a sequence: User → Host (model) → Client → Server → Ticket API. Label initialize, tools/list, tools/call, result into working memory.
Whiteboard: USB-C metaphor vs OS metaphor. List three servers students would not install without review.
Recap: MCP is the standard cable for agent tools and context. Continue with MCP Server.