What is the Model Context Protocol (MCP) and what problem does it solve?
981 views
21 of 83
1
The problem
Question presented to candidate:
"Everyone is talking about MCP, the Model Context Protocol. In plain terms, what is it, what problem was it created to solve, and how does a request actually flow between the model, the app and an MCP server? Where does it stop helping you?"
What a strong answer should cover:
The integration problem: every AI app wiring every tool by hand is NรM custom connectors; a shared protocol makes it N clients plus M servers, and a service change touches one server instead of every app
The roles: a host application (chat app, IDE, agent) runs one MCP client per server; servers expose tools, resources and prompts; clients can offer sampling, roots and elicitation back to servers
The wire format: JSON-RPC 2.0 over stdio for local servers or Streamable HTTP for remote ones, with discovery at runtime (tools/list) instead of hard-coded tool lists
The host mediates: the model never talks to a server directly; the host decides which tools to expose, asks for consent, executes calls and feeds results back
Security posture: servers are third-party code holding credentials, tool annotations are only hints, and tool results are untrusted input that can carry prompt injection
Where it does not help: MCP standardises the plumbing, not tool quality, auth policy or reliability; and it keeps evolving (the 2026-07-28 revision made the protocol core stateless)
Code / implementation expected: Optional โ sketching the JSON-RPC exchange or a host routing a tool call is a plus; no SDK code needed.
mcp
protocol
tools
integration
2
Try it yourself
Sketch your approach before you read the solution. That is what the interview tests.
Stuck? Get a hint.
A short nudge toward the approach. It will not give the answer away.
3
Solution
Target Audience: Engineers who have used tool calling and keep hearing "just ship an MCP server", and anyone preparing for an AI engineering interview.
Difficulty: Medium
Verified with: Node 22.22.0 and Python 3.12.3 (both examples, identical output). Protocol details were checked in October 2026 against the published SDK packages themselves: @modelcontextprotocol/sdk 1.32.1 (the v1 line, spec up to 2025-11-25), @modelcontextprotocol/server and @modelcontextprotocol/core 2.3.1 (the v2 line, spec 2026-07-28) and the Python mcp 2.3.0 wheel, plus the official MCP changelog and Anthropic announcement pages found by web search.
How to read this doc: Every idea is explained in plain language first, then tagged with ๐ Interview term: so you also learn the words an interviewer expects. All program output shown was produced by actually running the examples; the **Ver
The solution is hidden so you can try first
11 min read ยท 12 sections
4
Read the code
Integration count: custom connectors vs one protocol
// Integration count: point-to-point connectors vs one shared protocol.// N host apps (chat app, IDE, custom agent...) and M services (GitHub, Postgres...).const cases = [[1, 5], [3, 5], [5, 20], [10, 50]];
constpad = (s, n) => String(s).padEnd(n);
console.log(pad("hosts N", 9) + pad("services M", 12) + pad("custom N*M", 12) + pad("MCP N+M", 9) + "saved");
for (const [n, m] of cases) {
const custom = n * m;
const mcp = n + m;
const saved = Math.floor((100 * (custom - mcp)) / custom + 0.5);
console.log(pad(n, 9) + pad(m, 12) + pad(custom, 12) + pad(mcp, 9) + saved + "%");
}
// One service ships a breaking API change. Who has to change code?const n = 10;
console.log("");
console.log("service API change with " + n + " hosts:");
console.log(" custom connectors: " + n + " connectors to update, in " + n + " codebases");
console.log(" MCP: 1 server to update, 0 host changes (hosts re-run tools/list)");
// Where the N+M saving does not apply: a host with only one integration.console.log("");
console.log("break-even: N*M > N+M needs N >= 2, M >= 2 and N*M > 4");
for (const [a, b] of [[1, 1], [1, 4], [2, 2], [2, 3]]) {
console.log(" N=" + a + " M=" + b + ": custom " + a * b + ", MCP " + (a + b));
}
A host discovering and routing tools across two MCP servers