---
title: "n8n"
description: "Give the AI Agent of an n8n workflow the Nextmail tools, with the MCP Client Tool and an OAuth sign-in."
url: "https://nextmail.sh/docs/mcp/frameworks/n8n"
area: "MCP server"
category: "Frameworks and tools"
---

# n8n

Give the AI Agent of an n8n workflow the Nextmail tools, with the MCP Client Tool and an OAuth sign-in.

## Before you start

You need n8n 1.119 or later, where the MCP Client Tool can sign in with OAuth and register itself. n8n connects to the remote server, `https://api.nextmail.sh/mcp`, so there is nothing to install and no command line involved.

## Add the MCP Client Tool

1. Open the workflow with your AI Agent node, and add the MCP Client Tool to its tools.
2. Set Endpoint to `https://api.nextmail.sh/mcp`, and keep Server Transport on HTTP Streamable.
3. Set Authentication to MCP OAuth2 and create a credential. Keep Use Dynamic Client Registration on, so n8n registers itself and you paste no client ID or secret, and enter `https://api.nextmail.sh/mcp` as the Server URL.
4. Choose Connect my account. Nextmail opens in a new window: sign in, then pick the workspace, the access, the addresses n8n may reach and how long the approval lasts.
5. Under Tools to Include, choose Selected and pick the tools the workflow needs.

| Field | Value |
| --- | --- |
| Endpoint | `https://api.nextmail.sh/mcp` |
| Server Transport | HTTP Streamable |
| Authentication | MCP OAuth2 |
| Tools to Include | Selected |

> After you approve, the browser returns to your n8n instance, at `/rest/oauth2-credential/callback` on its address, so that address has to be reachable from the browser you approve in.

## What the agent can do

The server registers up to 600 tools, and n8n sees the ones both your role and the approval allow. Read only, the default, leaves out every tool that sends from your addresses or changes your mail, so choose Read and send when the workflow should draft or reply. Selected keeps the agent to the tools you tick, such as `whoAmI`, `listThreads` and `getThread` to read, and `createDraft` or `replyToEmail` to answer.

- n8n is listed in Account → Connected apps, where you can narrow what it reaches or remove it.
- The MCP server never asks before a tool acts, so a workflow that sends mail sends it at once.
- n8n cannot ask you for a verification code, so a tool that needs one is refused. When the workflow has to make such a change, choose Allow changes for 60 minutes on n8n in Account → Connected apps.

## Related

- [n8n](https://nextmail.sh/agents/n8n.md): The n8n page: what an agent can do with a mailbox on Nextmail, and prompts to try.
- [What it can reach](https://nextmail.sh/docs/mcp/scope.md): How your role and the approval decide the tool list.
- [Tools](https://nextmail.sh/docs/mcp/tools.md): All 600, grouped by what they are for.
- [The local bridge](https://nextmail.sh/docs/cli/ai-and-mcp.md): How `mcp serve` forwards calls, renews tokens and reports refusals.
