AlgoViz

MCP hosts, clients and stateless requests

medium 6 min

The host owns the user interaction and decides which model suggestions may become calls.

Video lesson · Chapter 1 of 4

A quote reaches another replica

0:00 / 4:00

Theory

Read or listen first. About 2 min.

What it is

The host owns the user interaction and decides which model suggestions may become calls. Its MCP client translates an approved operation into a versioned JSON-RPC request. In the July 2026 protocol core, a request carries its own protocol context. A client that needs to inspect what a server offers can call server/discover. A client that already knows an applicable method can make its request directly.

Why it exists

The November 2025 lifecycle began with initialize and an initialized notification. That sequence remains important when integrating a peer using that revision. The July revision removes the core handshake and transport session ID. Load balancing becomes simpler because the next request can reach another instance. A shopping quote can still be stateful: its handle, expiry, owner and contents belong to the application.

Ask two replicas for a catalog quote

MCP client → Replica A (quote request). Replica A → Quote ledger (record offer). MCP client → Replica B (read Q7). Replica B → Quote ledger (check owner and expiry)
MCP client → Replica A (quote request). Replica A → Quote ledger (record offer). MCP client → Replica B (read Q7). Replica B → Quote ledger (check owner and expiry)

Inside this chapter

Chapter sources
Host, client and server roles
The host chooses when to consult a server and how results enter the model context. The client sends and correlates protocol messages. The server validates authority and performs its supported operation. A reachable endpoint or advertised feature alone is insufficient authority to act.

The three roles split responsibility. The host is the application the person uses: it owns the conversation, decides which servers to connect and whether a model's suggestion becomes a real call. Each client is the host's protocol connector to one server, handling message framing and matching responses to requests. The server exposes capabilities and must enforce its own authorisation, because it cannot assume every client behaves well. Seeing a tool in a list only tells you it exists.

Example. A catalog advertises quoting and ordering. A user authorized only for quotes can invoke the former even though the client can discover both.

Another example. A coding assistant (host) connects to a Git server and a ticket server through two clients. The model suggests deleting a branch; the host asks the developer first, and the Git server still checks the developer's repository permissions when the call arrives.

Who decides, who carries, who checks

If the model proposed place_order instead, the host or the server would stop it, even though discovery lists both tools.
Versioned lifecycle and optional discovery
Under July 2026, send the version and required request metadata according to the selected transport. Use optional server discovery when the client needs capabilities up front. Keep November 2025 initialization as a distinct compatibility path.

Under the November 2025 lifecycle, a connection starts with initialize, where both sides agree a version and capabilities, followed by an initialized notification; later requests rely on that negotiated state. In the July 2026 core, as the chapter describes, each request carries its own version and protocol context, so no handshake is required and discovery is an optional call. The practical effect is that any server instance can handle any request without remembering an earlier exchange.

Example. A new client contacts replica B after a call to replica A. B handles the self-describing request without reconstructing a core transport session.

Two revisions, two ways to start

Keep the older handshake as a separate compatibility path rather than mixing the two flows.
Business state handles
A stateless protocol core allows an application to keep quote state in storage and return an explicit reference. Validate the principal, resource, expiry and current authorization each time the reference is presented.

Removing protocol sessions does not remove state; it moves the state you care about into the application where it belongs. A quote lives in a database row with an owner, contents and expiry, and the handle (Q7) is just a pointer to that row. Because handles can be copied into chat messages, logs or other tools, the server must check who is presenting it and whether they are still allowed, every time.

Example. Quote Q7 belongs to a specific buyer. Sharing Q7 in a message cannot transfer the buyer’s authority to another caller.

Another example. A travel agent tool returns hold H31 for a seat. A second agent session that sees H31 in a shared log tries to confirm it; the booking service rejects the call because H31 belongs to the first traveller's account.

Presenting Q7 is not owning Q7

Check on every useBuyer A presents Q7Another caller presents Q7
Principal matches quote owneryesno
Quote not expiredyesyes
Caller still authorised for quotesyesnot relevant, already failed
Resultread or act on Q7deny, log the attempt
The handle is a lookup key into the application's own store, re-authorised each time.
JSON-RPC message types
MCP messages follow JSON-RPC 2.0. A request has an id and a method and expects a response; a response echoes that id and carries either a result or an error; a notification has a method but no id and expects no reply. The id is how a client matches replies to requests when several are in flight.

