← All integrations
Import.io + Vercel AI SDK

Web scraping tools for the Vercel AI SDK

Create an MCP client with a Streamable HTTP transport and pass Import.io Web Scraper MCP tools straight into generateText or streamText.

Connects via
MCP
Setup
10 min
Available on
10,000 free successful calls, then $0.0002 per call
TypeScript
import { experimental_createMCPClient as createMCPClient, generateText, stepCountIs } from 'ai';
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
import { openai } from '@ai-sdk/openai';

const mcp = await createMCPClient({
  transport: new StreamableHTTPClientTransport(new URL('https://mcp.import.io/mcp'), {
    requestInit: { headers: { Authorization: `Bearer ${process.env.IMPORTIO_MCP_KEY}` } },
  }),
});

const { text } = await generateText({
  model: openai('gpt-5'),
  tools: await mcp.tools(),
  stopWhen: stepCountIs(8),
  prompt: 'Get the price and rating of every product on https://example.com/headphones',
});
await mcp.close();
console.log(text);

How it connects.

Source

The web

Any public page, rendered, through managed proxies

Engine

Import.io

Rendering, proxy routing, captcha handling, extraction

Path

Import.io MCP

https://mcp.import.io/mcp

Destination

Vercel AI SDK

Import.io tools in generateText and streamText for TypeScript apps.

What teams do with it.

Live data in chat UIs

Stream answers that include what the page says right now.

Get the price and rating of every product on this page.

Server actions with web lookups

Fetch and extract inside a Next.js route or server action.

Check stock for this SKU on the retailer’s site.

Any model, same tools

Swap providers without touching the Import.io integration.

Compare this product’s price in the US and UK stores.

Set it up.

  1. npm install ai @ai-sdk/openai @modelcontextprotocol/sdk (AI SDK 5).
  2. Create the MCP client with a StreamableHTTPClientTransport to https://mcp.import.io/mcp.
  3. Pass await mcp.tools() to generateText or streamText, and close the client when done.

Questions.

Where should the key live?

On the server only. Call Import.io from a route handler or server action and never ship the mcp_live_ key to the browser.

What does the Import.io MCP cost?

Signup includes 10,000 successful calls. After that it is $0.0002 per successful call. Setup requests, tool listings, malformed requests, blocked requests and failed upstream calls are never billed, and you can set a monthly spend limit that stops paid usage when reached.

OAuth or API key?

Use OAuth in interactive clients that support it: the client opens a sign-in, stores the credentials and reuses them. Use an API key for scripts, servers and clients without OAuth, sent as Authorization: Bearer mcp_live_…. Keep keys out of prompts and shared config files.

Which tools does the server expose?

importio_web_fetch, importio_render, importio_extract_data and importio_get_html, page helpers such as importio_page_text, importio_page_links and importio_search_cards, and browser actions for clicks, form input, scrolling, pagination, waits, screenshots and captcha handling. Requests can pick a proxy country and type, with bounded retries when a page blocks.

Give Vercel AI SDK
the live web.