The MCP server exposes capabilities. The MCP client lives inside the host—Claude Desktop, Cursor, or your LangGraph runtime—and translates agent tool calls into protocol requests. Confusing client with server is the most common 15.3 error.
After this lecture you will specialize: tools (actions) vs resources (readable context). Memory from 15.2 still applies: client results land in working memory.
Learning Objectives
By the end of this lesson, students should be able to:
- Define the MCP client as the host-side protocol speaker.
- Contrast host vs client vs server responsibilities.
- Describe the client lifecycle: connect, initialize, discover, invoke, tear down.
- Explain how listed tools become LLM function/tool schemas.
- Place HITL approval on the client/host, not on the remote server alone.
- Connect multiple servers to one host without merging trust domains blindly.
An MCP client is the component, embedded in an AI host, that maintains a session with one MCP server: it performs the JSON-RPC handshake, caches the tool/resource catalog, invokes calls on behalf of the model, and returns results into the host’s agent loop.
Host vs Client vs Server
| Role | Owns | Does not own |
|---|---|---|
| Host | UX, model, memory, HITL, multi-agent graph | Downstream DB/API details |
| Client | MCP session, catalog cache, call routing | Business I/O implementation |
| Server | Tools/resources implementation + ACLs | Planning / which tool to pick |
One host often runs many clients (one session per server). That is how an IDE can attach Git, Slack, and Postgres at once.
Client Lifecycle
Connect
- Spawn stdio or open HTTP
- initialize + ack
- Store server capabilities
Discover
- tools/list, resources/list
- Map to LLM tool schemas
- Refresh on notifications
Invoke
- Model emits a tool call
- Host may require HITL
- Client sends tools/call
Bridging MCP Tools to the Agent Loop
Policy Belongs on the Client/Host
Servers enforce data ACLs; hosts enforce product policy: which servers are installed, which tools are allowlisted, which calls need HITL, how results are compacted into working memory, and whether to write recaps into episodic LTM. A client that auto-approves every tools/call is a foot-gun.
Strengths
- One host can multiplex many servers
- Natural point for allowlists and HITL
- Translates MCP schemas ↔ model tool APIs
- Keeps agent frameworks server-agnostic
Tradeoffs
- Catalogs go stale without refresh
- Name collisions across servers
- Latency stacking (model + RPC)
- Misconfigured client = silent capability leak
“The MCP client is a separate product the user installs, like the server.” Users install servers (and configure hosts). The client is library code inside Claude Desktop, Cursor, or your agent runtime. If you are writing a custom host in LangGraph, you embed the client SDK.
Knowledge Check
- Short Answer: Where does the MCP client run? Answer: Inside the host (IDE, chat app, or agent runtime).
- True/False: One host may open multiple MCP client sessions. Answer: True—typically one per server.
- Multiple Choice: Mapping tools/list → OpenAI-style function schemas is done by the: (a) GPU driver, (b) client/host, (c) vector index. Answer: (b).
- Short Answer: Who should usually enforce HITL approval for dangerous tools? Answer: The host/client policy layer.
- True/False: The client implements lookup_ticket against the database. Answer: False—the server does.
- Multiple Choice: Name collisions across servers are handled by: (a) ignoring them, (b) namespacing/allowlists in the host, (c) CNNs. Answer: (b).
- Short Answer: What happens to tool results after invoke? Answer: They enter the host’s working memory / agent loop.
- True/False: Users typically install MCP clients from a marketplace, not servers. Answer: False—they install/configure servers; clients are embedded.
- Multiple Choice: initialize is sent by the: (a) client to the server, (b) database to the LLM, (c) user to DNS. Answer: (a).
- Short Answer: Next lecture focuses on invocable MCP actions named what? Answer: MCP Tools.
Key Takeaways
- The client is host-side protocol + catalog + invocation glue.
- Hosts multiplex clients; servers stay implementation details.
- Allowlists, HITL, and memory compaction belong with the client/host.
- Do not confuse installing a server with “installing a client app.”
- Continue with MCP Tools.
Lab: Given two fake servers both exposing search, design a host allowlist + prefix (jira.search vs wiki.search) and show the LLM tool list.
Whiteboard: Sequence diagram with HITL gate between model tool call and client.invoke.
Recap: The MCP client is the host’s protocol adapter. Continue with MCP Tools.