Vercel · Agent frameworks

Memrio for the Vercel AI SDK

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.

Jump to setup
live
Vercel AI SDKmemrio

Why pair them

01

Model-agnostic

Swap providers freely. The registry tools are the same for every model.

02

Streams cleanly

Tool calls show up in streamText so your UI can show “Reading Refund policy…” while the agent works.

03

Governed content

Your product answers from pages someone approved — and you can prove it from the request log.

Setup

2 steps, about ten minutes.

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.

Create an agent and key first
  1. 01

    Install the MCP client

    The MCP client ships as its own package alongside ai.

    terminal
    pnpm add ai @ai-sdk/mcp
  2. 02

    Create the client and pass tools to the model

    Use the http transport with an Authorization header. Close the client when the request finishes.

    route.ts
    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

A first prompt for Vercel AI SDK

What is our refund window for annual plans?

FAQ

Vercel AI SDK and Memrio

Can I limit which tools the model sees?
Yes. Pick from the object returned by registry.tools() before passing it to the model — for example only browse and get_page for a read-only assistant.
Does Memrio need a workspace or page-set header?
No. The API key is scoped to one workspace and one agent page set, so the key alone tells the server what the agent may read. Send only the Authorization header.
Which pages can the agent see?
Only published pages inside the agent page set you configured. Drafts and pages waiting on review are hidden unless you turn on "Read drafts" for a test agent.
Can the agent edit pages?
Only if you enable "Can edit pages" on that agent. It then gets get_page_source, create_page, update_page, and append_to_page. Edits are submitted as versions for human review unless the agent is also allowed to publish.

Other integrations