AgentMail MCP server

AgentMail hosted mailbox tools through its documented stdio bridge. Requires an AgentMail API key; runtime tools are discovered from the hosted service.

Local (stdio)Credential

Set up AgentMail

Configuration examples, not tested connections. Replace placeholders and review the upstream documentation before use.

Claude Code

Run in your terminal.

claude mcp add agentmail --env AGENTMAIL_API_KEY="$AGENTMAIL_API_KEY" -- npx -y agentmail-mcp

Cursor

Merge into ~/.cursor/mcp.json

{
  "mcpServers": {
    "agentmail": {
      "command": "npx",
      "args": [
        "-y",
        "agentmail-mcp"
      ],
      "env": {
        "AGENTMAIL_API_KEY": "REPLACE_WITH_AGENTMAIL_API_KEY"
      }
    }
  }
}

Codex

Run in your terminal.

codex mcp add agentmail --env AGENTMAIL_API_KEY="$AGENTMAIL_API_KEY" -- npx -y agentmail-mcp

Gemini CLI

Merge into ~/.gemini/settings.json

{
  "mcpServers": {
    "agentmail": {
      "command": "npx",
      "args": [
        "-y",
        "agentmail-mcp"
      ],
      "env": {
        "AGENTMAIL_API_KEY": "REPLACE_WITH_AGENTMAIL_API_KEY"
      }
    }
  }
}

OpenCode

Merge into ~/.config/opencode/opencode.jsonc

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "agentmail": {
      "type": "local",
      "command": [
        "npx",
        "-y",
        "agentmail-mcp"
      ],
      "enabled": true,
      "environment": {
        "AGENTMAIL_API_KEY": "REPLACE_WITH_AGENTMAIL_API_KEY"
      }
    }
  }
}

VS Code

Merge into .vscode/mcp.json

{
  "servers": {
    "agentmail": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "agentmail-mcp"
      ],
      "env": {
        "AGENTMAIL_API_KEY": "${input:AGENTMAIL_API_KEY}"
      }
    }
  },
  "inputs": [
    {
      "id": "AGENTMAIL_API_KEY",
      "type": "promptString",
      "description": "AGENTMAIL_API_KEY",
      "password": true
    }
  ]
}

Using more than one server?Add to a config with other servers

Step-by-step setup guides: Claude Code and Codex CLI, Cursor and VS Code. In Claude Desktop, the Cursor JSON goes in claude_desktop_config.json. This is a local server that runs on your machine; see remote vs local servers and authentication and security basics.

Overview

AgentMail is an email service for AI agents, and agentmail-mcp is its Model Context Protocol integration. Upstream now keeps a single tool implementation on a hosted server at https://mcp.agentmail.to/mcp. The npm package agentmail-mcp, used in the snippets below, is a thin stdio bridge to that hosted server; a Python bridge with the same name runs through uvx.

Use it when an agent needs a real mailbox: to receive sign-up or verification emails, read and reply to messages, or run outreach and support workflows without borrowing a personal account. This registry lists example tools such as list_inboxes, get_inbox, list_messages and get_message. The bridges discover the current tools and their schemas from the hosted service at runtime, so the exact list can change upstream without a new package release. Stdio clients that want fewer tools can pass --tools with a comma-separated list.

Setup and authentication: you need an AgentMail account and API key, passed to the bridge as the AGENTMAIL_API_KEY environment variable. The snippets keep it out of the command line; Claude Code and Codex read it from your shell, and the JSON examples use a placeholder for you to replace. If your client supports remote MCP servers, upstream recommends connecting to the hosted endpoint directly, which supports OAuth sign-in as well as an API key sent in an x-api-key header. Anything the agent can read in its inboxes becomes model context, so treat incoming mail as untrusted input.

Example tools

  • list_inboxes
  • get_inbox
  • list_messages
  • get_message

Tool names are upstream examples. The server's live tool list can differ.

Browse Productivity servers

Sources

This page was written from the upstream documentation below and last reviewed on 11 October 2026. Listing is not a security or compatibility endorsement. Report a correction through the contact page.