2025年版サーバの移行

読了まで約75 分分、9 節 節の 6 例 例。

第2026.11.14版 2026年11月19日時点で例が通過 70 例中 70 例が合格 変更点

AIによる翻訳。英語版は人による検証済みである。 当社の書籍の作り方

英語版の書籍(版2026.11.14)から翻訳した。 原文を読む

この章を読み終えると、2025年のリビジョンと Python SDK の 1.x 系向けに書かれた Model Context Protocol サーバを、リビジョン 2026-07-28 の仕様と mcp 2.3.0 に移せるようになる。移行先についての主張は、このリビジョンと SDK バージョンで成り立つものである。ここでは、サーバが何に依存しているかを調べ、セッションを取り除き、HTTP+SSE トランスポートから移し、サンプリング、ルート、ログ、動的クライアント登録を置き換え、コードを移植する。さらに、古いクライアントが残っている間、新旧両方の世代のクライアントに応答する方法も扱う。

これまでの各章は、本書が扱う唯一の事例であるショップのサーバを、固定したリビジョン向けの shop-support として最初から組み立ててきた。しかし、多くのチームはそこから始めるわけではない。彼らが持っているのは、2025年のチームがリビジョン 2025-03-26 から 2025-11-25 に対して SDK 1.x で書いたサーバと、それらのリビジョンをいまも使うホストである。この章は、2025年のプロトコルを教える唯一の章であり、それも移行元としてのみ扱う。

それらのリビジョンから固定したリビジョンまでの間に、Model Context Protocol (MCP) は、initialize ハンドシェイクとプロトコルセッションを廃止し、サーバが呼び出しの途中でクライアントへ送るリクエストを廃止し、5つの機能と1つのサンプリングフィールドの2つの値を非推奨にした(変更履歴)。ショップの2025年版サーバは、これらのリビジョンで廃止または非推奨となった機能の大半を使っている。次のリストは、チームが mcp==1.30.0 向けに書いたとおりのそのサーバである。

"""shop-support as a 2025-era team wrote it, for SDK 1.x and revisions up to 2025-11-25."""
import os

from mcp.server.fastmcp import Context, FastMCP
from mcp.server.session import ServerSession
from mcp.types import SamplingMessage, TextContent
from pydantic import BaseModel

import shop_calls                                   # the shop's API, as chapter 3 calls it; not shown

server = FastMCP("shop-support", "Answers the support team's questions about orders, refunds and stock.",
                 port=8000, stateless_http=False)
quotes: dict[ServerSession, dict] = {}              # each connection's open quote

class Release(BaseModel):
    release: bool

@server.tool()
async def quote_refund(order_id: str, ctx: Context) -> dict:
    quotes[ctx.session] = quote = shop_calls.quote(order_id)
    await ctx.info(f"quoted {quote['amount']} for {order_id}")
    return quote

@server.tool()
async def issue_refund(ctx: Context) -> dict:
    quote = quotes.pop(ctx.session)                 # the quote this connection made last
    if not quote["within_limit"]:
        answer = await ctx.elicit(f"Refund {quote['amount']}? It is above the policy limit.", Release)
        if answer.action != "accept" or not answer.data.release:
            return shop_calls.hold(quote)
    return shop_calls.refund(quote)

@server.tool()
async def triage_ticket(text: str, ctx: Context) -> str:
    reply = await ctx.session.create_message(
        [SamplingMessage(role="user", content=TextContent(type="text", text=text))],
        max_tokens=20, system_prompt="Name the one shop tool this ticket needs.")
    return reply.content.text

@server.tool()
async def save_restock_report(ctx: Context) -> str:
    folder = (await ctx.session.list_roots()).roots[0].uri.path
    return shop_calls.write_restock_report(folder)

server.run(transport="sse" if os.environ.get("SHOP_OLD_HOSTS") else "streamable-http")   # HTTP+SSE: the 2024 transport

このリストは2025年版のショップサーバである。この章用の共有モジュール lib.legacy が、ホストの OAuth 設定と各依存関係を見つけるための規則とともに、これをテキストとして保持している。リストは表示して走査するだけで、実行しない。SDK 1.x と SDK 2.x はどちらも mcp ディストリビューションなので、1つの環境にはどちらか一方しか入れられず、例の環境は 2.x に固定されている。そのため、どの例も、移植後のサーバを 2.x 上で実行するか、リストを読むかのどちらかである。shop_calls は、第3章のツールが行うショップの API 呼び出しを表すもので、リストには示されていない。

この部分はまだ翻訳されていないため、英語で表示している。

Inventory what the old server depends on

最終変更:版2026.11.14

A migration starts with a list, because the pinned revision treats each old feature in one of three ways, and each way sets its own deadline. The first group was removed at revision 2026-07-28, with no window: the initialize handshake, protocol sessions and the Mcp-Session-Id header, requests a server sends to the client in the middle of a call, whatever they ask for, the HTTP GET stream, resources/subscribe, ping, logging/setLevel and stream resumability (changelog). A client at the pinned revision never uses any of them, so code that depends on one fails for that client the first time it runs.

The second group is deprecated: roots, sampling, logging, the HTTP+SSE transport and Dynamic Client Registration. The changelog says that roots, sampling and logging stay "fully functional during the deprecation window" (same source), and the specification's registry gives each deprecated feature a migration path and an earliest removal (deprecated features). An earliest removal is the date when a feature becomes eligible to go, not when it goes. Removal is a decision the core maintainers make when they prepare a revision, so a feature may stay deprecated much longer (feature lifecycle). The window runs at least twelve months from the release of the revision that first marks the feature deprecated, and it can be cut to ninety days for an active security risk, so the windows differ from feature to feature. Dropping a feature from the specification doesn't oblige an SDK to drop it, because each SDK's own policy decides (same source).

The third kind isn't a protocol change at all. SDK 2.x renamed and moved parts of the 1.x API, so a 1.x server fails to start on 2.x even where the protocol didn't change (migration guide).

We parse the server listing in this chapter and the host's OAuth setup, shown in Replace dynamic client registration, with Python's ast module, and match each node against lib.legacy.RULES. Each rule names a dependency, its status at the pinned revision, its replacement and, for a deprecated feature, the registry's earliest removal. The scan then prints them grouped by status, with the function each one sits in.

