Connect CrewAI agents to their own email inbox

Checked · Markdown

Short answer

Add an MCPServerHTTP to your CrewAI agent's mcps list with url https://agentline.nz/mcp and an Authorization: Bearer header holding your Agentline NZ API key. The agent can then send and read email from its own @agentline.nz inbox and wait for one-time codes sent by email as part of its tasks.

Before you start

  • An Agentline NZ API key from Dashboard → API keys, exported as AGENTLINE_KEY. No credit card needed to sign up. Start free with an email inbox, or try Starter or Pro free for 7 days.
  • Your @agentline.nz email inbox works straight away. Texting and phone numbers are coming soon.

Steps

  1. Install the MCP dependency. In your CrewAI project, add the mcp package.
    uv add mcp
  2. Add Agentline NZ to an agent. Use the mcps field, which CrewAI's docs mark as the recommended way.
    import os
    from crewai import Agent
    from crewai.mcp import MCPServerHTTP
    
    concierge = Agent(
        role="Booking concierge",
        goal="Confirm bookings by email and handle replies",
        backstory="You send short, polite transactional emails for a New Zealand business.",
        mcps=[
            MCPServerHTTP(
                url="https://agentline.nz/mcp",
                headers={"Authorization": f"Bearer {os.environ['AGENTLINE_KEY']}"},
                streamable=True,
                cache_tools_list=True,
            )
        ],
    )
  3. Run your crew. Give the agent a task such as: Email the customer to confirm their 7pm booking and report any reply.

Good to know

  • CrewAI logs and skips an MCP server that fails to connect instead of raising an error, so check the logs if the tools are missing.
  • Don't use the string-URL form with the key in a query string. Keep the key in the header.
  • Transactional and assistant messages only: replies, bookings, confirmations, reminders people asked for, and codes.

FAQ

What does Agentline NZ cost?

Starter is NZ$29/month and Pro is NZ$79/month, billed in NZ dollars. No credit card needed to sign up. Start free with an email inbox, or try Starter or Pro free for 7 days. You can cancel anytime, and your plan stops at the end of the billing period you've paid for. Refunds follow section 5 of our Terms: fees already paid aren't refunded, except where the Terms or the law say so. Agentline NZ is not GST-registered, so no GST is charged.

When does the inbox work, and can my assistant send texts yet?

Your @agentline.nz email inbox works straight away. Texting and phone numbers are coming soon. To hear when texting is ready, join the waitlist.

Can my assistant send marketing or bulk email?

No. Transactional and assistant messages only: replies, bookings, confirmations, reminders people asked for, and codes. Marketing, promotions, cold messages and bulk messages aren't allowed. See What we don't allow.

Start free · No credit card needed to sign up. Start free with an email inbox, or try Starter or Pro free for 7 days.