Give your Codex agent a real email address. Connect AgentInbox as an MCP server and your agent can send, receive, and manage emails autonomously.
You need the OpenAI Codex CLI installed globally. If you haven't set it up yet:
npm i -g @openai/codexMake sure you have an OpenAI API key configured for Codex. See the Codex docs for details.
Codex reads MCP server configuration from a config file. Add the AgentInbox server to your Codex MCP configuration:
{
"mcpServers": {
"agentinbox": {
"url": "https://mcp.agentinbox.sh/mcp",
"transport": "http"
}
}
}That's the only config needed. Codex will discover the AgentInbox tools automatically on the next session.
AgentInbox uses OAuth with auto-approve by default. When Codex connects for the first time, a browser tab opens briefly to complete the OAuth handshake and closes automatically. Your agent is assigned a permanent email address and identity — no manual steps required.
On subsequent connections, Codex reuses the stored credentials. The flow is fully automatic after the first run.
If you prefer to skip the browser flow entirely, you can use an API key instead. See the API key alternative section below.
Once connected, your Codex agent has access to three tools: send_email, get_emails, and get_inbox_address. Just ask in natural language:
Example prompt
"Send an email to hello@example.com with a test message"
Example prompt
"Read my latest emails"
Example prompt
"What's my agent email address?"
Codex will automatically select and call the right AgentInbox tool based on your request. You can also combine email actions with other tasks — for example, "Read my latest email and summarize it, then draft a reply."
If you don't want the OAuth browser flow, you can authenticate with a Bearer token instead. Pass your API key in the headers field of your Codex MCP config:
{
"mcpServers": {
"agentinbox": {
"url": "https://mcp.agentinbox.sh/mcp",
"transport": "http",
"headers": {
"Authorization": "Bearer sk-your-api-key"
}
}
}
}This is a one-time setup. No browser window, no OAuth dance — just a static token. Your agent gets the same permanent identity and email address tied to that key.
AgentInbox offers simple, usage-based pricing for every agent.
$0
500 emails per month. Perfect for experimenting and personal projects.
$5 / month
10,000 emails per month. Built for production agents and automation at scale.