Model-agnostic
Swap providers freely. The registry tools are the same for every model.
Vercel · Agent frameworks
Turn the registry into tools for generateText and streamText in a few lines. The AI SDK’s MCP client discovers browse, search_pages, and get_page and hands them to whichever model you run.
Why pair them
Swap providers freely. The registry tools are the same for every model.
Tool calls show up in streamText so your UI can show “Reading Refund policy…” while the agent works.
Your product answers from pages someone approved — and you can prove it from the request log.
Setup
You need two values from an agent page in Memrio: the workspace MCP URL and an API key. Examples use https://memrio.ai/api/mcp/acme — swap in yours.
The MCP client ships as its own package alongside ai.
pnpm add ai @ai-sdk/mcpUse the http transport with an Authorization header. Close the client when the request finishes.
import { createMCPClient } from '@ai-sdk/mcp';
import { generateText } from 'ai';
const registry = await createMCPClient({
transport: {
type: 'http',
url: 'https://memrio.ai/api/mcp/acme',
headers: { Authorization: 'Bearer mr_live_8f3a…' },
},
});
try {
const tools = await registry.tools();
const { text } = await generateText({
model: 'openai/gpt-5',
system:
'Browse the memrio page set first. Answer only from the pages you open.',
tools,
prompt: 'What is our refund window for annual plans?',
});
console.log(text);
} finally {
await registry.close();
}Try it
“What is our refund window for annual plans?”
FAQ
Other integrations