AI agents & MCP
Relay is built the way agents like to work: one HTTPS call, a machine-readable spec, and predictable typed errors — no SDK or language runtime to reason about.
Why agents get along with Relay
- One endpoint, one shape.
POST /v1/emailwith a JSON body — trivial to express as a tool definition. - Machine-readable. The full OpenAPI spec lets an agent (or a codegen step) discover every field and error without scraping HTML.
- Deterministic errors. Stable snake_case codes an agent can branch on, instead of prose it has to interpret.
Wrapping the send as a tool
Because there is no SDK, exposing Relay to an agent is just a schema over one fetch. Here's a send tool an LLM can call directly:
// A minimal "send_email" tool an agent can call — no SDK, just fetch.
{
"name": "relay_send_email",
"description": "Send a transactional email via Relay.",
"input_schema": {
"type": "object",
"required": ["to", "subject"],
"properties": {
"to": { "type": "array", "items": { "type": "string" } },
"subject": { "type": "string" },
"html_body": { "type": "string" }
}
}
}MCP
A hosted Model Context Protocol server — so assistants like Claude and Cursor can send, look up activity, and manage suppressions through Relay — is on the near roadmap. The API surface it exposes is exactly the one documented here, so anything you build against the HTTPS API maps one-to-one to the MCP tools.