If you're still deciding between exposing an APIContract that defines how one program asks another for data or actions: which endpoints to call, what to send and what comes back. On the web, usually HTTP with JSON. or an MCPOpen protocol that standardizes how AI apps connect to external tools and data: a server exposes actions and the agent discovers and calls them. server, start with MCP or API: when to use each. This article is the next step: you've already picked MCP and want to understand the pieces from the inside, with the names you'll find in the spec, in the SDKs and in job postings.
I'll use the MCP server of my personal CRM as the example. It lets an assistant look up companies, contacts and deals. It has been live for a few months, and many of the decisions below came from problems that showed up there.

The Architecture in Three Roles
The official documentation separates three roles, and mixing up the first two is the most common mistake:
| Role | What it is | Example |
|---|---|---|
| Host | The AI application the person uses. It coordinates the model, the interface and the permissions. | Claude, ChatGPT, Cursor, VS Code |
| Client | A component inside the host that keeps the connection to one server. | The host opens one client for each configured server |
| Server | The program that exposes tools, resources and prompts. | The MCP server for GitHub, for a database, for my CRM |
It's a one-to-one relationship: each client talks to a single server. If the host has five servers configured, it keeps five clients. That isolates the servers from each other: the CRM server can't see what the GitHub server returned.
What the Server Offers: Tools, Resources and Prompts
The spec defines three primitives, and the difference between them is who decides to use them:
| Primitive | Who decides | What for | Example in my CRM |
|---|---|---|---|
| Tools | The model | Run an action or query with arguments | search_companies, get_deal |
| Resources | The application | Read-only data, identified by URI | crm://companies/{id} |
| Prompts | The person | Ready-made instruction templates, often a slash command | "Weekly summary" |
Tools are the primitive everyone uses. Each one has a name, a description and an inputSchema in JSON Schema, which is required. Since June 2025 a tool can also declare an outputSchema and return structuredContent, a JSON you can validate on top of the text. In my CRM, every tool returns both: the text for the model to read and the JSON for the host to show in a table.
The description deserves more care than it seems. It's the only thing the model uses to decide which tool to call, and with twenty similar tools, a vague description makes it pick the wrong one or make up arguments. Say what the tool does, when to use it and when not to.

Resources are addressed by URI, and a server can publish URI templates (RFC 6570). The CRM publishes crm://companies/{id}: the host fills in the {id} and reads the record without the model having to call a tool.
Prompts show up in the host as shortcuts. The person picks one, fills in the arguments and the host builds the message.
What the Client Offers: Elicitation
The flow also goes the other way. Sometimes the server needs something from the person using it: a confirmation, a missing piece of data. That's what elicitation is for, with two modes:
- form: the server describes a simple form and the host shows it to the person. The spec forbids using this mode for sensitive data.
- url: the host opens an external page. It's the right mode for passwords, credentials or payments, because the data never goes through the MCP client.
Two other client capabilities, sampling (the server asks the host to run the model) and roots (the host tells the server which folders it can see), were deprecated on July 28, 2026. They still work, but for new code the recommendation is to call the LLMAI model trained on large amounts of text to predict the next word, which lets it chat, summarize, translate and write code. provider's API directly and pass folders as tool arguments.
The Conversation Underneath: JSON-RPC 2.0
Every message is a JSON-RPC 2.0 object in UTF-8. A tool call looks like this:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "search_companies",
"arguments": { "query": "solar energy", "limit": 5 },
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": { "elicitation": {} }
}
}
}And the response:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"resultType": "complete",
"content": [{ "type": "text", "text": "3 companies found: ..." }],
"structuredContent": [{ "id": 41, "name": "..." }],
"isError": false
}
}Notice the _meta. In the current version, the protocol version and the client capabilities travel with every request. That comes from the biggest recent change in MCP.
Stateless: What Changed on July 28, 2026
Up to the November 2025 version, a connection started with a handshake (initialize), where client and server agreed on version and capabilities, and the HTTP server returned an Mcp-Session-Id that the client sent back afterwards. That tied the client to one instance: behind a load balancer, the second request could land on a replica that didn't know that session.
The July 28, 2026 version dropped both:
- No
initializeand noMcp-Session-Id. Each request carries version and capabilities in_meta. server/discover, an optional call for the client to ask the server what it supports before starting.- Every result gets a
resultType. The most interesting one isinput_required: instead of the server sending a request to the client in the middle of the call, it returns "I need this", and the client repeats the call with the answers ininputResponses. - Required HTTP headers:
MCP-Protocol-Version,Mcp-MethodandMcp-Name. A proxy can route or block by tool without opening the body. - Out go
pingandlogging/setLevel; tasks (long-running operations) become an official extension.
My CRM got to that conclusion before the spec did, for a practical reason: the API runs with several workers, and a session kept in the memory of one of them doesn't exist in the other. Its MCP server was already stateless and returned plain JSON, with no stream.

