MCP.so
Sign In

primitive

@primitivedotdev

About primitive

Official Node.js, Python, and Go SDKs plus the primitive CLI for Primitive — email infrastructure for AI agents. Generated from the OpenAPI spec.

Config

Add this server to your MCP-compatible client using the configuration below.

{
  "mcpServers": {
    "primitive": {
      "url": "https://www.primitive.dev/mcp",
      "headers": {
        "Authorization": "Bearer prim_YOUR_API_KEY"
      }
    }
  }
}

Tools

30

List all inbound domains for the organization, both verified and unverified. Each domain includes its verification status and DNS records. Use before addDomain to check whether a domain is already claimed.

Claim a new domain and receive the DNS records to publish. Returns dns_records with the exact records to add. If the domain has an mx_conflict (existing mail provider), re-call with confirmed: true to proceed. After publishing DNS records, call verifyDomain to complete setup.

Check DNS records for a domain claim (MX, TXT, SPF, DKIM, DMARC). On success the domain becomes verified and starts receiving mail. On failure, returns which checks passed and which still need attention. If DNS propagation is incomplete, wait a few minutes and retry.

Download a BIND-format DNS zone file for a domain. Useful when users want to import all required DNS records at once rather than copying them individually. Returns plain text in BIND zone file format.

Use this when you need the authenticated Primitive account summary, including plan, onboarding state, and managed inbox domain. managed_inbox_address is a domain, not a complete mailbox. When it is non-null, this MCP result also includes sender_address, such as [email protected], for use as sendEmail.requestBody.from.

Use this when the user asks whether inbound email is ready or needs setup. Returns domains, routes, deployed Functions, and recent inbound activity.

What can I send FROM? Lists this account's verified outbound (sendable) domains plus any domains still pending DNS verification, with next actions. Call this BEFORE sendEmail to pick a valid `from` domain — the account email is not necessarily sendable. The same sendable list is echoed in a cannot_send_from_domain error.

Use this when you need to browse inbound emails received at verified domains with cursor pagination, status filters, date filters, or sender/recipient search.

Use this when you need to find inbound emails with structured filters or full-text matching. Use sort=received_at_asc plus date_from for new-mail polling.

Use this when you need full details for one inbound email ID, including parsed bodies, threading metadata, SMTP envelope, webhook state, and replies.

Use this when the user has selected a specific inbound email and confirmed a reply. Sends real outbound email with threading handled server-side.

Use this when the user has confirmed a new outbound email. Sends real email through Primitive's relay and can wait for the first SMTP delivery outcome, or schedule the send for a future time with scheduled_at. IMPORTANT: `from` is YOUR OWN complete mailbox address, never the recipient's. Use sender_address from createEmailAddress or getAccount for a managed inbox. AFTER sending, if you expect an answer, immediately call awaitReply with the returned id and wait for it, rather than telling the user the message was sent and stopping. Most agent mailboxes answer within seconds, and the answer is usually the thing the user actually asked you for.

SIMULATION ONLY: nothing is delivered. NEVER call this when the user actually wants an email to arrive, and never describe its result as a sent email: no message is sent, queued, or stored, and the recipient receives nothing. To really send with no account, call createEmailAddress (instant, no signup form and no verification) and then sendEmail with the api_key it returns; that is the correct path for any genuine send request. This tool exists only to preview the response shape: it validates the body against the exact same schema as sendEmail (including cc/bcc, reply_to, tags, attachments, and scheduled_at) and returns a synthetic success envelope marked demo: true. Demo requests are capped at 16KB total body, so large attachments are rejected even though the schema allows them.

List outbound emails sent by this org, with cursor pagination and filters. Bodies are omitted from list rows to keep responses small — use getSentEmail to fetch a specific row with full body. Useful for auditing delivery status, finding bounced sends, or checking gate-denied attempts.

Get the full record for a single sent email by id, including body_text and body_html. Use to inspect delivery details for a specific send — e.g. the SMTP response on a bounced row, or the gate denial reason on a gate_denied row.

Cancel a still-scheduled send before it dispatches (terminal status "canceled"; the same idempotency key becomes reusable). Pass the sent email id from a sendEmail response that used scheduled_at, or from listSentEmails. Returns a conflict error once the send has already started dispatching.

Wait for the threaded reply to a sent email. Call this immediately after sendEmail or replyToEmail when you expect an answer. With only the sent email's id it long-polls for up to 30 seconds by default. Do not report that nobody replied or ask the user to check later until this call returns with no reply. Set wait=false only for a deliberate immediate poll. Matching uses reply threading, not a sender or subject guess.

Get the full conversation an inbound email belongs to as ordered, chat-model-ready turns with bodies. Each message is oldest-first with a direction (inbound/outbound) and a derived role (inbound→user, outbound→assistant). For a brand-new message, returns just that one turn. The response includes a truncated boolean (true when the message cap was reached) and a message_count field.

Get a conversation thread by id: metadata plus all inbound and outbound messages interleaved oldest-first. Each message has a direction (inbound/outbound) and id; fetch inbound message bodies via getEmail, or outbound bodies via getSentEmail. Discover thread_id from any email or sent-email record. Compare message_count against messages.length to detect truncation.

