Skip to main content

AgentMail MCP server for AI assistant email integration

Project description

AgentMail MCP Integration

A simple Model Context Protocol (MCP) server that integrates with AgentMail to dynamically manage email inboxes, list messages, and send or reply to emails—all through an AI assistant such as Claude. This reference implementation demonstrates how to use AgentMail’s API within an MCP server to orchestrate email inboxes on the fly.

About AgentMail

AgentMail is an API-first email provider that allows AI Agents to create inboxes on the fly to send, recieve and take action on emails. We have layers of intelligence built on top of the email layer optimized for agentic workflows and make data digestable by LLMs. Request an API key here!


Important Note

This is a work in progress package as the MCP protocol is still evolving. Will update as soon as new features are added. Join our discord and join the community! Discord

Features

  • Create new inboxes dynamically on the fly
  • List and retrieve inboxes to see what’s active
  • Send emails from any of your AgentMail inboxes
  • Reply to messages within existing threads
  • List threads and messages for a chosen inbox
  • Retrieve attachments for messages

Prerequisites

  • Python 3.10+
  • AgentMail API key
  • (Optional) Claude Desktop or any other front-end that supports MCP commands

Installation

There exists a PyPi package for this project. Once installed, you can reference it in your Claude Desktop configuration (or run it directly) to enable email management tools.

PIP (Local or PyPI)

If you maintain your own Python environment, simply install the package from your virtual enviornment (from PyPI or a local source):

pip install agentmail-mcp

Then run:

agentmail-mcp --api-key="YOUR_AGENTMAIL_API_KEY"

This will get the server running on your local machine.

Option 1: Using Claude Desktop

If you want to interact with the server from Claude Desktop, follow these exact steps.

  1. Activate your virtual environment.
source .venv/bin/activate
  1. Run the line below to find out where the Agentmail MCP server package is located. It should be in some .venv/bin/ directory if you installed the agentmail-mcp package in the virtual environment. For Claude Desktop it is important you installed it in the virtual environment.
which agentmail-mcp
  1. Copy the path that is returned.

  2. Paste the path into the command field in the claude_desktop_config.json file.

  3. Restart Claude Desktop.

Here is what the claude_desktop_config.json file should look like:

{
  "mcpServers": {
    "agentmail-mcp": {
      "command": "/path/to/agentmail-mcp",
      "args": ["--api-key", "{AGENT_MAIL_API_KEY}"]
    }
  }
}

If you don't have a claude_desktop_config.json file, create one in the following directory:

On macOS, the config file is typically located at: ~/Library/Application Support/Claude/claude_desktop_config.json

On Windows, it’s usually located at: %APPDATA%/Claude/claude_desktop_config.json

After saving, restart Claude Desktop to load the new MCP server.

Usage

With your server running in Claude Desktop (or another MCP client), you can prompt Claude with natural language commands that map to AgentMail MCP tools. For example: • “Create a new inbox named demo.” • “List all my inboxes.” • “Send an email from inbox test@agentmail.to to test@example.com with subject ‘Hello’ and body explaining the weather in San Francisco for the past week. • “Reply to the most recent message in inbox abc123.”

Internally, Claude calls the exposed MCP tools (create_inbox, list_inboxes, send_message, etc.), which in turn call the AgentMail API.

License

License

MIT License - This project is distributed under the MIT license. Use at your own risk.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentmail_mcp-0.3.0.tar.gz (35.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentmail_mcp-0.3.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file agentmail_mcp-0.3.0.tar.gz.

File metadata

  • Download URL: agentmail_mcp-0.3.0.tar.gz
  • Upload date:
  • Size: 35.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for agentmail_mcp-0.3.0.tar.gz
Algorithm Hash digest
SHA256 542b655057b0c321c93a5ea830161ce8ac519079b6535011bac5de05f56a69e6
MD5 f729f3296ff7b283acd5e184eb69753c
BLAKE2b-256 a6c1a7b97535ff3751525334b01142adc18b7534d5282a623ca4a175953eb288

See more details on using hashes here.

File details

Details for the file agentmail_mcp-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: agentmail_mcp-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for agentmail_mcp-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0cf916574a9a2a746b92d0a1a23d951bf99760e6ba7c26f28fc0a1e7b4069b14
MD5 230b0cb430d997fdd87c48e0aaf4030b
BLAKE2b-256 2ed5fe537233b7ab0bc55fcf58889b49672c18fc5c723a94546d9a397881489a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page