MCP (Model Context Protocol) is an open protocol that standardizes how AI applications connect to external tools and data. Instead of every assistant (Claude Code, Cursor, ChatGPT) building its own integration with GitHub, a database or Jira, the tool implements an MCP server once and any compatible application can use it.
A comparison that usually helps: MCP is to AI agents what USB is to peripherals. You don't need a different cable for every computer.
In this post I explain how MCP works in practice, with diagrams, example messages and how to use it in Claude Code.
Not a developer? Read up to the section Why it matters for your product. From there on, the post goes into implementation details.
Table of contents
- The problem MCP solves
- Host, client and server
- Why it matters for your product
- What an MCP server offers
- A tool call, step by step
- stdio or HTTP?
- Using MCP in Claude Code
- MCP vs API, CLI and agents
- Security tips
- FAQ
- Conclusion
The problem MCP solves
A language model, on its own, only knows what was in its training data and what you paste into the conversation. To be useful in a developer's day to day, it needs to look things up (issues, tables, logs, docs) and do things (open a PR, run a query, create a ticket).
Before MCP, every AI application solved this its own way. With 3 applications and 4 tools, that's 12 different integrations, each with its own format, its own auth and its own bugs.
With a shared protocol, the math changes: each application implements the client side once, each tool implements the server side once, and everyone can talk to each other.
It's the same reasoning behind LSP (Language Server Protocol), which standardized how editors talk to languages. MCP actually takes inspiration from it.
The protocol was created by Anthropic in November 2024 and, in December 2025, donated to the Agentic AI Foundation, under the Linux Foundation. So today it isn't "one company's protocol", it's an open standard with neutral governance.
Host, client and server
MCP has three roles, and understanding each one clears up 90% of the confusion:
- Host: the application you use. Claude Code, Cursor, an IDE, a chat app. It holds the model (LLM) and decides what the model can reach.
- MCP client: a component inside the host. Each client keeps a connection to one server.
- MCP server: a program that exposes capabilities (tools, data, prompts) of some system: GitHub, PostgreSQL, the file system, your internal API.
Notice an important detail: the model never talks to the server directly. The host does, through its clients. The model only "asks" to use a tool, and the host decides whether to run it, ask for your approval, or block it.
Under the hood, messages follow the JSON-RPC 2.0 format. Nothing magical: JSON objects with method, params and id.
Why it matters for your product
If you work in product or management, MCP changes a few things in practice:
- Your system can be used by any AI assistant. With an MCP server, an ERP, a CRM or an internal platform works in Claude, ChatGPT, Cursor and whatever comes next, without a custom integration for each one.
- Integrate once, work everywhere. Instead of maintaining N integrations with N AI tools, the team maintains one. Less code, less maintenance.
- Customers will ask for it. Just like everyone started asking "do you have an API?", the question "do you have MCP?" is starting to show up in software evaluations.
- It requires security decisions. Which data the agent can read, what it can change and when a person needs to approve are product decisions, not just engineering ones. More on that in security tips.
What an MCP server offers
A server can expose three kinds of things, called primitives:
| Primitive | What it is | Who decides to use it | Example |
|---|---|---|---|
| Tools | Functions that do something | The model | list_issues, run_query, create_ticket |
| Resources | Read-only data identified by a URI | The application or the user | A file, a table schema, a log |
| Prompts | Ready-made prompt templates | The user | "Review this PR", "Explain this query" |
In practice, tools are by far the most used. When someone says "I installed the GitHub MCP", they almost always mean a server that exposes tools.
Each tool comes with a name, a text description and a JSON Schema for its parameters. The model reads that description to decide when and how to call the tool. That's why a well-written description matters as much as the code.
A tool call, step by step
Let's see what happens when you ask Claude Code how many open issues a repository has, with a GitHub MCP server configured:
- You ask the question in natural language.
- The host asks the server which tools exist (
tools/list). - The server answers with the list of tools and their schemas.
- The model reads the descriptions, picks the
list_issuestool and builds the arguments. - The host sends
tools/callto the server. - The server calls the real GitHub API.
- The API responds.
- The server returns the result to the host.
- The model uses that result to write the answer.
The messages exchanged in steps 5 and 8 look roughly like this (simplified):
{
"jsonrpc": "2.0",
"id": 7,
"method": "tools/call",
"params": {
"name": "list_issues",
"arguments": { "repo": "acme/shop", "state": "open" }
}
}
{
"jsonrpc": "2.0",
"id": 7,
"result": {
"content": [
{ "type": "text", "text": "12 open issues: #41 Fix RSS, #39 ..." }
]
}
}
The part I find most interesting: the server knows nothing about AI. It receives JSON, runs a function and returns JSON. The "intelligence" lives in the model, which decides what to call. For backend developers, writing an MCP server is very similar to writing an API endpoint.
The latest revision of the spec, 2026-07-28, made the protocol stateless: the
initializehandshake and the sessions on the HTTP transport are gone, and every request now carries the client's version and capabilities. That makes servers running behind a load balancer much simpler. The details are in the official changelog.
stdio or HTTP?
The spec defines two transports, that is, two ways for messages to travel between client and server:
- stdio: the host starts the server as a child process on your machine and talks over standard input and output. It's simple, needs no network or auth, and is ideal for local tools (files, a development database, scripts).
- Streamable HTTP: the server runs somewhere else and receives
POSTrequests on an endpoint. The reply comes back as JSON or as a stream (SSE). This is the way to go for shared services and SaaS, usually with OAuth or a token.
The old "HTTP+SSE" transport is deprecated. If you find tutorials talking about it, they're probably out of date.
In part 3 of this series I show an MCP server over HTTP in PHP, with token authentication.
Using MCP in Claude Code
In Claude Code, adding a server is one command.
A remote server (HTTP):
claude mcp add --transport http github https://api.githubcopilot.com/mcp/
A local server (stdio), passing the command that starts the process after --:
claude mcp add my-server -- /path/to/my-server
To check what's configured:
claude mcp list
And inside a session, the /mcp command shows the status of each server and lets you authenticate the ones that use OAuth.
A useful tip for teams: with --scope project, the config goes into a .mcp.json file at the root of the repository. That way everyone who clones the project gets the same servers, versioned alongside the code.
MCP vs API, CLI and agents
A lot of confusion comes from mixing MCP up with things it isn't:
- MCP is not an agent. It's just the plumbing. Planning, deciding and acting is the job of the application (host) and the model.
- MCP is not a model, and it doesn't make the model smarter. It gives access to information. If the model picks the wrong tool, the protocol won't save it.
- MCP doesn't replace your API. Usually the MCP server is a thin layer on top of the API you already have.
- More servers isn't always better. Every tool has a name, a description and a schema, and all of that takes up room in the model's context. Dozens of tools installed "just in case" make the agent slower, more expensive and more confused when choosing.
- Sometimes a CLI is enough. If the agent already runs terminal commands, tools like
gh,psqlorkubectlmay do the job. MCP shines when there's no CLI, when you need managed auth, or when you want to control exactly what the agent can do.
Security tips
An MCP server is code running with your credentials. Treat it like any other dependency:
- Only install servers from trusted sources. A stdio server is a process on your machine, with access to whatever your user can access. In May 2026, a malicious version of a VS Code extension harvested secrets and access tokens from a GitHub employee's machine, and the attackers used that access to clone around 3,800 of the company's internal repositories. MCP servers are the same kind of vector: third-party code running with your access.
- Use least-privilege tokens. If the agent only needs to read issues, the token shouldn't be able to delete repositories.
- Watch out for prompt injection. A tool's result goes into the model's context. If it comes from a source third parties control (a public issue, an email, a web page), someone can write instructions there to manipulate the agent.
- Keep a human in the loop for destructive actions. Reading data can be automatic. Writing to production should not be.
FAQ
Is MCP only for Claude? No. It was created by Anthropic, but today it's an open standard maintained by the Agentic AI Foundation, under the Linux Foundation. Cursor, VS Code, ChatGPT and many other applications support MCP.
What's the difference between MCP and function calling? Function calling is the model's ability to ask for a function to run. MCP is the protocol that standardizes where those functions come from and how they're called. A host uses function calling under the hood so the model can pick the tools that came from MCP servers.
Is MCP secure? The protocol is as secure as the servers you install and the permissions you give them. See the security section.
What's the current version of the spec? Revision 2026-07-28, which made the protocol stateless. The full spec is at modelcontextprotocol.io.
Conclusion
At the end of the day, MCP is a simple, well-executed idea: a shared contract, over JSON-RPC, so any AI application can use any tool. It isn't magic, but it solves a real integration problem, the same way LSP did for editors.
For backend developers, the good part is that writing an MCP server is a lot like what we already do every day: receive a request, validate parameters, run some business logic and return a result.
In the next post we'll get our hands dirty and build an MCP server from scratch. Then, in the third part, we put that server online over HTTP, with authentication and a tool that writes data.
See you next time, and cheers!