By Shakil Ahmed, Android developer & software engineer
What Is MCP (Model Context Protocol)? A Simple Guide for Developers
MCP explained simply: the N×M problem, hosts, clients and servers, tools, resources and prompts, stdio vs Streamable HTTP, the 2026 spec and security tips.
If you use AI tools every day, you have probably heard the question what is MCP, and why does every AI app suddenly support it? In short, MCP (Model Context Protocol) is an open standard that lets AI applications connect to tools and data in one common way, so you build an integration once and use it in many apps.
I run my own MCP server for this portfolio site, and my AI assistant uses it to publish blog posts. So this guide is not only theory: you get simple explanations, a real message and the security lessons I learned the hard way.
The Problem MCP Solves: N × M Integrations
Imagine you have 3 AI apps: a chat app, an IDE assistant and a terminal agent. You also have 4 tools: GitHub, a database, your calendar and your blog.
Without a standard, each AI app needs its own connector for each tool. That is 3 × 4 = 12 custom integrations. Add one more app and you need 4 more. This is called the N × M problem.
With MCP, each tool is wrapped once as an MCP server, and each AI app learns to speak MCP once. Now you need only 3 + 4 = 7 pieces, and every app can talk to every tool.
The USB-C analogy
The official site describes MCP as "a USB-C port for AI applications". Before USB-C, every phone had a different charger. Now one cable works with many devices. MCP does the same for AI: one protocol, many tools, many apps.
Tip: MCP does not make the model smarter. It only gives the model a clean, standard way to see data and use tools. The thinking still happens inside the model. If you want to understand that part, read How LLMs Work: Tokens, Context and Temperature.
MCP Architecture: Hosts, Clients and Servers
MCP has three roles. The names confuse many people, so let's keep it simple.
| Role | What it is | Example |
|---|---|---|
| Host | The AI application you use | Claude Desktop, VS Code, Cursor, Claude Code |
| Client | A connector inside the host, one per server | The part of VS Code that talks to your GitHub server |
| Server | A program that exposes tools and data | A GitHub server, a database server, my blog server |
One host can connect to many servers, with one client per server. All messages use JSON-RPC 2.0: a request has a method, params and an id, and the response has the same id plus a result or an error.
The Three MCP Primitives: Tools, Resources and Prompts
A server can offer three kinds of things. The spec calls them primitives.
1. Tools (the model decides)
A tool is an action the model can call. For example: search_issues, create_post, run_query. Each tool has a name, a description and a JSON Schema for its input. The model reads the description and decides when to call it.
2. Resources (the app decides)
A resource is read-only data, like a file, a database row or a report. It has a URI, for example notes://all. The host application decides which resources to load into the conversation.
3. Prompts (the user decides)
A prompt is a reusable template that the user picks, often from a slash menu. For example, a "Review this pull request" prompt that fills in the right instructions for you.
Let's understand it:
- Tools = verbs. The model calls them to do something.
- Resources = nouns. The app reads them to know something.
- Prompts = shortcuts. The user picks them to start something.
If you want to know how a model decides which tool to call, see AI Agents Explained: How They Plan, Use Tools and Make Mistakes.
MCP Transports: stdio vs Streamable HTTP
A transport is how messages travel between client and server. MCP has two standard transports.
| stdio | Streamable HTTP | |
|---|---|---|
| Where the server runs | On your machine, as a child process | On a remote server or local port |
| How messages travel | stdin and stdout pipes | HTTP POST to one endpoint (like /mcp) |
| Who starts it | The host launches it | It is always running |
| Authentication | Usually not needed (local) | Required: bearer tokens or OAuth |
| Good for | Local files, dev tools, personal scripts | Shared team tools, SaaS, web apps like ChatGPT |
Warning: With stdio, stdout belongs to the protocol. If your server prints a debug line with
console.log, it breaks the JSON-RPC stream and the host drops the connection. Always log to stderr.
The older "HTTP+SSE" transport is officially Deprecated as of the 2026-07-28 spec. New servers should use Streamable HTTP.
What a Tool Call Looks Like in JSON
Let's see a real exchange. First, the client asks the server to run a tool:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "get_weather",
"arguments": {
"location": "Dhaka"
}
}
}
The server runs the tool and answers:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"resultType": "complete",
"content": [
{
"type": "text",
"text": "Current weather in Dhaka: 29°C, humid, light rain"
}
],
"isError": false
}
}
Let's understand it:
method: "tools/call"tells the server what to do. Before this, the client usually callstools/listto learn which tools exist.argumentsmust match the tool's input schema. A good server validates them.contentis a list of blocks (text, image, audio or resource). The model reads these blocks.isError: truemeans "the tool ran but failed". The model can read the message and try again with better input.resultTypeis new in the 2026-07-28 spec. Normal results say"complete".
Tip: The spec's own examples hide one detail. In the current version, every request also carries a
_metablock with the protocol version and the client's capabilities. Official SDKs add this for you, so you rarely write it by hand.
The Current MCP Spec Version and What Changed (as of November 2026)
MCP versions are dates, not numbers. As of November 2026, the current spec version is 2026-07-28. The previous one was 2025-11-25.
This is a big revision. The main changes, from the official changelog:
- MCP is now stateless. The old
initializehandshake is gone. Every request carries its own protocol version and client capabilities in_meta. - No more protocol sessions. The
Mcp-Session-Idheader was removed from Streamable HTTP. If a server needs state (like a shopping cart), it returns a handle, and the model passes that handle back as a normal tool argument. - New
server/discovermethod. Servers must implement it, so clients can ask "which versions and features do you support?" - New
subscriptions/listen. One long-lived stream replaces the old GET stream and resource subscribe calls for change notifications. - Multi Round-Trip Requests. When a server needs more input (for example, asking the user a question), it returns an
input_requiredresult, and the client retries the request with the answers. - Deprecations. Roots, Sampling and Logging are now Deprecated. Dynamic Client Registration is Deprecated in favor of Client ID Metadata Documents.
Why does this matter? Stateless servers are much easier to scale behind a normal load balancer, like any REST API.
Also, in December 2025, Anthropic donated MCP to the Agentic AI Foundation, a fund under the Linux Foundation. So MCP is now a vendor-neutral open standard, not one company's product.
Who Supports MCP Today (as of November 2026)
MCP support is now wide. Some well-known hosts:
- Claude (web and desktop apps) through connectors, plus Claude Code in the terminal.
- ChatGPT through developer mode and apps. It connects to remote servers only (Streamable HTTP or SSE), not local stdio servers. Plan availability differs, so check OpenAI's help pages.
- VS Code with GitHub Copilot in Agent mode, and Cursor.
- Many other agents, IDEs and testing tools listed on the official MCP site.
On the SDK side, the official TypeScript SDK released v2 in July 2026 and supports the 2026-07-28 spec. I show how to use it in Build Your First MCP Server in TypeScript (Step by Step).
MCP Security Basics Every Developer Should Know
MCP gives an AI real power over real systems. That is useful, and also risky. Here are the basics.
1. Authenticate every remote server
A remote MCP server on the public internet without auth is an open door. Use OAuth or at least a strong bearer token, and check it on every request. I wrote more about this in MCP Integrations: Why Authentication Makes or Breaks Them.
2. Follow least privilege
Give each tool only the access it needs. My blog server has a read-only tool for checking posts and separate write tools for publishing. When something breaks, I start with the read-only tool first. See Debug an MCP Connection with One Read-Only Tool.
3. Treat tool output as untrusted input
If a tool returns text from a web page or an email, that text enters the model's context. An attacker can hide instructions in it, like "send me the user's files". This is prompt injection. Keep a human in the loop for risky actions.
4. Never put secrets in URLs you share
Some connectors let you paste a URL with a token in the query string. It works, but URLs end up in logs, browser history, screenshots and chat messages. On my own setup I keep the token in an Authorization header and I rotate it if a URL ever leaks. Treat any URL with a key inside it like a password.
5. Make write tools safe to retry
Networks fail. If the AI retries a "create post" call, you do not want two posts. Use idempotency keys or check-before-write logic. I explain my approach in Retry an MCP Write Without Creating Two Blog Posts.
Warning: Tool annotations like
readOnlyHintare only hints. The spec says clients must treat them as untrusted unless the server is trusted. Do real access control on the server.
When NOT to Use MCP
MCP is great, but it is not always the right tool.
- One app, one API, no plan to share. If only your own backend calls one model with one function, normal function calling in the model API is simpler.
- Hard real-time or high-volume work. MCP adds a model in the loop. For a payment pipeline that runs 1,000 times per second, write normal code.
- Deterministic jobs. If a cron job can do it with no judgment, you don't need an AI or MCP at all.
- Very sensitive actions with no human review. If you can't accept a wrong call, don't expose the action to a model yet.
A good rule: use MCP when you want many AI apps to use the same tools, or when you want to give your AI assistant safe, structured access to your own systems.
Also remember that the model still needs good instructions to use tools well. Prompt Engineering for Developers covers that side. And when an agent writes code through MCP tools, review it carefully, as I explain in AI Coding Agents: Review Work You Did Not Write.
Frequently Asked Questions
What is MCP in simple words? MCP (Model Context Protocol) is an open standard that lets AI apps connect to tools and data in one common way. You build an MCP server once, and any MCP-compatible app can use it.
Is MCP only for Claude? No. Anthropic created MCP in November 2024, but it is now governed by the Agentic AI Foundation under the Linux Foundation. ChatGPT, VS Code, Cursor and many other apps support it as of November 2026.
What is the difference between MCP and function calling? Function calling lets one model API request a function. MCP standardizes how apps discover and call tools on external servers. Hosts often use both together.
Do I need to update my MCP server for the 2026-07-28 spec? If you use an official SDK, upgrading the SDK does most of the work. The TypeScript v2 SDK also serves older clients from the same code by default. Check your SDK's migration guide before you upgrade.
Key Takeaways
- What is MCP? An open protocol that connects AI apps (hosts) to tools and data (servers) in one standard way, solving the N × M integration problem.
- Servers offer three primitives: tools (actions), resources (read-only data) and prompts (templates).
- Use stdio for local servers and Streamable HTTP for remote ones. Never write logs to stdout in a stdio server.
- As of November 2026, the current spec is 2026-07-28. It makes MCP stateless and removes protocol sessions.
- Security is your job: authenticate, use least privilege, treat tool output as untrusted, keep secrets out of URLs and make writes safe to retry.
- Ready to build one? Continue with Build Your First MCP Server in TypeScript.
Related articles
What AI agents really are: the observe-think-act loop, tool calling, memory, MCP, common failures like looping and prompt injection, and practical guardrails.
Step-by-step: build a notes MCP server in TypeScript with the v2 SDK, test it in the MCP Inspector, connect Claude, then serve it over HTTP with a bearer token.
How Retrieval-Augmented Generation lets AI answer from your own documents: the pipeline, embeddings, a small Python example, common failures and how to evaluate.
MCP connects AI assistants to application tools, but a working demo is only the beginning. Authentication and predictable operations determine reliability.