agentmail-mcp
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.
What this skill does
# 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`
**Authentication:** OAuth 2.0 via Smithery. The remote server does NOT accept an API key in
env — it returns `401 Bearer error="invalid_token"` and redirects your MCP client through
the OAuth authorization server at `https://auth.smithery.ai/agentmail`. The MCP client
handles the browser-based consent flow automatically on first connect.
Add to your MCP client configuration:
```json
{
"mcpServers": {
"AgentMail": {
"url": "https://mcp.agentmail.to"
}
}
}
```
On first use, your MCP client opens a browser window to complete the Smithery OAuth flow;
after approval, tokens are cached by the client. If you need API-key auth (no OAuth flow),
use Option 2 or Option 3 below instead.
---
## 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`
The server accepts the API key in two ways: via `AGENTMAIL_API_KEY` env var, or via the
`--api-key` CLI flag. Use whichever works in your MCP client's launcher environment.
```json
{
"mcpServers": {
"AgentMail": {
"command": "/path/to/your/.venv/bin/agentmail-mcp",
"env": {
"AGENTMAIL_API_KEY": "YOUR_API_KEY"
}
}
}
}
```
If env vars don't propagate through your MCP launcher, pass the key as an argument
instead:
```json
{
"mcpServers": {
"AgentMail": {
"command": "/path/to/your/.venv/bin/agentmail-mcp",
"args": ["--api-key", "YOUR_API_KEY"]
}
}
}
```
Find your path:
```bash
# Activate your virtual environment, then:
which agentmail-mcp
```
### Run Standalone
```bash
# Option A: env var
export AGENTMAIL_API_KEY=your-api-key
agentmail-mcp
# Option B: CLI flag (useful if env vars aren't available)
agentmail-mcp --api-key="your-api-key"
```
---
## Available Tools
The Node MCP server (`npx agentmail-mcp`, Option 1 and Option 2) exposes **17 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 |
| `forward_message` | Forward 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 |
| `create_draft` | Create a draft message |
| `list_drafts` | List drafts in an inbox |
| `get_draft` | Get a draft by ID |
| `update_draft` | Update a draft |
| `send_draft` | Send a previously-created draft |
| `delete_draft` | Delete a draft without sending |
The legacy **Python MCP server** (`pip install agentmail-mcp`, Option 3) is a separate
codebase with a smaller tool set — it omits the six `*_draft` tools above. For new
projects, prefer the Node server (Option 1 or Option 2) for full parity with the toolkit.
---
## 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
```
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.