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.
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.
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!
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
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.
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.
If you want to interact with the server from Claude Desktop, follow these exact steps.
source .venv/bin/activate
which agentmail-mcp
Copy the path that is returned.
Paste the path into the command
field in the claude_desktop_config.json
file.
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.
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 [email protected] to [email protected] 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
MIT License - This project is distributed under the MIT license. Use at your own risk.
⸻