Architecture · Agents
Model Context Protocol (MCP) Architecture, Explained
The short answer
The Model Context Protocol (MCP) is an open standard for connecting AI applications to tools and data. An AI application (the host) runs an MCP client for each MCP server it connects to; servers expose tools the model can call, resources it can read and prompts it can use, over stdio locally or Streamable HTTP remotely. Since the 2026-07-28 specification, the protocol is stateless: every request carries its own version and capabilities.
By Maitreya Kulkarni · Updated · 12 min read
01 · The architecture
How Do Hosts, Clients And Servers Fit Together?
The host is the AI application a person uses. For each server it connects to, it runs a client that speaks JSON-RPC over a transport. The server exposes tools, resources and prompts backed by your systems, and remote servers are protected by OAuth.
NX-AR-05 · Architecture
The MCP architecture
- Outside world
- Data & integration
- AI agent
- System of record
- L1
Hosts
(Outside world)AI applications
Claude, ChatGPT, IDEs
. Hands work to: MCP client.Your own agents
. Hands work to: MCP client.
Passes down: requests - L2
Client
(Data & integration)MCP client
One per server connection
. Hands work to: Streamable HTTP, stdio.
Passes down: JSON-RPC messages - L3
Transport
(Data & integration)Streamable HTTP
Remote servers, OAuth
. Hands work to: MCP server.stdio
Local processes
. Hands work to: MCP server.
Passes down: calls - L4
Server
(AI agent)MCP server
Your capabilities, your rules
. Hands work to: Tools, Resources, Prompts.
Passes down: capabilities - L5
Primitives
(AI agent)Tools
Actions with typed inputs
. Hands work to: Your APIs and data.Resources
Context the model can read
. Hands work to: Your APIs and data.Prompts
Reusable templates
. Hands work to: Your APIs and data.
Passes down: reads and actions - L6
Your systems
(System of record)Your APIs and data
Authorization server
OAuth 2.1
. Hands work to: Streamable HTTP.
02 · Why MCP
What Problem Does MCP Solve?
Integration sprawl. Without a standard, every AI application needs a custom connector for every system: N applications times M systems. With MCP, each system is wrapped once as a server and every compatible application can use it, so the work becomes N plus M.
Write once
One MCP server for your product works in Claude, ChatGPT, IDEs and your own agents.
Typed and described
Tools come with JSON Schema inputs and outputs and descriptions models understand.
Permissioned
Remote servers use OAuth, so access is granted by a person and scoped per user.
03 · Primitives
What Can An MCP Server Offer?
Three core primitives, plus optional extensions. Tools are actions the model can invoke, resources are data the application can read into context, and prompts are reusable templates a person can pick. Extensions such as Tasks add long-running work.
| Primitive | Controlled by | Example |
|---|---|---|
| Tools | Controlled byThe model (with user approval) | Examplesearch_products, create_order |
| Resources | Controlled byThe application | ExampleA file, a record, a schema |
| Prompts | Controlled byThe user | Example“Summarise this account” |
| Tasks (extension) | Controlled byClient polls | ExampleA report that takes minutes |
04 · 2026-07-28
What Changed In The 2026-07-28 Specification?
MCP became stateless. The initialize handshake and protocol-level sessions are gone; every request carries its protocol version and client capabilities in its metadata, and servers advertise themselves through a new server/discover call. Several older features were deprecated with a twelve-month window.
Stateless core
No initialize or initialized messages; each request is self-describing, which makes servers easy to scale and cache.
No sessions
The Mcp-Session-Id header is gone from Streamable HTTP; servers needing state pass explicit handles as tool arguments.
Multi round-trip requests
Servers ask for missing input (confirmations, elicitation) in a result, and clients retry with the answers.
Tasks as an extension
Long-running work moved to the io.modelcontextprotocol/tasks extension, with polling instead of a blocking call.
Cacheable discovery
List results carry freshness hints, and tools should be listed in a stable order for prompt caching.
Deprecations
Roots, Sampling and Logging are deprecated, and Client ID Metadata Documents replace dynamic client registration.
{ "jsonrpc": "2.0", "id": 7, "method": "tools/call", "params": { "name": "search_products", "arguments": { "query": "trail shoes", "max_price": 150 }, "_meta": { "io.modelcontextprotocol/protocolVersion": "2026-07-28" } }}05 · Security
How Is A Remote MCP Server Secured?
With OAuth 2.1 and least privilege. The server publishes protected-resource metadata pointing to its authorization server, the person approves scopes in their browser, and the client presents a short-lived token bound to that server. Tool output is treated as untrusted by the host.
Protected-resource metadata
Defined by RFC 9728, it tells clients where to get tokens for your server.
Audience-bound tokens
Tokens are valid only for your server, so a leaked token can't be replayed elsewhere.
Scoped tools
Read and write tools need separate scopes; destructive tools are annotated so hosts ask first.
Injection awareness
User-generated text returned by tools is labelled and sanitised, so it can't steer the calling model.
06 · Step by step
What Does A Tool Call Look Like On The Wire?
Under the stateless specification, a client can discover a server's capabilities, then send each request with its protocol version and capabilities in the message itself. If the server needs more input, such as a person's confirmation, it returns an input-required result and the client retries with the answer.
NX-AR-05b · Sequence
A tool call over Streamable HTTP
- Your people
- Outside world
- AI agent
- System of record
Your peopleThe person
Outside worldHost and client
AI agentMCP server
System of recordYour API
01Host and client to MCP server: Discover capabilities
server/discover
02MCP server to Host and client: Versions, tools, identity
03Host and client to MCP server: Call a tool
tools/call + _meta protocolVersion
04MCP server to Host and client: Input required
resultType: input_required
05Host and client to The person: Asks to confirm
06The person to Host and client: Confirms
07Host and client to MCP server: Retry with the answer
inputResponses
08MCP server to Your API: Runs the action
09Your API to MCP server: Result
10MCP server to Host and client: Structured result
resultType: complete
The ecosystem
MCP
Claude
ChatGPT
Gemini
GitHub
Cloudflare


