Skip to main content
The Vercel AI SDK has built-in support for MCP servers. This guide shows how to use Smithery with the AI SDK to add MCP tools to your AI applications.

Installation

Quick Start

Use createConnection from @smithery/api/mcp to get a transport for the AI SDK’s MCP client:
Smithery handles OAuth, token refresh, and connection management automatically.

Streaming Responses

Use streamText for streaming responses. Close the client in onFinish:

Multiple MCP Servers

Connect to multiple servers and aggregate their tools:

Learn More