Agents SDK reduces MCP schema conversion, adds exposure controls and direct host APIs
The Agents SDK now reuses converted MCP schemas to avoid repeated conversions, adds an includeMcpTools flag to control automatic MCP tool exposure in Think mode, and enables non-AI-SDK hosts to invoke the Code Mode runtime directly through new execute, search, and describe methods.
This release reduces repeated MCP schema conversion and adds an opt-out for Think's automatic MCP tool exposure. It also lets non-AI-SDK hosts invoke the durable Code Mode runtime directly.
Control direct MCP tool exposure in Think
Agents SDK MCP clients now reuse converted input and output schemas while a live connection keeps the same tool catalog. This avoids converting every MCP JSON Schema to Zod again for each model turn.
@cloudflare/think also adds includeMcpTools. Set it to false when you expose MCP tools through Code Mode or another mechanism outside Think's automatic tool set:
import { Think } from "@cloudflare/think";
export class MyAgent extends Think {
includeMcpTools = false;
waitForMcpConnections = true;
}import { Think } from "@cloudflare/think";
export class MyAgent extends Think<Env> {
includeMcpTools = false;
waitForMcpConnections = true;
}
This setting skips Think's automatic getAITools() call. MCP registration, restoration, discovery, raw catalog access, direct calls, and Code Mode connectors continue to work.
Use listTools() when you only need the raw MCP catalog. For connector setup, refer to Use MCP tools with Code Mode.
Invoke the Code Mode runtime without the AI SDK
@cloudflare/codemode@latest adds execute(), search(), and describe() to the durable runtime handle. MCP servers and other hosts can now execute code and discover connector methods without adapting the runtime to an AI SDK tool.
const matches = await runtime.search("create issue");
const docs = await runtime.describe(matches.results[0].path);
const outcome = await runtime.execute({
code: `async () => github.create_issue({ title: "Bug" })`,
});const matches = await runtime.search("create issue");
const docs = await runtime.describe(matches.results[0].path);
const outcome = await runtime.execute({
code: `async () => github.create_issue({ title: "Bug" })`,
});
Search and describe results include requiresApproval: true for protected connector methods. Resolve a paused execution with the existing approve() and reject() methods.
For setup and exact method types, refer to Create a durable Code Mode runtime and the Code Mode API reference.
Upgrade
npmyarnpnpmbunnpm i agents@latest @cloudflare/think@latest @cloudflare/codemode@latestyarn add agents@latest @cloudflare/think@latest @cloudflare/codemode@latestpnpm add agents@latest @cloudflare/think@latest @cloudflare/codemode@latestbun add agents@latest @cloudflare/think@latest @cloudflare/codemode@latestSource: original entry ↗
More from Cloudflare
Follow Cloudflare to get its new changes in your feed and email digest.
Cloudflare One Client for macOS 2026.8.2100.0
GA release for macOS Cloudflare One Client with improved split tunnel handling that no longer briefly blocks traffic during reconnects, support for non-RFC 1918 local IPv4 networks, faster connects with lower memory use, and numerous reliability fixes across DNS, reauthentication, and client stability.
Cloudflare One Client for Windows 2026.8.2100.0
This GA release improves split tunnel reliability, adds support for non-RFC 1918 local networks, optimizes connection performance with faster reconnections and lower memory usage, and includes numerous bug fixes for DNS, registration, and network handling. The client now features a service recovery mechanism that automatically restarts on system unlock and better handles large hosts files without blocking traffic.
Cloudflare One Client for Linux 2026.8.2100.0
New GA release for Linux with improved split tunnel handling that no longer briefly blocks traffic during reconnects, support for non-RFC 1918 local IPv4 networks, faster tunnel reconnections, and lower memory usage. Includes numerous stability and reliability fixes for DNS, reconnection behavior, and crash issues.