scan-a-2025-server.py Python 3.12.15 合格
"""Sorts the 2025-era server's dependencies, and its host's OAuth setup, into removed, deprecated and SDK changes, eachwith its replacement. The prose's point, that removed dependencies fail for every client at the pinned revision, rests on the first group'scount and the functions it names."""import astfrom lib import legacyfound: dict[str, list[str]] = {rule.feature: [] for rule in legacy.RULES}def where(tree: ast.Module, node: ast.AST, listing: str) -> str:    """The function a node sits in, or the listing's setup when it sits in none."""    for function in ast.walk(tree):        if isinstance(function, ast.AsyncFunctionDef | ast.FunctionDef) and node in ast.walk(function):            return function.name    return f"{listing} setup"                # module-level code, outside every functionfor listing, source in legacy.LISTINGS.items():    tree = ast.parse(source)                   # parsed, never run: SDK 1.x can't install beside 2.x    for node in ast.walk(tree):        for rule in legacy.RULES:            # each function is listed once per feature, however many of its nodes match            if rule.matches(node) and where(tree, node, listing) not in found[rule.feature]:                found[rule.feature].append(where(tree, node, listing))print("written for:", legacy.WRITTEN_FOR)for kind in ("removed", "deprecated", "sdk"):    rules = [rule for rule in legacy.RULES if rule.kind == kind and found[rule.feature]]   # a rule with no match is left out    print(f"{kind} dependencies:", len(rules))    for rule in rules:        print(f"  {rule.feature}: {', '.join(found[rule.feature])} -> {rule.replacement}")        if rule.removal:                          # only deprecated features have a removal date            print(f"  {rule.feature} earliest removal: {rule.removal}")
出力python scan-a-2025-server.py
written for: mcp==1.30.0
removed dependencies: 2
  sessions: server setup, quote_refund, issue_refund -> a handle the server mints, passed back as a tool argument
  pushed requests: triage_ticket, issue_refund, save_restock_report -> an input request in a Multi Round-Trip Request
deprecated dependencies: 5
  sampling: triage_ticket -> a model call the host or the server makes itself
  sampling earliest removal: first revision released on or after 2027-07-28
  roots: save_restock_report -> a tool parameter, a resource URI or server configuration
  roots earliest removal: first revision released on or after 2027-07-28
  logging: quote_refund -> stderr on stdio, or OpenTelemetry
  logging earliest removal: first revision released on or after 2027-07-28
  HTTP+SSE transport: server setup -> Streamable HTTP
  HTTP+SSE transport earliest removal: three months after SEP-2596 reaches Final
  dynamic client registration: host setup -> a Client ID Metadata Document
  dynamic client registration earliest removal: first revision released on or after 2027-07-28
sdk dependencies: 3
  FastMCP: server setup -> mcp.server.mcpserver.MCPServer
  positional instructions: server setup -> instructions= by keyword
  transport settings on the constructor: server setup -> arguments to run() or streamable_http_app()

The removed ones come first, because they fail for every client at the pinned revision. The scan found 2 removed dependencies, 5 deprecated ones and 3 SDK changes. The removed dependencies are the sessions that quote_refund and issue_refund share, and the requests that three tools push in the middle of a call: ctx.elicit in issue_refund, create_message in triage_ticket and list_roots in save_restock_report.

So sampling and roots are on both lists. As features they are deprecated, and they keep working through their window: for a 2025-era client as written, and for a client at the pinned revision only when the server asks for them through a round trip, as Replace sampling, roots and logging shows. Pushed mid-call, they fail for that client as ctx.elicit does, with SDK 2.3.0 raising NoBackChannelError (mcp/server/_streamable_http_modern.py). Of sampling, roots and logging, only logging works as written for a client at the pinned revision, and only for a request whose _meta asks for a log level. For any other request the SDK drops the line (mcp/server/connection.py).

Four of the deprecated features share one earliest removal, the first revision released on or after 2027-07-28. The HTTP+SSE transport's date is different, and Move from HTTP+SSE to Streamable HTTP gives it.

The SDK at 2.3.0 doesn't warn about all of these either. Its sampling, roots and logging APIs emit MCPDeprecationWarning, a UserWarning that prints by default (what's new). Its HTTP+SSE app and client and its registration code carry no deprecation marker: we searched mcp/server/sse.py, mcp/client/sse.py, mcp/server/auth/handlers/register.py and mcp/client/auth/oauth2.py for "deprecat" and found nothing. A server can run on 2.x without a single warning and still depend on two deprecated features.

Working rule: Inventory before you change anything, and sort the list by status. Fix every removed dependency before you let a client at the pinned revision connect, because there is no window for it, and count every request the server pushes mid-call as removed, even when the feature it asks for is only deprecated. Give each deprecated one a date of your own, earlier than the registry's earliest removal, and don't wait for warnings: run a scan like this one in CI, because the SDK is silent about some deprecated features.

initialize とセッション ID を取り除く

最終変更:版2026.11.11

旧サーバーが依存しているものを洗い出すの調査では、最初にセッションを挙げた。2025 年版の仕様では、接続は initialize で始まり、Streamable HTTP サーバーは応答の中でセッション ID を割り当てることができた。クライアントはその後、すべてのリクエストで Mcp-Session-Id を送り、サーバーが 404 を返したときは新しいセッションを開始し、DELETE でセッションを終了しなければならなかった(2025-11-25 のトランスポート)。サーバーはセッションごとに好きなものを保持できた。

固定した版では、ハンドシェイクとセッションが取り除かれている。各リクエストは、プロトコルのバージョンとクライアントの機能を _meta に載せて送る。クライアントは、サーバーが何に対応しているかを、すべてのサーバーが実装しなければならない(MUST)server/discover で尋ねる。呼び出しをまたいで状態を必要とするサーバーは、明示的なハンドルを発行し、クライアントにそれを通常のツール引数として返送させる(変更履歴)。_meta のキーについては、すべてのリクエストでバージョンと機能を送るに示している。

2025 年版時代のサーバーは、セッションごとに 1 つの状態を保持していた。quote_refund は見積もりを ctx.session に保存する。これは接続を表す SDK のオブジェクトである。issue_refund は引数を取らず、その接続が最後に作成した見積もりを返金する。SDK 1.x では 1 つの接続のすべてのリクエストに 1 つのオブジェクトが対応するため(1.x の mcp/server/lowlevel/server.py)、この方式は動作していた。ここでは第 3 章の見積もり関数と返金関数を囲む形で、2 つのツールを変更せずに 2.x へ移し、固定した版で 1 つのクライアントから各ツールを 1 回ずつ呼び出す。続いて、第 3 章のサーバーを同じ方法で呼び出す。そのサーバーでは、quote_refund が quote_id を返し、issue_refund がそれを受け取る。