Download all attachments for an inbound email as a gzip-compressed tar archive. Returns the archive as a base64-encoded string along with the attachment count and SHA-256 digest. Prefer getEmail first to check the attachment manifest before downloading.

List all active webhook endpoints for the organization. Each endpoint shows its URL, enabled state, and optional domain restriction.

Create a webhook endpoint to receive email.received events. If an endpoint with the same URL already exists but is deactivated, it is reactivated. After creating, call testEndpoint to confirm your signature verifier accepts the payload.

Soft-delete a webhook endpoint. The endpoint will no longer receive deliveries.

Send a sample email.received event to a webhook endpoint to verify your signature verifier. Rate limited to 4/min and 30/hr. Successful deliveries and verified-domain endpoints are exempt.

List all whitelist and blocklist filter rules for the organization.

Create a whitelist or blocklist filter rule. Patterns are stored lowercase. Per-domain filters require a Pro plan.

Delete a filter rule.

List webhook delivery attempts with pagination and filters. Each delivery includes the target endpoint and a nested email object with sender/recipient/subject. Useful for diagnosing delivery failures or confirming a specific email was delivered.

Re-send a stored webhook payload from a previous delivery attempt to its original endpoint. Rate limited per org (burst + sustained windows, shared budget with email webhook replays).

Get this user's Primitive managed inbox domain, creating the account on first use: no signup form, no password, no email verification, no browser. CALL THIS FIRST whenever you do not already have a Primitive API key and the user wants to send or receive email, instead of telling them to sign up or visit a website. On first use the REST response's address field is a domain such as pink-ram.primitive.email, not a complete mailbox. When it is non-null, this MCP result also includes sender_address such as [email protected] for use as sendEmail.requestBody.from. It also returns an api_key. IMPORTANT: pass that api_key as the `api_key` argument on every later Primitive tool call in this conversation, exactly as returned; those calls fail without it. If this user already has a domain, the result repeats it with existing_account: true. Report it as their existing managed inbox rather than announcing a new one, and calling again will not produce a different one. The result also carries an upgrade link the user can open whenever they want to attach this domain to a full account.

Overview

What is primitive?

Primitive is an inbound and outbound email platform with SDKs for Node.js, Python, and Go. It centers on a small default workflow: receive an inbound email, inspect a normalized email object, and send, reply, or forward synchronously. The SDKs also include a non-custodial x402 payments client for USDC transactions.

How to use primitive?

Install the SDK for your language (npm install @primitivedotdev/sdk, pip install primitivedotdev, or go get github.com/primitivedotdev/sdks/sdk-go@latest). Use receive(...) to parse an incoming email, client(...) to create an outbound client with an API key, and then send(...), reply(...), or forward(...) to act on the email.

Key features of primitive

  • Inbound email parsing and synchronous outbound sending
  • Non-custodial x402 payments on Base and Base-Sepolia
  • SDKs for Node.js, Python, and Go
  • Webhook verification and MIME parsing helpers
  • Low-level generated APIs and OpenAPI exports
  • Primitive Memories key-value store operations

Use cases of primitive

  • Automate email replies from a webhook endpoint
  • Send, reply, or forward emails programmatically
  • Accept USDC micro‑payments before processing an email action
  • Build custom email workflows with raw MIME or API access

FAQ from primitive

What languages does the primitive SDK support?

Node.js (npm), Python (pip), and Go (go get) are officially supported.

How does x402 payments work in primitive?

One party registers a payout address and requests a USDC payment; the paying agent signs locally with its own key. Keys never leave the caller, and settlement occurs on the chosen network (base or base-sepolia).

Do I need an API key to use primitive?

Yes. The outbound client requires a PRIMITIVE_API_KEY, and webhook verification uses a PRIMITIVE_WEBHOOK_SECRET.

Are there lower-level APIs beyond the default workflow?

Yes. The SDKs also expose raw webhook parsing, generated HTTP API packages, MIME parsing, and a CLI for advanced use cases.

Where is email data stored?

Primitive provides a key‑value store called Primitive Memories for custom data, but the README does not specify where email payloads themselves are stored.

Frequently asked questions

What languages does the primitive SDK support?

Node.js (npm), Python (pip), and Go (go get) are officially supported.

How does x402 payments work in primitive?

One party registers a payout address and requests a USDC payment; the paying agent signs locally with its own key. Keys never leave the caller, and settlement occurs on the chosen network (base or base-sepolia).

Do I need an API key to use primitive?

Yes. The outbound client requires a `PRIMITIVE_API_KEY`, and webhook verification uses a `PRIMITIVE_WEBHOOK_SECRET`.

Are there lower-level APIs beyond the default workflow?

Yes. The SDKs also expose raw webhook parsing, generated HTTP API packages, MIME parsing, and a CLI for advanced use cases.

Where is email data stored?

Primitive provides a key‑value store called Primitive Memories for custom data, but the README does not specify where email payloads themselves are stored.

Comments

More Other MCP servers