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.
Guides
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.
Google Workspace