stateless-after-migration.py Python 3.12.15 · cryptography 50.0.2 · httpx2 2.16.2 · jsonschema 4.26.0 · mcp 2.3.0 · mcp-types 2.3.0 · pydantic 2.14.3 · starlette 1.10.0 · uvicorn 0.54.0 合格
"""Ports the 2025 server's per-connection quote to SDK 2.x unchanged, then with the handle the pinned revision asks for.The prose's point rests on the session-keyed failure, the count of session objects, and the handle's refund line."""import asyncioimport osfrom mcp import Clientfrom mcp.server.mcpserver import Context, MCPServerfrom mcp.server.mcpserver.exceptions import ToolErrorfrom lib import confirmations, loopback, shop_api, shop_toolschapter3 = confirmations.chapter3_tools()          # quote_refund and issue_refund from lib.shop_toolsserver = MCPServer("shop-support", version="0.12.0")quotes = {}                                        # the 2025 code: each connection's open quote, by its sessionsessions_seen = set()@server.tool(description="Quote a refund for a whole order, for issue_refund to refund.")def quote_refund(order_id: str, ctx: Context) -> str:    sessions_seen.add(id(ctx.session))       # each request gets its own session object at the pinned revision    quotes[ctx.session] = chapter3["quote_refund"].fn(order_id, sku="KG-1050")   # chapter 3's quote needs a SKU; the port pins one    return f"Quoted {quotes[ctx.session].amount}."@server.tool(description="Refund the quote this connection made last.")def issue_refund(ctx: Context) -> shop_tools.Refund:    sessions_seen.add(id(ctx.session))    if ctx.session not in quotes:        raise ToolError("There is no open quote in this session. Call quote_refund first.")    return chapter3["issue_refund"].fn(quotes.pop(ctx.session).quote_id)   # pop: a quote is used onceasync def main() -> None:    with loopback.serve(shop_api.create_app()) as api_url:        os.environ.update(shop_api.server_env(api_url))      # both servers run in this process        with loopback.serve(server.streamable_http_app()) as old, \             loopback.serve(shop_tools.create_server().streamable_http_app()) as new:            async with Client(old + "/mcp") as client:                await client.call_tool("quote_refund", {"order_id": "O-2415"})                print("session-keyed issue_refund:", (await client.call_tool("issue_refund", {})).content[0].text)                print("session objects in two calls:", len(sessions_seen))            async with Client(new + "/mcp") as client:                quote = await client.call_tool("quote_refund", {"order_id": "O-2415", "sku": "KG-1050"})                refund = await client.call_tool("issue_refund", {"quote_id": quote.structured_content["quote_id"]})                print("handle issue_refund:", refund.structured_content["status"], refund.structured_content["amount"])asyncio.run(main())
出力python stateless-after-migration.py
session-keyed issue_refund: Error executing tool issue_refund: There is no open quote in this session. Call quote_refund first.
session objects in two calls: 2
handle issue_refund: requested 23.98

変更せずに実行した移植版は、2 回目の呼び出しで失敗した。「Error executing tool issue_refund: There is no open quote in this session. Call quote_refund first.」と表示された。2 回の呼び出しは 1 つのクライアントから 1 つのプロセスに対して行われたが、見えたセッションオブジェクトは 2 個の異なるものだった。固定した版にはセッションが属する接続が存在しないため、SDK はリクエストごとに別のオブジェクトを与える。見積もりを保存した時点では何も失敗せず、バグは何かがそれを読み戻したときに初めて現れる。Mcp-Session-Id ヘッダーをキーとして状態を保持するサーバーは、さらに悪い結果になる。固定した版ではどのクライアントもこのヘッダーを送らないため、すべてのクライアントの状態が同じキー None の下に入ってしまう。

ハンドルを使うと、返金は成功した。requested 23.98。これは、エンドポイントではなくタスクを中心にツールを設計するが第 3 章のために選んだ設計である。こうしたハンドルについて仕様が示す指針は、ハンドルを不透明にして有効期限を設けること、そして認証を備えたサーバーは呼び出しのたびにハンドルに対する呼び出し元の認可を確認することである(ツール)。サーバーが混乱した代理人として振る舞うのを防ぐでは、店の見積もり ID を、それが発行された顧客に結び付ける。1 つのプロセスのメモリ内にあるハンドルは、そのプロセスとともに失われる。したがって、サーバーをレプリカとして動かす場合は、スティッキーセッションなしでレプリカを動かすが SQLite で行っているように、ハンドルを共有ストレージに置く。

実践ルール: 旧サーバーを検索し、セッション、そのセッション ID、接続ごとに保存されているものをすべて見つけ、それぞれの状態を、あるツールが返し次のツールが引数として受け取るハンドルに置き換える。ハンドルは不透明にし、作成するツールの説明に明記した有効期限を持たせ、呼び出しのたびに呼び出し元がそれを使ってよいかを確認し、すべてのレプリカが読める場所に保存する。後の呼び出しが必要とするものを、セッションをキーとする辞書に入れてはならない。まだセッションを持つ 2025 年版時代のクライアントに対しても同様である。

HTTP+SSE から Streamable HTTP への移行

最終変更:版2026.11.11

initialize とセッション ID の削除で扱ったセッションは、Streamable HTTP の 2025 年版の形式に属するものである。ショップの 2025 年当時のサーバーには、もう一つの古いトランスポートが残っている。SHOP_OLD_HOSTS が設定されている場合、サーバーの最後の行がこの HTTP+SSE を提供する。HTTP+SSE は、リビジョン 2025-03-26 が置き換えたトランスポートである。このトランスポートでは、クライアントは一つのエンドポイントでイベントストリームを開いたままにし、メッセージはもう一つのエンドポイントへ POST する(Streamable HTTP)。SDK 1.x はこの二つを /sse と /messages/ で提供する(1.x では mcp/server/fastmcp/server.py)。リビジョン 2025-03-26 はこれに代えて Streamable HTTP を採用した(2025-03-26 changelog)。本書が固定しているリビジョンでは、このトランスポートがライフサイクルポリシーの対象となり、その期間はより短い(changelog)。

