Runstack Docs

AI SDK (runstack-tools)

Drop-in Runstack meta tools for the Vercel AI SDK. Use 150+ connector tools in any agentic workflow with one line.

runstack-tools is the official npm package that wraps the Runstack MCP server as native Vercel AI SDK tools. Add 150+ connector tools (GitHub, Notion, Gmail, Linear, Google Sheets, Google Calendar, …) to any generateText, streamText, or agent loop with a single import.

Under the hood it forwards tools/call JSON-RPC requests to /mcp — same auth, same usage tracking, same 4 meta tools.

Install

npm install runstack-tools ai zod

You'll need a Runstack API key (rsk_…). See API Keys.

Quick start

import { generateText } from 'ai';
import { runstackTools } from 'runstack-tools';

await generateText({
  model: 'anthropic/claude-sonnet-4-5',
  prompt: 'Star the vercel/ai repo on GitHub and email me a confirmation.',
  tools: runstackTools(process.env.RUNSTACK_API_KEY!),
});

That single tools: line gives the model access to every tool across every connector you have linked.

Scoping to one connector

When you only need a single connector, scope search_tools to it. All 4 meta tools are still returned, so the agent can authenticate and execute as needed — but discovery is limited to the chosen connector.

tools: runstackTools('github', process.env.RUNSTACK_API_KEY!)

Supported connector slugs:

  • github
  • notion
  • gmail
  • linear
  • google-sheets
  • googlecalendar

What you get

runstackTools() returns an object with the four AI SDK tool() definitions that mirror the meta tools on the MCP server:

ToolPurpose
search_toolsDiscover tools by regex over names and descriptions
check_authenticationVerify the user has connected the required provider
initiate_connectionGet an OAuth link for the user to connect a provider
execute_toolRun any discovered tool with type-coerced arguments

Because the object shape is Record<string, Tool>, it plugs straight into any AI SDK call site:

import { streamText } from 'ai';
import { runstackTools } from 'runstack-tools';

const result = streamText({
  model: 'anthropic/claude-sonnet-4-5',
  messages,
  tools: runstackTools(process.env.RUNSTACK_API_KEY!),
});

You can also merge them with your own tools:

tools: {
  ...runstackTools(apiKey),
  myCustomTool: tool({ /* ... */ }),
}

Self-hosted endpoint

If you're running Runstack on your own infrastructure, override the endpoint:

runstackTools(apiKey, { endpoint: 'https://runstack.mycompany.com/mcp' })

// or with a connector
runstackTools('github', apiKey, { endpoint: 'https://runstack.mycompany.com/mcp' })

How it relates to /mcp

SurfaceBest for
runstack-toolsBuilding agents with the Vercel AI SDK in Node/Edge
MCP ServerClaude Desktop, Cursor, any MCP-native client
stdio MCPLocal tools that need a stdio MCP transport

All three speak to the same registry and the same 4 meta tools — pick whichever matches your runtime.

On this page