Set up in one minute
3 steps · about a minute · works on every plan, including Free
- 1
Install the MCP client
Add the AI SDK's MCP package:
npm install ai @ai-sdk/mcp
- 2
Load DoubleCrawl as tools
Use your API key from the dashboard (get one with 5,000 free credits):
import { createMCPClient } from '@ai-sdk/mcp'; const doublecrawl = await createMCPClient({ transport: { type: 'http', url: 'https://mcp.doublecrawl.com/mcp', headers: { Authorization: `Bearer ${process.env.DOUBLECRAWL_API_KEY}` }, }, }); const tools = await doublecrawl.tools(); - 3
Pass the tools to generateText
Give
toolstogenerateTextorstreamTextand close the client when you're done.
Pay only for pages we deliver
Vercel AI SDK uses your DoubleCrawl credits. Failed pages are free, and annual billing saves 10%.
A page costs 1 credit at Level 1, 4 at Level 2 or 25 at Level 3. Full pricing and Enterprise →
Do I need an API key to use DoubleCrawl in Vercel AI SDK?
Yes. Create a free account, copy your key from the dashboard and put it in the config above. You start with 5,000 free credits.
When does Vercel AI SDK use DoubleCrawl?
Whenever it needs a web page, and especially when a plain fetch fails. You can also ask for it directly: \"use DoubleCrawl to open ...\".
What does a page cost?
1 credit at Level 1, 4 at Level 2 and 25 at Level 3. Failed pages cost 0, and retries are on us.
Can I get the page as seen from another country?
Yes. Mention the country in your request ("from Germany") and Vercel AI SDK passes it to DoubleCrawl.
Does it work with streamText and edge runtimes?
The MCP client works with both generateText and streamText. Close the client when the response is finished.