サーバー側では、この移行は削除で済む。移植後のショップのサーバーは、stdio から HTTP へのサーバーの移行と同様に、一つのエンドポイントで streamable_http_app()、または run(transport="streamable-http") を提供する。ツールには何も変更がない。固定したリビジョンで HTTP 接続するクライアントはすべて Streamable HTTP を使うので、トランスポートそのものが妨げになることはない。古いトランスポートをいつ外せるかを決めるのは、いまも HTTP+SSE で接続しているホストであり、それらは定義上 2025 年当時のクライアントである。

これらのホストには二つの道がある。それらのホストを引き続きサポートしなければならないサーバーは、Streamable HTTP のエンドポイントと並べて、古い SSE エンドポイントと POST エンドポイントをホストできる。仕様はリビジョン 2025-03-26 以降これを認めている(Streamable HTTP)。SDK 2.3.0 にはなお MCPServer.sse_app() があり、パスは 1.x と同じ二つである。run(transport="sse") も使える(mcp/server/mcpserver/server.py)。古いサーバーが依存するものの棚卸しで確認したとおり、どちらも非推奨警告を出さない。もう一つの道は、ホストが Streamable HTTP へ移ることである。SDK 1.x のクライアントはすでにこれに対応している(1.x では mcp/client/streamable_http.py)。

レジストリが示す HTTP+SSE の最短の削除時期は three months after SEP-2596 reaches Final であり、すでに過ぎている可能性がある。ただし、その日に SDK が sse_app() を削除するという意味ではない。各 SDK が自ら判断するからである(feature lifecycle)。このトランスポートは、SEP-2596 がライフサイクルポリシーを定めた時点で、すでに 1 年以上非推奨だった。そのため猶予期間は 12 か月ではなく 3 か月とされ、提案のページでは日付なしで Final と記されている。この日付が意味するのは、ホストが次のリビジョンまでこのトランスポートが残ると当てにできないということであり、あなたも同様である。

ショップのサポートチームは期日を決めた。古いエンドポイントは、サーバーのログに /sse へ接続するホストが記録されている間だけ残す。チームはそうした各ホストの所有者に、エンドポイントを削除する日を伝える。その日までに移行できないホストは、古いサーバーの 1.x のデプロイに対して SDK 1.x のままとどまることができる。これについてはSDK 1.x から 2.x へのコードの移植で扱う。

実践ルール: ログに HTTP+SSE をなお使うホストが見当たらない限り、サーバーの HTTP+SSE トランスポートは移植せず削除する。使うホストがある場合は、Streamable HTTP のエンドポイントと並べて古いエンドポイントを提供し、それらへのすべての接続をクライアントごとにログに記録し、削除の期日を定めて各ホストの所有者に伝える。このトランスポートは、期間が 12 か月ではなく 3 か月だったので、すでに削除の対象になっているものとして扱う。

この部分はまだ翻訳されていないため、英語で表示している。

Replace sampling, roots and logging

最終変更:版2026.11.11

Three of the dependencies that Inventory what the old server depends on found have two changes stacked on them, and it pays to keep them apart. The first is a mechanism. A 2025 server sent its own request to the client in the middle of a call (elicitation/create, sampling/createMessage, roots/list) and waited for the answer. The pinned revision says that pattern "is no longer supported" and that this is a breaking change. A server asks through a Multi Round-Trip Request instead, returning an input request whose values may be an ElicitRequest, a CreateMessageRequest or a ListRootsRequest (Multi Round-Trip Requests). The second is the features themselves. Roots, sampling and logging are deprecated, with migration paths in the registry: roots to tool parameters, resource URIs or server configuration; sampling to integrating with a model provider's API directly; logging to stderr on stdio, or OpenTelemetry (deprecated features).

So a Multi Round-Trip Request replaces the push, not sampling. A server that moves its sampling/createMessage into an input request still depends on a deprecated feature. Elicitation is the one of the three that isn't deprecated, so it is the only one worth moving into the round trip and keeping.

The 2025-era issue_refund pushes its confirmation with ctx.elicit, which fails at the pinned revision, as See why a stateless server can't wait for an answer showed. The port asks with a resolver. A parameter declared Annotated[Release, Resolve(confirm)] is filled by running confirm before the tool, and when confirm returns Elicit(...), the SDK asks the person at the host (Ask for structured input with elicitation). confirm asks only when the shop's API holds the refund for confirmation. We quote order O-2289, whose refund is above the policy's limit, call issue_refund once by hand to see the first round, and then let Client run the rounds with the scripted lead from chapter 5, who says yes.

replace-pushed-requests.py Python 3.12.15 · cryptography 50.0.2 · httpx2 2.16.2 · jsonschema 4.26.0 · mcp 2.3.0 · mcp-types 2.3.0 · pydantic 2.14.3 · starlette 1.10.0 · uvicorn 0.54.0 合格
"""Ports the 2025 server's pushed confirmation to a resolver that serves both eras, and its log line to stderr. The prose'spoint rests on the first round's result and the question it asks, and the refund's status after the lead's yes."""import asyncioimport loggingimport osfrom typing import Annotatedfrom mcp import Clientfrom mcp.server.mcpserver import Elicit, Resolvefrom pydantic import BaseModelfrom lib import confirmations, loopback, shop_api, shop_toolsserver, held = confirmations.shop_server(version="0.12.0")   # chapter 3's other tools; held is its issue_refundlog = logging.getLogger("shop-support")                       # to stderr, not to the clientclass Release(BaseModel):    release: booldef confirm(quote_id: confirmations.QuoteId) -> Elicit[Release] | Release:    refund = held.fn(quote_id)                                # the same quote always gives the same refund    if refund.status != "needs_confirmation":        return Release(release=False)                         # nothing held, so nothing to ask    # returning Elicit asks the person at the host; the SDK sends the question in the client's form    return Elicit(f"Refund {refund.amount} on order {refund.order_id}? It is above the policy limit.", Release)@server.tool(description=shop_tools.DESCRIPTIONS["issue_refund"], annotations=held.annotations)def issue_refund(quote_id: confirmations.QuoteId, answer: Annotated[Release, Resolve(confirm)]) -> shop_tools.Refund:    refund = held.fn(quote_id)    if refund.status == "needs_confirmation" and answer.release:        refund = confirmations.release(refund)    log.info("refund %s is %s", refund.refund_id, refund.status)    return refundasync def main() -> None:    with loopback.serve(shop_api.create_app()) as api_url:        os.environ.update(shop_api.server_env(api_url))      # the server runs in this process        with loopback.serve(server.streamable_http_app()) as url:            async with Client(url + "/mcp", elicitation_callback=confirmations.say_yes) as client:                quote = (await client.call_tool("quote_refund", {"order_id": "O-2289"})).structured_content                first = await client.session.call_tool("issue_refund", {"quote_id": quote["quote_id"]},                                                        allow_input_required=True)   # returns the input request, not an answer                print("first round:", first.result_type)                print("first round asks:", ", ".join(r.method for r in first.input_requests.values()))                refund = await client.call_tool("issue_refund", {"quote_id": quote["quote_id"]})   # Client answers with the lead's yes                print("refund after the lead's yes:", refund.structured_content["status"])asyncio.run(main())
出力python replace-pushed-requests.py
first round: input_required
first round asks: elicitation/create
refund after the lead's yes: requested

