Install
Installai, @ai-sdk/mcp and a provider such as @ai-sdk/anthropic.
Call the tools from a model
agent.ts
ai 7, where isStepCount limits the number of tool-calling steps. See the AI SDK MCP documentation for other transports.
When a tool fails, see Troubleshooting.