API & MCP
Everything a person can do on Sortbay E-mail (.eml/.mbox) to JSON, a program or AI agent can do with the same inputs and get the identical result.
HTTP API
POST https://sortbayemailparse.usefulweb.site/api/v1/calculate– run Sortbay E-mail (.eml/.mbox) to JSONGET https://sortbayemailparse.usefulweb.site/api/v1/tool– inputs, output schema, examples- OpenAPI 3.1: /openapi.json · /openapi.yaml
- Errors:
application/problem+json;422includes per-fielderrors.
Sortbay E-mail (.eml/.mbox) to JSON
Parses e-mail source the way a mail program would — RFC 5322 headers, MIME multipart, quoted-printable and base64, encoded subjects and file names in any charset, mbox archives — and returns each message as JSON: sender, recipients, date in UTC, subject, the readable text (HTML mail reduced to safe plain text), threading ids and the attachments by name, type and size. Attachment contents are never extracted or stored.
| Field | Type | Default | Description |
|---|---|---|---|
source | textarea | "From: =?UTF-8?Q?J=C3=BCrgen_M=C3=BCller?= <buchhaltung@example.de>\nTo: \"Examp | E-mail source (.eml text) or mbox. Paste the full source of a message (headers, a blank line, then the body) — in most mail programs “Show original” or “View source”. Several messages: paste an mbox (each starts with a “From ” line). |
file | file | — | E-mail file (.eml or .mbox, optional). Up to 10 MB. Used instead of the pasted text when given. Export single mails as .eml or a folder as .mbox from your mail program. |
includeHeaders | boolean | false | Include every header line in the result |
Example request
Invoice with a PDF and a German subject
curl -X POST https://sortbayemailparse.usefulweb.site/api/v1/calculate -H 'content-type: application/json' -d '{"source":"From: =?UTF-8?Q?J=C3=BCrgen_M=C3=BCller?= <buchhaltung@example.de>\nTo: \"Example Ltd, Accounts\" <accounts@example.org>\nSubject: =?UTF-8?B?UmVjaG51bmcgTnIuIDIwMjYtMTE4IOKAkyBiaXR0ZSBwcsO8ZmVu?=\nDate: Tue, 1 Dec 2026 08:03:10 +0000\nMessage-ID: <inv-118@example.de>\nMIME-Version: 1.0\nContent-Type: multipart/mixed; boundary=\"mix-1\"\n\n--mix-1\nContent-Type: multipart/alternative; boundary=\"alt-1\"\n\n--alt-1\nContent-Type: text/plain; charset=ISO-8859-1\nContent-Transfer-Encoding: quoted-printable\n\nGuten Tag,\n\nanbei die Rechnung f=FCr November. Zahlbar innerhalb von 14 Tagen.\n\nGr=FC=DFe\nJ=FCrgen M=FCller\n--alt-1\nContent-Type: text/html; charset=utf-8\n\n<html><body><p>Guten Tag,</p><p>anbei die Rechnung für November.</p><script>alert(1)</script></body></html>\n--alt-1--\n\n--mix-1\nContent-Type: application/pdf; name=\"Rechnung-2026-118.pdf\"\nContent-Disposition: attachment; filename=\"Rechnung-2026-118.pdf\"\nContent-Transfer-Encoding: base64\n\nJVBERi0xLjQKJcfsj6IKMSAwIG9iago8PC9UeXBlL0NhdGFsb2c+PgplbmRvYmoKdHJhaWxlcgo8\nPC9Sb290IDEgMCBSPj4KJSVFT0YK\n--mix-1--\n"}'
Every result contains
inputs (normalised, defaults applied), summary, result (validated against the published schema), units, assumptions, sources, warnings, computedAt and links.
MCP (Model Context Protocol)
- Streamable HTTP endpoint:
https://sortbayemailparse.usefulweb.site/mcp– protocol revisions 2026-07-28 (stateless) and 2025-11-25 / 2025-06-18 / 2025-03-26 (initialize handshake). - Tools:
sortbay_email_parse - Local stdio connector:
node src/mcp-stdio.ts --tool=sortbay-email-parse
{
"mcpServers": {
"sortbay-email-parse": { "type": "http", "url": "https://sortbayemailparse.usefulweb.site/mcp" }
}
}