The first round came back as input_required, with one question, elicitation/create: the same request the 2025 server pushed, carried in a result instead. After the lead's yes, the refund's status was requested. The resolver also works for 2025-era clients, because the SDK sends its questions in whichever form the client's revision uses (mcp/server/mcpserver/resolve.py). Serve old and new clients through the window runs both.

The port's log line uses Python's logging, not ctx.info. MCPServer configures logging to stderr when it is built (mcp/server/mcpserver/utilities/logging.py), so the line goes to the server's own logs and never to the client. On stdio, stdout carries only the protocol's messages, and stderr is where a server's logs belong (stdio). Trace calls with OpenTelemetry covers the other path.

Sampling goes entirely. The 2025-era triage_ticket asked the host's model, through sampling, which tool a ticket needs, and the port deletes that tool. The host's own model already reads every ticket and picks the tools (Work through the ticket queue), so the server was asking the host to do what the host does anyway. A server that needs a model for its own work calls a model provider with its own credentials, which also lets it choose and pay for the model.

save_restock_report asked the client for its roots and wrote to the first one. Its port takes the folder as a parameter and checks it against the folders the server's configuration allows, in SHOP_EXPORT_DIRS, after resolving the path, so that .. can't climb out.

roots-to-a-parameter.py Python 3.12.15 · cryptography 50.0.2 · httpx2 2.16.2 · jsonschema 4.26.0 · mcp 2.3.0 · mcp-types 2.3.0 · pydantic 2.14.3 · starlette 1.10.0 · uvicorn 0.54.0 合格
"""Replaces the 2025 server's roots with a folder parameter that the server checks against its own allow-list. The prose'spoint rests on the two export lines: the allowed folder saves, and the path that climbs out is refused."""import asyncioimport osfrom pathlib import Pathfrom mcp import Clientfrom mcp.server.mcpserver import MCPServerfrom mcp.server.mcpserver.exceptions import ToolErrorfrom lib import loopback, restock, shop_apiserver = MCPServer("shop-support", version="0.12.0")EXPORT_DIRS = [Path(d).resolve() for d in os.environ.get("SHOP_EXPORT_DIRS", "exports").split(",")]   # the allow-list; a relative entry resolves from the working directory@server.tool(description="Recount stock and save the restock report as CSV in export_dir, a folder the server allows.")async def save_restock_report(export_dir: str) -> str:    folder = Path(export_dir).resolve()                  # "exports/../private" resolves outside exports    if folder not in EXPORT_DIRS:            # an exact match, so a subfolder of an allowed folder is refused too        raise ToolError(f"{export_dir} isn't an export folder. Use one of: {', '.join(d.name for d in EXPORT_DIRS)}.")    report = await restock.run(below=30, seconds=0)   # reports SKUs under 30 units; seconds=0 skips the per-SKU wait    folder.mkdir(exist_ok=True)    (folder / "restock.csv").write_text("sku,units\n" + "".join(f"{r.sku},{r.units}\n" for r in report.reorder))    return f"Saved {len(report.reorder)} products to reorder in {export_dir}/restock.csv."async def main() -> None:    with loopback.serve(shop_api.create_app()) as api_url:        os.environ.update(shop_api.server_env(api_url))      # the server runs in this process        async with Client(server) as client:            for folder in ("exports", "exports/../private"):                saved = await client.call_tool("save_restock_report", {"export_dir": folder})                print(f"export to {folder}:", saved.content[0].text)asyncio.run(main())
出力python roots-to-a-parameter.py
export to exports: Saved 5 products to reorder in exports/restock.csv.
export to exports/../private: Error executing tool save_restock_report: exports/../private isn't an export folder. Use one of: exports.

The allowed folder worked: "Saved 5 products to reorder in exports/restock.csv." The path that climbs out did not: "Error executing tool save_restock_report: exports/../private isn't an export folder. Use one of: exports." The host or the model now passes the folder, and the server, not the client, decides where it may write.

Working rule: Move every pushed elicitation into a resolver, which serves both eras. Delete sampling rather than move it: let the host's model do model work, or call a provider from the server with the server's own credentials. Turn roots into a parameter checked against an allow-list in the server's configuration, and send log lines to stderr and your traces, never to the client.

動的クライアント登録の置き換え

最終変更:版2026.11.11

インベントリが見つけた最後の非推奨の依存先は、サーバではなくホストにある。しかし、サポートチームのホストが移植後のサーバ向けにトークンを取得できるかどうかは、この依存先で決まる。2025年版のホストは、出会った認可サーバごとに、OAuth の動的クライアント登録(Dynamic Client Registration)を通じて自分自身を登録していた。

"""How the support team's 2025 host got tokens for shop-support: it registered itself with each authorization server."""
from mcp.client.auth import OAuthClientProvider
from mcp.shared.auth import OAuthClientMetadata

auth = OAuthClientProvider(
    server_url="https://mcp.fernhill.example/mcp",
    client_metadata=OAuthClientMetadata(client_name="Support desk", redirect_uris=["http://127.0.0.1:3030/callback"]),
    storage=token_store, redirect_handler=open_browser, callback_handler=wait_for_code,
)

SDK 1.x の OAuthClientProvider は、client_metadata_url が与えられていない場合にこの方法で登録を行う(1.x では mcp/client/auth/oauth2.py)。固定されたリビジョンでは、動的クライアント登録は非推奨となり、クライアント ID メタデータドキュメント(Client ID Metadata Documents)が代わりに採用されている。後者はリビジョン 2025-11-25 ですでに推奨されていたものであり、動的クライアント登録は後方互換性のために残されている(changelog、2025-11-25 changelog)。削除が最も早く行われる時期は first revision released on or after 2027-07-28 である。