JSON-RPC is deliberately small: method names, parameters, ids and a standard error shape. MCP defines the methods and parameter shapes on top. Errors come back as an error object with a code and message rather than an HTTP failure, so a client must read the body even when transport succeeded. A tool that ran but failed in business terms usually reports that inside its result, which is different again from a protocol error.

Example. A client sends request 41 to call create_quote. The response with id 41 carries the quote. A cancellation notice for an earlier request has no id of its own.

JSON
{"jsonrpc": "2.0", "id": 41, "method": "tools/call", "params": {"name": "create_quote", "arguments": {"sku": "NB-01", "quantity": 3}}}{"jsonrpc": "2.0", "id": 41, "result": {"content": [{"type": "text", "text": "Quote Q7 created"}]}}{"jsonrpc": "2.0", "method": "notifications/cancelled", "params": {"requestId": 40}}
Simplified request, response and notification. Revision-specific metadata that each request must carry is omitted here.
November 2025 protocol notes

Trace one negotiated connection to a catalog

Model Context Protocol defines how hosts connect clients to servers that expose capabilities. A versioned lifecycle and JSON-RPC messages let the participants discover what they can exchange. The host still owns the model-facing experience and authorization remains explicit.

Follow a single connection through initialization before tracing a tool call. This separates an unsupported feature, a transport problem and a tool-level failure. The worked examples use the November 2025 protocol revision linked below.

Prerequisites & Environment
Start with a host application, a client connection and a server offering a harmless read-only capability. Verify that both ends agree on protocol version and advertised features. Keep transport diagnostics separate from tool diagnostics: a connected process can still expose no compatible capability. Connect a client to a read-only catalog fixture. Test a successful initialization separately from a server that advertises no tools.
The MCP connection lifecycle
MCP uses JSON-RPC messages and a lifecycle with initialization and capability negotiation. A host manages clients, and each client maintains a logical connection to one server. The protocol carries requests and results; the host still decides what to expose to a model and which operations the user permits. A server agrees on a version but advertises resources only. Use the resource feature and avoid inferring tool support from a successful connection.
Compare both protocol walkthroughs

How it works

Step through the idea, or press Play.

Step 1 of 4

MCP client. An approved quote request

Understand it

Worked example

Ask two replicas for a catalog quote

  1. 1

    An approved quote request

    The user requests a quote for three notebooks. The client knows the method and uses the July revision. Discovery would also be available if it needed to inspect capabilities.

  2. 2

    Create a quote under the buyer’s identity

    The server validates the request. It stores the quoted items, expiry and owner in the business store.

  3. 3

    Q7 identifies the saved quote

    A stable handle survives replica replacement. It conveys a reference that must still be authorized.

  4. 4

    Read Q7 after rerouting

    A subsequent self-describing request reaches B. B rechecks identity and reads the application record without an MCP transport session.

Follow the handoffs

The November 2025 lifecycle began with initialize and an initialized notification. That sequence remains important when integrating a peer using that revision. The July revision removes the core handshake and transport session ID. Load balancing becomes simpler because the next request can reach another instance. A shopping quote can still be stateful: its handle, expiry, owner and contents belong to the application.

Reaching replica B under each revision

AspectNovember 2025 lifecycleJuly 2026 core
Start of interactioninitialize, then initializednone required; optional server/discover
Transport session IDties later requests to the sessionremoved from the core
Request lands on replica BB needs the session, or affinity to AB handles the self-describing request
Quote Q7application state in the business storeapplication state in the business store
The last row does not change: business state was never the protocol's job.

Summary

The whole topic in one minute.

The protocol core no longer depends on a transport session. A business application can persist and authorize its own records.

The November 2025 lifecycle began with initialize and an initialized notification. That sequence remains important when integrating a peer using that revision. The July revision removes the core handshake and transport session ID. Load balancing becomes simpler because the next request can reach another instance. A shopping quote can still be stateful: its handle, expiry, owner and contents belong to the application.

Sources