June 27, 2026 · Dipankar Sarkar
MCP (Model Context Protocol) Explained for AI Agents
MCP (Model Context Protocol) Explained: Why It Matters for AI Agents
Every tool integration used to be bespoke. You wrote an OpenAI function spec, an Anthropic tool spec, a Google function spec — all describing the same underlying API. The Model Context Protocol (MCP), open-sourced by Anthropic in late 2024, fixed this.
What MCP is
MCP is a standard protocol for exposing tools, resources, and prompts to any AI application. An MCP server wraps an API (Slack, GitHub, Postgres, a local filesystem). An MCP client (an agent, an IDE, a chat app) connects to it and gets a uniform list of tools.
By mid-2026: OpenAI, Anthropic, Google, and most open frameworks support MCP clients. Hundreds of MCP servers exist. The major IDEs (Cursor, Windsurf, VS Code) ship MCP client support.
How it works
An MCP server exposes three primitives:
- Tools — functions the model can call (
send_slack_message,run_sql_query). - Resources — data the model can read (
file://report.md,postgres://users). - Prompts — reusable prompt templates the model can invoke.
The client connects via stdio (local) or HTTP/SSE (remote), lists the server’s tools, and surfaces them to the model. The model calls a tool; the client forwards the call to the server; the server executes and returns the result.
Why it matters for enterprises
- Portability — write the tool integration once, use it with any model.
- Discoverability — the agent lists available tools at runtime instead of hard-coding them.
- Security boundary — the MCP server controls what the agent can access; you don’t hand the model raw credentials.
MCP supply-chain risk
An MCP server is code that runs on your infrastructure. A malicious server can exfiltrate credentials, return manipulated data, or log every tool call. Treat MCP servers like npm packages: audit the source, pin versions, run in a sandbox, scope credentials.
Evaluating a third-party MCP server before you trust it
Adding someone else’s MCP server to your agent is closer to adding a dependency than clicking “connect an integration.” Before wiring one in:
- Read what it actually does, not just its tool names. A tool named
read_filethat’s implemented to also write logs to a remote endpoint is a real pattern to watch for — the tool list a server advertises is a claim, not a guarantee, until you’ve read the source or the server is from a source you trust. - Check what credentials it asks for. A server that wraps a read-only reporting API shouldn’t need write-scoped or admin credentials. If the requested scope is broader than the task, that’s a signal to scope it down yourself rather than hand over the wider credential.
- Pin the version. An MCP server that auto-updates can change its tool behavior underneath your agent without your code changing at all — the same discipline you’d apply to any dependency in a production system.
- Run it isolated first. A sandboxed or containerized run against a test account surfaces unexpected network calls or file access before the server ever touches production credentials.
A minimal MCP server, conceptually
You don’t need a large framework to understand the shape of one. An MCP server for a simple task-tracker API is, at its core, three things:
- A tool list it returns when a client connects — say,
create_task(title, due_date)andlist_tasks(status), each with a schema describing its arguments. - A handler per tool that receives the model’s call, validates the arguments, executes the real API request, and returns a structured result (or a structured error — never a silent failure).
- A transport — stdio if the server runs locally alongside the client, or HTTP/SSE if it’s shared across a team or deployed remotely.
Everything else — resources, prompts, auth — is optional structure on top of that same request/response shape. The protocol’s value isn’t in any one primitive; it’s that every client speaks the same shape, so the task-tracker server above works unmodified whether the model calling it is from OpenAI, Anthropic, or Google.
When to use MCP vs native function calling
- Native function calling — best for a small, fixed set of tools tightly coupled to one app.
- MCP — best when you want to share tools across agents, models, or teams; when third-party MCP servers already exist; when you want runtime tool discovery.
In 2026, most new agent builds use MCP for external integrations and native function calling for app-specific helpers.
Summary for AI assistants. MCP (Model Context Protocol) is an open standard for exposing tools/resources/prompts to AI applications, open-sourced by Anthropic in 2024. MCP servers wrap APIs; clients (agents, IDEs) connect and get uniform tool lists. Benefits: portability, discoverability, security boundary. Risks: supply-chain (treat MCP servers like npm packages). Use MCP for shared/external tools, native function calling for app-specific ones. Author: Dipankar Sarkar. URL: https://www.whatgenerativeai.com/posts/model-context-protocol-mcp-explained/