# Email for Claude Code and Cursor agents

> Add an email MCP server and give the coding agent an address of its own. In Claude Code it is one command, in Cursor one entry in mcp.json, and a sign-in where you choose what it may do.

## Why a coding agent needs email

Coding agents hit email more often than you would think:

- **Testing a sign-up flow.** The app under development emails a confirmation link. The agent needs an address that receives it, and a way to wait for it.
- **Signing up for a service.** A new API, a staging dashboard, a package registry. Each sends a code.
- **Checking the app's own mail.** Does the password-reset email render, does the link work, is the from address right.
- **Reporting back.** A long job finishes overnight and the agent emails a summary.

Using your own address for these means you fetch every code. Using a throwaway means the account's later mail goes nowhere. An address the agent owns fixes both.

## Claude Code

One command adds the hosted server:

```sh
claude mcp add --transport http pidgeon https://pidgeon.ai/api/mcp --scope user
```

`--scope user` makes it available in every project; `--scope project` writes it to `.mcp.json` to share with the repository. Then open `/mcp`, pick pidgeon and sign in in the browser. The consent screen asks what the agent may do, read, read and send, or full access, and which addresses it reaches. That choice becomes an API key held for Claude Code, listed under **Developers → API keys → Connected apps**, where Disconnect ends it.

For an agent with nobody there to sign in, such as one in CI, pass a key instead:

```sh
claude mcp add --transport http pidgeon https://pidgeon.ai/api/mcp \
  --header "Authorization: Bearer $PIDGEON_API_KEY"
```

Or install the plugin, which adds the server and the Pidgeon skill together:

```text
/plugin marketplace add pidgeon-ai/pidgeon-plugins
/plugin install pidgeon@pidgeon
```

## Cursor

Add Pidgeon from its [cursor.directory listing](https://cursor.directory/plugins/pidgeon), or add the server by hand to `~/.cursor/mcp.json` (or `.cursor/mcp.json` for one project):

```json
{
  "mcpServers": {
    "pidgeon": {
      "url": "https://pidgeon.ai/api/mcp"
    }
  }
}
```

Cursor signs you in on the first call. To use a key instead, add `"headers": { "Authorization": "Bearer ${env:PIDGEON_API_KEY}" }` beside the URL, and Cursor fills it from your environment.

Codex, VS Code and Gemini CLI take the same server; `npx -y @pidgeon-ai/mcp init --client codex` (or `vscode`, or `gemini`) writes it into that client's own config file.

## Or one line, and let the agent do it

If you have no account yet, paste this into the agent:

```text
Read pidgeon.ai/skill.md and get yourself an email address.
```

The agent signs itself up with two HTTP calls. The address is live at once and can receive; to send, it asks you for a six-digit code that arrives at your address. Then it stores the key and connects the MCP server.

## What it looks like in use

Ask Claude Code to "test the sign-up flow on localhost:3000 and confirm the email arrives". With Pidgeon connected it will:

1. call `create_address` and get an address such as `test-7c1e@pidgeon.email`;
2. fill in the form, with a browser tool or a request;
3. call `await_message` with `has_code: true`, which returns when the email lands, with the code in `extracted.codes` and the confirmation link at the top of `extracted.links`;
4. follow the link, or type the code, and report what the email said.

The email the agent reads is cleaned of hidden text first, and checked by Pidgeon Firewall, because the agent is about to act on text somebody else wrote. If you want the agent to write mail but not send it, choose read-and-draft at the consent screen: it writes drafts, and a person sends them.

## Other options

Any MCP server that can send and receive email works the same way in both clients. [Email MCP servers compared](https://pidgeon.ai/blog/mcp-server-for-email) sets out what to check: whether it can wait for mail, whether replies stay in the thread, and what it does about injection. If you would rather the agent worked in your own Gmail, Google's official Gmail MCP server writes drafts for you to send; [Pidgeon vs the Gmail API](https://pidgeon.ai/vs/gmail-api) compares the two approaches.

## Start

[Sign up](https://pidgeon.ai/signup), or paste the line above. The [Claude Code](https://pidgeon.ai/integrations/claude-code) and [Cursor](https://pidgeon.ai/integrations/cursor) pages have the same steps, and the [MCP guide](https://pidgeon.ai/docs/mcp.md) lists every tool.

## Questions

### How do I add email to Claude Code?

Run claude mcp add --transport http pidgeon https://pidgeon.ai/api/mcp, then open /mcp and sign in. Claude Code then has tools to create an address, wait for mail and send.

### How do I add email to Cursor?

Add Pidgeon from cursor.directory, or put {"mcpServers": {"pidgeon": {"url": "https://pidgeon.ai/api/mcp"}}} in ~/.cursor/mcp.json. Cursor signs you in on the first call.

### Can a coding agent test my app’s sign-up emails?

Yes. It creates an address, signs up with it, and await_message returns the confirmation email with the code and link already extracted, so it can finish the flow and report what the email said.