クライアント ID メタデータドキュメントでは、クライアント ID を、ホストが自身のメタデータを公開する https:// の URL にする。このため、どの認可サーバも事前にそのクライアントを登録する必要がない。メタデータドキュメントでクライアントを識別するでは、ショップのホスト向けにドキュメントを一つ作成し、固定されたリビジョンが選択肢に付ける優先順位を示している。順位は、事前登録済みの資格情報、メタデータドキュメント、登録の順である。

移植に必要な変更は引数一つである。ホストはドキュメントの URL を client_metadata_url として渡す。すると SDK 2.x の OAuthClientProvider は、認可サーバが client_id_metadata_document_supported を通知している場合にそのドキュメントを使う。サーバが通知していない場合、プロバイダはその旨を知らせずに登録へフォールバックする。これは第8章の例で示したとおりであり、2.3.0 にある SDK の登録コードも、非推奨の警告を出さない。したがって、認可サーバは移植の半分を担う。認可サーバはメタデータドキュメントへの対応を通知しなければならない。また、登録エンドポイントは移行期間の間に限り、ドキュメントを公開できないホストのためだけに残すべきである。

登録が残っている間は、固定されたリビジョンの二つの規則が重要になる。クライアントは、保存する資格情報を認可サーバの発行者(issuer)をキーにして管理しなければならず(MUST)、認可サーバが変わった場合は再度登録しなければならない(changelog、client registration)。登録を行うクライアントは、適切な application_type を送らなければならない(MUST)。ユーザーのマシン上で動作し、ループバックのリダイレクトを使うホストの場合、この値は native とすべきである(SHOULD)。本書のホストがこれに当たる(changelog、client registration)。MCP サーバの URL ごとにクライアント ID を一つ保存していた 2025年版のホストは、ショップが認可サーバを移した日に、最初の規則を破ることになる。

実践ルール: すべてのホストについてクライアント ID メタデータドキュメントを公開し、その URL を client_metadata_url として渡すこと。運用するすべての認可サーバが、このドキュメントへの対応を通知するようにすること。登録エンドポイントは、それを必要とするホストが移行を終えるまでに限って残すこと。各トークンがどの種類のクライアント ID に対して発行されたかをログに記録し、登録によるトラフィックがいつ止まったかを確認できるようにすること。

この部分はまだ翻訳されていないため、英語で表示している。

Port the code from SDK 1.x to 2.x

最終変更:版2026.11.11

The sections so far changed what the shop's server does. The SDK changes that Inventory what the old server depends on found are a separate job, and they stop the old file from starting on 2.x. Two facts shape that job. The first is that the 1.x line is still maintained. The first 2.x release and a 1.x release both shipped on 2026-07-28, the day of the pinned revision, and the 1.x release on 2026-09-07, mcp==1.30.0, is a "maintenance release of the 1.x line" (PyPI; release notes). The migration guide says the 1.x line keeps receiving critical bug fixes and security patches, and nobody has published an end date (migration guide). The second fact is that both lines are the one mcp distribution, so a deployment runs one or the other, never both.

The guide lists the breaks. Those that touch a server like the shop's: mcp.server.fastmcp.FastMCP is mcp.server.mcpserver.MCPServer; McpError is MCPError(code, message, data); fields are snake_case (input_schema, is_error); the HTTP client is httpx2, not httpx; streamablehttp_client is gone, in favour of streamable_http_client; host, port, stateless_http and json_response moved from the constructor to run() and streamable_http_app(); instructions is no longer the second positional argument; MCP_* environment variables are no longer read; the WebSocket transport is removed; and ctx.log takes data, not message (migration guide).

Most of these fail loudly, which is the kind you want. One doesn't. We run the 2025-era server's setup lines on 2.3.0 and see the import, the exception it raised, and the constructor. Then we build the server twice, once with the arguments as written and once ported, and ask each what a client sees.

port-to-sdk-2.py Python 3.12.15 · mcp 2.3.0 合格
"""Tries the 2025 server's setup lines on SDK 2.x: two breaks fail with an error, and one fails silently. The prose's point,that the second positional argument now sets the title, rests on the two title and instructions lines a client sees."""import asynciofrom mcp import Clientfrom mcp.server.mcpserver import MCPServerINSTRUCTIONS = "Answers the support team's questions about orders, refunds and stock."try:    from mcp.server.fastmcp import FastMCP          # the 2025 server's first importexcept ModuleNotFoundError as error:    print("import FastMCP:", str(error).split(". ", 1)[1].split("; see")[0])   # the message after its first sentencetry:    from mcp.shared.exceptions import McpError      # what 1.x tools raised for protocol errorsexcept ImportError as error:    print("import McpError:", str(error).split(" (")[0])   # drops the parentheticaltry:    MCPServer("shop-support", instructions=INSTRUCTIONS, port=8000, stateless_http=False)   # port and stateless_http moved to run() and streamable_http_app() in 2.xexcept TypeError as error:    print("port on the constructor:", error)as_written = MCPServer("shop-support", INSTRUCTIONS)                     # 1.x's second argument was instructionsported = MCPServer("shop-support", instructions=INSTRUCTIONS, version="0.12.0")   # a keyword, so the string can't become the titleasync def main() -> None:    for label, server in (("as written", as_written), ("ported", ported)):        async with Client(server) as client:            print(f"{label} title:", client.server_info.title)            print(f"{label} instructions:", client.instructions)asyncio.run(main())
出力python port-to-sdk-2.py
import FastMCP: This is mcp 2.x, where FastMCP was renamed to MCPServer (from mcp.server.mcpserver import MCPServer) and other APIs changed
import McpError: cannot import name 'McpError' from 'mcp.shared.exceptions'
port on the constructor: MCPServer.__init__() got an unexpected keyword argument 'port'
as written title: Answers the support team's questions about orders, refunds and stock.
as written instructions: None
ported title: None
ported instructions: Answers the support team's questions about orders, refunds and stock.

The import failed with a message that names the rename and the import to use instead: "This is mcp 2.x, where FastMCP was renamed to MCPServer (from mcp.server.mcpserver import MCPServer) and other APIs changed" (mcp/server/fastmcp.py, which exists only to raise it). McpError failed with "cannot import name 'McpError' from 'mcp.shared.exceptions'", and the constructor with "MCPServer.init() got an unexpected keyword argument 'port'". Each points at the line to change.

