MCP Overview
The Model Context Protocol standardises how an AI application discovers and calls external capabilities, turning N × M bespoke integrations into N + M.
You have not marked these as done yet. Read on anyway if they feel familiar; come back to them if something here does not land.
Key points
- MCP is a client–server protocol (JSON-RPC) between an AI application and capability providers.
- It reduces integration count from N × M to N + M, which only matters when N and M are both > 1.
- Servers expose three primitives: tools, resources, prompts (MCP Primitives: Tools, Resources, Prompts).
- The LLM sees plain tool definitions; the MCP client does the translation.
- MCP does not solve tool selection, argument quality, permissions or trust.
MCP walkthrough
→ initialize { clientInfo, capabilities }
← { serverInfo, capabilities: { tools: {}, resources: {}, prompts: {} } }The integration problem
Before a shared protocol, every AI application (a chat assistant, an IDE agent, an internal support bot) that wanted GitHub, Postgres, Slack and Jira access wrote four bespoke adapters. With N applications and M systems, that is N × M integrations, each with its own schema format, auth handling and error conventions.
MCP separates the two sides. An application implements an MCP client once. A system exposes an MCP server once. Any client can then talk to any server, so the integration count drops to N + M. This is the same economics that made JDBC/ODBC, LSP (Language Server Protocol) and USB worth standardising.
The catch is that protocols only pay off when both sides are numerous. If you have one application and two internal APIs, a direct integration is simpler — see MCP vs Direct Integration vs Function Calling.
- 3 applications × 5 systems = 15 adapters without a protocol; 3 + 5 = 8 with one, and the marginal cost of a new system is one server, not three adapters.
- Standardisation covers discovery, invocation, schemas and transport — not the semantics of what a tool does.
Architecture
The host application embeds an MCP client. The client opens a session to one or more servers, asks each what it offers, and forwards the model's tool calls. The server owns the connection to the real system and returns results the client puts back into the model's context.
The LLM never speaks MCP. It sees ordinary tool definitions (JSON schema) that the client derived from the server's tools/list response, and it emits ordinary tool calls that the client translates into tools/call requests.
What MCP does not solve
MCP standardises plumbing, not judgment. The model still has to pick the right tool among 40 exposed ones, still hallucinates arguments, and still trusts whatever text a server returns — a malicious or compromised server is a prompt-injection channel (Indirect Prompt Injection).
It also does not remove the need for Tool Permissions and Least Privilege. A server that exposes delete_repository next to search_repository hands the model both; the host must decide which to surface and which to gate behind Human-in-the-Loop Overview approval.
- Every additional server adds tool definitions to the prompt — 10 servers × 15 tools can consume thousands of tokens before the user says anything (Token Budgets).
- Server output is untrusted content; treat it like a scraped web page, not like your own code.
When to use — and when not to
- Multiple AI applications need the same integrations, or you want to consume community-maintained servers.
- Integrations should be swappable without redeploying the host application.
- You want a uniform audit and permission layer across many capability providers.
- One application, one or two internal APIs — a direct function-calling integration is less code and fewer moving parts.
- Latency-critical paths where an extra process hop and serialization matter.
- When you cannot vet the servers you would connect to — each one is inside your trust boundary.
Failure modes
Reference · showHide
- Tool sprawl: dozens of servers flood the prompt and the model picks wrong tools (
wrong-tool-selectedis the matching challenge). - A compromised or badly written server returns injected instructions in a tool result.
- Version drift between client and server capabilities breaks discovery silently.
- Treating MCP adoption as a product feature rather than an integration decision.
Tradeoffs
Overhead is modest per call; the real cost is prompt size and trust surface as servers accumulate.
Check yourself
Answer out loud or on paper first, then compare. These come from the interview questions linked to this lesson.
What problem does MCP solve compared with implementing every integration directly?
Show a strong answerHide the answer
Without a protocol, every agent host has to implement every integration: M hosts × N services, each with its own tool definitions, auth handling, and result formatting. MCP splits this into a client (the host application) and servers that expose capabilities in a standard shape: tools (callable functions with JSON schemas), resources (readable data), and prompts (templates), with runtime discovery so the client learns what a server offers instead of hardcoding it. See MCP Overview and MCP Primitives: Tools, Resources, Prompts.
The practical win is reuse and decoupling: a GitHub server written once works in any MCP-capable host; the integration lives in its own process with its own credentials, and can be updated independently. It also standardises the lifecycle: initialise, capability negotiation, tool listing, invocation, and errors. See MCP Lifecycle: Init, Discovery, Invocation.
It does not make the model better at using tools. The model still sees tool names, descriptions, and schemas, and all the tool-design rules apply. It adds a process boundary and transport, which is latency and one more thing to operate.
Full interview question, with follow-ups and red flags →How does MCP relate to native function calling, and when would you use one, the other, or both?
Show a strong answerHide the answer
They are different layers. Function calling is the model capability: the model receives tool schemas and emits structured calls. MCP is a protocol for how a host application discovers and invokes tools from external servers; when the host gets a tool list from an MCP server, it still presents those tools to the model via function calling. MCP does not replace function calling; it feeds it. See MCP vs Direct Integration vs Function Calling.
Direct function calling with in-process handlers is right when you own the integration, it serves one application, and you want the lowest latency and simplest security model. MCP is right when capabilities should be shared across hosts, provided by other teams or vendors, or discovered at runtime. Both together is the common production shape: a few critical in-process tools plus MCP servers for shared or third-party capabilities.
Costs of MCP: a process or network hop per call, server lifecycle management, version skew between server and host, and trusting server-supplied descriptions.
Full interview question, with follow-ups and red flags →A server exposes 60 tools. What do you do?
Show a strong answerHide the answer
Filter to the subset the task needs before sending to the model; selection accuracy degrades with tool count.
Full interview question, with follow-ups and red flags →