🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

sendmux-mcp

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sendmux-mcp

Email inbox API and outbound sending tools for AI Agents.

pipPyPI
Version
1.5.0
Weekly downloads
513
Maintainers
1

Email Inbox API + Sending by Sendmux

PyPI version Python versions PyPI downloads Licence

Email inbox API, inbound mail, and outbound sending MCP servers for AI agents, with inbound email, clean JSON parsing, webhooks, and multi-provider routing through Sendmux.

This package is the Sendmux MCP. Keep it separate from any documentation-search MCP used by docs tooling.

Documentation

Requirements

  • Python 3.10 or newer.
  • A send-capable smx_mbx_* key or owner-approved Sending-resource smx_agent_* token for Sending tools.
  • A mailbox-scoped smx_mbx_* key or scoped smx_agent_* token for Mailbox tools.
  • A root smx_root_* key for Management tools.

Installation

pip install sendmux-mcp

Usage

Run a single local server with the per-surface commands.

SENDMUX_API_KEY=smx_mbx_... sendmux-mcp-mailbox
SENDMUX_API_KEY=smx_root_... sendmux-mcp-management
SENDMUX_API_KEY=smx_mbx_... sendmux-mcp-sending

Run a combined local server with sendmux-mcp.

SENDMUX_MCP_SURFACES=mailbox,sending \
SENDMUX_MAILBOX_API_KEY=smx_mbx_... \
SENDMUX_SENDING_API_KEY=smx_mbx_... \
sendmux-mcp

Run all three local surfaces when you have both key types.

SENDMUX_MCP_SURFACES=mailbox,management,sending \
SENDMUX_MAILBOX_API_KEY=smx_mbx_... \
SENDMUX_MANAGEMENT_API_KEY=smx_root_... \
SENDMUX_SENDING_API_KEY=smx_mbx_... \
sendmux-mcp

The generic sendmux-mcp command also accepts --surface or --surfaces. The wrapper commands select exactly one surface.

Transports

stdio is the default transport for local agent clients.

SENDMUX_API_KEY=smx_mbx_... sendmux-mcp-mailbox --transport stdio

http and streamable-http expose the MCP endpoint over HTTP. HTTP mode defaults to 127.0.0.1:8765/mcp and requires a separate MCP bearer token unless you explicitly opt out.

SENDMUX_API_KEY=smx_mbx_... \
SENDMUX_MCP_HTTP_BEARER_TOKEN=local-mcp-token \
sendmux-mcp-mailbox --transport http --host 127.0.0.1 --port 8765 --path /mcp

/health returns a small JSON health response for the selected surfaces.

Hosted Endpoint

The public hosted MCP endpoint is https://mcp.sendmux.ai/mcp.

For hosted clients, use HTTP transport with OAuth. Do not add manual Authorization headers, API keys, custom OAuth endpoints, or custom scopes unless your client explicitly requires them.

Hosted OAuth clients that omit requested scopes during registration or authorization are supported; the server advertises the hosted scope set through discovery and bearer challenges.

The packaged sendmux-mcp-hosted command runs the hosted server runtime. Local and private deployments should use the local commands above unless you are operating a compatible OAuth-backed hosted environment.

Configuration

