---
title: "The Nextmail MCP server"
description: "Point an MCP client at one URL. Each tool is named for what it does, and it follows what you approve."
url: "https://nextmail.sh/developers/mcp"
---

# Every click in the app is a tool an agent can call.

The window below shows one session run by an agent. Open the mailbox tab, read a thread, star it or search, and the agent repeats each click with a tool.

[Open console](https://nextmail.sh/console) [Get Started](https://nextmail.sh/signup.md?next=%2Fconsole)[Read the MCP docs](https://nextmail.sh/docs/mcp/overview.md)

Park Studio Pro

Inbox

Everything addressed to you, minus spam.

Homepage copy, final round

9:41

Sarah Chen

Invoice 2214 for August

9:12

Northwind Cloud

Can we move Thursday?

8:55

Omar Haddad

Signed contract attached

8:30

Mia Chen

Your code is 481 207

8:02

Lumen

Photos from Saturday

Yesterday

Leo Martin

Your flight to Lisbon is confirmed

Yesterday

Skyline Travel

Quarterly numbers are in

Wed

Ken Ito

Coffee next week?

Tue

Priya Raman

Your session, run by an agent

1. Go through my inbox the way I just did.

Last tool call

```
{  "jsonrpc": "2.0",  "id": 1,  "method": "tools/call",  "params": {    "name": "listThreads",    "arguments": {      "folder": "inbox"    }  }}{  "jsonrpc": "2.0",  "id": 1,  "result": {    "content": [      {        "type": "text",        "text": "Subject: Homepage copy, final round | ID: t1 | Latest Message Received: 9:41"      },      {        "type": "text",        "text": "Latest Message Sender: Sarah Chen <sarah@lumen.studio>"      },      {        "type": "text",        "text": "Subject: Invoice 2214 for August | ID: t2 | Latest Message Received: 9:12"      },      {        "type": "text",        "text": "Latest Message Sender: Northwind Cloud <billing@northwind.example>"      },      {        "type": "text",        "text": "Subject: Can we move Thursday? | ID: t3 | Latest Message Received: 8:55"      },      {        "type": "text",        "text": "Latest Message Sender: Omar Haddad <omar@haddad.co>"      },      {        "type": "text",        "text": "Subject: Signed contract attached | ID: t4 | Latest Message Received: 8:30"      },      {        "type": "text",        "text": "Latest Message Sender: Mia Chen <mia@chenlegal.com>"      },      {        "type": "text",        "text": "Subject: Your code is 481 207 | ID: t5 | Latest Message Received: 8:02"      },      {        "type": "text",        "text": "Latest Message Sender: Lumen <no-reply@lumen.studio>"      },      {        "type": "text",        "text": "Subject: Photos from Saturday | ID: t6 | Latest Message Received: Yesterday"      },      {        "type": "text",        "text": "Latest Message Sender: Leo Martin <leo@martin.studio>"      },      {        "type": "text",        "text": "Subject: Your flight to Lisbon is confirmed | ID: t7 | Latest Message Received: Yesterday"      },      {        "type": "text",        "text": "Latest Message Sender: Skyline Travel <trips@skyline.example>"      },      {        "type": "text",        "text": "Subject: Quarterly numbers are in | ID: t8 | Latest Message Received: Wed"      },      {        "type": "text",        "text": "Latest Message Sender: Ken Ito <ken@ito.partners>"      },      {        "type": "text",        "text": "Subject: Coffee next week? | ID: t9 | Latest Message Received: Tue"      },      {        "type": "text",        "text": "Latest Message Sender: Priya Raman <priya@raman.design>"      }    ]  }}
```

What your clicks call

Open a thread, star it, search or reply.

## MCP, a building block for email.

Point an MCP client at one URL. Each tool is named for what it does, and it follows what you approve.

606 tools

### MCP server

Point a client at one URL and sign in. The tools follow what you approve.

[Read the docs : MCP server](https://nextmail.sh/docs/mcp/overview.md)

- listThreads Approved
- sendEmail Waiting for you

### Approval

An app sees only the tools its approval covers.

[Read the docs : Approval](https://nextmail.sh/docs/mcp/overview.md)

Your client

Nextmail

https://api.nextmail.sh/mcp

### Point the client at one URL

The client finds the server's tools and lists them for you.

[Read the docs : Point the client at one URL](https://nextmail.sh/docs/mcp/overview.md)

nextmail.sh

Wants to connect

Deny Approve

### No key to paste

The client signs in through your browser, and you approve it.

[Read the docs : No key to paste](https://nextmail.sh/docs/mcp/overview.md)

- threads:read
- contacts:read
- labels:write
- emails:send

### Scopes

Each tool names the scope it needs, such as threads:read or emails:send.

[Read the docs : Scopes](https://nextmail.sh/docs/mcp/overview.md)

## One address to paste. Any MCP client.

The server speaks MCP over HTTP. Add its address to your client, sign in once in the browser and approve what it may reach.

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

Run it in a terminal, then type /mcp in Claude Code to sign in.

[Full Claude Code setup](https://nextmail.sh/agents/claude-code.md)

```
[mcp_servers.nextmail]url = "https://api.nextmail.sh/mcp"
```

Add it to ~/.codex/config.toml, then run codex mcp login nextmail.

[Full Codex setup](https://nextmail.sh/agents/codex.md)

```
{  "mcpServers": {    "nextmail": {      "url": "https://api.nextmail.sh/mcp"    }  }}
```

Add it to ~/.cursor/mcp.json for every project, or to .cursor/mcp.json for one.

[Add to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=nextmail&config=eyJ1cmwiOiJodHRwczovL2FwaS5uZXh0bWFpbC5zaC9tY3AifQ%3D%3D)[Full Cursor setup](https://nextmail.sh/agents/cursor.md)

```
{  "servers": {    "nextmail": {      "type": "http",      "url": "https://api.nextmail.sh/mcp"    }  }}
```

In VS Code, add it to .vscode/mcp.json, then use it from Copilot's agent mode.

[Add to VS Code](https://vscode.dev/redirect/mcp/install?name=nextmail&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fapi.nextmail.sh%2Fmcp%22%7D)[Full GitHub Copilot setup](https://nextmail.sh/agents/github-copilot.md)

```
{  "mcpServers": {    "nextmail": {      "serverUrl": "https://api.nextmail.sh/mcp"    }  }}
```

Add it to ~/.codeium/windsurf/mcp\_config.json.

[Full Windsurf setup](https://nextmail.sh/agents/windsurf.md)

```
{  "mcpServers": {    "nextmail": {      "httpUrl": "https://api.nextmail.sh/mcp"    }  }}
```

Add it to ~/.gemini/settings.json, then run /mcp auth nextmail in Gemini CLI.

[Full Gemini CLI setup](https://nextmail.sh/agents/gemini-cli.md)

```
https://api.nextmail.sh/mcp
```

Open Settings, then Connectors, choose Add custom connector and paste this address.

[Full Claude Desktop setup](https://nextmail.sh/agents/claude-desktop.md)

```
https://api.nextmail.sh/mcp
```

In ChatGPT, turn on Developer mode in Settings, then create an app and paste this address.

[Full ChatGPT setup](https://nextmail.sh/agents/chatgpt.md)

```
openclaw gateway stopopenclaw mcp add nextmail --url https://api.nextmail.sh/mcp --transport streamable-http --auth oauthopenclaw mcp login nextmailopenclaw gateway start
```

Run these with the Gateway stopped. Open the link the login prints to approve access, then the Gateway starts again.

[Full OpenClaw setup](https://nextmail.sh/agents/openclaw.md)

Or let the agent set itself up

Paste this into any agent that can open a web page or run a terminal command. It reads the guide written for agents, then tells you the one step that needs you.

Prompt for your agent

Read https://nextmail.sh/agent.md and follow it. Then tell me what I need to do to sign you in to my Nextmail mailbox. If I have no account yet, create one with my address and ask me for the code that arrives. Wait for my go-ahead before you send anything.

[Read the agent guide](https://nextmail.sh/docs/get-started/ai-agents.md)[Open agent.md](https://nextmail.sh/agent.md)[Read this page as Markdown](https://nextmail.sh/agents.md)

## Everything an inbox does. Through one connection.

An agent gets an address, reads what arrives and answers in the thread. Each step is a real tool, command or event.

### Get an address

nextmail temp new

### Wait for mail

waitForEmail

### Read the thread

getThread

### Reply in it

replyToEmail

### Share a file

createFileLink

### Hear back

email.replied

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

## 606 tools. Each named for what it does.

An app gets only the tools its approval covers, so one held to reading has no sending tool at all.

- Workspace 202
- Calendar 50
- Mail 46
- Your account 39
- Audiences 35
- Contacts 29
- Automations 26
- Templates 23
- Knowledge base 23
- [and 14 more toolkits](https://nextmail.sh/docs/mcp/tools.md)

## 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)

## Four doors. One mailbox behind them.

REST, the SDK, the command line and MCP reach the same operations, with the same scopes and the same limits.

- [REST POST /emails](https://nextmail.sh/developers/api.md)
- [SDKs nextmail.emails.send()](https://nextmail.sh/developers/sdk.md)
- [CLI nextmail send](https://nextmail.sh/developers/cli.md)
- [MCP sendEmail](https://nextmail.sh/developers/mcp.md)

Nextmail

- [Domains](https://nextmail.sh/docs/sdk/reference/domains.md)
- [Inboxes](https://nextmail.sh/docs/sdk/reference/domains.md)
- [Sending](https://nextmail.sh/docs/sdk/reference/emails.md)
- [Receiving](https://nextmail.sh/docs/sdk/reference/threads.md)
- [Webhooks](https://nextmail.sh/docs/sdk/reference/webhooks.md)
- [Live events](https://nextmail.sh/docs/sdk/reference/live-events.md)
- [Calendar](https://nextmail.sh/docs/sdk/reference/calendar.md)
- [Contacts](https://nextmail.sh/docs/sdk/reference/contacts.md)
- [Attachments](https://nextmail.sh/docs/sdk/reference/files.md)
