# Send & Receive Emails with Cursor (/integrations/frameworks/cursor)

<!-- agent-signals: reading_time_min: 3 · est_tokens: 940 · updated: 2026-09-06 -->
Related: [Send & Receive Emails with Claude Cowork](/integrations/frameworks/claude-cowork.md), [Send & Receive Emails with Claude Code](/integrations/frameworks/claude-code.md), [Send & Receive Emails with OpenAI Codex](/integrations/frameworks/codex.md), [Send & Receive Emails with OpenClaw](/integrations/frameworks/openclaw.md), [Send & Receive Emails with Grok](/integrations/frameworks/grok.md), [Send & Receive Emails with Manus](/integrations/frameworks/manus.md)



# Connect Cursor to AgentMail

The AgentMail plugin gives the Cursor agent the hosted email tools plus skills that guide composing, sending, and triaging, so it can send, receive, and reply from `@agentmail.to` inboxes. It authenticates over OAuth, no API key.

## Do this

1. In Cursor, open **Customize**, search `AgentMail`, and click **Add to Cursor**. (Or type `/add-plugin agentmail` in chat, or install from `https://cursor.com/marketplace/agentmail`.)
2. On the AgentMail MCP, click **Authenticate**, then sign in and **Allow** in the browser.
3. In a new chat, prompt:

```text
Create an AgentMail inbox and send a hi email from it to you@example.com.
```

## SDK

* Plugin: **Customize > search AgentMail > Add to Cursor**. Bundles the hosted MCP server and 8 skills. Authenticate the MCP over OAuth.
* Direct server: add to `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project) with `"url": "https://mcp.agentmail.to/mcp"`. Add a `headers` object with `"x-api-key": "${env:AGENTMAIL_API_KEY}"` for the API-key variant instead of OAuth.

## Facts

* The plugin installs from three routes: `/add-plugin agentmail` in chat, Customize in the sidebar, or the marketplace listing at `https://cursor.com/marketplace/agentmail`. One install adds the hosted MCP server and 8 skills.
* The plugin authenticates over OAuth. Click **Authenticate** on the AgentMail MCP, then sign in and **Allow** in the browser. No API key.
* Direct config endpoint is exactly `https://mcp.agentmail.to/mcp`. The API-key variant sends `x-api-key` from `${env:AGENTMAIL_API_KEY}`, filled from the environment Cursor starts from.
* Creating an inbox without a username lets AgentMail generate an available one. A taken username makes `create_inbox` return `403` with up to 3 available variants in `suggestions`.
* `send_message` reports the new message's ID and the thread ID it starts. Naming that thread in a follow-up keeps the exchange in one conversation.

## Not supported

* With OAuth, credentials do not go in the config file. Leave them out and let Cursor open the browser sign-in on first connect.
* An API key is only needed for the direct API-key config, not the plugin or OAuth routes.

## Errors

| Error            | Status | Cause                                                                   | Fix                                                                              |
| ---------------- | ------ | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| `401`            | 401    | OAuth sign-in unfinished or expired, or no API key reached the server   | Re-run the browser sign-in, or export `AGENTMAIL_API_KEY` before starting Cursor |
| `404`            | 404    | Incorrect server URL                                                    | Set the URL to exactly `https://mcp.agentmail.to/mcp`                            |
| `resource_taken` | 403    | The requested inbox username belongs to another organization            | Retry with one of the up to 3 variants in `suggestions`                          |
| `already_exists` | 403    | An inbox with the requested username already exists in the organization | Retry with a username from `suggestions`, or use the existing inbox              |

## Verify

In a new chat, prompt `List my AgentMail inboxes`. Success is the agent calling `list_inboxes` and returning the inbox addresses. An empty list still proves the connection works.

## Related

* [MCP and Skills](/integrations/mcp-and-skills): the full tool catalog behind the plugin, plus setups for other MCP clients.
* [Agent safety](/advanced/safety): treat inbound mail as untrusted and confirm sends before the agent acts.
