Agents built with TanStack AI can now call OAuth-protected MCP servers through Vercel Connect, with no credentials for you to store or rotate.
The new @vercel/connect/tanstack-ai subpath exports connectMCPTransport , which takes a TanStack transport config and attaches a Connect-backed auth provider. The provider is called before every MCP request, so the token is always fresh.
import { chat , toServerSentEventsResponse } from '@tanstack/ai' ;
import { createMCPClient } from '@tanstack/ai-mcp' ;
import { vercelGatewayText } from '@tanstack/ai-vercel-gateway' ;
import {
connectMCPTransport ,
getConsentChallenge ,
} from '@vercel/connect/tanstack-ai' ;
export async function POST ( request : Request ) {
const { messages } = await request .…