MCP: From Motivation to DeploymentLesson 02

Understanding MCP Architecture: Hosts, Clients, Servers, and Transports

How an MCP host, its clients, and its servers fit together: the JSON-RPC data layer, local stdio and remote Streamable HTTP transports, and what stateless requests mean in the 2026-07-28 protocol.

Shopping tool request through MCP1 · Shoppinghost2 · Shopclient3 · Shopserver4 · ProductcatalogMCP

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.

TEXT
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:

  1. 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.
  2. 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.

ComponentWhat it ownsIn the shopping assistant
MCP hostUser interaction, LLM calls, model context, permissions, and coordination of clientsThe Python chatbot
MCP clientProtocol connection to one corresponding server; discovery and requestsshop client and files client
MCP serverExposed capabilities and their implementationsShopping 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.

Data 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.

PrimitiveWhat it providesShopping exampleTypical client method
ToolExecutable operationSearch products, check inventory, save a notetools/call
ResourceContextual data addressable by URIshop://catalog, shop://products/kb-101resources/read
PromptReusable message template/workflowrecommend_keyboard(max_price="100")prompts/get

Tools: operations

A shopping server could expose a function conceptually like:

PYTHON
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:

TEXT
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:

TEXT
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:

The flow involves two separate request IDs and two separate protocols:

  • The Claude tool_use.id matches a later Claude tool_result.tool_use_id.
  • The MCP JSON-RPC id matches 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:

PYTHON
# 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:

JSON
{
  "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.

  • method tells the MCP server which protocol operation is requested.
  • name identifies the specific tool inside that server.
  • arguments carries inputs for the tool.
  • id correlates the MCP request and response.
  • _meta carries 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:

That 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.

The 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:

StateWhere it belongsExample
MCP protocol session stateNot required for 2026-07-28 requestsNo prior initialization needed to interpret a request
Application dataDatabase, files, application servicesA product catalog or inventory stored in products.json
LLM conversation historyHost/model integrationA 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)

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

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/discover lets 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/listen and 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.

Related Posts

Shopping inventory call through a remote MCP server1 · Shoppinghost2 · MCPclient3 · Remoteserver4 · ProductcatalogHTTPS /mcp

Deploy a Remote MCP Server: Streamable HTTP, Cloudflare, AWS, and Capacity Planning

  • Stackfable
  • 08 Nov 2026

Move a shopping MCP server from local stdio to remote HTTP, compare deployment options, and estimate the capacity it needs.

Read More: Deploy a Remote MCP Server: Streamable HTTP, Cloudflare, AWS, and Capacity Planning
Product resource selected by the shopping host1 · Shopperchooses ID2 · Pythonhost3 · Productresource4 · Displayonly5 · Claudegets context

MCP Beyond Tools: Add Resources and Prompts to Our Shopping Assistant

  • Stackfable
  • 08 Nov 2026

Extend a shopping MCP server with product resources and a reusable prompt, and see when the host passes each to Claude.

Read More: MCP Beyond Tools: Add Resources and Prompts to Our Shopping Assistant
A shopping request routed to two MCP servers1 · Keyboardrequest2 · Pythonhost3 · Shopsearch + stock4 · Notessave file

Connecting One MCP Client to Multiple Servers: Build a Shopping Assistant That Can Save Notes

  • Stackfable
  • 08 Nov 2026

Connect a shopping assistant to separate shopping and filesystem MCP servers, then discover and route their tools through one Python host.

Read More: Connecting One MCP Client to Multiple Servers: Build a Shopping Assistant That Can Save Notes