mcp_servers expose their tools to the agent automatically, so you do not write tool wrappers.
Requirements
- Python 3.10 or newer.
openai-agentsinstalled.- A Sendmux key for the surface you are calling. Mailbox work needs an
smx_mbx_key or a scopedsmx_agent_token.
Install
Connect over local stdio
The SDK manages the subprocess for you and passes your key through its environment.triage.py
sendmux-mcp entry point:
Connect over private HTTP
Use this when the agent runs somewhere it cannot spawn a process. Start the server yourself:Require approval before an agent sends
The SDK can hold a tool for approval before it runs. Pair this with the Sendmux sending gate when a human should see the message first.tool_filter narrows what the model can see at all. Use it to build a
read-only triage agent, then add the sending tools only to the agent that is
meant to reply.Give each user their own mailbox
Mailbox-scoped keys are the isolation boundary. Open a server per tenant so the agent working one tenant structurally cannot read another tenant’s mail.Sending stays gated
A durablesmx_agent_ token includes mailbox.read and email.receive, not email.send. After a named human owner accepts the invite and approves sending, exchange the durable token for a one-hour Sending-resource token and pass that as SENDMUX_SENDING_API_KEY.
Troubleshooting
The agent sees no tools
The agent sees no tools
Confirm the surfaces the server started with.
sendmux-mcp requires
SENDMUX_MCP_SURFACES; the single-surface entry points do not. Check
tool_filter as well, since it hides everything it does not name.The subprocess exits immediately
The subprocess exits immediately
Check the key prefix. Mailbox accepts
smx_mbx_ or a scoped smx_agent_,
Sending accepts a send-capable smx_mbx_ or an owner-approved
Sending-resource smx_agent_, and Management requires smx_root_.Tool calls time out
Tool calls time out
Raise
client_session_timeout_seconds, and set max_retry_attempts so
transient list and call failures retry with backoff.You granted more than one mailbox
You granted more than one mailbox
Start the workflow with
mailbox_list_granted_mailboxes and pass the
returned mailbox_id to tools that act on one mailbox.Next steps
Agent frameworks
Compare connections across frameworks.
MCP
Review environment variables and tool discovery.
Agent access
Register an agent and complete owner approval.
Python SDK
Call Sendmux directly when you want full endpoint coverage.