Model Context Protocol (MCP)
One plug that fits everything
Remember when every phone had a different charger? Nightmare. Then USB-C arrived: one plug for everything. MCP (Model Context Protocol) is the USB-C for AI agents. Instead of writing custom glue code for every tool and data source, an agent speaks one standard language to connect to any tool that supports MCP.
Key points
- MCP is an open standard (created by Anthropic) for connecting agents to tools and data.
- Think 'USB-C port for AI tools' — one uniform interface instead of custom glue everywhere.
- An agent (the client) talks to MCP servers that expose tools and resources.
The one-line definition
Model Context Protocol (MCP) is an open standard that defines a common way for AI agents to talk to tools and data sources. An MCP client (your agent) connects to MCP servers that expose tools (actions) and resources (data), all through the same interface — no custom integration per tool.
Note: MCP standardises tool access. Build the connector once; reuse it everywhere.
The problem MCP solves
Without a standard, every tool you connect (GitHub, your database, Slack, Google Drive) needs its own hand-written integration. With N agents and M tools, that's roughly N × M custom connectors to build and maintain — it explodes. MCP turns this into N + M: each tool exposes one MCP server, each agent is one MCP client, and they all speak the same protocol.
Before MCP vs after MCP
BEFORE MCP (custom glue, N x M) AFTER MCP (one standard, N + M) ────────────────────────────── ───────────────────────────────
Agent A ──custom──► GitHub Agent A ─┐ Agent A ──custom──► DB Agent B ─┤ Agent A ──custom──► Slack │ speak MCP Agent B ──custom──► GitHub ▼ Agent B ──custom──► DB ┌────────────────────────┐ Agent B ──custom──► Slack │ MCP protocol │ ...tangled mess 🌀... └───────────┬────────────┘ │ one connector each ┌──────────┼──────────┐ ▼ ▼ ▼ GitHub DB Slack (server) (server) (server) ✅
How a client talks to MCP servers
┌──────────────────────────┐ │ 🧠 AGENT (MCP CLIENT) │ └───────────┬──────────────┘ │ 1. 'What can you do?' (discover) ▼ ┌────────────────────┐ │ MCP PROTOCOL │ uniform request/response └─────────┬──────────┘ ┌─────────┼──────────┐ ▼ ▼ ▼ ┌──────────┐ ┌────────┐ ┌──────────┐ │ MCP SRV │ │MCP SRV │ │ MCP SRV │ │ GitHub │ │ DB │ │ Filesystem│ └────┬─────┘ └───┬────┘ └────┬─────┘ │ exposes: │ exposes: │ exposes: ▼ ▼ ▼ tools: create tools: query resources: _issue, get_pr _rows files, dirs
- Agent calls a tool ──► 3. Server runs it ──► 4. Returns result
A tiny code example (read it like English)
From the agent's side, MCP makes tools feel uniform: connect to a server, ask what tools it offers, then call one by name. The agent doesn't care if it's GitHub or a database underneath — the protocol is the same.
# The agent (MCP client) connects to an MCP server
client = MCPClient()
client.connect("github-server")
# 1. Discover what the server can do (no custom code per tool)
tools = client.list_tools()
# -> ['create_issue', 'get_pull_request', 'search_code', ...]
# 2. Call a tool by name through the standard interface
result = client.call_tool(
"create_issue",
{"repo": "my-app", "title": "Bug in login"},
)
# Same client, same calls would work for a DB or Slack server
print(result)
When does MCP earn its keep?
| Scenario | Recommendation | Why |
|---|---|---|
| Connecting one agent to many tools/data sources | ✅ Use MCP | One standard interface beats hand-writing each integration. |
| You want tools reusable across different agents | ✅ Use MCP | An MCP server is built once and any MCP client can use it. |
| A throwaway script calling one fixed function | ❌ Overkill | A direct function call is simpler than running a protocol. |
| Using third-party tools that already ship MCP servers | ✅ Use MCP | Plug in instantly instead of reverse-engineering an API. |
MCP mistakes beginners make
| Mistake | Consequence | Fix |
|---|---|---|
| Confusing MCP with RAG. | You expect MCP to fetch documents by meaning, which isn't its job. | RAG retrieves text to ground answers; MCP standardises how agents CONNECT to tools/data. |
| Mixing up client and server roles. | You build the wrong side and nothing connects. | The agent is the CLIENT; the thing exposing tools/resources is the SERVER. |
| Adding MCP for a single hardcoded tool. | Extra moving parts for no benefit. | Use MCP when you have many tools or want reuse; otherwise just call the function directly. |
Remember these lines
- MCP = USB-C for AI tools: one standard plug instead of custom glue per tool.
- Agent = client; the tool/data provider = server exposing tools and resources.
- MCP standardises tool ACCESS; RAG grounds ANSWERS in retrieved text — different jobs.
Key takeaways
- MCP is an open standard (by Anthropic) for connecting agents to tools and data through one uniform interface.
- Think 'USB-C port for AI tools': build a connector once, reuse it across agents and tools.
- An MCP client (the agent) talks to MCP servers that expose tools (actions) and resources (data).
- MCP standardises tool access, turning an N×M integration mess into a clean N+M setup.
Frequently Asked Questions
What is Model Context Protocol?
Remember when every phone had a different charger? Nightmare.
How does Model Context Protocol work?
Model Context Protocol (MCP) is an open standard that defines a common way for AI agents to talk to tools and data sources . An MCP client (your agent) connects to MCP servers that expose tools (actions) and resources (data), all through the same interface — no custom integration per tool.
What are the key takeaways about Model Context Protocol?
MCP is an open standard (by Anthropic) for connecting agents to tools and data through one uniform interface. Think 'USB-C port for AI tools': build a connector once, reuse it across agents and tools. An MCP client (the agent) talks to MCP servers that expose tools (actions) and resources (data). MCP standardises tool access, turning an N×M integration mess into a clean N+M setup.
Related topics
Practice this on DevInterviewMaster
Read the full Model Context Protocol (MCP) breakdown with interactive demos, quizzes, and Hinglish notes.
800+ system-design, LLD, coding, and design-pattern topics. Unlock everything with Pro (₹499, one-time) or Ultimate (₹999, one-time) — lifetime access, no subscription.