Short answer: MCP’s 2026-07-28 specification makes protocol requests stateless: each request must carry the information needed to process it, and a server must not infer context from an earlier request, connection, or process. That does not make an agent’s workflow stateless. If work spans multiple tool calls, the application can keep it alive with explicit state—such as a handle returned by one tool call and supplied to the next.
Hidden assumptions about connection affinity, process continuity, or remembered context can make a harness fail when requests are retried, interleaved, routed to another server instance, or resumed in a different runtime. The available sources do not establish that statefulness is a general cause of agent crashes, or provide a crash-rate statistic. The practical lesson is narrower: make protocol context and workflow state explicit, and preserve tool failures instead of masking them during shell cleanup.
As an Amazon Associate I earn from qualifying purchases.
What “stateful” and “stateless” mean in MCP
The Model Context Protocol (MCP) specification dated 2026-07-28 says MCP is stateless: the request itself contains the information needed to process it, and the server processes requests independently. A server must not use an earlier request on the same connection to infer protocol context or treat connection or process identity as proof that a request belongs to a continuing conversation.
Recommended Free Tools
That is a protocol rule, not a ban on application state. A client, server, or agent harness can support a multi-step workflow, but it needs to represent that workflow deliberately. A tool can create application state and return an identifier; the client can then pass that identifier in later tool arguments. The identifier is an application-defined reference, not a protocol-defined MCP session object.
#1 Best Overall
The distinction matters because a transport connection, a running process, an agent task, and a user’s workflow have different lifetimes. An agent runtime may maintain its own session while the MCP requests it issues remain independently processable. The OpenAI Agents API architecture guide describes a hosted harness as the runtime that runs a model/tool loop and maintains an agent session; that application-level session does not restore MCP transport sessions.
What changed on 2026-07-28—and what did not
The 2026-07-28 MCP release retires the initialize/initialized exchange and the Mcp-Session-Id header. Protocol version, client information, and client capabilities move to per-request metadata. A client that wants to discover server capabilities in advance can use the discovery RPC described by the current specification. Follow that version’s exact metadata and HTTP header requirements rather than carrying forward an older request format.
This is a version boundary, not a timeless description of MCP. The 2025-11-25 Streamable HTTP transport specification described a different flow: during initialization, a server could assign an MCP-Session-Id, which a client then returned on later requests. Do not combine that older session-header flow with the 2026-07-28 stateless flow. Before changing a client, server, or harness, confirm which protocol version each actually implements.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #2
| Question | 2025-11-25 Streamable HTTP flow | 2026-07-28 MCP specification |
|---|---|---|
| Where does protocol continuity come from? | The server could assign an MCP-Session-Id at initialization for the client to return on subsequent requests. |
Each request carries its protocol context; the server must not infer it from an earlier request, connection, or process. |
| What happened to initialization? | The transport described the initialization and session-header flow. | The initialize/initialized exchange and Mcp-Session-Id header are retired. |
| Can application workflows still span requests? | Yes, subject to the application’s design. | Yes. Keep workflow state in the application and pass an explicit reference where needed; it is not an MCP session object. |
| What does this imply for routing? | Session-based deployments could depend on session continuity or a way to access session state. | The project announcement says requests can be routed to any server instance without protocol-level sticky sessions or a shared session store. |
The comparison describes these two specified versions; it is not a claim that every deployed client or server has already migrated.
Why hidden state can break a harness
A harness that quietly expects “the next call will reach the same process” can behave differently under ordinary operational events. A retry may arrive after the original process exits; load balancing may route a request to a different instance; two tasks may interleave calls; or a workflow may resume in a new runtime. Under the 2026-07-28 rule, the server cannot safely reconstruct protocol context from the connection history. If the application also kept its only copy of workflow state in process memory, the work may be impossible to resume.
These are conditional failure modes, not evidence that MCP statefulness causes agents to crash in general. The specification and project announcement do not establish a crash rate or a measured reliability improvement from statelessness. Stateless requests remove a protocol-level dependency on connection affinity; they do not by themselves guarantee durable application state, correct retries, or a crash-free agent.
Design workflow state as an explicit application concern
Return a handle for work that spans calls
When one tool call creates state that another needs, return an application-defined handle and have the client include it in each relevant later call. The model can see and carry that value, as the MCP project announcement emphasizes. Because the handle is application-defined, the server must decide how to validate it, who may use it, how long it remains valid, how it is persisted, and how it is cleaned up. SEP-2567 describes the explicit-handle approach but does not define a wire-level handle method or type.
- Make the handle stable enough for the workflow’s intended lifetime.
- Check ownership and authorization; possession of an identifier should not grant access unless the application deliberately designs it that way.
- Define behavior for expired, malformed, unknown, or unauthorized handles.
- Decide how state is persisted and removed, including what happens after a server restart.
Make retries and side effects deliberate
Independently routed requests and retrying clients make duplicate-call behavior an important engineering decision. For a tool that changes external state, use stable operation identifiers or another deliberate deduplication strategy where appropriate, and define what a repeated call means. This is a harness-design recommendation, not a separate MCP requirement. A stateless protocol request can still trigger a state-changing application operation.
Keep each lifetime separate
Document where protocol metadata, process-local data, agent-task data, and durable workflow state live. A long-running stdio child process is not automatically a durable workflow store; an HTTP connection is not a conversation identifier; and an agent runtime’s session is not an MCP transport session. This separation makes recovery choices visible instead of leaving them implicit in deployment behavior.
Rank #4
Build a Zsh execution boundary that preserves failures
Zsh’s official 5.9.2 manual, updated July 12, 2026, notes that Zsh can emulate POSIX shells but its default mode is not POSIX-compatible. If a script uses Zsh syntax, invoke Zsh explicitly and test it under the same invocation mode used in deployment. Do not assume that running it under /bin/sh has the same behavior.
A small wrapper can preserve the child command’s exit status while leaving its standard output and standard error separate. It accepts an executable and arguments as positional parameters, rather than building a command string for eval.
#!/usr/bin/env zsh
cleanup() {
local rc=$?
trap - EXIT
# Release wrapper-owned resources here.
# Do not replace rc with a cleanup command's status.
exit "$rc"
}
trap cleanup EXIT
if (( $# == 0 )); then
print -u2 -- "usage: harness.zsh command [argument ...]"
exit 64
fi
"$@"
rc=$?
exit "$rc"
Save it as harness.zsh, make it executable if you plan to invoke it directly, and pass the tool command and its arguments separately—for example, ./harness.zsh /path/to/tool --mode check. The wrapper does not implement MCP request formatting, retries, or durable workflow storage; those belong in the client and application design. Child diagnostics remain on standard error, leaving standard output available to a caller that expects machine-readable output.
Handle Zsh statuses and traps intentionally
The Zsh manual documents status 127 when a command cannot be found, and 126 when a file cannot be executed or certain executable formats are unrecognized. These are useful distinctions: a missing tool is not the same launch problem as a present but unexecutable one. Avoid converting every launch failure into an indistinguishable generic retry.
Zsh’s TRAPZERR runs for many nonzero statuses but has exceptions, including commands in sublists that end in && or ||. TRAPEXIT runs at shell exit and receives the exit status in $? at the start of trap execution. Signal traps also have their own return-status behavior. Capture the original status before cleanup, as the wrapper does, and test the exact interruption and cleanup paths you deploy rather than assuming a Bash trap recipe behaves identically in Zsh.
A migration and reliability checklist
- Confirm the protocol version. Check what the client and server actually implement before changing initialization, headers, or metadata.
- Use the matching request rules. For the 2026-07-28 specification, carry required protocol context in each request and follow its current HTTP requirements; do not depend on prior requests or connection identity.
- Move workflow continuity into the application. Return and pass explicit handles for state that must survive across tool calls, and define authorization, expiry, persistence, and invalid-handle behavior.
- Review side-effecting retries. Decide what duplicate calls do and how the application identifies repeated operations.
- Make process outcomes visible. Distinguish cancellation, child-process termination, malformed output, unavailable tools, and nonzero exits. Log diagnostics to the appropriate channel and preserve the child’s status during cleanup.
- Test the deployed shell mode. Exercise missing and unexecutable commands, normal success, nonzero child status, interruption, and cleanup with the same Zsh invocation used in production.
The version facts here are based on the MCP project’s 2026-07-28 specification and announcement, the 2025-11-25 Streamable HTTP specification for the older flow, SEP-2567 for explicit application handles, the OpenAI Agents API architecture guide for the hosted harness concept, and the Zsh 5.9.2 manual. Protocol and shell details can change, so use the version-specific official documentation for the implementation you deploy.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchQuick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

