---
title: "Frameworks and tools"
description: "Connect LangChain, the Vercel AI SDK, the OpenAI Agents SDK, CrewAI, n8n or OpenClaw to a mailbox on Nextmail, with one sign-in and the tools your approval allows."
url: "https://nextmail.sh/docs/mcp/frameworks"
area: "MCP server"
category: "Frameworks and tools"
---

# Frameworks and tools

Connect LangChain, the Vercel AI SDK, the OpenAI Agents SDK, CrewAI, n8n or OpenClaw to a mailbox on Nextmail, with one sign-in and the tools your approval allows.

## Two ways in

An agent you build reaches the same MCP server as Claude Code or Cursor, and gets the same tools. What differs is how it signs in, because the server takes an approved OAuth sign-in and never an API key.

| Way in | How it signs in | Use it from |
| --- | --- | --- |
| The local bridge, `npx -y @nextmail/cli mcp serve` | The command line sign-in you make once with `npx @nextmail/cli login`. The bridge renews the token by itself. | Code that can start a local MCP server: LangChain, the Vercel AI SDK, the OpenAI Agents SDK and CrewAI |
| The remote server, `https://api.nextmail.sh/mcp` | OAuth 2.1 with dynamic client registration and PKCE, run by the tool itself. You approve it in your browser. | Tools that run that sign-in, such as n8n and OpenClaw, and code with an OAuth provider |

> An API key sent to the MCP server gets `401`, with a `WWW-Authenticate` header that points at the OAuth metadata. Code that holds a key calls the REST API or an SDK instead, and wraps the calls it needs as tools of its own. In Python that wrapping is done: `langchain-nextmail` and `llama-index-tools-nextmail` turn the mail calls into tools for LangChain, LangGraph and LlamaIndex agents.

- [LangChain toolkit](https://nextmail.sh/docs/python/langchain.md): Mail tools for LangChain and LangGraph agents, on an API key.
- [LlamaIndex tool spec](https://nextmail.sh/docs/python/llamaindex.md): The same tools for LlamaIndex agents, on an API key.

## Guides

- [LangChain](https://nextmail.sh/docs/mcp/frameworks/langchain.md): Python and TypeScript, with LangChain’s MCP adapter.
- [Vercel AI SDK](https://nextmail.sh/docs/mcp/frameworks/vercel-ai-sdk.md): The AI SDK’s MCP client, locally and in a deployed app.
- [OpenAI Agents SDK](https://nextmail.sh/docs/mcp/frameworks/openai-agents-sdk.md): An MCP server on an agent, in Python or TypeScript.
- [CrewAI](https://nextmail.sh/docs/mcp/frameworks/crewai.md): `mcps` on an agent, with a tool filter.
- [n8n](https://nextmail.sh/docs/mcp/frameworks/n8n.md): The MCP Client Tool with an OAuth sign-in. No code.
- [OpenClaw](https://nextmail.sh/docs/mcp/frameworks/openclaw.md): OpenClaw’s MCP registry, with an OAuth sign-in.

## Keep the tool list short

The server registers up to 600 tools, fewer when your role or the approval leaves some out, and a framework sends every tool it loads to the model on each turn. Give the agent the ones its job needs. Each guide shows how its framework filters them, starting from `whoAmI`, `listThreads` and `getThread`.

The approval decides what exists at all. Read only, the default, leaves out every tool that sends from your addresses or changes your mail, such as `sendEmail`, `replyToEmail` and `createDraft`. Choose Read and send when the agent should draft or reply, then add those tools to its list.

## Verification codes

A few tools make a change the REST API guards with a verification code, such as creating a rule or removing a domain. An agent cannot type one, so the tool is refused, and the refusal says why. With the bridge, run `npx @nextmail/cli verify` in a terminal with the same profile. For a tool connected over OAuth, choose Allow changes for 60 minutes on it in Account → Connected apps. Either way, those tools run for the next 60 minutes.

## Related

- [Connect a client](https://nextmail.sh/docs/mcp/connect.md): The endpoints, the OAuth flow, tokens and revocation.
- [What it can reach](https://nextmail.sh/docs/mcp/scope.md): How your role and the approval decide the tool list.
- [The local bridge](https://nextmail.sh/docs/cli/ai-and-mcp.md): How `mcp serve` forwards calls, renews tokens and reports refusals.
- [API keys](https://nextmail.sh/docs/api/keys.md): For code that calls the REST API or an SDK instead of MCP.
