newsman
Run opt-in email on your own Cloudflare account with Rust and Amazon SES. Every web action is also a tool on the HTTP MCP server.
This is a web app spec on Spekkr, published by dwrtz. It is listed with the other specs. Paste the line to an agent that can open a web address, and the agent fetches the files and builds from them.
- Spec
dwrtz/newsman- Version
- 0.4.1
- Published by
- dwrtz
- Updated
- 25 Nov 2026
This is version 0.4.1, the newest. This address stays with 0.4.1 when a later version is published. The spec's page always shows the newest.
Build this version
Build the spec at https://spekkr.com/dwrtz/newsman/v/0.4.1/start.md.
Paste this to your AI agent. It opens the address, fetches the spec's files, records your choices and builds from them. Nothing to install, no account.
Published by dwrtz.
What does the result look like?
What can I customize?
Your choices go into the line you copy. Anything else is yours to edit, but it leaves the tested path.
What do I get?
-
spec.mdRequirements for a self-hosted opt-in email application with complete HTTP MCP access.newsman
newsman is a self-hosted alternative to beehiiv for sending email to people who have opted in. A museum can announce an exhibit, a software team can send release notes, and a writer can publish a newsletter. The operator chooses the purpose, audience and timing of each message. A single, email-only announcement is a complete use case.
The HTTP MCP server is a full publishing interface. An authorized client can compose, upload an image, choose an audience, test a message, inspect its cost, commit a send, read delivery receipts and export the results. The Rust server runs the same operations for the browser and MCP. An operator can begin a task in one client and finish it in another. MCP contract · Operation schemas
Run the Rust Worker and data stores in the operator’s Cloudflare account, using the operator’s Amazon SES identity for delivery. The reference implementation is available under the MIT license. Source and installation guide
R1. Install one independent workspace
One installation owns its messages, audience, operators, credentials and records. Bootstrap a single allowlisted operator or a small team of named operators. A publisher can use verified email codes for browser sign-in and authorize both MCP resources exclusively for these operators. Keep the recipient-facing consent pages available to holders of their own proofs. Collect a display name, sender identity, monitored reply address, footer, time zone and public HTTPS origin. newsman can serve its own recipient signup and consent pages. Operators can also link to those pages from an existing site. An installation can begin empty.
Accept when the operator can create and preview a draft in a clean installation, see which delivery prerequisites remain, and connect a remote MCP client. An empty allowlist closes operator access.
R2. Provide every application action over HTTP MCP
The public URLs of the two MCP surfaces are the installation origin plus
/mcpfor operators and/reader/mcpfor recipients. The registry defines a named tool for every web action, including reports, private file transfers, revisions, grant management and failure recovery. Use a shared command and query implementation. A visual control and its tool must apply the same authorization, validation and side effects. An operator can delegate fewer scopes to an individual client.Accept when a full-scope client can perform every console operation with structured inputs and outputs, including retrieving the bytes of a generated export. The release test detects a web operation missing from MCP. Parity tests
R3. Record consent and respect opt-outs
The hosted signup form accepts an email address and optional acquisition tags. Use a generic check-inbox response. A confirmation email provides a purpose-bound proof. Opening the landing page displays the confirmation step. The recipient’s explicit action records consent once. Support confirmation resends and idempotent opt-outs by form, recipient MCP tool or one-click email action. Preserve the distinction between a voluntary unsubscribe, a hard bounce and a complaint. Require fresh consent for voluntary re-subscription and retain protective holds.
Accept when duplicate submissions and a link scanner’s GET create zero extra confirmations, and an opt-out blocks a queued delivery that has yet to reach the provider.
R4. Manage the audience and its data
Search recipients, inspect consent history, manage tags and save segments. Show audience counts and suppression exclusions before committing a send. Export records in a portable format. Provide audited suppression and erasure with a minimal keyed suppression record for respecting previous opt-outs. Stage bulk input, inspect diagnostics and reconcile the eligible set before committing an import. An operator can start with new signups or import from a prior provider.
Accept when an imported active row cannot override a complaint. A segment preview and its exported results identify the same eligible recipients at the same cut. Import and cutover
R5. Create a message
Save versions of the title, subject, preheader, HTML and plain text. Work from a blank draft, a template or a supplied source bundle. Include optional accessible images and links. Render previews from the same validated content used for the send. The stable tool names beginning with
issue_apply to any message. An operator may optionally attach a canonical URL and choose a time for a web release. The default workflow ends in the recipient’s inbox.Accept when a one-off message can be composed, rendered and sent using only the hosted app and an email address. An operator can restore an old revision, preview the result and distinguish the draft from a prior approved version.
R6. Choose when and to whom to send
Support sending immediately and scheduling a particular message for an operator-selected instant. Test sends go to configured test recipients. A prepare operation returns the content digest, audience selection, counts, sender identity, intended send time and estimated base cost. A separate commit accepts that exact plan. Recheck every recipient’s eligibility before submission. A cancellation fences remaining work. The console and MCP expose uncertainty about any request already sent to SES.
Accept when committing a reviewed plan through the web and replaying it through MCP produces one campaign. Editing its source cannot change the frozen content. Two messages can be sent at unrelated times without a configured series or subscription interval.
R7. Audit delivery and engagement
Distinguish provider acceptance, destination-server delivery, bounce, complaint, opt-out and uncertain submission. A duplicate notification must have one effect. Provide filtered reports with units, observation windows and denominators. Clearly label optional click measurement, imported provider statistics and unavailable data. Keep attribution optional and apply the installation’s reporting time zone. Tie delivery and operator actions back to the relevant immutable revision.
Accept when repeated or out-of-order delivery feedback leaves campaign totals and suppression consistent. An authorized client can page reports and audit records through either interface. Delivery contract
R8. Offer an optional public handoff
When the operator chooses a web copy, export an archive bundle and preserve supplied identifiers and release metadata. The owner of that website controls its publication. A message can precede, coincide with or follow that release. Verification records what a request to the configured destination actually observes. Links presented to recipients must resolve at the time of use.
Accept when a message with no canonical URL, feed or release date needs no archive operations to send. An opt-in handoff can be downloaded and later verified without creating another delivery.
R9. Operate and recover
Show sender readiness, queue health, provider limits and available recovery actions. Use durable job and delivery records to resume work after interruptions. Separate local mail capture and production sending. Keep credential material, confirmation proofs and addresses out of operational logs. A restore must carry forward recent suppressions and reconcile attempts with uncertain outcomes.
Accept when the same message is processed through a duplicate wake-up, a simulated provider timeout and an operator recovery, with one delivery or an explicit unresolved attempt for every eligible recipient.
Screenshots
The reference console uses self-hosted Geist Sans. A bold lowercase wordmark identifies the workspace, semibold headings mark each screen, and tabular numerals keep counts aligned as values change.
The gallery shows a running instance with example data. The publishing desk shows recent messages and delivery status on desktop and mobile. The editor opens an individual draft. The MCP connections screen gives a client the endpoint and shows its access. Publishing desk · Message editor · HTTP MCP connections · Mobile publishing desk
# newsman newsman is a self-hosted alternative to beehiiv for sending email to people who have opted in. A museum can announce an exhibit, a software team can send release notes, and a writer can publish a newsletter. The operator chooses the purpose, audience and timing of each message. A single, email-only announcement is a complete use case. **The HTTP MCP server is a full publishing interface.** An authorized client can compose, upload an image, choose an audience, test a message, inspect its cost, commit a send, read delivery receipts and export the results. The Rust server runs the same operations for the browser and MCP. An operator can begin a task in one client and finish it in another. [MCP contract](parity.md) · [Operation schemas](operations.json) Run the Rust Worker and data stores in the operator’s Cloudflare account, using the operator’s Amazon SES identity for delivery. The reference implementation is available under the MIT license. [Source and installation guide](https://github.com/dwrtz/newsman) ## R1. Install one independent workspace One installation owns its messages, audience, operators, credentials and records. Bootstrap a single allowlisted operator or a small team of named operators. A publisher can use verified email codes for browser sign-in and authorize both MCP resources exclusively for these operators. Keep the recipient-facing consent pages available to holders of their own proofs. Collect a display name, sender identity, monitored reply address, footer, time zone and public HTTPS origin. newsman can serve its own recipient signup and consent pages. Operators can also link to those pages from an existing site. An installation can begin empty. **Accept when** the operator can create and preview a draft in a clean installation, see which delivery prerequisites remain, and connect a remote MCP client. An empty allowlist closes operator access. ## R2. Provide every application action over HTTP MCP The public URLs of the two MCP surfaces are the installation origin plus `/mcp` for operators and `/reader/mcp` for recipients. The registry defines a named tool for every web action, including reports, private file transfers, revisions, grant management and failure recovery. Use a shared command and query implementation. A visual control and its tool must apply the same authorization, validation and side effects. An operator can delegate fewer scopes to an individual client. **Accept when** a full-scope client can perform every console operation with structured inputs and outputs, including retrieving the bytes of a generated export. The release test detects a web operation missing from MCP. [Parity tests](acceptance.md) ## R3. Record consent and respect opt-outs The hosted signup form accepts an email address and optional acquisition tags. Use a generic check-inbox response. A confirmation email provides a purpose-bound proof. Opening the landing page displays the confirmation step. The recipient’s explicit action records consent once. Support confirmation resends and idempotent opt-outs by form, recipient MCP tool or one-click email action. Preserve the distinction between a voluntary unsubscribe, a hard bounce and a complaint. Require fresh consent for voluntary re-subscription and retain protective holds. **Accept when** duplicate submissions and a link scanner’s GET create zero extra confirmations, and an opt-out blocks a queued delivery that has yet to reach the provider. ## R4. Manage the audience and its data Search recipients, inspect consent history, manage tags and save segments. Show audience counts and suppression exclusions before committing a send. Export records in a portable format. Provide audited suppression and erasure with a minimal keyed suppression record for respecting previous opt-outs. Stage bulk input, inspect diagnostics and reconcile the eligible set before committing an import. An operator can start with new signups or import from a prior provider. **Accept when** an imported active row cannot override a complaint. A segment preview and its exported results identify the same eligible recipients at the same cut. [Import and cutover](migration.md) ## R5. Create a message Save versions of the title, subject, preheader, HTML and plain text. Work from a blank draft, a template or a supplied source bundle. Include optional accessible images and links. Render previews from the same validated content used for the send. The stable tool names beginning with `issue_` apply to any message. An operator may optionally attach a canonical URL and choose a time for a web release. The default workflow ends in the recipient’s inbox. **Accept when** a one-off message can be composed, rendered and sent using only the hosted app and an email address. An operator can restore an old revision, preview the result and distinguish the draft from a prior approved version. ## R6. Choose when and to whom to send Support sending immediately and scheduling a particular message for an operator-selected instant. Test sends go to configured test recipients. A prepare operation returns the content digest, audience selection, counts, sender identity, intended send time and estimated base cost. A separate commit accepts that exact plan. Recheck every recipient’s eligibility before submission. A cancellation fences remaining work. The console and MCP expose uncertainty about any request already sent to SES. **Accept when** committing a reviewed plan through the web and replaying it through MCP produces one campaign. Editing its source cannot change the frozen content. Two messages can be sent at unrelated times without a configured series or subscription interval. ## R7. Audit delivery and engagement Distinguish provider acceptance, destination-server delivery, bounce, complaint, opt-out and uncertain submission. A duplicate notification must have one effect. Provide filtered reports with units, observation windows and denominators. Clearly label optional click measurement, imported provider statistics and unavailable data. Keep attribution optional and apply the installation’s reporting time zone. Tie delivery and operator actions back to the relevant immutable revision. **Accept when** repeated or out-of-order delivery feedback leaves campaign totals and suppression consistent. An authorized client can page reports and audit records through either interface. [Delivery contract](delivery.md) ## R8. Offer an optional public handoff When the operator chooses a web copy, export an archive bundle and preserve supplied identifiers and release metadata. The owner of that website controls its publication. A message can precede, coincide with or follow that release. Verification records what a request to the configured destination actually observes. Links presented to recipients must resolve at the time of use. **Accept when** a message with no canonical URL, feed or release date needs no archive operations to send. An opt-in handoff can be downloaded and later verified without creating another delivery. ## R9. Operate and recover Show sender readiness, queue health, provider limits and available recovery actions. Use durable job and delivery records to resume work after interruptions. Separate local mail capture and production sending. Keep credential material, confirmation proofs and addresses out of operational logs. A restore must carry forward recent suppressions and reconcile attempts with uncertain outcomes. **Accept when** the same message is processed through a duplicate wake-up, a simulated provider timeout and an operator recovery, with one delivery or an explicit unresolved attempt for every eligible recipient. ## Screenshots The reference console uses self-hosted Geist Sans. A bold lowercase wordmark identifies the workspace, semibold headings mark each screen, and tabular numerals keep counts aligned as values change. The gallery shows a running instance with example data. The publishing desk shows recent messages and delivery status on desktop and mobile. The editor opens an individual draft. The MCP connections screen gives a client the endpoint and shows its access. [Publishing desk](shots/overview.png) · [Message editor](shots/compose.png) · [HTTP MCP connections](shots/mcp.png) · [Mobile publishing desk](shots/overview-mobile.png)
-
operations.jsonMachine-readable registry and schemas for operator and recipient HTTP MCP tools and web actions. -
parity.mdClient connection, examples, permissions, file transfer and web/MCP parity checks.# Operate newsman over HTTP MCP A client with the operator’s full delegated authority can do the whole job over HTTPS. The same Rust command updates a message whether an operator clicks Save in the console or an agent calls `issue_update`. A client can retrieve content, digests, receipts, reports and file bytes as structured results. Screen automation is unnecessary. ## One operation registry [operations.json](operations.json) is the versioned inventory of names, scopes, views, inputs and outputs. The console uses the same inventory as MCP. The operator surface currently contains 59 tools and the separately exposed recipient surface contains five. Operators reach the HTTP adapter through `POST /api/ops/{name}` and remote clients use `POST /mcp`. Retain existing tool names for compatibility. On the wire, an “issue” is a message draft and a “campaign” is a committed delivery. | Goal | Example calls in order | | --- | --- | | Compose a standalone message | `issue_create`, `issue_update`, `issue_render`, `send_test` | | Import material and send | `file_begin`, `file_write`, `file_finish`, `issue_import`, `segment_preview`, `send_prepare`, `send_commit` | | Follow a committed send | `campaign_get`, `attempts_list`, `report_get`. Use `send_cancel` to stop remaining submissions | | Recover an interrupted task | `jobs_list`, `job_get`, `job_retry` or `attempt_resolve`, according to the recorded outcome | | Export private records | `export_create`, `job_get`, successive `file_read` calls, then verify the result digest | | Administer access | `operators_add`, `operators_list`, `grants_list`, `grants_revoke`, `operators_remove` | | Manage one recipient’s consent | `reader_info`, `reader_subscribe`, `reader_resend`, `reader_confirm`, `reader_unsubscribe` on `/reader/mcp` | ## Connect Configure the deployment’s canonical HTTPS origin. Connect the client to its `/mcp` endpoint, authorize the requested scopes, initialize, and discover tools with `tools/list`. The server negotiates MCP revisions `2025-11-25`, `2025-06-18` and `2025-03-26` over Streamable HTTP. Each tool advertises its OAuth scope when the endpoint is protected. The March revision returns the same domain result as JSON text. Requests include the negotiated protocol header and allow JSON and event-stream responses. At the operator endpoint a signed-in bearer grant is required. A missing or invalid credential receives an HTTP challenge carrying the protected-resource metadata URL. The reader endpoint exposes signup and narrowly scoped actions on proofs received by email. In email-code mode an approved operator must delegate a separate read grant naming the reader endpoint. [Authorization and transport](access.md) ## Try a send from an MCP client The following JSON-RPC messages illustrate tool calls after initialization. Use IDs returned by the running installation. Creation, update and send commands use a caller-provided idempotency key. ```json {"jsonrpc":"2.0","id":21,"method":"tools/call","params":{"name":"send_prepare","arguments":{"key":"prepare-release-003","issue_id":"message-003","issue_version":2,"audience":{"statuses":["active"]}}}} ``` Omitting a future send time requests dispatch on commit. Inspect the returned subject, sender, counts, costs and digest before committing. Pass the exact plan ID and digest to `send_commit` with a new command key. Use the resulting campaign ID to read progress. ```json {"jsonrpc":"2.0","id":22,"method":"tools/call","params":{"name":"campaign_get","arguments":{"id":"campaign-003"}}} ``` A successful tool result provides the structured output declared by the registry and a text representation for clients that consume text. Clients can list and call tools without loading the console. Per-tool schemas resolve shared definitions and have object roots. ## Cross-interface consistency - Authorize a call, validate its arguments and resolve resource-level permissions before returning data, including on retries and file reads. A grant for one operation does not imply permission for the records of a more sensitive job. - An operator command carries a `key`. Persist its input fingerprint, receipt and domain mutation at the same durable boundary. Repeating the same command by the same principal with the same key and input returns its original result. A changed input under that key conflicts. Mutations of existing objects use the recorded version when the schema requires one. - List results are paged using opaque cursors. Long-running work returns an inspectable job. File upload and download use bounded chunks, offsets, content digests and a final byte count. Clients can finish a private transfer and verify the object entirely over MCP. - Both surfaces distinguish invalid input, denied access, unavailable storage, stale revisions, expired plans, throttling and ambiguous delivery. Return actionable execution errors. Unknown JSON-RPC methods and malformed messages use protocol errors. Signup and resend share the same generic acknowledgement across recipient interfaces. - A client with a restricted grant can discover only its available capabilities or receive explicit permission errors. Revocation applies to already connected clients on the next operation. Local interface details such as opening a modal and the OAuth login and consent exchange use their respective presentation or identity protocols. ## Parity checks Resolve the entire web operation inventory and compare it with the MCP tools accessible to the same actor. Exercise the HTTP endpoint using a separate client against the running Worker. Compare the two adapters’ validated inputs, result schemas, state effects and errors. A browser-only mutation, export that returns unreachable bytes, report with different filters or missing authorization check fails the release. Cross-channel retries must not create duplicate campaigns, recipient submissions, membership changes or import jobs. [Acceptance scenarios](acceptance.md) -
access.mdRust identity and OAuth flow, the operator allowlist, delegated scopes and recipient proofs.# Operator identity, client grants and recipient proofs One workspace can belong to one person or to a small allowlisted team. All active operators have the same application role. A grant issued to a remote client can carry a subset of that role. Recipients hold proofs for their own consent actions. ## Identity boundaries | Entry point | Authority | Action | | --- | --- | --- | | Browser console and command API | Verified email-code session or Cloudflare Access identity on the allowlist | Read and change the workspace. A browser mutation includes a matching Origin and CSRF token. | | `/mcp` | OAuth bearer grant bound to this installation’s MCP resource, operator and scopes | Discover and invoke authorized operator tools over HTTPS. | | Authorization and consent | Authenticated operator session plus the operator’s explicit grant | Approve a registered client, exact callback, resource and scopes. | | OAuth metadata, token and revocation endpoints | Issuer discovery or the relevant OAuth credential | Discover the issuer, exchange codes, renew and revoke credentials. Protocol endpoints return machine-readable challenges and errors. | | Hosted recipient pages and `/reader/mcp` | Rate-limited signup or purpose-bound proof. Email-code mode also requires a resource-specific operator grant for reader MCP | Request confirmation, confirm or unsubscribe. | ## Configure the allowlist In email-code mode, the deployment supplies the exact approved addresses. Send an eight-digit code only to an approved inbox and return the same acknowledgement for an unknown address. Bind the code to its requesting browser, expire it after ten minutes and invalidate it after five unsuccessful attempts or one successful use. Limit new challenges to one per minute and five per hour per address. Keep only a keyed digest of a live code. Use a Secure, HttpOnly, SameSite cookie and a server-side session with a twelve-hour lifetime. Signing out revokes the session. Check the current deployment allowlist when authenticating, admitting a roster member, authorizing commands, exchanging a code and refreshing a grant. Browser forms for sign-in, verification, sign-out and OAuth consent must send the installation's exact Origin on POST. Reject missing, opaque and foreign origins. Use an origin-only referrer policy on those pages to keep paths and query parameters private. In email-code mode both MCP endpoints require OAuth, including discovery of the tools. A grant to the reader resource has read scope and authorizes reader tools with their existing proof requirements. Each grant names its exact resource. Web signup, confirmation and unsubscribe follow their own consent rules. Before a newsletter handoff, the deployment may restrict signup and delivery to designated test recipients. For an installation using Cloudflare Access, bootstrap exact verified operator addresses. An empty configuration creates no interactive administrator. Validate the Access application JWT with the configured team’s signing keys, issuer, expected audience and validity window. Bind an eligible verified email to a stable operator identity. An invitation alone cannot authorize commands. The Rust Worker verifies requests under its own authorization rules even if traffic reaches an alternate route. [Cloudflare Access JWT validation](https://developers.cloudflare.com/cloudflare-one/access-controls/applications/http-apps/authorization-cookie/validating-json/) Manage membership using `operators_list`, `operators_add` and `operators_remove`. Protect the last bound active operator from concurrent removal. Removal invalidates the operator’s grants. Re-admitting a prior identity starts a fresh membership generation. During operation, check current D1 membership and grant status on every command. Persist active-membership and resource preconditions with the mutation or detect and retry concurrent changes. A storage outage must fail closed. The local development identity is explicitly selected in an isolated local environment. It is unsuitable for a public deployment. The deployment guide identifies the variables for Access, public origin, bootstrap operator and client registration. Populate credential bindings using the hosting account’s secret store. ## Delegate a remote client The Rust application is both the protected-resource implementation and its OAuth issuer. An unauthenticated operator request receives HTTP 401 with a Bearer challenge pointing to the RFC 9728 protected-resource metadata. That metadata identifies the issuer, whose authorization server metadata describes the authorization, token and revocation endpoints. Use authorization code with PKCE S256. Bind the authorization transaction, single-use code and resulting grant to the verified user, registered client, permitted redirect, exact MCP resource and selected scopes. Store server-side token lookups as digests in D1. Keep raw bearer tokens, codes and refresh tokens out of logs and operator listings. A returned token has a finite validity period. When the operator consents to `offline_access`, a client can refresh its grant for unattended use. Revoking the grant or removing the operator prevents further authorized work. [MCP authorization](https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization) · [Protected-resource metadata](https://www.rfc-editor.org/rfc/rfc9728) A publisher can pre-register a public client or trust its HTTPS Client ID Metadata Document (CIMD). For CIMD, match the configured client ID, the document's client ID and an exact callback permitted by both the publisher and the document. Fetch only configured documents, without following redirects. The client and issuer must both support the public token authentication method `none`. The OAuth issuer advertises CIMD when configured and returns its exact `iss` on successful and error callbacks. Published metadata includes the `offline_access` scope for explicitly renewable grants. [MCP authorization](https://modelcontextprotocol.io/specification/2025-11-25/basic/authorization) · [OpenAI authentication](https://developers.openai.com/plugins/build/auth) The four application scopes are `read`, `write`, `send` and `admin`. Together they permit the full web workflow. A grant for reporting needs only its required scopes. A title, cursor, file handle or job ID cannot enlarge the grant’s authority. Check the underlying object’s required access on every transfer step. A valid token with insufficient scope gets HTTP 403. An expired, invalid or wrong-resource token gets 401. Use `grants_list` and `grants_revoke` for inspection and removal through the web console or MCP. Post the consent decision to the issuer with the session's CSRF token. The consent page's form policy must allow the browser to follow the response to the registered callback origin for that request. Revalidate the exact callback before redirecting and suppress the referrer on the redirect. ## Transport and consent checks Implement stateless Streamable HTTP with JSON-RPC 2.0, `initialize`, `notifications/initialized`, `ping`, `tools/list` and `tools/call`. Negotiate the requested supported revision among `2025-11-25`, `2025-06-18` and `2025-03-26`. The last revision supports bounded batches, text tool results and requests without a version header. Later revisions take one message per POST and support structured output. Notifications receive HTTP 202 and a standalone stream request can receive HTTP 405. Validate the Origin and any supplied protocol header. [MCP transport](https://modelcontextprotocol.io/specification/2025-11-25/basic/transports) Use an origin-only referrer on the hosted signup form. Suppress the referrer on pages containing a confirmation or unsubscribe proof. For signup and resend, rate limit requests and return the same generic result for an unknown, pending, active or suppressed address. Confirmation and unsubscribe use distinct, purpose-bound proofs. A GET can safely display a landing page. A deliberate POST changes consent. Mailbox providers can invoke the signed one-click POST without cookies, login or interactive confirmation. [RFC 8058](https://www.rfc-editor.org/rfc/rfc8058)
-
delivery.mdCloudflare deployment, SES feedback, recipient delivery boundaries, costs and recovery.# Deploy and deliver ## Run in the operator’s accounts | Resource | Responsibility | | --- | --- | | Rust Worker compiled to WebAssembly, with static browser assets | Serve the console, remote MCP server, signup and consent pages, OAuth, dispatch and delivery feedback. | | Cloudflare D1 | Keep operator and client grants, consent, suppressions, revisions, dispatch plans, recipient attempts, receipts, reports and audit events. | | Private Cloudflare R2 | Store immutable uploaded media, import files and downloadable results. Check authority on access and expire staged objects according to the installation’s data policy. | | Cron trigger and optional Queue wake-ups | Drain due work. Durable records in D1 allow another invocation to find it after an interruption. A wake-up contains work identifiers. | | Amazon SES v2 and an SNS Standard topic | Submit messages using a regional verified sender. Deliver signed feedback to `/webhooks/ses`. | Deploy each environment separately. The local Worker uses an isolated capture transport, storage and identities. Configure the production origin, allowlisted operators, OAuth clients, verified From domain, monitored Reply-To, postal footer, SES region, configuration set, credentials, feedback topic and sending limits. Previewing a draft requires no AWS access. [Workers bindings](https://developers.cloudflare.com/workers/runtime-apis/bindings/) · [SES production access](https://docs.aws.amazon.com/ses/latest/dg/request-production-access.html) A deployment can restrict recipient addresses at signup, immediately before SES submission and in the AWS sending role while an existing provider handles the newsletter. Campaign pause still allows confirmations and approved proofs. A proof to an eligible, explicitly selected seed subscriber carries working one-click headers and a visible opt-out for that subscriber. An ordinary preview to another approved test address carries preview content. An AWS workload identity can exchange a five-minute signed assertion for temporary role credentials using STS. Publish its issuer metadata and public key at the canonical installation origin. Limit the role trust to the exact issuer, audience and subject. Restrict the role to the sender, configuration set, regional quota and feedback subscription. Keep signing material in Worker secrets. ## Freeze the message and audience An operator creates a standalone message or imports a versioned source bundle. Render safe email HTML and a plain-text alternative and include a visible unsubscribe control. Freeze sender, subject, preheader, body, asset references, audience selection, version and digest at commitment. A registered command key and unique plan prevent duplicate campaigns even across adapters. Snapshot the eligible recipients at that cut. A later signup is eligible for a future send. Any subsequent suppression can still stop an outstanding delivery. Publishers who attach a web URL can offer a read-online link when that location is available. Make an optional image accessible to the intended email client without exposing private draft or import objects. The email workflow uses no pre-existing website, issue frequency, public archive or feed. ## Submit with a durable boundary 1. Stage one recipient attempt for each unique campaign and eligible recipient. Before calling SES, atomically check campaign state, consent, suppression, current limits and the attempt’s state. Persist that the attempt is crossing the provider boundary. A later cancellation stops other queued work. 2. Use a SigV4-signed regional SES v2 `SendEmail` request. Include the configured sender, monitored Reply-To, one recipient, HTML and text alternatives, the SES configuration set and opaque correlation tags. Keep automatic network retries off for this submission. Record a returned SES message ID as provider acceptance. 3. Record a definite validation rejection, back off from definite throttling and retain an uncertain result when a response is lost or ambiguous. Duplicate worker invocations cannot make a new submission for an already claimed attempt. A matching signed SES event may independently establish acceptance. The operator can view unresolved attempts and record supporting evidence, permanently skip an attempt, or authorize another submission after establishing that the first did not occur. 4. At dispatch, apply account sending rates, rolling quotas and the installation’s local budget. Include confirmations and tests. A pause leaves drafts, recipient controls and feedback available. A restore starts with dispatch paused and reconciles accepted and uncertain attempts, new consent and suppressions before resumption. [SES quotas](https://docs.aws.amazon.com/ses/latest/dg/manage-sending-quotas.html) · [SES error handling](https://docs.aws.amazon.com/ses/latest/dg/troubleshoot-error-messages.html) ## Authenticated feedback Enable DKIM and domain alignment for the verified regional sender. For a custom MAIL FROM configure its MX and SPF records as instructed by SES. The message carries a visible unsubscribe URL in both alternatives and the RFC 8058 `List-Unsubscribe` and `List-Unsubscribe-Post` headers. A qualifying DKIM signature must cover these headers. Verify an actual controlled seed message and the one-click action before general delivery. [SES DKIM](https://docs.aws.amazon.com/ses/latest/dg/send-email-authentication-dkim.html) · [SES one-click unsubscribe](https://aws.amazon.com/blogs/messaging-and-targeting/using-one-click-unsubscribe-with-amazon-ses/) Verify an SNS envelope’s AWS topic, message type, timestamp, permitted certificate location and signature before applying any delivery state. Authenticate subscription confirmations. Store the SNS message ID and normalize the semantic delivery event for deduplication. Preserve provider event times even when notifications arrive out of order. Apply an authenticated hard bounce or complaint to the corresponding reader. An older delivery event cannot reverse that suppression. [SNS signature verification](https://docs.aws.amazon.com/sns/latest/dg/sns-verify-signature-of-message.html) · [SES event payloads](https://docs.aws.amazon.com/ses/latest/dg/event-publishing-retrieving-sns-contents.html) Commit each feedback receipt, delivery change and suppression together. When another writer commits first, retry from the current database state and check the SNS message ID again. Acknowledge a duplicate that already committed. If contention persists, return HTTP 503 so SNS can redeliver the notification. [SNS HTTP delivery retries](https://docs.aws.amazon.com/sns/latest/dg/sns-message-delivery-retries.html) ## Costs and recovery Base SES expenditure scales with the number of outbound messages, including confirmations and tests. For illustration, 4,000 messages at the reference à-la-carte price of $0.10 per thousand have a base send charge of $0.40. A one-off send to 40,000 eligible recipients would have a $4.00 base charge at that rate. These examples assume neither an interval nor a list size. Factor in applicable data and optional service charges, SNS notifications, Worker requests, D1 operations, queue usage and R2. Use current regional prices and account allowances for an installation-specific estimate. [SES pricing](https://aws.amazon.com/ses/pricing/) · [SNS pricing](https://aws.amazon.com/sns/pricing/) · [Workers pricing](https://developers.cloudflare.com/workers/platform/pricing/) · [D1 pricing](https://developers.cloudflare.com/d1/platform/pricing/) · [Queues pricing](https://developers.cloudflare.com/queues/platform/pricing/) · [R2 pricing](https://developers.cloudflare.com/r2/pricing/) Retain backups and test restoration of D1, private files and signing configuration in isolation. D1 Time Travel covers the database. Reconcile protected files and post-backup consent, suppression and dispatch records separately before enabling production delivery. [D1 Time Travel](https://developers.cloudflare.com/d1/reference/time-travel/)
-
migration.mdOptional suppression-first migration from beehiiv or another list manager, with a reconciliation exercise.# Bring an existing audience A new installation can start with zero recipients. An operator moving an established list can import an all-status export from beehiiv or map another provider’s records to the same import format. A migration is complete when the operator can explain exactly who may be contacted, demonstrate an opt-out that still works and reconcile the send ledger. ## Stage and inspect 1. Record each input’s source, UTC cutoff and SHA-256 checksum. Gather all statuses, any separate opt-out, complaint and bounce records, and consent evidence. For an existing sender also inventory accepted, pending and scheduled sends. Keep these materials in private storage. [beehiiv exports](https://www.beehiiv.com/support/article/12258595483543-exporting-post-content-or-subscriber-data-from-beehiiv) · [SES suppression lists](https://docs.aws.amazon.com/ses/latest/dg/sending-email-suppression-list.html) 2. Upload the files through the web console or MCP with `file_begin`, `file_write` and `file_finish`. Check whole-file hashes and map the actual headers. Preserve known confirmation times and provenance. Resolve recipients using consistent address normalization and prior identifiers where available. Leave unproven addresses ineligible. 3. Run `import_prepare`. Inspect its count of eligible, duplicate, suppressed, pending, held, test-only and unresolved records. Account for every input row. Suppression records win over imported active rows. In a beehiiv export, honor a valid unsubscribe timestamp on an inactive row. Preserve the distinction between the subscription creation date and evidence of a confirmed opt-in. Map documented QA acquisition sources to test-only when rehearsing a publisher’s list. Resolve collisions before proceeding. Record the sorted eligible set’s digest privately. 4. Commit the reviewed plan and inspect the job receipt. A cross-interface replay with the same identity and key must give the same outcome. Importing prior activity cannot create an email send or a new-acquisition event. ## Synthetic reconciliation The letters below stand for distinct test identities. The row for B occurs twice in the input. | Identity | Evidence | Expected result | | --- | --- | --- | | A | Active with a trustworthy opt-in record | Eligible | | B | Older active entry and subsequent unsubscribe | One suppressed identity | | C | Permanent bounce | Suppressed | | D | Complaint | Suppressed | | E | Pending confirmation | Pending | | F | No consent evidence | Held | | G | Explicit test contact | Test-only | Eight source rows produce seven identities and one eligible recipient. Reverse the row order and repeat the rehearsal from a clean state. Apply the reviewed files twice. In each run, only A is eligible. Opt A out after preparing a send and check that no message reaches the local capture sink for A. ## Cut over Choose an operator-owned cutoff and temporarily pause sending. Establish who handles new signup requests, prior-provider links and each already planned campaign. Reconcile the last delta at the changeover and record the watermark with `migration_reconcile`. Carry forward consent times, suppression reasons, historical send receipts, and optional tracked campaign information. Historical click series retain their provider and measurement definition. Make legacy unsubscribe and pending-confirmation links actionable for as long as older messages circulate. Ingest authenticated updates from the old system or reconcile recent verified exports before dispatch. Apply a subsequent unsubscribe even if a legacy active entry arrives afterward. When a historic confirmation has expired, the recipient can request a new challenge. Keep stale or conflicting records held until resolved. Verify a new signup, a confirm, a repeated confirm and an unsubscribe, including an action from an old email. Reconcile the final eligible-set digest and confirm a single dispatch owner. Enable the intended send only after the operator can account for every changed record. ## Roll back Pause dispatch and fence queued work. Preserve ongoing consent, unsubscribe and provider feedback routes. Export post-cutoff suppressions, confirmations and the delivery ledger. When resuming with a previous sender, apply suppressions first, then verifiable positive consent. Never release a campaign from another sender for a recipient whose prior delivery was accepted or is still unknown. Finish the rehearsal by testing a newsman unsubscribe at the restored sender, verifying the eligible audience and confirming that the interrupted campaign produced no duplicate submissions.
-
acceptance.mdChecks for the Rust reference implementation, remote MCP operation and standalone sending.# Build and acceptance Use the MIT-licensed Rust reference implementation for code, local setup and deployment configuration. A conforming installation is a Cloudflare Worker compiled from Rust to WebAssembly with web assets, D1 and private R2. Amazon SES v2 provides email delivery and signed SNS notifications supply feedback. Configure access and credentials in the publisher’s own accounts. An isolated local instance uses a mail capture transport. [Source and setup](https://github.com/dwrtz/newsman) The pull choices configure the initial display name (`publication_name`), deployment HTTPS origin (`public_origin`), operator time zone (`time_zone`), optional archive handoff delay (`archive_lag_days`), and regional SES identity (`ses_region`). A delay of zero adds no wait. The send time is chosen separately for every actual send. The operator can complete all workflows with the hosted console, recipient pages and MCP. ## Start and secure the workspace (R1, R2) Build with the pinned Rust dependency lockfile and Wasm target. Use the generated Worker artifact in an isolated Cloudflare-compatible runtime. Provision the initial operator explicitly and close operator access when none is configured. Exercise both the web and bearer-token paths. Try an unauthorized identity, an expired credential, a mismatched resource, an incorrect redirect URI and a revoked grant. Confirm all four scopes permit the full operator tool set while a read-only grant cannot send. Verify that removing a bound operator invalidates their existing grants. With the email-code profile, test both approved inboxes and an unlisted address. Check single use, browser binding, logout, and the current allowlist for both MCP resources. Exchange one grant per resource and verify that each works only at its intended endpoint. With recipient restrictions enabled, a signup outside the test list creates no recipient or confirmation job. Deliver a proof to an eligible seed, inspect its signed one-click headers and exercise its opt-out. Connect a hosted client using a permitted HTTPS client metadata document, an exact callback and S256. Exercise the public token exchange, refresh, tool list and a read operation. Verify issuer identification on success, denial and callback errors. A callback that differs from the configured or published URI cannot receive a code. Test negotiation with the March, June and November 2025 Streamable HTTP clients and keep anonymous discovery of protected tools behind OAuth. Start a fresh browser at the authorization URL. Submit the native email and code forms, approve consent, follow the redirect to a different registered origin and use the code to read the issue list. Repeat the consent step with Deny and verify that the callback receives the original state and an access-denied error. Sign out from the console and check that the browser session has ended. Let the browser generate its own request headers throughout. ## Run a one-off send (R2, R3, R4, R5, R6) 1. Start an empty workspace and create a general announcement. Leave the source, archive and feed unset. Use a non-newsletter fixture such as a one-time registration notice and choose the test environment’s configured reply address. 2. Register one synthetic recipient through the hosted form and another through the public reader endpoint. A confirmation-link GET or repeated signup must not add an active recipient. A valid confirmation POST followed by a retry produces one activation. Suppressed and pending recipients stay out of the eligible count. 3. In one interface save a subject, content, plain text and preheader. Open the same revision from the other. Review exact rendered HTML and text. Test a transfer by staging an image or source file through one interface, finishing through the other and comparing the returned hash. 4. Send a proof to a permitted test destination. Prepare a send, inspect its audience, cost and content digest, then commit the exact returned plan. Do the same with a future operator-specified instant. An empty release calendar or external website setting cannot prevent either operation. 5. Repeat the send command in the other interface using the same key. Inspect the campaign and attempt records. A cross-interface retry produces one durable campaign and one submission per eligible recipient. A changed payload with a reused key conflicts. ## Exercise every interface (R2, R4, R7, R8) Connect a standard remote MCP client to the running Worker and perform discovery. Compare the operator tool names against the full console operation registry and compare the reader surface independently. Check the schemas and spot-check values transferred between interfaces. Every operator command must have a shared authorization and idempotency boundary. Create a test-only web operation with no MCP registration and verify the parity check fails. Retrieve a complete exported file through successive `file_read` calls and compare bytes. [Parity contract](parity.md) Use one optional source bundle with an explicitly supplied canonical URL and release time. Confirm its archive handoff preserves the supplied identifiers and that a content correction does not enqueue a campaign. An unrelated message with no source metadata can immediately return to normal email sending. ## Delivery and recovery (R3, R6, R7, R9) | Scenario | Expected outcome | | --- | --- | | Concurrent commits, retried queue notification or overlapping schedule ticks | One campaign receipt and one persisted submission fence for each unique eligible recipient. | | SES accepts a request but the response is lost | An uncertain attempt remains held until signed provider evidence or deliberate operator resolution. | | Opt-out after scheduling, before provider submission | The final send boundary excludes that recipient. | | Opt-out after the provider boundary | The prior submission may finish. Subsequent submissions are blocked. | | Duplicate or reordered SNS events | The report is stable and an old delivery cannot reverse a complaint or permanent bounce. | | Signed SNS notification contends with another database write | Retry locally. Persistent contention returns HTTP 503. Redelivering the same message after recovery commits a single receipt and applies the feedback once. | | Invalid signature or unexpected topic | Delivery and consent state are unchanged. | | Import replay or rollback | The reviewed eligible set and all new opt-outs survive. See the seven-identity fixture in [migration.md](migration.md). | Capture actual signup, delivery and report receipts from controlled tests. Inspect one-click headers, validate the endpoint with a controlled seed inbox, and rehearse a restore in isolation ahead of production sending. The operator can see uncertain attempts, inspect the relevant evidence and choose the resulting action in either interface. ## Reference screens Generate gallery captures from the running console with only synthetic content. Show the overview, the message composer and the page a publisher uses to connect an MCP client. Keep credentials, personal data and live subscriber records out of screenshots. [Overview](shots/overview.png) · [Composer](shots/compose.png) · [HTTP MCP](shots/mcp.png)
-
evidence.mdPublic signup behavior, static REA evidence and independent implementation choices.# Product evidence and design decisions On 2026-11-24, Reverse Engineer Anything 6.10.1 statically inspected one published beehiiv form-loader script. Its report identified a form-selecting attribute, an iframe and campaign parameters. Inspection of those source locations showed how the loader selects a form and carries attribution to it. The SHA-256 of the inspected script was `30e9e5e230bc70bd202af25db3d3c12ca84ee4d6f65190a6138de7d096c366d5`. The local analysis produced evidence ID `ev_7db54375a4f3d371e3ec0c129142a5387ec9eec8f7e9a31e7c3a9a26bc8fe4d7`. This is evidence about that shipped browser artifact. [Published form loader](https://subscribe-forms.beehiiv.com/v3/loader.js) · [Reverse Engineer Anything](https://github.com/morluto/rea) The general product capability is an opt-in form that can preserve attribution. newsman offers hosted signup that also works with JavaScript disabled. Existing websites and applications may link to it or submit through an appropriate same-origin adapter. Registration and confirmation have separate states and effects. The Rust backend, self-hosted Cloudflare storage, SES delivery, allowlisted operators and full HTTP MCP surface are independent design choices. The application’s own acceptance checks establish their behavior. The screenshots in this release show the running reference implementation with example content. [Reference implementation](https://github.com/dwrtz/newsman)
Is it for me?
- Kind
- web app
- Platforms
- web, backend
- Tools
- Rust, WebAssembly, Cloudflare Workers, Cloudflare D1, Cloudflare R2, Cloudflare Queues, Cloudflare Access, Amazon SES v2, Amazon SNS, Model Context Protocol
What does it need?
- Agent permissions
- shell, network
- Commands it runs
cargo test --lockednpm cinpm run buildnpm testnpm run test:paritynpm run test:e2enpm run devnpm run demonpm run screenshotsnpm run check:deploy- Secrets it reads
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_SESSION_TOKENREADER_PROOF_SECRETNEWSMAN_SECRETAWS_WORKLOAD_KEY
What changed?
- 0.4.125 Nov 2026Browser sign-in, sign-out and the hosted signup form preserve the Origin required for CSRF checks. OAuth consent returns operators to their registered connector callback after approval or denial.Since 0.4.0: changed
acceptance.md,access.md,delivery.md. - 0.4.025 Nov 2026Hosted MCP clients can connect using trusted OAuth client metadata, exact callbacks and PKCE. Streamable HTTP negotiates three protocol revisions and describes the scopes required by each tool.Since 0.3.1: changed
acceptance.md,access.md,parity.md. - 0.3.125 Nov 2026Concurrent signed SES notifications retry their database writes. Persistent contention returns HTTP 503 so SNS can redeliver pending feedback.Since 0.3.0: changed
acceptance.md,delivery.md. - 0.3.025 Nov 2026Operators can sign in with verified inbox codes. The deployment allowlist applies to both MCP resources. A recipient-restricted pilot supports one-click proofs and short-lived AWS role credentials.Since 0.2.1: changed
acceptance.md,access.md,delivery.md,migration.md,parity.md,spec.md. - 0.2.125 Nov 2026The console uses self-hosted Geist Sans for the wordmark, headings and counters. The gallery shows the publishing desk on desktop and mobile, the message editor and HTTP MCP connections.Since 0.2.0: changed
shots/compose.png,shots/mcp.png,shots/overview.png,spec.md; addedshots/overview-mobile.png. - 0.2.025 Nov 2026General-purpose opt-in email publishing, independent send times, optional web handoff, MIT-licensed Rust reference implementation, full remote MCP access and screenshots of the running console.Since 0.1.0: changed
acceptance.md,access.md,delivery.md,evidence.md,migration.md,operations.json,parity.md,spec.md; addedshots/compose.png,shots/mcp.png,shots/overview.png. - 0.1.024 Nov 2026Initial specification for self-hosted email delivery with Cloudflare, Amazon SES and HTTP MCP.
For agents: start.md says how to build this spec, spec.json holds its manifest and the address of every file, and bundle.tar.gz holds its files.



