---
title: "Email tools for Vercel AI SDK"
description: "Give agents built with Vercel AI SDK a real inbox over MCP. They read, reply and send from the addresses you approve, for as long as you allow."
url: "https://nextmail.sh/agents/vercel-ai-sdk"
---

[All frameworks and tools](https://nextmail.sh/agents.md#frameworks)

Vercel AI SDK + Nextmail

# An inboxfor Vercel AI SDK.

Agents built with Vercel AI SDK read, reply and send from the addresses you approve. They load the Nextmail tools over MCP, with a sign-in you give once.

[Open Vercel AI SDK](https://ai-sdk.dev)

Connect Vercel AI SDK

```
import { createMCPClient } from '@ai-sdk/mcp'import { StdioMCPTransport } from '@ai-sdk/mcp/mcp-stdio'import { generateText, isStepCount } from 'ai' const client = await createMCPClient({  transport: new StdioMCPTransport({    command: 'npx',    args: ['-y', '@nextmail/cli', 'mcp', 'serve'],  }),}) try {  const { whoAmI, listThreads, getThread } = await client.tools()  const { text } = await generateText({    model: 'openai/gpt-6-astra',    tools: { whoAmI, listThreads, getThread },    stopWhen: isStepCount(10),    prompt: 'Summarise my unread mail.',  })  console.log(text)} finally {  await client.close()}
```

The MCP client starts the local bridge while you develop. A deployed app connects over HTTP with an OAuth provider, as the guide shows.

## Three steps. Then it works on its own.

1. 01
   
   Install the adapter
   
   Run npm install ai @ai-sdk/mcp in your project.
2. 02
   
   Sign in once
   
   Run npx @nextmail/cli login and approve in your browser what the agent may reach. On a server, add --no-browser and paste the code back.
3. 03
   
   Load the tools
   
   Vercel AI SDK starts the bridge, npx -y @nextmail/cli mcp serve, and gets the tools your approval allows. Hand the agent only the ones it needs.

[Read the full Vercel AI SDK guide](https://nextmail.sh/docs/mcp/frameworks/vercel-ai-sdk.md)

## What your Vercel AI SDK agent can do with it. Through one connection.

`$ nextmail temp new`

[Agent features](https://nextmail.sh/agents/features.md)

## Tasks for your Vercel AI SDK agent. In plain words.

Each prompt shows the tools it is likely to call.

- Summarise my unread mail at support@acme.com and draft replies. Don't send them yet.
  
  - listThreads
  - getThread
  - createDraft
- Answer Ada's refund question in her thread, then file it under refunds.
  
  - getThread
  - replyToEmail
  - modifyLabels
- Find the invoice Jonas sent last month and sum up the thread.
  
  - listThreads
  - getThreadSummary
- Add Noor Haddad to my contacts and to the Beta audience.
  
  - createContact
  - addContactToAudience

## You approve it. Like any other app.

When the client signs in, you pick the workspace, what it may do, which addresses it reaches and for how long. Account → Connected apps changes or removes it later.

- **Your role is the ceiling**
  An app never holds a permission you lack, and when your role loses one, the app loses it on its next call.
- **Some things are never granted**
  No app can create or rotate API keys, open billing or manage the workspace, whatever you tick.
- **Risky changes wait for you**
  Adding a webhook, writing a rule, changing roles or removing a domain needs your verification code, or a 60-minute allowance you switch on for that app.

[How an approval is scoped](https://nextmail.sh/docs/mcp/scope.md)

## Asked first. Answered plainly.

## More frameworks and tools. Same server, your stack.

- [LangChain Full LangChain setup](https://nextmail.sh/agents/langchain.md)
- [OpenAI Agents SDK Full OpenAI Agents SDK setup](https://nextmail.sh/agents/openai-agents-sdk.md)
- [CrewAI Full CrewAI setup](https://nextmail.sh/agents/crewai.md)
- [n8n Full n8n setup](https://nextmail.sh/agents/n8n.md)

[See everything agents can do](https://nextmail.sh/agents.md)

## Give it an address. Watch it work.

MCP, the API and the command line come with every plan, the free one included. Connect a client and approve exactly what it reaches.

[Open mail](https://nextmail.sh/mail/inbox) [Get Started](https://nextmail.sh/signup.md)[Read the MCP guide](https://nextmail.sh/docs/mcp/overview.md)

`claude mcp add --transport http nextmail https://api.nextmail.sh/mcp`
