Skip to main content
Use this section to wire Sendmux into an agent you are building in code. Every framework here reaches Sendmux through MCP, so the tools your agent gets are the tools your key or grant allows.
These pages cover frameworks you build agents with. To configure Sendmux in a coding assistant such as Claude Code or Cursor, use MCP client setup.
Replace placeholder keys and tokens before running any snippet. Do not commit smx_root_, smx_mbx_, or private HTTP bearer tokens to version control.

Choose a connection

Framework agents run without a browser, so pick the connection your runtime can complete. Local stdio is the shortest path for a single service. Private HTTP suits containers, serverless runtimes, and any framework whose MCP client sends headers but cannot spawn a process.
The local package installs from PyPI, so a stdio connection needs Python available in the same runtime. Choose private HTTP when your service runs somewhere that cannot install it.

Pick your framework

Mastra

Connect with @mastra/mcp and hand the tools to an Agent.

LangGraph

Load tools through the LangChain MCP adapters.

CrewAI

Attach tools to a crew with MCPServerAdapter.

AI SDK

Use createMCPClient with generateText or streamText.

OpenAI Agents SDK

Pass a server into mcp_servers on an Agent.

Google ADK

Add an McpToolset to an LlmAgent.

What your agent can do

Tool names are generated from the current public API surfaces, so open your framework’s tool listing after connecting to see what a given key or grant exposes.
Give an agent the narrowest surface that completes its task. A mailbox-scoped key confines the agent to the mail you granted it. A smx_root_ key does not.

Sending stays gated

A durable smx_agent_ token carries mailbox.read and email.receive, not email.send. A named human owner has to accept the invite and approve sending before the agent exchanges that token for a one-hour Sending-resource token. Build the approval step into your agent’s flow rather than around it.

Next steps

MCP

Review connection modes, environment variables, and tool discovery.

Agent access

Register an agent and complete owner approval.

Agent skills

Install the skills pack so agents reach for Sendmux by default.

API keys

Create and scope the credentials your agent uses.

Mastra

Give a Mastra agent a Sendmux mailbox and sending access through MCP.

LangGraph

Load Sendmux mailbox and sending tools into a LangGraph agent through the LangChain MCP adapters.

CrewAI

Attach Sendmux mailbox and sending tools to a CrewAI agent or crew.

AI SDK

Use Sendmux mailbox and sending tools from the AI SDK with generateText or streamText.

OpenAI Agents SDK

Give an OpenAI Agents SDK agent a Sendmux mailbox through an MCP server.

Google ADK

Add Sendmux mailbox and sending tools to a Google ADK agent with an MCP toolset.