MCP
Overview
The Model Context Protocol (MCP) is an open standard that lets AI clients call external tools. AgentMail runs a hosted MCP server at https://mcp.agentmail.to/mcp that exposes inbox, message, thread, draft, and attachment tools to any compatible client, plus AgentID tools that create accounts for your agent at services like Firecrawl. Clients that support MCP Events, such as ChatGPT, can also subscribe to new mail and act on it as it arrives.
The server supports two authentication paths:
- OAuth (default, recommended for Claude Desktop, Claude.ai, and ChatGPT). The client signs in through
console.agentmail.toand the server uses your console identity for every call. - API key (for Cursor, Windsurf, and other clients that do not implement the MCP OAuth flow). Pass the key as an
x-api-keyheader; query-string keys end up in logs and history.
If you belong to more than one AgentMail organization, the OAuth consent screen will ask you to pick which one to use before completing the connection.
Setup
Claude Desktop and Claude.ai (OAuth)
- Open Settings, then Connectors, and click Add custom connector.
- Set the name to
AgentMail. - Set the URL to
https://mcp.agentmail.to/mcp. - Click Add, then Connect on the new connector.
- A browser window opens at
console.agentmail.to. Sign in. - If you belong to multiple organizations, pick one on the consent screen.
- Back in Claude, send a test message like
List my AgentMail inboxesto confirm the connection.
OAuth is the recommended path for Claude products. You do not need an API key; the server uses your console identity to call AgentMail on your behalf.
ChatGPT (OAuth)
AgentMail is available as a plugin in ChatGPT.
- Open ChatGPT Plugins, search for AgentMail, and select Install plugin. On a workspace plan, your admin controls which plugins are available.
- Sign in at
console.agentmail.towhen the browser window opens. If you belong to multiple organizations, pick one on the consent screen. - In a chat, type
@and select AgentMail, then sendList my AgentMail inboxesto confirm the connection.
ChatGPT asks you to confirm write actions, such as sending mail or connecting an app, before it runs them. To have ChatGPT act on new mail as it arrives, see MCP Events.
Cursor (API key)
- Generate an API key at console.agentmail.to under Settings, then API Keys.
- Open Cursor settings, go to MCP, and add a server with this config:
Windsurf and other MCP clients
Use the same URL and header pattern as Cursor. If a client cannot send custom headers, use the stdio-based compatibility bridge instead and pass AGENTMAIL_API_KEY through the subprocess environment.
Claude Code
Add the server with the claude mcp command:
Claude Code will run the same OAuth flow on first use. Connectors installed on Claude.ai do not automatically sync to Claude Code, so install it separately.
For Claude Code, Cursor, and Codex, the AgentMail plugin installs this server together with the AgentMail skills.
Create accounts for your agent with AgentID
The connector includes the AgentID tools, so your assistant can create an account for your agent at an app, using an inbox as its identity:
- “Create an account at Firecrawl for my agent.”
- “My agent needs a web search API. Set one up.”
- “Which services is support-bot@agentmail.to signed up for?”
The assistant gives you a single-use sign-in link that expires after five minutes. Open it in the browser that should hold the agent’s session, then ask the assistant to confirm. See AgentID in Claude, ChatGPT, and Cursor for the full walkthrough, including getting an API key.
Get notified when mail arrives
The server publishes a message.received event through MCP Events. In a ChatGPT dot or Work chat, ask something like Whenever support@agentmail.to gets a new email, summarize it for me, and ChatGPT starts the task within seconds of each new email instead of checking the inbox on a schedule. The event carries metadata only; the assistant reads the message itself with get_message.
Available tools
MCP clients discover the live tool catalog from the hosted server. The canonical repository publishes the same runtime-generated contract in mcp-manifest.json, so tool names and schemas do not drift between the runtime, bridges, tests, and documentation.
The server exposes 37 tools, grouped by resource. OAuth sessions also receive 2 organization-selection tools.
Inboxes
Threads
Messages
Drafts
Attachments
Allow and block lists
Agent sign-up
Apps
Accounts
Organizations (OAuth sessions only)
Troubleshooting
Claude says it cannot access AgentMail. The connector is not installed or not connected. Follow the Claude Desktop setup steps above and confirm the connector shows as connected in Settings, then Connectors.
The assistant does not list the AgentID tools. Disconnect and reconnect the AgentMail connector so the client reloads the tool list, then ask List AgentID apps.
OAuth opens console.agentmail.to but says you do not have an account. Sign up at console.agentmail.to first, then retry the connector flow.
You picked the wrong organization on the consent screen. Open Settings, then Connectors, disconnect the AgentMail connector, and connect again. The consent screen will let you choose a different organization.
API key requests return an authentication error. Verify the key in console.agentmail.to under Settings, then API Keys. Confirm the key has not been revoked and that you copied the full value, including the am_ prefix.
Resources
- AgentMail Console to manage API keys and organizations.
- Support for help with installation or auth issues.
- agentmail-mcp on GitHub for the hosted server, compatibility bridges, and generated contract.
