MarmunkDevelopers
Answers

Both. They are the same contract with different doors.

Teams wiring agents to email usually frame this as a choice between paradigms. In Marmunk it is not: the MCP tools are generated from the same types as the TypeScript SDK and the OpenAPI document, so both doors lead to identical semantics — same idempotency rules, same msg_* resources, same status vocabulary. The real question is where the sending decision is made.

01

The one rule

Who decides to send? If an LLM decides — mid-conversation, from context you cannot enumerate in advance — the agent needs MCP tools. If your application code decides (checkout completed → send receipt), the send is a deterministic API call from your backend, and REST or the SDK is simpler.

The two compose freely. A support agent with MCP tools can escalate a complex case, and your backend still sends the “case resolved” email deterministically. Both appear in the same trace history because they are the same platform.

02

When the agent decides

Connect over hosted MCP — a Streamable HTTP endpoint with OAuth, so a human connects the agent once through the dashboard flow and no key ever sits in a prompt or config file. Use this for agents whose whole value is judgment: an ops copilot that triages incidents and notifies the right people, an assistant that sends order updates when a customer asks.

The tool surface stays small and legible — send, trace, list — and because the tools return the platform’s status vocabulary, the agent reports outcomes accurately instead of paraphrasing “202 Accepted” into “delivered.”

03

When your backend decides

Deterministic sends belong in your code: receipts, MFA codes, password resets, fulfillment notices. These don’t need an LLM in the loop — they need reliability, idempotency keys bound to the business event, and signed webhooks confirming delivery. Call the REST API directly or use the generated TypeScript SDK, which is built from the same OpenAPI document the MCP tools come from.

Keeping these sends out of the agent’s tool surface also shrinks what a prompt injection or confused planner can touch.

04

The common hybrid

Most production setups end up hybrid: the backend owns the high-volume deterministic flows, the agent holds a scoped, expiring credential for the judgment-driven ones. Because plan envelopes are hard caps shared across both doors, the agent can never exhaust the mailbox your checkout flow depends on — the cap simply fails closed, visibly, in the trace.

Start with Connect your agent for the MCP path and the Quickstart for the REST path; both sit on the same canonical contract.