You have a few internal endpoints: one for article data, one for users, one more for reports. Then there is one AI agent that has to reach all of them. The fastest way is to write a connector per pair, one piece of code for model A and data source X, another for model A and source Y. At first it feels settled. Everything runs, the demo is smooth, and you feel productive that day.
The problem shows up the moment the model is replaced. The tool calling format differs, the way arguments are described differs, even error handling differs. Half of those connectors suddenly become trash, and you start over 😅. Rough math: five models times ten data sources means fifty implementations to maintain. That number is only an illustration, but the pain is real for anyone who has babysat glue code.
That is the point where Model Context Protocol (MCP) enters. The basic idea is simple. Instead of every model talking to every source through a custom path, everything talks through one standard protocol. A data source is written once as a server, and any model that understands the protocol can use it.
Key takeaways
- Model Context Protocol turns model-to-data integration from dozens of hand-built connectors into one open protocol everyone shares.
- An MCP server splits the roles cleanly: tools are called by the model, resources are read by the app, and prompts are picked by the user.
- Credentials stay on the server side and never enter the prompt, because a server is not allowed to read the whole conversation.
- Since the 2026-07-28 spec the protocol is stateless, so an MCP server deploys like any ordinary HTTP workload, with no sessions to babysit.
- If the tutorial you're reading still uses FastMCP or the SSE transport, it's an old version: the API names moved and the transport is deprecated.
Why is this small problem expensive?
That glue code rarely counts as serious work. It only reshapes formats, copies schemas, and pastes credentials in. Yet that is exactly the part that breaks, because a change on one end forces a change on the other. The cost never shows up in sprint planning, but it piles up quietly until one day you notice half your time goes to patching connectors.
If you have used a modern editor, you have felt a similar fix in another world. The MCP spec itself says the protocol borrows from Language Server Protocol. Every editor used to implement support for every programming language. Once a shared protocol existed, one language server could serve many editors. MCP brings that same pattern to AI agents, so you write a connector once and never care who uses it later.
Who talks to whom
The architecture has three roles. The Host is the application you use directly, a desktop app or an editor extension, and the AI model runs inside it. The Client is the component inside the host that handles communication. The Server is the program that exposes capability or data, and that is where the code you write ends up.
One thing to remember: one client pairs with exactly one server. If a host connects to three servers, there are three clients inside it. That split is no accident, because it is where the security boundary forms. Under the architecture principles in the spec, a server may not read the whole conversation and may not see into another server. Conversation history stays in the host.
Credentials stay safe too. A database token or API key stays on the server side, so it never travels into the prompt. The model only knows there is a tool with a given name and given arguments, not the password behind it. That is a design decision you can relax about.
Three primitives, and who holds control
A server can offer three kinds of things, and the difference lies in who decides when they get used.
- Tools are controlled by the model. The model decides when to call them, and a tool usually has side effects like writing data or sending something.
- Resources are controlled by the application. They hold data read through a URI, and the host decides what enters the context.
- Prompts are controlled by the user. They are workflow templates a human picks on purpose.
For those of us used to building web APIs, there is a handy parallel. A resource is like GET: it only reads and changes nothing. A tool is like POST, because it can change state out in the world. With that mindset, deciding whether a function should be a resource or a tool usually takes seconds.
Why the protocol was rebuilt
This is the most important part, so let's take it slowly. MCP was born with a stdio transport for local applications. There the server is a child process living beside the host, and state is natural. There is a connection, there is a session, and everything runs on one machine.
Trouble starts when the server runs far from the host. That state comes along into HTTP: session bookkeeping, streams left hanging, and message replay when the connection drops. A Cloudflare post notes that the main criticism of MCP was exactly its stateful connection. The burden is routing requests to a sticky session, holding streams open, and replaying messages. Who enjoys operating all that in production?
The answer from the 2026-07-28 specification is firm. The initialize handshake and the Mcp-Session-Id header are removed. In their place, every request carries the protocol version, the client identity, and its capability. A client that still wants to know server capabilities up front can call server/discover, but that is optional, not a requirement. In short, the protocol is now stateless at the protocol level.
A few new details are worth noting. First, the Mcp-Method and Mcp-Name headers are now mandatory on Streamable HTTP requests. A gateway, a rate limiter, or a WAF can decide without parsing the JSON body, and that is good news for whoever runs infrastructure.
Second, tools/list results and their friends carry cache hints ttlMs and cacheScope, in a deterministic order. That means the tool catalog can be cached by a client safely, with no worry that the order shifts.
Third, there is MRTR (Multi Round-Trip Request). When a tool needs confirmation, the server answers input_required along with the request it needs. The client collects the user's answer, then repeats the original call. That kind of server-to-client work used to need an open stream; now an ordinary request round is enough.
The consequence is big: an MCP server can now be an ordinary HTTP workload. No session to keep alive, and the server can run on serverless. According to Cloudflare, once the protocol was stateless, MCP servers could run on Workers and their McpAgent primitive was no longer needed. That is what happens when you move state off the connection and onto the request.
One note so nothing gets confused: stateless does not mean your app may not have state. If you need it, create an explicit handle from a tool, such as a cart identifier or a work session, then let the model carry it back as an argument on the next call. State moves somewhere visible; it does not vanish.
What to watch for in old tutorials
Many MCP tutorials were written before the changes above, so there are traps you will run into easily. If you find an example that looks convincing, check these first:
from mcp.server.fastmcp import FastMCPis the old API. Today you usefrom mcp.server import MCPServer, and the old import throwsModuleNotFoundErroroutright.- The HTTP+SSE transport was replaced by Streamable HTTP in the
2025-03-26revision. It survives for compatibility, but its status is deprecated. - Roots, Sampling, and Logging are deprecated too, with a transition window of at least 12 months. Meanwhile
pingis gone from the protocol.
This article has an expiry date of its own. Spec revisions arrive 3 to 8 months apart, in the order 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25, then 2026-07-28. The version used here is 2026-07-28, so if you read this long after that, check the latest version before copying anything.
Your first MCP server, in a few lines
Enough theory, let's look at the code. The server below has one resource holding a table schema and one search tool. The contents are deliberately simple, and the search function only returns text, not a real query.
# server.py
from mcp.server import MCPServer
mcp = MCPServer("Invasikode Database Server")
@mcp.resource("db://articles/schema")
def get_articles_schema() -> str:
"""Skema DDL tabel artikel, buat konteks LLM."""
return """
CREATE TABLE articles (
id SERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
slug VARCHAR(255) UNIQUE NOT NULL,
tags VARCHAR(255),
status VARCHAR(32) DEFAULT 'draft'
);
"""
@mcp.tool()
def search_articles_by_keyword(keyword: str, limit: int = 5) -> str:
"""Cari artikel berdasarkan kata kunci judul.
Args:
keyword: Kata kunci pencarian.
limit: Batas maksimum artikel yang dikembalikan.
"""
return f"Berhasil mengambil {limit} artikel dengan kata kunci '{keyword}'."
Notice what is missing from that code. There is no hand-written JSON Schema, because the type hints and docstring already become the schema. There is no request handler, no capability declaration. The name, the description, and the argument schema all derive from the Python function itself. That is the point: you write an ordinary function, and the SDK handles the rest. This code was run on the Python SDK mcp 2.0.0, with the protocol negotiated at 2026-07-28, and its tools and resources registered. It has not been tested on a production server, so treat it as a starting point. Full documentation is in the Python SDK guide.
Running it is easy: save it as server.py, install the package, then start it through the SDK. After that you register it with the host. In a desktop app, that is usually a config file like claude_desktop_config.json, pointing at the command that starts your server. In an editor, it is usually an extension or the MCP settings. Once registered, try asking the agent about the article table schema, then see whether it uses the resource you just wrote 🙂.
Why this matters to you
The most concrete benefit is write once, use everywhere. The connector to the article database you wrote can be used by any host that supports MCP, with no change on the server side. Changing models no longer means rewriting connectors, and that solves the problem from the opening.
Credentials stay on your side as well. The server holds the tokens and keys; the model only sees results you already allowed. And because the protocol is now stateless, deploying an MCP server no longer needs special tricks. You can treat it like any other HTTP service you already run, load balancer and autoscaling included. That is the change that should genuinely interest you if you work in backend!
Standardization and who holds the protocol
Anthropic introduced MCP on November 25, 2024. In December 2025, the protocol was donated to the Agentic AI Foundation, a directed fund under the Linux Foundation. The founders are Anthropic, Block, and OpenAI, with backing from Google, Microsoft, AWS, Cloudflare, and Bloomberg. Governance did not change, so the decision process already running stays the same.
On adoption, the donation post records that as of December 2025 there were more than 10,000 active public MCP servers. The protocol has also been adopted by ChatGPT, Cursor, Gemini, Microsoft Copilot, and VS Code. That number explains well enough why many developers decided to learn MCP now rather than later 🚀.
So if your internal endpoints are already waiting to be attached to an agent, you have your shortcut. Start with one small function, let type hints be the schema, and file those fifty connectors away as an old story. Just make sure the spec version you use matches the one your host uses.