Connect AgentMailr to Claude Desktop, Claude Code, or Cursor using the Model Context Protocol. No custom code. Just add the config and your AI tool gains full email capability.
*Originally published at [lumbox.co](https://lumbox.co/blog/mcp-email-server-claude-cursor/)*
The Model Context Protocol (MCP) lets AI tools like Claude Desktop and Cursor connect to external services. AgentMailr ships an MCP server that gives your AI tool 30+ email tools without writing any code.
## Claude Desktop Setup
Add this to your Claude Desktop config file (`~/Library/Application Support/Claude/claude_desktop_config.json` on Mac):
```json
{
"mcpServers": {
"agentmailr": {
"command": "npx",
"args": ["-y", "@agentmailr/mcp-server"],
"env": {
"AGENTMAILR_API_KEY": "ak_your_key",
"AGENTMAILR_API_URL": "https://api.agentmailr.com"
}
}
}
}
```
Restart Claude Desktop. The email tools appear automatically.
## Claude Code (CLI) Setup
Run this command to add the server globally:
```shell
claude mcp add agentmailr npx -y @agentmailr/mcp-server
```
Then set the environment variables in your shell profile.
## Cursor Setup
In Cursor settings, go to MCP Servers and add:
```json
{
"agentmailr": {
"command": "node",
"args": ["/path/to/agentmailr-mcp/dist/index.js"],
"env": {
"AGENTMAILR_API_KEY": "ak_your_key"
}
}
}
```
## Available Tools After Setup
Once connected, Claude or Cursor can use these tools:
- `create_inbox`: Create a new inbox
- `get_otp`: Wait for and return an OTP code
- `list_emails`: Read emails in an inbox
- `read_email`: Read a specific email
- `send_email`: Send from an inbox
- `reply_to_email`: Reply in a thread
- `wait_for_email`: Block until an email arrives
- And 20+ more tools
## Hosted MCP Server
For remote access without running a local process, use the hosted MCP server:
```json
{
"url": "https://mcp.agentmailr.com/mcp",
"type": "streamable-http",
"auth": { "type": "bearer", "token": "ak_your_key" }
}
```