Connect AgentInbox to Claude Code in one command. Your agent gets its own email address and can send, receive, and thread emails — no API keys required.
npm install -g @anthropic-ai/claude-code and follow the setup prompts.Open your terminal and run this single command:
claude mcp add --transport http agentinbox https://mcp.agentinbox.sh/mcpThat's it. This registers AgentInbox as an MCP server in your Claude Code configuration. The server URL is stored locally and persists across sessions.
The first time Claude Code connects to AgentInbox, it needs to authenticate via OAuth. Here's what happens:
401 response.agent-b4a0@agent-mail.agentinbox.sh.On every subsequent session, authentication is fully automatic — no browser opens, no prompts. The stored credentials are reused silently.
Just tell Claude Code what you want to send in plain English:
> Send an email to hello@example.com saying I'm testing AgentInboxClaude Code will call the send_email tool behind the scenes, filling in the to, subject, and body fields automatically. You'll see a confirmation with the email ID and your agent's sender address.
Your agent can receive emails too. Anyone who replies to your agent's address lands in the inbox:
> Check my inbox for new emailsThis calls the get_emails tool. Claude Code will summarize the results — showing sender, subject, and a preview of each email.
Not sure what address was assigned? Just ask:
> What's my email address?This calls get_inbox_address and returns your agent's email, display name, plan tier, and domain. Share this address with anyone who needs to email your agent.
AgentInbox supports email threads using the inReplyTo parameter. When your agent replies to an email, pass the original messageId as inReplyTo — this sets the standard In-Reply-To and References headers so email clients group messages into a conversation.
> Reply to the last email from alice@example.com and say "Thanks, I'll look into that"Claude Code is smart enough to fetch the inbox, find the relevant message, extract the messageId, and pass it as inReplyTo automatically. You can also filter by thread using threadId in the get_emails tool.
Need rich formatting? The send_email tool accepts an optional htmlBody parameter alongside the plain-text body.
When htmlBody is provided, the email is sent as a multipart MIME message — email clients that support HTML will render the rich version, while others fall back to the plain-text body. Just ask Claude Code to send an HTML email and it will construct the markup for you.
If you prefer to skip the OAuth flow entirely, you can use an API key. Add this to your .mcp.json file:
{
"mcpServers": {
"agentinbox": {
"url": "https://mcp.agentinbox.sh/mcp",
"headers": {
"Authorization": "Bearer sk-your-api-key"
}
}
}
}With a Bearer token, no browser window opens at all. The agent is identified by its API key and gets the same persistent email address every time.
$0
per month
$5
per month