// Run it by with the Vercel AI SDK. // npm install ai @ai-sdk/anthropic @ai-sdk/mcp // Env: RUNITBY_API_KEY (https://runitby.app/app/keys), ANTHROPIC_API_KEY import { anthropic } from '@ai-sdk/anthropic' import { createMCPClient } from '@ai-sdk/mcp' import { generateText, isStepCount } from 'ai' const mcp = await createMCPClient({ transport: { type: 'http', url: 'https://runitby.app/mcp', headers: { Authorization: `Bearer ${process.env.RUNITBY_API_KEY}` }, }, }) try { const { text } = await generateText({ model: anthropic('claude-sonnet-5-5'), tools: await mcp.tools(), stopWhen: isStepCount(20), prompt: 'Ask Jordan (jordan@example.com) for her shipping address: name, street, city, postal code ' + 'and country. Email her the link, then wait for her answer and print it.', }) console.log(text) } finally { await mcp.close() }