MCP client - Vercel - verified
How to add an MCP server to Vercel AI SDK
Where to add MCP servers in Vercel AI SDK: In code: createMCPClient({ transport }) from the @ai-sdk/mcp package. Its docs list support for stdio, Streamable HTTP and SSE. It handles OAuth sign-in for remote servers.
Vercel AI SDK homepage - Vercel AI SDK in our tools directory - Compare all MCP clients
- Kind
- SDK or framework
- stdio
- Yes
- Streamable HTTP
- Yes
- SSE
- Yes
Add a server
- Where the config lives
- In code: createMCPClient({ transport }) from the @ai-sdk/mcp package
The example from the Vercel AI SDK docs, copied verbatim. Swap in your server's name, command or URL.
import { createMCPClient } from '@ai-sdk/mcp';
const mcpClient = await createMCPClient({
transport: {
type: 'http',
url: 'https://your-server.com/mcp',
// optional: configure HTTP headers
headers: { Authorization: 'Bearer my-api-key' },
// optional: provide an OAuth client provider for automatic authorization
authProvider: myOAuthClientProvider,
// optional: allow redirect responses (default is 'error' to prevent SSRF)
redirect: 'follow',
},
});Which server?
Pick a server from the verified directory of official MCP servers. Each one lists its transport, auth and the setup snippets its vendor publishes, so you can match it to what Vercel AI SDK supports.
MCP support
What the Vercel AI SDK docs say it supports. Not stated means the docs do not say either way.
| Feature | Value | Source |
|---|---|---|
| ToolsCalls the functions a server exposes. | Yes | ai-sdk.dev/docs/ai-sdk-core/mcp-tools |
| ResourcesReads data and files a server exposes as resources. | Yes | ai-sdk.dev/docs/ai-sdk-core/mcp-tools |
| PromptsOffers a server's prompt templates to the user. | Yes | ai-sdk.dev/docs/ai-sdk-core/mcp-tools |
| SamplingLets a server ask the client's model for a completion. | Not stated | Docs do not say |
| RootsTells a server which directories it may work in. | Not stated | Docs do not say |
| ElicitationLets a server ask the user for input mid-task. | Yes | ai-sdk.dev/docs/ai-sdk-core/mcp-tools |
| DiscoveryPicks up tools, prompts or resources a server adds or removes while connected. | Not stated | Docs do not say |
| InstructionsUses the instructions a server sends when it connects. | Not stated | Docs do not say |
| stdioStarts a local server as a subprocess. | Yes | ai-sdk.dev/docs/ai-sdk-core/mcp-tools |
| Streamable HTTPConnects to a remote server over the current HTTP transport. | Yes | ai-sdk.dev/docs/ai-sdk-core/mcp-tools |
| SSEConnects over the older HTTP+SSE transport. | Yes | ai-sdk.dev/docs/ai-sdk-core/mcp-tools |
| OAuthSigns in to remote servers with OAuth. | Yes | ai-sdk.dev/docs/ai-sdk-core/mcp-tools |
Worth knowing
The AI SDK MCP client is a lightweight client for tool conversion that supports stateless MCP 2026-07-28 and legacy servers, treats prompts as experimental, and does not support receiving notifications.
Other SDKs and frameworks
FAQ
Where is the Vercel AI SDK MCP config?
In code: createMCPClient({ transport }) from the @ai-sdk/mcp package. The example on this page is copied from https://ai-sdk.dev/docs/ai-sdk-core/mcp-tools
Does Vercel AI SDK support remote MCP servers over Streamable HTTP?
Yes, per https://ai-sdk.dev/docs/ai-sdk-core/mcp-tools. Its docs list support for stdio, Streamable HTTP and SSE.
Does Vercel AI SDK support OAuth for MCP servers?
Yes. It handles OAuth sign-in for remote servers. Source: https://ai-sdk.dev/docs/ai-sdk-core/mcp-tools
Which MCP features does Vercel AI SDK support?
Its docs list Tools, Resources, Prompts and Elicitation. They do not state Sampling, Roots, Discovery and Instructions.
Sources
Last verified from the pages below.
- AI SDK docs: Model Context Protocol (MCP) - ai-sdk.dev
Newsletter
New MCP servers, the week they ship
One email per week. New official MCP servers, the coding tools that support them and how developers wire them up.