Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

docs: Rewrite Vercel AI SDK provider page — Steps pattern, tested e2e

Sushmithamallesh57c9ccb14ec0
diff --git a/docs/content/docs/providers/google.mdx b/docs/content/docs/providers/google.mdx
index f02432473..b10dc8d48 100644
--- a/docs/content/docs/providers/google.mdx
+++ b/docs/content/docs/providers/google.mdx
@@ -56,7 +56,7 @@ session = composio.create(user_id="user_123")
tools = session.tools()
config = types.GenerateContentConfig(tools=tools)
-chat = client.chats.create(model="gemini-2.0-flash", config=config)
+chat = client.chats.create(model="gemini-3-pro-preview", config=config)
response = chat.send_message("Star the composiohq/composio repository on github")
# Agentic loop — keep executing tool calls until the model responds with text
@@ -87,7 +87,7 @@ const session = await composio.create("user_123");
const tools = await session.tools();
const chat = ai.chats.create({
- model: 'gemini-2.0-flash',
+ model: 'gemini-3-pro-preview',
config: {
tools: [{ functionDeclarations: tools }],
},
diff --git a/docs/content/docs/providers/vercel.mdx b/docs/content/docs/providers/vercel.mdx
index ba0796142..433e37545 100644
--- a/docs/content/docs/providers/vercel.mdx
+++ b/docs/content/docs/providers/vercel.mdx
@@ -1,140 +1,138 @@
---
title: Vercel AI SDK
description: Build an agent with Vercel AI SDK and enable it to use 800+ tools with Composio.
-keywords: [ai sdk]
+keywords: [ai sdk, vercel]
---
-Vercel AI SDK allows you to configure an optional async `execute` function that the framework uses to execute the tool calls.
+The Vercel AI SDK provider transforms Composio tools into Vercel's [tool format](https://sdk.vercel.ai/docs/ai-sdk-core/tools-and-tool-calling) with built-in execution — no manual agentic loop needed.
-The Vercel provider for Composio formats the Composio tools and adds this `execute` function to the tool calls.
-
-## Usage with Tools
+<Callout type="info">
+Vercel AI SDK is TypeScript only. There is no Python SDK.
+</Callout>
-Use Composio as a native tool with the Vercel AI SDK.
+<IntegrationTabs tabs={[
+ { value: "tools", label: "Tools" },
+ { value: "mcp", label: "MCP" },
+]}>
-### Installation
+<IntegrationContent value="tools">
+<Steps>
+<Step>
+**Install**
```bash
npm install @composio/core @composio/vercel ai @ai-sdk/anthropic
```
+</Step>
-### Usage
-
-Create a session and use it as a native tool with Vercel AI SDK:
+<Step>
+**Configure API Keys**
<Callout type="info">
-- Set `COMPOSIO_API_KEY` environment variable with your API key from [Settings](https://platform.composio.dev/?next_page=/settings).
-- Set `ANTHROPIC_API_KEY` environment variable with your [Anthropic API key](https://console.anthropic.com/settings/keys).
+Set `COMPOSIO_API_KEY` with your API key from [Settings](https://platform.composio.dev/?next_page=/settings) and `ANTHROPIC_API_KEY` with your [Anthropic API key](https://console.anthropic.com/settings/keys).
</Callout>
+```txt title=".env"
+COMPOSIO_API_KEY=xxxxxxxxx
+ANTHROPIC_API_KEY=xxxxxxxxx
+```
+</Step>
+
+<Step>
+**Create session and run**
+
+The Vercel provider is **agentic** — tools include an `execute` function, so the AI SDK handles tool calls automatically via `maxSteps`.
+
```typescript
// @noErrors
-import "dotenv/config";
import { anthropic } from "@ai-sdk/anthropic";
import { Composio } from "@composio/core";
import { VercelProvider } from "@composio/vercel";
-import { stepCountIs, streamText } from "ai";
+import { streamText, stepCountIs } from "ai";
-// Initialize Composio with Vercel provider (API key from env var COMPOSIO_API_KEY)
const composio = new Composio({ provider: new VercelProvider() });
-// Unique identifier of the user
-const userId = "user_123";
-
-// Create a session and get native tools for the user
-const session = await composio.create(userId);
+// Create a session for your user
+const session = await composio.create("user_123");
const tools = await session.tools();
-console.log("Fetching GitHub issues from the Composio repository...");
-
-// Stream the response with tool calling
const stream = await streamText({
- system: "You are a helpful personal assistant. Use Composio tools to take action.",
model: anthropic("claude-sonnet-4-5"),
- prompt: "Fetch all the open GitHub issues on the composio repository and group them by bugs/features/docs.",
- stopWhen: stepCountIs(10),
- onStepFinish: (step) => {
- for (const toolCall of step.toolCalls) {
- console.log(`[Using tool: ${toolCall.toolName}]`);
- }
- },
tools,
+ prompt: "Star the composiohq/composio repository on github",
+ stopWhen: stepCountIs(10),
});
for await (const textPart of stream.textStream) {
process.stdout.write(textPart);
}
-
-console.log("\n\n---");
-console.log("Tip: If prompted to authenticate, complete the auth flow and run again.");
```
+</Step>
+</Steps>
+</IntegrationContent>
-## Usage with MCP
-
-Use Composio with the Vercel AI SDK for a fully managed MCP experience.
+<IntegrationContent value="mcp">
+<Steps>
+<Step>
+**Install**
-### Installation
+No `@composio/vercel` package needed — use Vercel AI SDK's [MCP client](https://sdk.vercel.ai/docs/ai-sdk-core/mcp) directly.
```bash
-npm install dotenv @composio/core ai @ai-sdk/anthropic @ai-sdk/mcp
+npm install @composio/core ai @ai-sdk/anthropic @ai-sdk/mcp
```
+</Step>
-### Usage
-
-Use Composio with Vercel AI SDK's `streamText` for completions:
+<Step>
+**Configure API Keys**
<Callout type="info">
-- Set `COMPOSIO_API_KEY` environment variable with your API key from [Settings](https://platform.composio.dev/?next_page=/settings).
-- Set `ANTHROPIC_API_KEY` environment variable with your [Anthropic API key](https://platform.claude.com/settings/keys).
+Set `COMPOSIO_API_KEY` with your API key from [Settings](https://platform.composio.dev/?next_page=/settings) and `ANTHROPIC_API_KEY` with your [Anthropic API key](https://console.anthropic.com/settings/keys).
</Callout>
+```txt title=".env"
+COMPOSIO_API_KEY=xxxxxxxxx
+ANTHROPIC_API_KEY=xxxxxxxxx
+```
+</Step>
+
+<Step>
+**Create session and run**
+
```typescript
// @noErrors
-import "dotenv/config";
import { anthropic } from "@ai-sdk/anthropic";
import { experimental_createMCPClient as createMCPClient } from "@ai-sdk/mcp";
import { Composio } from "@composio/core";
-import { stepCountIs, streamText } from "ai";
+import { streamText, stepCountIs } from "ai";
-// Initialize Composio (API key from env var COMPOSIO_API_KEY or pass explicitly: { apiKey: "your-key" })
const composio = new Composio();
-// Unique identifier of the user
-const userId = "user_123";
+// Create a session for your user
+const { mcp } = await composio.create("user_123");
-// Create a session for the user
-const { mcp } = await composio.create(userId);
-
-// Create an MCP client to connect to the Composio MCP server
const client = await createMCPClient({
transport: {
type: "http",
url: mcp.url,
- headers: mcp.headers, // Authentication headers for the Composio MCP server
+ headers: mcp.headers,
},
});
const tools = await client.tools();
-console.log("Summarizing your emails from today");
-
const stream = await streamText({
- system: "You are a helpful personal assistant. Use Composio tools to take action.",
model: anthropic("claude-sonnet-4-5"),
+ tools,
prompt: "Summarize my emails from today",
stopWhen: stepCountIs(10),
- onStepFinish: (step) => {
- for (const toolCall of step.toolCalls) {
- console.log(`[Using tool: ${toolCall.toolName}]`);
- }
- },
- tools,
});
for await (const textPart of stream.textStream) {
process.stdout.write(textPart);
}
-
-console.log("\n\n---");
-console.log("Tip: If prompted to authenticate, complete the auth flow and run again.")
```
+</Step>
+</Steps>
+</IntegrationContent>
+</IntegrationTabs>