Connect an agent (MCP)
Let OpenCode, Claude Code, Codex, Cursor, ChatGPT and other agents work with Nightmail: as you, with an API key, or with one inbox.
Ways to connect
| Connect | What the agent can reach | Set up |
|---|---|---|
| With the agent prompt | Its own API key in this workspace: send email, and manage domains, inboxes and receiving. It can't create API keys, inbox connection keys, inbox keys or mail-client (IMAP/SMTP) passwords, and never reaches members or billing. The prompt you copy carries a one-time setup token; without it, the agent asks for a code you approve. | How it works |
| Sign in as you | What you approve in the browser: read, send or full access. It signs in with your Anomaly account (GitHub or Google); choose its workspace and receiving tools in Settings → Account. | The setup below, then sign in from your client. |
| With an API key | Exactly what the key can do, in this workspace only. No browser sign-in: the key goes in the config’s Authorization header. An agent token works the same way. | Create key |
| One agent inbox | Only that inbox, with an API key for it: read its mail and, if allowed, reply. Nothing else in the workspace. | Connect an agent |
MCP server
https://nightmail.dev/mcpopencode mcp add nightmail --global --url https://nightmail.dev/mcp- In OpenCode, run /mcps, select nightmail and choose Sign in.
- Approve the access in your browser.
claude mcp add --transport http --scope user nightmail https://nightmail.dev/mcp- In Claude Code, run /mcp, select nightmail and choose Authenticate.
- Approve the access in your browser.
codex mcp add nightmail --url https://nightmail.dev/mcp- Run it in a terminal. Codex opens your browser to sign in.
- Approve the access in your browser.
- To sign in again later, run codex mcp login nightmail.
Add to Cursor
- Cursor opens and asks to install it: choose Install.
- In Cursor Settings → MCP, choose Connect beside nightmail.
- Approve the access in your browser.
Open Claude connectors
- In Claude or Claude Desktop, open Customize → Connectors and choose Add → Custom → Web.
- Name it nightmail, paste the URL above and choose Connect.
- Approve the access in your browser.
Open ChatGPT plugins
- In ChatGPT on the web, open Plugins, choose + and then Add custom MCP server.
- Name it nightmail, paste the URL above and choose OAuth.
- Choose Create as a plugin. Approve the access in your browser.
Add to VS Code
- VS Code opens and asks to install it: choose Install.
- When VS Code asks, let nightmail sign in.
- Approve the access in your browser.
- Add a remote (Streamable HTTP) server with the URL above.
- It signs in with OAuth. Approve the access in your browser.
Feedback
Agents can tell us what got in their way with sendFeedback: what happened, what would have made it easier, and the request ID if there is one. Every connection that can read lists it, and the server’s instructions ask agents to report each distinct problem once and carry on. We see which workspace and which key or sign-in sent each report, and read every one; no reply comes back.