ClaudeCloudflare Developer PlatformJul 27, 2026, 12:00 AM

Agents, Workers - Agents SDK adds MCP Specification 2026-07-28 support

A condensed section focused on the key takeaways first.

Original Post

Quick Digest

Summary

A condensed section focused on the key takeaways first.

claudeen

Agents, Workers - Agents SDK adds MCP Specification 2026-07-28 support Summary

Key Points

  • Point 1: July 27, 2026 Agents SDK adds MCP Specification 2026-07-28 support Agents Workers Agents SDK v0.20.0 adds client and server support for the MCP 2026-07-28 release candidate ↗ .
  • Point 2: Workers can serve tools, prompts, resources, and elicitation without an MCP transport session or Durable Object.
  • Point 3: Agents can connect to both MCP 2026-07-28 servers and existing legacy servers.

Summary

This is an English summary of "Agents, Workers - Agents SDK adds MCP Specification 2026-07-28 support" published on 2026-07-27.

Key Points

  • Point 1: July 27, 2026 Agents SDK adds MCP Specification 2026-07-28 support Agents Workers Agents SDK v0.20.0 adds client and server support for the MCP 2026-07-28 release candidate ↗ .
  • Point 2: Workers can serve tools, prompts, resources, and elicitation without an MCP transport session or Durable Object.
  • Point 3: Agents can connect to both MCP 2026-07-28 servers and existing legacy servers.

Full Translation

Translations

A translation section that keeps the flow of the original article.

claudeja

Agents, Workers - Agents SDK adds MCP Specification 2026-07-28 support(原文タイトル)

概要

公開日: 2026-07-27 翻訳生成に失敗したため、原文をそのまま保存しています。

原文

July 27, 2026 Agents SDK adds MCP Specification 2026-07-28 support Agents Workers Agents SDK v0.20.0 adds client and server support for the MCP 2026-07-28 release candidate ↗ . Workers can serve tools, prompts, resources, and elicitation without an MCP transport session or Durable Object. Agents can connect to both MCP 2026-07-28 servers and existing legacy servers. Client support The MCP client manager now uses @modelcontextprotocol/client . For each connection, it probes for MCP 2026-07-28 support with server/discover . If the server does not support the stateless protocol, the client continues with the legacy initialize handshake on the same connection. Existing addMcpServer calls do not need a protocol-version setting or separate clients for each protocol generation. For stateless requests, elicitation uses input_required through multi-round-trip requests (MRTR). The legacy path uses the same form and URL handlers for pushed requests. The SDK collects input, retries the original operation, and resolves the original callTool , getPrompt , or readResource promise with its final result. OAuth callbacks now validate issuer metadata through the v2 SDK. Discovery state and issuer-bound credentials persist across browser redirects and Durable Object hibernation. Run stateless servers createMcpHandler now accepts a factory that returns a server from @modelcontextprotocol/server . The factory creates an isolated server for each request. import { McpServer } from "@modelcontextprotocol/server" ; import { createMcpHandler } from "agents/mcp/server" ; function createServer () { return new McpServer ({ name: "example" , version: "1.0.0" }); } export default { fetch ( request , env , ctx ) { return createMcpHandler (createServer)(request, env, ctx); }, }; import { McpServer } from "@modelcontextprotocol/server" ; import { createMcpHandler } from "agents/mcp/server" ; function createServer () { return new McpServer ({ name: "example" , version: "1.0.0" }); } export default { fetch ( request , env , ctx ) { return createMcpHandler (createServer)(request, env, ctx); }, } satisfies ExportedHandler ; The isolated agents/mcp/server entry keeps McpAgent , WorkerTransport , MCP client transports, and SDK v1 modules out of stateless server bundles. The Workers wrapper validates present browser Origins, supports explicit delegation to trusted Origin middleware, and exposes request handling plus typed change notifications. Backward compatibility The same createMcpHandler(createServer)(request, env, ctx) route serves MCP 2026-07-28 clients and legacy clients that use stateless requests. You do not need separate routes or tool definitions for ordinary tools, prompts, and resources. McpAgent is deprecated and feature-frozen. Migrate existing McpAgent servers to the stateless handler at your earliest convenience. If a server depends on protocol sessions, RPC, pushed server-to-client requests, standalone streams, or replay, use the migration guide to design stateless equivalents and run both routes while clients transition. Migrate existing SDK v1 servers Upgrade the Agents SDK: npm yarn pnpm bun npm i agents@latest yarn add agents@latest pnpm add agents@latest bun add agents@latest Move ordinary SDK v1 server definitions into an SDK v2 factory and serve them with createMcpHandler . The handler's default legacy compatibility means most stateless deployments need only one route. If an existing McpAgent server still needs sessionful features, add the stateless path beside it. Use isLegacyRequest() to send only legacy traffic to the existing route: import { isLegacyRequest } from "@modelcontextprotocol/server" ; import { createMcpHandler } from "agents/mcp/server" ; import { MyMcpAgent } from "./legacy-server" ; import { createServer } from "./server" ; const stateless = createMcpHandler (createServer, { route: "/mcp" , legacy: "reject" , }); const legacy = MyMcpAgent. serve ( "/mcp" ); export default { async fetch ( request , env , ctx ) { if ( await isL