The constructor as written didn't fail. In 2.x the second positional argument is title (mcp/server/mcpserver/server.py), so the server's instructions became its title. A client saw the title "Answers the support team's questions about orders, refunds and stock." and no instructions (None), and a host that puts a server's instructions in the model's context would silently lose them. With instructions= by keyword, the ported server's title is None and its instructions arrive. The port number moves to the last line, as server.run(transport="streamable-http", port=8000).

The silent breaks share a shape: an argument that still type-checks, or a setting nothing reads, like the MCP_* environment variables. Find them by reading the guide's list against the code, not by waiting for errors, and check what a client sees with a test like the one that builds the server twice.

Working rule: Keep a 2025-era server pinned to mcp<2 until its port passes its tests, then port in one change: the imports and renames the errors point at, then each silent break from the migration guide, checked with a test against what a client sees. Pin the 2.x release exactly afterwards, and treat each 2.x release as a change to test, since the SDK's warnings and defaults move between releases.

この部分はまだ翻訳されていないため、英語で表示している。

Serve old and new clients through the window

最終変更:版2026.11.14

The ported server from Replace sampling, roots and logging answers clients at the pinned revision. The support team's hosts don't all move on one day, and a 2025-era host can't move forward on its own: it sends initialize and expects an answer. The pinned revision allows a dual-era server, which serves both eras on the same endpoint. An initialize request selects the 2025 semantics for that process on stdio or that session on HTTP, and a request with the pinned revision's _meta is served statelessly. A server that serves only the pinned revision SHOULD name the versions it supports in its error to initialize, because a 2025 client can't discover them any other way (versioning). On the other side, a 2.x Client in its default mode tries server/discover first and falls back to initialize (mcp/client/_probe.py; Call the tool from a client).

At 2.3.0, MCPServer.streamable_http_app() is dual-era with nothing to configure. It reads each request's MCP-Protocol-Version header: a request with no header, or with a version from 2024-11-05 to 2025-11-25, goes to the 2025 handler with its sessions, and anything else goes to the stateless handler (mcp/server/streamable_http_manager.py). The 2025 path keeps its sessions in the memory of the process that made them, so 2025-era clients keep their stickiness requirements (what's new).

We serve the ported server's app as replica a, recorded with chapter 6's lib.wire.record_http, and a second copy of it as replica b. A client in the default mode and a client in mode="legacy", which speaks the 2025 handshake, each quote a refund above the policy's limit and issue it on replica a, with the scripted lead saying yes. Then we send the 2025 client's session ID to each replica.

serve-two-revisions.py Python 3.12.15 · cryptography 50.0.2 · httpx2 2.16.2 · jsonschema 4.26.0 · mcp 2.3.0 · mcp-types 2.3.0 · pydantic 2.14.3 · starlette 1.10.0 · uvicorn 0.54.0 合格
"""Serves the ported refund confirmation from one app to a 2026-07-28 client and a 2025-11-25 client, then sends the 2025client's session ID to a second replica. The prose's point rests on the two "question came as" lines (one resolver, twoforms), the two refund lines, and the two session lines: the replica that made the session answers, and the other returns a 404."""import asyncioimport osimport httpx2from mcp import Clientfrom lib import confirmations, http_mcp, loopback, shop_api, wireLEGACY = {"MCP-Protocol-Version": "2025-11-25", "Accept": "application/json, text/event-stream"}   # a 2025 version routes to the 2025 handlerdef asked_how(exchanges: list[dict]) -> str:    messages = [m for e in exchanges for m in e["messages"]]    if any(m.get("method") == "elicitation/create" for m in messages):        return "a request the server pushed mid-call"    return "an input request in a result" if any(m.get("result", {}).get("resultType") == "input_required"                                                 for m in messages) else "never"async def main() -> None:    server = http_mcp.load_server("replace-pushed-requests.py")     # the ported issue_refund, with its resolver    with loopback.serve(shop_api.create_app()) as api_url:        os.environ.update(shop_api.server_env(api_url))        with loopback.serve(wire.record_http(server.streamable_http_app(), "a.jsonl")) as a, \             loopback.serve(http_mcp.load_server("replace-pushed-requests.py").streamable_http_app()) as b:            for mode, order in (("auto", "O-2289"), ("legacy", "O-1085")):     # both above the policy limit                seen = len(wire.read_http_trace("a.jsonl"))   # this client's exchanges come after this count                async with Client(a + "/mcp", mode=mode, elicitation_callback=confirmations.say_yes) as client:                    quote = (await client.call_tool("quote_refund", {"order_id": order})).structured_content                    refund = await client.call_tool("issue_refund", {"quote_id": quote["quote_id"]})                    # the first response from this client that set a session ID                    session = next((e["response_headers"]["mcp-session-id"] for e in wire.read_http_trace("a.jsonl")                                    [seen:] if "mcp-session-id" in e["response_headers"]), None)                    print(f"{mode} revision:", client.protocol_version)                    print(f"{mode} session header:", "set" if session else "none")                    for replica, url in (("a", a), ("b", b)) if session else ():   # no session, nothing to send                        sent = httpx2.post(url + "/mcp", headers={"Mcp-Session-Id": session, **LEGACY},                                           json={"jsonrpc": "2.0", "id": 9, "method": "tools/list"})                        listed = "tools listed" if "check_stock" in sent.text else sent.json()["error"]["message"]                        print(f"2025 session on replica {replica}: HTTP {sent.status_code},", listed)                print(f"{mode} question came as:", asked_how(wire.read_http_trace("a.jsonl")[seen:]))  # this client's exchanges, as replica a logged them                print(f"{mode} refund:", refund.structured_content["status"])asyncio.run(main())
出力python serve-two-revisions.py
auto revision: 2026-07-28
auto session header: none
auto question came as: an input request in a result
auto refund: requested
legacy revision: 2025-11-25
legacy session header: set
2025 session on replica a: HTTP 200, tools listed
2025 session on replica b: HTTP 404, Session not found
legacy question came as: a request the server pushed mid-call
legacy refund: requested

The default client settled on 2026-07-28, got no session header (none), and its question came as an input request in a result. Its refund ended requested.

The 2025 client settled on 2025-11-25, got a session header (set), and its question came as a request the server pushed mid-call. Its refund ended requested, and so did the default client's.

One resolver served both eras, and no code in issue_refund checks which one it is in. That is simpler than the ctx.protocol_version check around ctx.elicit() that See why a stateless server can't wait for an answer allows. A hand-built input request, like chapter 5's, doesn't serve both: a 2025 client receives it as an invalid result (What goes wrong in production in chapter 5).

