Install langchain[mcp] 1.4 or later, wrap a FastMCP Client pointed at https://agentline.nz/mcp with your Agentline NZ API key as auth in langchain.mcp.MCPAdapter, and pass adapter.list_tools() to create_agent. The agent can then send and read email from its own @agentline.nz inbox and wait for one-time codes sent by email.
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
- Install LangChain with MCP support. langchain.mcp replaces the separate langchain-mcp-adapters package. If you have the old package, uninstall it.
pip install "langchain[mcp]>=1.4.0" pip uninstall langchain-mcp-adapters - Connect and build the agent. A string passed as auth is sent as Authorization: Bearer, and an https URL selects Streamable HTTP.
import asyncio, os from fastmcp.client import Client from langchain.agents import create_agent from langchain.mcp import MCPAdapter async def main(): client = Client("https://agentline.nz/mcp", auth=os.environ["AGENTLINE_KEY"]) async with MCPAdapter(client) as adapter: tools = await adapter.list_tools() agent = create_agent("claude-sonnet-5", tools) result = await agent.ainvoke( {"messages": [{"role": "user", "content": "What's my Agentline NZ email address?"}]} ) print(result["messages"][-1].content) asyncio.run(main()) - Run it. Run the script. The agent should call get_my_number.
Good to know
- langchain.mcp is in beta and raises LangChainBetaWarning. It doesn't wrap MCP prompts or resources yet, but Agentline NZ only uses tools.
- LangGraph's create_react_agent is replaced by langchain.agents.create_agent, which runs on LangGraph.
- Use any chat model your LangChain install supports in create_agent.
- Texting and phone numbers are coming soon. To hear when they're ready, join the waitlist.
FAQ
Can I still use MultiServerMCPClient?
LangChain's migration guide replaces langchain-mcp-adapters and MultiServerMCPClient with langchain.mcp.MCPAdapter. Existing code with transport http and a headers entry keeps working until you migrate.
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.
Related
- Connect the OpenAI Agents SDK to an agent email inbox
- Connect LlamaIndex agents to their own email inbox
- Connect CrewAI agents to their own email inbox
- How do I create an Agentline NZ API key?
Start free · No credit card needed to sign up. Start free with an email inbox, or try Starter or Pro free for 7 days.