home / skills / agentmail-to / agentmail-skills / agentmail-mcp

agentmail-mcp skill

/agentmail-mcp

This skill helps you manage email workflows by interfacing with AgentMail MCP to send, receive, list, and organize emails across clients.

npx playbooks add skill agentmail-to/agentmail-skills --skill agentmail-mcp

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
4.2 KB
---
name: agentmail-mcp
description: AgentMail MCP server for email tools in AI assistants. Use when setting up AgentMail with Claude Desktop, Cursor, VS Code, Windsurf, or other MCP-compatible clients. Provides tools for inbox management, sending/receiving emails, and thread handling.
---

# AgentMail MCP Server

Connect AgentMail to any MCP-compatible AI client. Three setup options available.

## Prerequisites

Get your API key from [console.agentmail.to](https://console.agentmail.to).

---

## Option 1: Remote MCP (Simplest)

No installation required. Connect directly to the hosted MCP server.

**URL:** `https://mcp.agentmail.to`

Add to your MCP client configuration:

```json
{
  "mcpServers": {
    "AgentMail": {
      "url": "https://mcp.agentmail.to",
      "env": {
        "AGENTMAIL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
```

---

## Option 2: Local npm Package

Run the MCP server locally via npx.

```json
{
  "mcpServers": {
    "AgentMail": {
      "command": "npx",
      "args": ["-y", "agentmail-mcp"],
      "env": {
        "AGENTMAIL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
```

### Tool Selection

Load only specific tools with the `--tools` argument:

```json
{
  "mcpServers": {
    "AgentMail": {
      "command": "npx",
      "args": [
        "-y",
        "agentmail-mcp",
        "--tools",
        "send_message,reply_to_message,list_inboxes"
      ],
      "env": {
        "AGENTMAIL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
```

---

## Option 3: Local Python Package

Install and run the Python MCP server.

```bash
pip install agentmail-mcp
```

### Claude Desktop

Config location:

- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
- Windows: `%APPDATA%/Claude/claude_desktop_config.json`

```json
{
  "mcpServers": {
    "AgentMail": {
      "command": "/path/to/your/.venv/bin/agentmail-mcp",
      "env": {
        "AGENTMAIL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
```

Find your path:

```bash
# Activate your virtual environment, then:
which agentmail-mcp
```

### Run Standalone

```bash
export AGENTMAIL_API_KEY=your-api-key
agentmail-mcp
```

---

## Available Tools

| Tool               | Description                     |
| ------------------ | ------------------------------- |
| `create_inbox`     | Create a new email inbox        |
| `list_inboxes`     | List all inboxes                |
| `get_inbox`        | Get inbox details by ID         |
| `delete_inbox`     | Delete an inbox                 |
| `send_message`     | Send an email from an inbox     |
| `reply_to_message` | Reply to an existing message    |
| `list_threads`     | List email threads in an inbox  |
| `get_thread`       | Get thread details and messages |
| `get_attachment`   | Download an attachment          |
| `update_message`   | Update message labels           |

---

## Client Configuration

### Cursor, VS Code, Windsurf

Add the same MCP server entry in your client config file:

Cursor: `.cursor/mcp.json`  
VS Code: `.vscode/mcp.json`  
Windsurf: MCP config file

```json
{
  "mcpServers": {
    "AgentMail": {
      "command": "npx",
      "args": ["-y", "agentmail-mcp"],
      "env": {
        "AGENTMAIL_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
```

---

## Compatible Clients

The AgentMail MCP server works with any MCP-compatible client:

- Claude Desktop
- Cursor
- VS Code
- Windsurf
- Cline
- Goose
- Raycast
- ChatGPT
- Amazon Q
- Codex
- Gemini CLI
- LibreChat
- Roo Code
- And more...

---

## Example Usage

Once configured, you can ask your AI assistant:

- "Create a new inbox for support emails"
- "Send an email to [email protected] with subject 'Hello'"
- "Check my inbox for new messages"
- "Reply to the latest email thanking them"
- "List all my email threads"
- "Download the attachment from the last message"

---

## Troubleshooting

### "Command not found"

Ensure npm/npx is in your PATH, or use the full path:

```json
"command": "/usr/local/bin/npx"
```

### "Invalid API key"

Verify your API key is correct and has the necessary permissions.

### Python package not found

Use the full path to the agentmail-mcp executable in your virtual environment:

```bash
# Find the path
source /path/to/venv/bin/activate
which agentmail-mcp
```

Overview

This skill provides an AgentMail MCP server that connects email tools to any MCP-compatible AI client. It offers hosted and local deployment options and exposes inbox, message, thread, attachment, and label-management tools. Use it to manage sending, receiving, and threading email from assistants like Claude Desktop, Cursor, VS Code, and more.

How this skill works

The server runs as a hosted endpoint or a local process (npm npx or Python package) and authenticates using your AgentMail API key. It exposes a set of MCP tools (create_inbox, send_message, list_threads, get_attachment, etc.) which MCP clients call to perform inbox and message operations. Configure your client by adding an AgentMail MCP server entry and supplying the AGENTMAIL_API_KEY via env or config.

When to use it

  • When you need an AI assistant to send or reply to email on your behalf.
  • When integrating email workflows into Claude Desktop, Cursor, VS Code, Windsurf, or other MCP clients.
  • When you want a local development server for testing email tooling with npx or a Python virtualenv.
  • When you need programmatic access to threads, attachments, or inbox management from an assistant.
  • When you prefer a hosted option to avoid local installation and keep setup minimal.

Best practices

  • Store AGENTMAIL_API_KEY in environment variables or secure client config, not plaintext code.
  • Limit tool exposure by launching the server with --tools when only a subset of functionality is needed.
  • Use the hosted URL for quick setup; use local npm or Python installs for development and offline control.
  • Verify your client’s MCP config path (Claude Desktop, Cursor, VS Code locations) and test with a single command first.
  • Troubleshoot by confirming npx/npm is in PATH or by using the full executable path for Python installs.

Example use cases

  • Ask your assistant to create a new inbox for support and start routing messages to it.
  • Have the assistant draft and send an email from a selected inbox to a customer.
  • List recent threads and ask the assistant to summarize or reply to the latest thread.
  • Download an attachment from the most recent message and save it locally.
  • Programmatically update message labels or archive conversations via assistant commands.

FAQ

How do I supply my API key to the MCP client?

Add AGENTMAIL_API_KEY to the MCP server entry env object or set it in your shell environment before launching the server.

Which clients are compatible?

Any MCP-compatible client works, including Claude Desktop, Cursor, VS Code, Windsurf, Raycast, and many CLI or GUI MCP clients.