Vercel AI SDK for building AI applications.
## Vercel AI SDK MCP Server: Full-Stack AI Applications The **Vercel AI SDK MCP Server** integrates Vercel's AI SDK into Google Antigravity. This TypeScript toolkit simplifies building AI-powered applications with streaming, edge-ready components for chat interfaces, completions, and more. ### Why Vercel AI SDK MCP? The Vercel AI SDK streamlines AI development: - **Streaming First**: Built for real-time responses - **Edge Ready**: Deploy to Vercel Edge Functions - **React Hooks**: Easy UI integration - **Multi-Provider**: OpenAI, Anthropic, and more - **Type Safe**: Full TypeScript support ### Key Features #### 1. Streaming Chat ```typescript import { streamText } from "ai"; import { openai } from "@ai-sdk/openai"; export async function POST(req: Request) { const { messages } = await req.json(); const result = await streamText({ model: openai("gpt-4-turbo"), messages, }); return result.toDataStreamResponse(); } ``` #### 2. React Integration ```typescript "use client"; import { useChat } from "ai/react"; export default function Chat() { const { messages, input, handleInputChange, handleSubmit } = useChat(); return ( <div> {messages.map((m) => ( <div key={m.id}> {m.role}: {m.content} </div> ))} <form onSubmit={handleSubmit}> <input value={input} onChange={handleInputChange} /> <button type="submit">Send</button> </form> </div> ); } ``` #### 3. Tool Calling ```typescript import { generateText, tool } from "ai"; import { z } from "zod"; const result = await generateText({ model: openai("gpt-4-turbo"), tools: { weather: tool({ description: "Get the weather for a location", parameters: z.object({ location: z.string(), }), execute: async ({ location }) => { return fetchWeather(location); }, }), }, prompt: "What is the weather in San Francisco?", }); ``` ### Configuration ```json { "mcpServers": { "vercel-ai": { "command": "npx", "args": ["-y", "@anthropic/mcp-vercel-ai"], "env": { "OPENAI_API_KEY": "your-openai-key", "ANTHROPIC_API_KEY": "your-anthropic-key" } } } } ``` ### Use Cases **Chat Applications**: Build streaming chat interfaces with React hooks and edge deployment. **AI Features**: Add AI-powered features to existing Next.js applications easily. **Multi-Provider**: Switch between AI providers without changing application code. The Vercel AI SDK MCP brings modern AI development patterns to Antigravity.
{
"mcpServers": {
"vercel-ai": {}
}
}