# Tutorial

> Source: <https://promptcube3.com/en/threads/5134/>
> Published: 2026-08-05 16:01:02+00:00

# Tutorial

[MCP](/en/tags/mcp/)spec just removed every long-standing architectural constraint that made stateless deployment painful. The handshake is gone. Sessions are gone. Three features are deprecated. And what's left is the cleanest prompt engineering workflow I've seen for building LLM agent tooling at scale.

I spent the last few days porting a personal MCP server to the new TypeScript SDK v2 and shipping it on Cloudflare Workers. Here's the breakdown of what changed, how the build actually works, and the deployment path I used.

## Why This Spec Change Matters for Deployment

Before the 2026-07-28 update, MCP servers required a sticky `initialize`

/ `initialized`

exchange and a session ID header. That killed round-robin load balancing, made autoscaling a nightmare, and prevented any kind of caching layer from sitting in front of your server. Every request had to hit the same instance.

Now? Every request is self-describing. It carries its own protocol version, client identity, and capabilities inside `_meta`

. A bare POST to any server instance is a complete conversation. No shared session state. No stream to hold open.

This is the stateless core that makes the whole deployment story simple: your MCP server is just a regular HTTP service now.

## The Feature That Changed My Mind: MRTR

Multi Round-Trip Requests (MRTR) solve a problem I ran into constantly with the old spec. When a tool needed user confirmation or a missing parameter mid-call, the server had to push an `elicitation/create`

request over a held-open stream. That meant stateful connections, which is the opposite of what you want on production infrastructure.

With MRTR, the server returns `resultType: "input_required"`

with the questions it needs, then closes the connection cleanly. The client collects answers and retries the original call with them attached, plus an opaque `requestState`

token so the server knows exactly where it left off. No open streams, no sessions, no sticky routing. Interactive tools on fully stateless infra — that's a real win for prompt engineering workflows.

There's a graceful fallback path too: if a client doesn't speak MRTR yet, the server can detect that and fall back to the old elicitation behavior. Given how many clients are still on pre-spec versions, this compatibility layer is essential and the SDK v2 handles it out of the box.

## Other Notable Additions

**Header-based routing**—`Mcp-Method`

and`Mcp-Name`

HTTP headers let your gateway, rate limiter, or WAF route and meter requests without parsing JSON bodies. Huge for production monitoring.**Cacheable tool lists**—`tools/list`

,`prompts/list`

,`resources/list`

, and`resources/read`

now carry`ttlMs`

and`cacheScope`

fields, modeled on HTTP Cache-Control. Clients cache your catalog instead of re-fetching on every connection.**Extensions framework**— Tasks moved into an official extension (`io.modelcontextprotocol/tasks`

), and you can build your own. MCP Apps and Enterprise Managed Authorization live there too.**Deprecations**— Roots, Sampling, and Logging are deprecated but keep working for at least 12 months. Plan your migration accordingly.

## The Build and Deploy Pipeline

I used the new TypeScript SDK v2 (the old `@modelcontextprotocol/sdk`

package is now v1) to scaffold the server in minutes. The stateless design meant I could test locally with raw curl and a lightweight client, then deploy to Cloudflare Workers on the free tier with zero configuration changes. The same code ran locally and in production without any environment-specific hacks — that's the kind of consistency that makes prompt engineering iteration fast.

The entire deployment took less time than my previous attempts with session-based architectures, and the cost was literally zero on Cloudflare's free plan. For anyone building LLM agent tooling who's been held back by MCP's old stateful constraints, this spec update removes the blocker entirely.

[Next popover hell →](/en/threads/5012/)

[these AI tool field notes](https://tanyan888.com/), with plenty of directly applicable cases.

## All Replies （0）

No replies yet — be the first!
