A shopping assistant receives a request to find a wireless mechanical keyboard under $100, check stock, and save the recommendation. The model can help choose a product, but it cannot inspect a product catalog or write a note on its own. The application needs to connect those actions to external systems and decide what to send back to the model.
This article uses a Python shopping chatbot as a running example. The protocol details refer to MCP version 2026-07-28.
The boundary MCP defines
MCP standardizes communication between an AI application and the external systems that provide its context and capabilities.
The AI application is the host. It creates an MCP client to talk to each MCP server. The server exposes tools, resources, and prompts through standard protocol messages.
User → AI host ↔ LLM
│
├── MCP client A ↔ Shopping MCP server
│ ├── search_products()
│ └── check_inventory()
│
└── MCP client B ↔ Filesystem MCP server
└── write_file()The application coordinates two separate interfaces:
- Host ↔ LLM: The model sees messages and tool descriptions, reasons about a request, and can return tool-use instructions. MCP does not define this model-provider API.
- MCP client ↔ MCP server: The client discovers and invokes capabilities using standardized MCP messages. MCP does define this interaction.
The shopping chatbot bridges those interfaces. An MCP server does not independently decide what Claude should do next.
Hosts, clients, and servers
Consider the full request:
Find a wireless mechanical keyboard under $100, check stock, and save the recommendation.
flowchart TD
accTitle: Shopping assistant MCP architecture
accDescr: A user talks to a Python shopping chatbot, the MCP host, which calls the Claude model over the Anthropic Messages API and owns two MCP clients, one connected to a shopping MCP server backed by a product catalog and one to a filesystem MCP server backed by an allowed notes folder.
U[User] --> H[Python shopping chatbot — MCP host]
H <-->|Anthropic Messages API| L[Claude model]
H --> C1[MCP client: shop]
H --> C2[MCP client: files]
C1 <-->|MCP| S1[Shopping MCP server]
C2 <-->|MCP| S2[Filesystem MCP server]
S1 --> D[(Product catalog)]
S2 --> F[(Allowed notes folder)]| Component | What it owns | In the shopping assistant |
|---|---|---|
| MCP host | User interaction, LLM calls, model context, permissions, and coordination of clients | The Python chatbot |
| MCP client | Protocol connection to one corresponding server; discovery and requests | shop client and files client |
| MCP server | Exposed capabilities and their implementations | Shopping functions or filesystem operations |
One host can create many clients. Each client connects to one server. This does not mean every remote server can serve only one client: a remote Streamable HTTP server may receive requests from many different clients. The one-to-one relationship describes each individual client connection.
A server might run locally as a subprocess or remotely as a network service. Neither location changes its role.
What the host does that the client doesn't
The host calls Claude, maintains its conversation history, decides what information to show the user, and enforces approval rules. Its MCP client is the lower-level component for communicating with a particular MCP server.
A useful analogy: the host is a travel planner, each MCP client is a dedicated contact channel, and each MCP server is a service provider. The contact channel carries requests; it doesn't decide the itinerary.
The data layer and the transport layer
The protocol separates what messages mean from how they travel.
flowchart TB
accTitle: The MCP data layer and transport layer
accDescr: The data layer defines JSON-RPC 2.0 messages and methods such as tools/list, tools/call, resources/read, and prompts/get. The transport layer delivers those messages over local stdio or remote Streamable HTTP.
subgraph D[Data layer — what to say]
M[JSON-RPC 2.0 messages]
P[Methods: tools/list, tools/call, resources/read, prompts/get]
M --> P
end
subgraph T[Transport layer — how to deliver it]
A[Local stdio]
B[Remote Streamable HTTP]
end
D --> TData layer: Defines JSON-RPC request, response, and notification formats; protocol and capability metadata; and methods such as tools/list and tools/call.
Transport layer: Moves those messages between processes or machines. It also handles transport-level connection behavior and, for HTTP, authentication details.
This division lets a shopping MCP server move from local stdio to remote Streamable HTTP without rewriting the underlying tool semantics.
Tools, resources, and prompts
MCP calls these three kinds of server capability primitives. They remain fundamental in the July 2026 specification.
| Primitive | What it provides | Shopping example | Typical client method |
|---|---|---|---|
| Tool | Executable operation | Search products, check inventory, save a note | tools/call |
| Resource | Contextual data addressable by URI | shop://catalog, shop://products/kb-101 | resources/read |
| Prompt | Reusable message template/workflow | recommend_keyboard(max_price="100") | prompts/get |
Tools: operations
A shopping server could expose a function conceptually like:
def search_products(query: str, max_price: float) -> list[dict]:
...The MCP server announces the function's name, description, and input schema. The client can later request its execution with tools/call.
Tools can read data or change it. A tool is not necessarily a write operation. The defining characteristic is that it is an invocable operation, often selected by an LLM through its host.
Resources: addressable context
A server might expose:
shop://catalog
shop://products/{product_id}A host can select a concrete resource and read it — for example, shop://products/kb-101. Reading a resource does not automatically place it into the LLM's context. The host chooses whether and how to include the returned content.
Resources are well suited to providing read-oriented data and context. Their contents may change over time; a resource does not have to be an immutable file.
Prompts: reusable workflows
The shopping server could also expose a reusable prompt:
recommend_keyboard(max_price="100", preference="wireless")The client retrieves the rendered template via prompts/get. The host may present it to the user or adapt its messages for a model API. Retrieving a prompt is not itself an LLM inference.
These distinctions matter because the server offers all three, but the host decides how to use them in the user experience.
How a tool call travels
The request passes through the host, the model API, and the MCP client-server connection:
sequenceDiagram
accTitle: A tool call from user question to final answer
accDescr: The host sends the user's question and converted tool schemas to Claude, receives a search_products tool-use request, forwards it through the shop MCP client to the shopping MCP server, then returns the result to Claude with the conversation history so it can answer.
autonumber
actor U as User
participant H as Python host
participant L as Claude API
participant C as Shop MCP client
participant S as Shop MCP server
U->>H: Find a wireless keyboard under $100
Note over H,C: Host already knows server's available tools
H->>L: Question + converted tool schemas
L-->>H: tool_use: search_products, arguments, id
H->>C: call_tool(search_products, args)
C->>S: MCP tools/call
S-->>C: MCP result (matching products)
C-->>H: CallToolResult
Note over H: Convert to Claude tool_result and append history
H->>L: Another Messages API call with history
L-->>H: Final answer or another tool_use
H-->>U: ResponseThe flow involves two separate request IDs and two separate protocols:
- The Claude
tool_use.idmatches a later Claudetool_result.tool_use_id. - The MCP JSON-RPC
idmatches the MCP client's request with the MCP server's response.
The host bridges the two interfaces. The MCP client does not automatically forward a result to Claude, and Claude does not directly call the shopping server's Python function.
Routing calls across multiple servers
The host discovers tools from each server, then maintains a map such as:
# Conceptual host-owned route table
routes = {
"shop__search_products": (shop_client, "search_products"),
"shop__check_inventory": (shop_client, "check_inventory"),
"files__write_file": (files_client, "write_file"),
}The prefixes are an application-level namespacing convention, not a protocol requirement. If Claude requests files__write_file, the host looks up the associated MCP client and asks it to invoke the server's original write_file tool.
JSON-RPC beneath the SDK
MCP's data layer uses JSON-RPC 2.0. A request names a method and can contain parameters. A response carries a matching JSON-RPC ID and a result or error.
This illustrative 2026-07-28-style tool request shows the essential fields:
{
"jsonrpc": "2.0",
"id": 12,
"method": "tools/call",
"params": {
"name": "search_products",
"arguments": {
"query": "wireless mechanical keyboard",
"max_price": 100
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientInfo": {
"name": "stackfable-client",
"version": "1.0.0"
},
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}This is not a packet captured from a running application. An MCP SDK normally creates and parses these messages; the host does not need to assemble the JSON by hand.
methodtells the MCP server which protocol operation is requested.nameidentifies the specific tool inside that server.argumentscarries inputs for the tool.idcorrelates the MCP request and response._metacarries protocol version and relevant client information/capabilities.
Notifications differ from requests: they do not expect a normal response and do not have a JSON-RPC request ID. For instance, a subscribed client can receive a notification when a server's tool list changes.
Stateless requests in MCP 2026-07-28
The current request lifecycle differs from older versions of MCP.
Earlier lifecycle: initialization before requests
Earlier versions used an initialization exchange before normal message traffic:
sequenceDiagram
accTitle: The older initialization lifecycle
accDescr: An MCP client initializes with the server, receives server details and capabilities, sends an initialized notification, and then requests the list of available tools.
participant C as MCP client
participant S as MCP server
C->>S: initialize
S-->>C: Server details and capabilities
C->>S: initialized notification
C->>S: tools/list
S-->>C: Available toolsThat exchange belongs to an older protocol version. It is not the required lifecycle of MCP 2026-07-28.
Current lifecycle: self-contained requests
Under the July 2026 protocol, every request carries protocol version and relevant client capability information in _meta. Servers support server/discover, which clients may call to learn capabilities and supported versions before other operations. It is not a mandatory handshake.
sequenceDiagram
accTitle: The 2026-07-28 request lifecycle
accDescr: A client may optionally call server/discover to learn the server's identity, capabilities, and supported versions, then sends tools/list and tools/call requests that each carry per-request metadata.
participant C as MCP client
participant S as MCP server
opt Discover versions and capabilities
C->>S: server/discover
S-->>C: Server identity + capabilities + supported versions
end
C->>S: tools/list with per-request _meta
S-->>C: Tool schemas
C->>S: tools/call with per-request _meta
S-->>C: Tool resultThe older initialize / initialized handshake and protocol-level session identifiers are no longer the model for current-version requests. A client may use connection pooling or maintain an open transport, but transport connection lifetime is not the same thing as protocol session state.
What statelessness does and does not mean
Stateless requests do not mean that application data or conversations disappear. These are different kinds of state:
| State | Where it belongs | Example |
|---|---|---|
| MCP protocol session state | Not required for 2026-07-28 requests | No prior initialization needed to interpret a request |
| Application data | Database, files, application services | A product catalog or inventory stored in products.json |
| LLM conversation history | Host/model integration | A Python host maintains and resends Claude messages |
Stateless MCP is compatible with stateful business workflows. For a cart, for example, an application can pass an explicit cart_id between operations and store cart contents in a database.
An MCP request is not the same thing as the chat conversation or the application's data store.
Local stdio and remote Streamable HTTP
The data-layer message can travel over different transports.
Local: standard input/output (stdio)
flowchart LR
accTitle: Local stdio transport
accDescr: The Python host and MCP client exchange protocol messages with a shopping MCP server subprocess over its standard input and output streams.
H[Python host / MCP client process] <-->|stdin / stdout| S[Shopping MCP server subprocess]A local implementation can start shopping_server.py as a subprocess and exchange MCP messages over its standard input and output. This requires no HTTP endpoint or remote authentication service.
Implementation note: Reserve stdout for protocol messages; ordinary diagnostic logs belong on stderr.
Remote: Streamable HTTP
flowchart LR
accTitle: Remote Streamable HTTP transport
accDescr: The host and MCP client communicate with a remote shopping MCP server using HTTP POST requests, with an optional Server-Sent Events stream.
H[Host / MCP client] <-->|HTTP POST; optional SSE stream| S[Remote shopping MCP server]The July 2026 documentation describes Streamable HTTP for remote MCP communication. The client sends requests using HTTP POST; Server-Sent Events can support streaming interactions and notifications. HTTP deployments need appropriate authentication and authorization.
The older HTTP+SSE transport is a different remote-server option. For new implementations, prefer Streamable HTTP rather than designing around legacy HTTP+SSE.
Neither transport changes the meaning of tools/list or tools/call; it changes how those MCP messages reach the server.
Discovery and change notifications
The 2026-07-28 architecture also includes:
- Capability and version discovery:
server/discoverlets a client learn the server's identity, supported protocol versions, and capabilities. - Per-request metadata: Requests carry the version and client capability context they need, instead of depending on earlier initialization.
- Notifications and subscriptions: A client can opt in via
subscriptions/listenand receive selected change notifications, such as updates to the tool list. - Client-side elicitation: Servers can request information or confirmation from a user through supported client functionality; the host still decides how that request is presented and authorized.
These features do not need to be implemented manually to understand the shopping example. An official SDK handles much of the protocol plumbing.
What MCP does not do for the shopping assistant
MCP is not an autonomous agent framework, a model API, or a conversation-memory system.
It does not:
- Automatically decide which tool Claude should request.
- Automatically send the MCP server's result back to Claude.
- Automatically insert every resource into the model's context.
- Execute prompts with an LLM merely because the server exposes them.
- Replace tool authorization, consent, or security controls.
Those responsibilities remain with the host and its product design. MCP standardizes the interface for discovering and accessing capabilities.
A security-sensitive host should treat remote servers, tool descriptions, and returned contents as untrusted until vetted; narrow permissions and confirm actions that access or modify user data.
The mental model
Why MCP? explains why applications benefit from a shared interface to external capabilities. The architecture here shows where that interface sits: the host connects its model API to one or more MCP clients, and each client talks to a server. From there, an implementation can register shopping functions on a server, route Claude's tool requests through the right client, and add a filesystem server without changing the model-facing tool-calling boundary. Resources and prompts add context and reusable messages that the host may choose to pass to the model.
The host runs the AI experience. Each MCP client connects it to a server. The server exposes tools, resources, and prompts. The protocol defines their messages; the transport delivers them.
When Claude requests a shopping tool, the host still decides how to route, authorize, execute, and return its result. MCP standardizes the connection without eliminating the host's responsibilities.
Sources
Primary source (current): MCP architecture overview — 2026-07-28. Protocol requirements: MCP 2026-07-28 specification.
Course background: The DeepLearning.AI course MCP: Build Rich-Context AI Apps with Anthropic informed the author's study of hosts, clients, servers, primitives, and transports. The protocol-version details above follow the linked official documentation. No affiliation or endorsement is implied.