MailFlatDocs
Documentation/API References/SDKs & Libraries

SDKs & Libraries

Official, installable clients for the MailFlat API: one line to install, one line to use. Pick your language or AI framework.

All packages

PackageForInstall
mailflatPythonpip install mailflat
@mailflat/sdkJavaScript / TypeScriptnpm i @mailflat/sdk
mailflat-mcpAI assistants (Claude, Cursor)uvx mailflat-mcp
@mailflat/ai-sdkVercel AI SDK agentsnpm i @mailflat/ai-sdk
mailflat.langchainLangChain agentspip install "mailflat[langchain]"
mailflat-sdksJava / SeleniumJitPack, see below
They are all the same API
Every client is a thin, typed wrapper over /api/v1, so behaviour is identical across languages. Authenticate with an account key (mf_live_…) from Agents → API keys.

Install & first call

# install
pip install mailflat
# use: create an inbox and wait for the OTP
from mailflat import MailFlat
mf = MailFlat(api_key="mf_live_…")
inbox = mf.create(label="signup")
otp = inbox.wait_for_otp(timeout=30) # → "482913"
Line by linewhat each step of this Python example does
mf.create(label=…)
Opens a plain-text agent inbox and returns its address.
wait_for_otp(timeout=30)
Polls /latest for you and raises on timeout instead of returning None.
Which one should I pick?Test suite · agent framework · assistant
Writing tests: the Python or JS client. Java if your suite is Selenium/JUnit.
Building an agent in code: the Vercel AI SDK suite or the LangChain toolkit, so the model calls the tools itself.
Using Claude Desktop or Cursor: the MCP server, no code at all.
Any other language: the raw API is six endpoints, see Agent API & MCP.
Java source: github.com/onderyentar21/mailflat-sdks (packages/java-sdk).