The 2025 session worked on replica a, which answered HTTP 200, tools listed, and failed on replica b, which answered HTTP 404, Session not found. A 2026 client has no session to lose. What it needs from replicas is handles they all reach, as Run replicas without sticky sessions showed. Behind a load balancer, then, 2025-era traffic needs routing by Mcp-Session-Id to the replica that made the session, while the rest goes anywhere. The SDK's other choice, stateless_http=True, removes the sessions for 2025 clients but takes away their cancellation and their server-to-client requests (What goes wrong in production in chapter 6). For the shop that would break the pushed confirmation that the 2025 client had answered, so we recommend sticky routing for the 2025 path, kept as small as the remaining clients allow.

Working rule: Serve both eras from one streamable_http_app() through the window, write every question a tool asks as a resolver, and route requests that carry Mcp-Session-Id to the replica that minted it. Count requests by era. When the 2025 count has stayed at zero for as long as your slowest host takes to upgrade, serve the pinned revision only, and answer initialize with an error that names the versions you support, as the specification asks.

この部分はまだ翻訳されていないため、英語で表示している。

What goes wrong in production

最終変更:版2026.11.11

A migration fails in the gaps between the two eras: one client sees the old server, a proxy sees the new one, a warning says nothing. These are the failures to watch for.

A 2025 session lands on another replica. The sign is 404 with "Session not found" from 2025-era clients only, after a deployment or a scale-out, as on replica b in Serve old and new clients through the window. A 2025 client that follows its revision starts a new session on 404 (2025-11-25 transports), so the symptom may be lost state rather than an error. Route by Mcp-Session-Id, and count 404s by client.

A proxy drops the version header. The SDK's app picks the era from MCP-Protocol-Version alone, and its source marks routing by the body as a later step (mcp/server/streamable_http_manager.py). A proxy that strips headers it doesn't know sends a 2026-era request down the 2025 path, which expects a handshake first. The sign is failures from clients at the pinned revision behind that proxy only. Make every proxy pass the MCP headers, as Read one HTTP exchange lists them.

Error codes moved. A missing resource is -32602 at the pinned revision, not -32002, though clients SHOULD still accept -32002 (resources). The revision adds -32020 for headers that disagree with the body, -32021 for a missing client capability and -32022 for an unsupported protocol version (changelog). A host that branches on the old codes treats the codes the pinned revision added as unknown ones. Search client code for each numeric code before the server moves.

Warnings that teach people to ignore warnings. MCPDeprecationWarning is a UserWarning, so it prints by default (what's new), and a server that still uses sampling, roots or logging writes it into its logs. Turned off wholesale, it also hides the next deprecation. Filter each warning by its message only once the feature is on your inventory with a date.

Silence about HTTP+SSE and registration. The SDK at 2.3.0 warns about neither, as the inventory found. A server can pass its tests with no warnings and still lose its oldest hosts when the transport goes. Keep the scan from Inventory what the old server depends on in CI, and treat a later SDK release that adds these warnings as a reason to recheck the dates.

Reading the earliest removal as the end date. A team that plans to move off sampling or roots on 2027-07-28 has no margin, because the first revision released on or after that date may remove them. A team that reads the date as the day they disappear may also drop a feature its SDK keeps supporting for longer. Plan by the clients you serve: the registry gives the earliest date, and your logs give the real one.

Working rule: Prove the port through the real proxy path before it takes traffic, with four tests: a 2025 client completes a confirmation, a 2026 client completes the same one, a 2025 session survives a deployment, and the version header reaches the server. Then watch requests by era, 404s by client and every deprecation warning, until the 2025 count reaches zero.

この章で下した判断

  • 2025年版のサーバーは、実行する例ではなくリストとして示す。 lib.legacy が SDK 1.x 向けのテキストとして保持し、例が実行するのは 2.x への移植版だけである。1つの環境に両方の系統を入れることはできないためである。
  • インベントリは、依存関係を削除済み、非推奨、SDK の変更に分類する。 非推奨の各機能には、レジストリが示す最も早い削除時期を添える。これは最も早い日付として読むものであり、終了日ではない。
  • スキャンは移行期間を通じて CI で実行する。 SDK はサンプリング、ルート、ログについては警告を出すが、HTTP+SSE と登録については警告を出さないためである。
  • セッションごとの状態はハンドルになる。 見積りは第3章の quote_id であり、クライアントが返送し、すべてのレプリカが読み取れる場所に保存する。
  • HTTP+SSE は廃止する。 ショップのサーバーは Streamable HTTP のみを提供し、古いエンドポイントは、ログにそれを使うホストが残っている間だけ維持する。
  • エリシテーションはリゾルバーに移す。 リゾルバーは両方の時代に対応する。サンプリングは削除し、チケットのトリアージはホストのモデルが行う。ルートは export_dir パラメーターになり、SHOP_EXPORT_DIRS と照合して検査する。ログは stderr とトレースに出力する。
  • ホストは client_metadata_url を通じて Client ID Metadata Document を使う。 認可サーバーが登録を維持するのは、ドキュメントを公開できないホストに対してのみである。
  • 2.x への移植は1回の変更で行う。 テストが通るまでは mcp<2 で固定し、instructions= はキーワードで指定し、トランスポートの設定は run() に置く。
  • デュアル時代対応の1つのアプリが、移行期間中は両方の時代に対応する。 2025年のトラフィックには Mcp-Session-Id によるスティッキールーティングを使い、stateless_http は使わない。

この版における本章

第2026.11.14版2026年11月19日時点で例が通過この章の6 例件のうち6件が合格

英語版の書籍(版2026.11.14)から翻訳した。

この節を引用する

形式

いずれの形式も、本訳書が従う英語版の書籍を出典として示す。

いずれの形式もこの版を明示している。そのリンクは現行版を開き、節の見出しには本文が最後に変更された日付が示される。アクセス日と取得日は、これを開いた日である。

このページの内容

全12章中の第12章: 2025年版サーバの移行

  1. Inventory what the old server depends on
  2. initialize とセッション ID を取り除く
  3. HTTP+SSE から Streamable HTTP への移行
  4. Replace sampling, roots and logging
  5. 動的クライアント登録の置き換え
  6. Port the code from SDK 1.x to 2.x
  7. Serve old and new clients through the window
  8. What goes wrong in production
  9. この章で下した判断

ページの先頭に戻るすべての章