Transports: Stdio and Streamable HTTP
| Transport | When to use | Authentication |
|---|---|---|
| stdio | A server that runs on the person's machine, as a child process of the host | Credential from the environment (variable, config file) |
| Streamable HTTP | A remote, shared server behind a domain | OAuth 2.1, per the spec |
The old HTTP with SSE transport was replaced in March 2025 and is now officially deprecated. If a tutorial tells you to open an SSE connection on one side and POST on the other, it predates that change.
Authorization on the Remote Server
Authorization is optional in the spec, but on an HTTP server that accesses someone's data, it makes no sense to skip it. These are the required rules:
- The authorization server implements OAuth 2.1.
- The MCP server publishes Protected Resource Metadata (RFC 9728), which is how the client finds out where to request the token.
- The client says which server it wants the token for (resource indicators, RFC 8707) and uses PKCE with S256.
- The server validates the audience and doesn't accept a token issued for another service. Forwarding the received token to a backend API (token passthrough) is forbidden.
To register the client, the current recommendation is the Client ID Metadata Document, a JSON published at a URL that identifies the client. Dynamic registration (RFC 7591) was deprecated in July 2026. The details of OAuth and PKCE are in the API concepts article.
My CRM is for personal use and doesn't implement OAuth: it uses its own tokens with the rcrm_ prefix, each with scopes, a limit of 60 calls per minute and revocation from the dashboard. It works because there's only one user. If other people were going to connect, the way forward would be the spec's.
Annotations: Hints, Not Guarantees
Any tool can carry annotations about its own behavior. The defaults are the most cautious ones:
| Annotation | Default | Meaning |
|---|---|---|
readOnlyHint |
false | Doesn't change anything |
destructiveHint |
true | May delete or overwrite |
idempotentHint |
false | Repeating with the same arguments doesn't change the result |
openWorldHint |
true | Talks to external systems |
The host uses this to decide when to ask for confirmation. But the spec says plainly that the client must treat annotations as untrusted, unless they come from a trusted server: a malicious server can mark a tool that deletes everything as "read-only".
In the CRM, the annotation comes from the code itself: each tool declares whether it writes, and readOnlyHint is derived from that, so there's no tool that writes but is marked as read-only because someone forgot.
Security: Where It Usually Goes Wrong
- Tool poisoning. In April 2025, Invariant Labs described attacks where a tool's description carries hidden instructions for the model, "a specialized form of indirect prompt injectionsAttack where malicious text in an email, website or document carries instructions the model follows as if they came from the user, hijacking its behavior.". The person sees the tool's name; the model reads the whole description.
- Rug pull. A server you approved changes its tool descriptions after the approval. Pinning the server version and reviewing changes helps.
- Confused deputy. An MCP server that acts as a proxy for another API can be tricked into using its own authorization on behalf of someone who shouldn't have it. The spec requires per-client consent in these cases.
- Holding an identifier isn't authentication. In the 2026 version, the old "session hijacking" became "State Handle Hijacking": the server can't treat possession of a state handle as proof of who is calling.
- SSRF during discovery. The client fetches metadata from URLs the server provides; a hostile server can point them at the internal network.
In the CRM, three decisions cover a good part of this. Without the right scope, the tool doesn't even show up in the list: the model can't call what it can't see. Every call and every denial goes to the audit log. And there's no tool that deletes records.
Ecosystem: Registry, Apps, SDKs and the Inspector
- Registry. The official registry of public servers has been in preview since September 8, 2025. It stores metadata in
server.jsonand points to the package on npm, PyPI or a Docker image. Names follow a verified namespace:io.github.user/*through GitHub, or a domain verified by DNS. - MCP Apps. The first official extension, released on January 26, 2026, lets a tool point to a
ui://resource with HTML, which the host shows as an interface: a chart, a form, a map. - SDKs. TypeScript, Python, C#, Go, Rust and Ruby are at the highest support tier. The TypeScript one, in version 2, was split into
@modelcontextprotocol/serverand@modelcontextprotocol/client. - Inspector. The official tool for testing a server without a host:
npx @modelcontextprotocol/inspectoropens an interface on port 6274, lists the tools and lets you call each one by hand. It's the first place to look when a host doesn't show your tool. The documentation is in the tools catalog. - Governance. Since December 9, 2025, MCP has been maintained by the Agentic AIUse of language models that plan, call tools and decide the next step on their own to reach a goal, instead of only answering a question. Foundation, under the Linux Foundation, and no longer by Anthropic alone.
If you use agents in the browser, Chrome DevTools MCP is a good server to see all of this working: it exposes DevTools as tools for the agent.
Quick check
Frequently Asked Questions
What's the difference between host and client in MCP?
The host is the AI application the person uses, like Claude or Cursor. The client is a component inside the host that keeps the connection to a single server. A host with several servers has several clients.
What's the difference between tools, resources and prompts?
Who decides to use them. Tools are actions the model chooses to call. Resources are data, identified by URI, that the application chooses to read. Prompts are instruction templates the person chooses to use, often as a slash command.
Does MCP still use SSE?
The HTTP with SSE transport was replaced by Streamable HTTP in March 2025 and is deprecated. The current transports are stdio, for local servers, and Streamable HTTP, for remote ones.
What changed in MCP version 2026-07-28?
The protocol became stateless: the initialize handshake and the Mcp-Session-Id are gone. Version and capabilities go with every request, every result has a resultType, and the server can ask for more information with input_required. Sampling and roots were deprecated.
Does an MCP server need OAuth?
Per the spec, authorization is optional. On a remote server that accesses someone's data, the recommendation is to follow the authorization section: OAuth 2.1, PKCE with S256, resource indicators and audience validation. On a local stdio server, the credential comes from the environment.
How do I test an MCP server?
With the official Inspector: npx @modelcontextprotocol/inspector opens an interface that lists the tools, resources and prompts and lets you call each one, without needing a host.
References
- Model Context Protocol, 2026-07-28 specification and changelog; pages for tools, resources, prompts, elicitation, Streamable HTTP and authorization, accessed in 2026.
- Model Context Protocol, architecture, security best practices, SDKs and Inspector.
- MCP blog: registry preview, 2025; MCP Apps, 2026; MCP joins the Agentic AI Foundation, 2025.
- JSON-RPC 2.0 Specification.
- IETF, RFC 9728, OAuth 2.0 Protected Resource Metadata, 2025; RFC 8707, Resource Indicators, 2020.
- Invariant Labs, MCP Security Notification: Tool Poisoning Attacks, 2025.
- Related reading on this blog: MCP or API, agentic AI concepts and context engineering.