Kolkata ·  
AI engineering
agents
deep · 6 min

MCP

Model Context Protocol: a standard way to plug tools and data into any AI app, so an integration gets written once instead of once per app.

updated 29 Sept 2026

If tool calling already lets a model call our functions, why does anyone need a protocol on top?

Let's say we're building a coding assistant, and we want it to read GitHub issues, look up errors in Sentry and query our Postgres database. With plain tool calling we write all three ourselves: the definition the model sees, the code that runs it, the auth. Fine. Now the team next door builds a different assistant and wants the same three. They write them again. So does the next team, and the one after. Every data source needs its own custom work, in every app.

MCP, the Model Context Protocol, is the fix Anthropic put out as an open standard in late 2024. A service gets written up once as an MCP server, and any app that speaks MCP can plug it in. The idea is borrowed from the Language Server Protocol, which did the same thing for code editors and programming languages. And it caught on. By mid-2026 the main official SDKs were close to half a billion downloads a month.

Who talks to whom

There are three roles. The host is the AI app: Claude Code, VS Code, or whatever we're building. It owns the model and the conversation. A server is a program that offers tools and data, either a local process or a service on the internet. And between them, the host creates one client per server, each with its own connection.

Messages are JSON-RPC 2.0, which is just small JSON objects with a method name and parameters. They go over one of two pipes. With stdio, the host starts the server as a local process and they talk through standard input and output. With Streamable HTTP, the client sends POST requests to a remote server, which can stream replies back, and OAuth is the recommended way to get tokens.

What a server offers

A server can offer tools (functions the model calls), resources (data the app can pull into context, like a database schema) and prompts (templates a user can pick). A database server might offer all three: query tools, the schema, and a prompt with worked SQL examples. A server can also ask the user for something mid-call, like a missing value or a confirmation. That's called elicitation.

Tools are what people mostly use, and here's the part that clears up a lot of confusion: to the model, MCP tools are just tools. The host fetches the tool lists from every connected server, merges them into one list and hands it to the model as ordinary definitions. When the model calls one, the host routes the call to the right server and passes the result back. The model has no idea MCP is involved. So everything in tool design applies unchanged.

On the wire, one call looks like this. The client sends tools/list and gets back each tool's name, description and input schema. The host gives those to the model. The model picks one, the client sends tools/call with the arguments, and the server returns content that goes into the conversation.

Why most tutorials are now wrong

Here's something to watch for. The version of the spec dated 2026-07-28 changed the protocol a lot, and most guides out there teach the old one.

Before it, a connection opened with a handshake, an initialize request and an initialized reply. Over HTTP, an Mcp-Session-Id header tied later requests to that session, and the server could keep state for it. If the server needed to ask the client something, a stream had to stay open.

All of that is gone. No handshake, no session ID. Every request carries its own protocol version, client name and capabilities in a _meta field, so the server can handle it without remembering anything. Why bother? Because now any request can land on any server instance behind a plain round-robin load balancer, with no shared storage for sessions. The maintainers say it was one of the most requested changes.

The rest follows from that. A server that needs to remember something, like a shopping cart, now has a tool return a handle (bsk_a1b2c3) that the model passes back as an argument. The maintainers found that works better than state hidden in the transport, since the model can see it. When a tool needs input from the user mid-call, the server answers input_required with its questions, and the client retries the same call with the answers attached. HTTP requests carry Mcp-Method and Mcp-Name headers so gateways can route without reading the body. Tool lists come back in a fixed order with cache hints, which keeps prompt caching working across reconnects. Sampling, roots and logging are deprecated but keep working for at least twelve months.

So if a guide starts with initialize, it's describing the old protocol.

When you plug in a lot of servers

Every connected server's tool definitions go into the model's context on every request. With thousands of tools, an agent can have to read hundreds of thousands of tokens of definitions before it even sees the question. Results cost too. Copy a two-hour meeting transcript from Google Drive into Salesforce with direct tool calls and the transcript passes through the model twice, around 50,000 extra tokens.

One fix is tool search, from tool design: load only the definitions the model asks for. The other, from Anthropic in 2025, is to stop calling MCP tools directly. Each tool becomes a code file (./servers/google-drive/getDocument.ts), and the model writes a short script that imports what it needs and moves data between tools inside the script. The transcript goes from Drive to Salesforce without ever entering the context. In their example, token use dropped from 150,000 to 2,000. Cloudflare got to the same idea and calls it Code Mode. The catch: now we're running code the model wrote, which needs a real sandbox with limits and monitoring.

And connecting someone's server means running someone's code. The spec itself says tools represent arbitrary code execution. A tool's description and its annotations ("read-only") are claims made by the server, to be treated as untrusted unless we trust the server. A bad server can hide instructions in a description (prompt injection), and any tool that can send data somewhere is a possible route for data exfiltration. The spec asks hosts to get the user's consent before calling tools, and admits the protocol can't enforce any of it. That's on the host.

Back to the question

So do we need MCP? For a coding agent, maybe not. Simon Willison's view is that coding agents are very good at running shell commands, so instead of an MCP server you install a command-line tool and put one example command in an AGENTS.md file. One example is often enough for the agent to work out the rest. It costs almost no context and needs no server. The code-execution approach points the same way: fewer tool definitions, more code.

MCP still makes sense where the opening problem bites. When the agent can't run a shell. When one integration should work in many apps. When a service needs OAuth and per-user permissions. Which of those wins out as agents get better at writing code is still being argued about.

Further reading