Agents SDK reduces MCP schema conversion; Think opt-out and Code Mode direct host APIs
Key Points
- MCP schema conversions are cached per live connection
- Think adds includeMcpTools opt-out for automatic MCP exposure
- Code Mode runtime exposes search(), describe(), and execute()
Summary
MCP schema conversion is now reused while a live connection keeps the same tool catalog, avoiding repeated JSON Schema -> Zod conversions on every model turn. @cloudflare/think adds an opt-out flag includeMcpTools to stop automatic MCP tool exposure. @cloudflare/codemode exposes runtime search(), describe(), and execute() so non-AI-SDK hosts (MCP servers, Workers, etc.) can discover and invoke Code Mode connector methods directly.
Key Points
- MCP clients cache converted input/output schemas for the duration of a live connection to reduce repeated conversion overhead.
- Think SDK: set includeMcpTools = false (and optionally waitForMcpConnections = true) to skip Think's automatic getAITools(); listTools() still provides the raw MCP catalog; registration, restoration, discovery, direct calls, and Code Mode connectors remain supported.
- Code Mode runtime: runtime.search(), runtime.describe(), and runtime.execute() let hosts discover protected methods (results include requiresApproval) and run code without adapting the runtime to an AI SDK; resume or resolve paused executions with approve() / reject().
Upgrade
Install the latest packages: npm i agents@latest @cloudflare/think@latest @cloudflare/codemode@latest (or use yarn/pnpm/bun equivalents).
Action Items
- If you surface MCP tools outside Think (e.g., via Code Mode), set includeMcpTools = false to avoid double exposure.
- Use listTools() when you only need the raw MCP catalog; use Code Mode connectors or runtime APIs for connector setup.
- Update runtime integration to handle requiresApproval and approve()/reject() flows for protected connector methods.