SettingEnvironmentDefault
Tool surfacesSENDMUX_MCP_SURFACESrequired for sendmux-mcp; wrapper commands select one surface
API key fallbackSENDMUX_API_KEYaccepted for compatible single-key setups
Mailbox API keySENDMUX_MAILBOX_API_KEYrequired when mailbox is selected unless a compatible fallback is provided
Management API keySENDMUX_MANAGEMENT_API_KEYrequired when management is selected unless a compatible fallback is provided
Sending API keySENDMUX_SENDING_API_KEYrequired when sending is selected unless the fallback key is a send-capable smx_mbx_* key or owner-approved Sending-resource smx_agent_* token
App API base URLSENDMUX_APP_BASE_URLhttps://app.sendmux.ai/api/v1
Sending API base URLSENDMUX_SENDING_BASE_URLhttps://smtp.sendmux.ai/api/v1
TransportSENDMUX_MCP_TRANSPORTstdio
HTTP hostSENDMUX_MCP_HOST127.0.0.1
HTTP portSENDMUX_MCP_PORT8765
HTTP pathSENDMUX_MCP_PATH/mcp
HTTP bearer tokenSENDMUX_MCP_HTTP_BEARER_TOKENrequired for HTTP unless opt-out is enabled
Allow unauthenticated HTTPSENDMUX_MCP_ALLOW_UNAUTHENTICATED_HTTPfalse
Allowed browser originsSENDMUX_MCP_ALLOWED_ORIGINSno browser origins
Snapshot directory overrideSENDMUX_MCP_OPENAPI_INPUT_DIR or OPENAPI_INPUT_DIRpackaged snapshots
App snapshot overrideSENDMUX_MCP_APP_OPENAPIpackaged app snapshot
Sending snapshot overrideSENDMUX_MCP_SENDING_OPENAPIpackaged sending snapshot
Request timeoutSENDMUX_MCP_TIMEOUT_SECONDS30
Retry attemptsSENDMUX_MCP_RETRY_MAX_ATTEMPTS3

Packaged OpenAPI snapshots are the default so released tool names, schemas, and descriptions stay stable. Path, directory, and URL overrides are available for development, canary, and debugging runs.

Tool Surfaces

  • Mailbox: 25 tools for granted mailboxes, profile/session discovery, messages, attachments, bounded message waits, threads, folders, search, counts, and mailbox sends. Requires an smx_mbx_* key or scoped smx_agent_* token. Agent tokens remain limited by server-side scopes; pre-claim self-registered agent tokens do not include email.send.
  • Management: 21 tools for domains, mailboxes, logs, metrics, spend summary, and webhooks. Requires an smx_root_* key.
  • Sending: 5 tools for attachment upload refs, single sends, and batch sends. Requires an smx_mbx_* key or owner-approved Sending-resource smx_agent_* token.

The server rejects keys with the wrong prefix before starting.

Attachment Workflow For Agents

Use mailbox_wait_for_message when a user asks an agent to wait for new mail. The tool is bounded; if it returns matched=false, call it again rather than holding an MCP tool call open indefinitely.

When a message has attachments:

  • Call mailbox_read_attachment with message_id and attachment_id when you need the attachment contents.
  • For small text-like attachments, read the returned text.
  • For binary or oversized attachments, use the returned resource_link / download_url promptly outside model context.
  • Use mailbox_get_attachment only when metadata is enough or you need to refresh the link.

Use mailbox_upload_attachment for outbound attachments over MCP. It accepts exactly one input mode:

  • file_path for local stdio MCP when the file is inside a client-declared filesystem root.
  • presign_upload_url=true for hosted MCP or shell-capable agents; upload the file to the returned URL with exact headers and no API key, then send with the returned blob_id.
  • content_base64 only for tiny agent-authored files, capped at 32 KiB decoded. If it is too large, switch to file_path, presigned upload, CLI --attach, or SDK file helpers.

file_path and presigned upload modes use the mailbox attachment cap, currently 7,500,000 bytes per attachment. Presigned uploads also pin the exact declared byte length and content type.

For mailbox sends, mailbox_send_message accepts either tiny inline base64 attachment objects (content, filename, content_type) or uploaded attachment references (blob_id, filename, content_type).

For Sending API sends, call sending_upload_attachment with file_path on local stdio MCP, or call sending_create_attachment_upload and PUT bytes outside model context for hosted/shell-capable agents. Then pass {"attachment_id": "att_..."} in sending_send_email.attachments[]. Avoid Sending inline base64 except for tiny generated content.

Console Scripts

  • sendmux-mcp
  • sendmux-mcp-mailbox
  • sendmux-mcp-management
  • sendmux-mcp-sending
  • sendmux-mcp-hosted

Support

Open an issue in Sendmux/sendmux-sdk with the package name, version, command, transport, and request ID from any API error.

Licence

MIT. See the licence file.

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts