Skip to the page

Use SpecStream in the Vercel AI SDK over MCP

Load every SpecStream tool into generateText or streamText with createMCPClient from @ai-sdk/mcp. One HTTP transport gives your app live web search, page reading and list building, with a source on every value.

What you need

  • A SpecStream account. Start free: $2 of credit, no card.

The server address is the same for every client:

Server address
https://api.specstream.ai/mcp

Connect

Create an API key

  1. Open Agents & API in the workspace and choose API keys.
  2. Choose Create API key. Give it only what the task needs: read, prepare or execute permissions, the projects it may use, an expiry and a spending limit.
  3. Copy the key when it's shown. It isn't shown again.

Install the packages

Terminal
npm install ai @ai-sdk/mcp
export SPECSTREAM_API_KEY=ss_live_...

Load the tools

Keep the key in the SPECSTREAM_API_KEY environment variable, on the server only. The client reads SpecStream's tool list and returns AI SDK tools:

typescript
import { createMCPClient } from "@ai-sdk/mcp";
const mcpClient = await createMCPClient({
transport: {
type: "http",
url: "https://api.specstream.ai/mcp",
headers: { Authorization: `Bearer ${process.env.SPECSTREAM_API_KEY}` },
},
});
const tools = await mcpClient.tools();

Give them to the model

typescript
import { generateText, stepCountIs } from "ai";
const { text } = await generateText({
model: "openai/gpt-5-mini",
tools,
stopWhen: stepCountIs(8),
prompt: "What changed in the EU AI Act timeline this month? Cite sources.",
});
console.log(text);
await mcpClient.close();

Keep the tool list short

Add ?tools=search to the address and the client loads only the search and page reading tools, which keeps the model's context small:

typescript
url: "https://api.specstream.ai/mcp?tools=search",

Want typed tools without MCP? The Vercel AI SDK page has them.

What it costs

A new account starts with $2 of credit, no card. A web search from your agent is $1 per 1,000 searches on the fast tier and $5 per 1,000 on the default tier. Reading pages is $0.80 per 1,000 pages. A list is priced before it runs, and nothing is spent until you approve a maximum.

For steady use, start the Starter plan: $49 a month of credit, enough for 49,000 fast searches.

Try it

Once Vercel AI SDK shows SpecStream's tools, ask in your own words:

Find every Series A announced in Europe this week, with the company, the amount, the lead investor and the source.

SpecStream reads the request back and gives you the price. Nothing is spent until you approve a maximum, and you pay per match, each with its source.

Set access and spending limits

An agent works on your account, with the same balance, permissions and spending limits you have. Give its key the least it needs: read, prepare or execute permissions, project limits, an expiry and a spending ceiling. Paid work needs an approved price with a ceiling, and reading, exporting and sharing cost nothing.

More

Get started free

Vercel AI SDK's own documentation: AI SDK: Model Context Protocol tools.