Purelymail
Connect Claude, ChatGPT or Cursor to Purelymail via MCP. Manage domains, mailboxes, routing rules, and account credit with an API token.
Example questions
Try asking your AI client
-
How much Purelymail credit is left on this account?
-
Which Purelymail domains are failing DNS checks?
-
List the mailbox users on example.com.
-
Show the routing rules for example.com.
-
Draft a plan to add support@example.com as an alias - do not create it until I confirm.
Overview
Connect Purelymail so AI clients can manage domains, mailbox users, routing rules, password reset methods, app passwords, and prepaid credit - without pasting the API token into prompts.
This integration administers the Purelymail account. It does not read or send mail.
Prerequisites
- A Purelymail account
- A stackgate.ai account
- An API token from the Purelymail account portal
Getting credentials
- Sign in to the Purelymail account portal.
- Open your account and click Refresh API Key. Refreshing replaces the previous token. Copy the new token immediately.
- In stackgate.ai, open My Integrations → Purelymail.
- Click Activate, paste the API token, and save. stackgate.ai tests the token with Purelymail
checkAccountCreditbefore storing it.
See the Purelymail API reference.
Credentials reference
| Field | Required | Where to find it | Notes |
|---|---|---|---|
| API token | Yes | Account portal → Refresh API Key | Sent as the Purelymail-Api-Token header. Stored encrypted. |
Using with AI clients
- Dedicated endpoint:
POST /mcp/purelymailwith a Sanctum bearer token - Private gateway: one config for all integrations - use
purelymail__*namespaced tools - Business gateway: same namespaced tools when Purelymail is enabled for the company
Key tools:
- check_account_credit, list_domains, get_ownership_code - credit, domains, and the DNS ownership TXT
- list_users, get_user, create_user -
create_usertakes the local part plusdomain_name; get, modify, and delete take the full address - list_routing_rules, create_routing_rule, delete_routing_rule - aliases and catch-alls; delete uses
routing_rule_id - add_domain, update_domain_settings, delete_domain - add uses
domain_name; settings and delete usename - create_app_password, delete_app_password - the secret is returned once; delete needs that secret, not an id
Destructive tools: modify_user (password change), delete_user, delete_password_reset, delete_routing_rule, delete_domain, and delete_app_password. Confirm with the user before calling them. delete_domain also removes that domain's users.
After connecting, use Edit tool access to restrict tools (for example read-only, no deletes).
See Documentation for HTTP authentication and private gateway setup.
Test the integration
How much Purelymail credit is left on this account?
Which domains are failing DNS checks?
List mailbox users on example.com.
Show routing rules for example.com.
Typical tools: check_account_credit, list_domains, list_users, list_routing_rules.
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
| 422 integration not configured | Credential form not completed | Add the API token under My Integrations |
Purelymail rejected this API token, or invalidToken |
Token was refreshed or revoked | Click Refresh API Key in the account portal and save the new token |
HTTP 200 with type: error |
Purelymail reports failures inside a successful HTTP response | Read the code and message. The hub treats type: error as a failed tool call |
list_users looks incomplete |
The API returns at most 1000 addresses | Narrow the question to one domain; the cap is on the Purelymail side |
add_domain fails DNS |
Ownership TXT is missing or DNS has not propagated | Call get_ownership_code, publish the TXT, then add the domain. After a later DNS fix, call update_domain_settings with recheck_dns true and then list_domains |
| App password cannot be deleted by id | Delete requires the secret | Use the secret returned by create_app_password |
Security and revocation
- Disconnect in My Integrations → Purelymail to delete the stored token from stackgate.ai.
- Click Refresh API Key in the Purelymail account portal to invalidate the previous token.
- The hub stores the API token encrypted. It does not store mailbox contents, mailbox passwords, or app passwords. Tool calls are audit logged. The token is never accepted as a tool argument.
Limitations
- Mail is not read or sent through this integration.
list_usersreturns at most 1000 addresses.create_useruses the local part inuser_name. Other user tools use the full address.add_domainusesdomain_name.update_domain_settingsanddelete_domainusename.delete_routing_ruleusesrouting_rule_id, notid.create_routing_rulewithprefixfalse is an exact local-part match.- App passwords are shown once by Purelymail. Delete needs that secret.
Available tools
-
check_account_credit
Return the Purelymail account credit balance as a decimal string.
-
list_domains
List domains on the Purelymail account, including DNS status. Set include_shared to include domains shared with this account.
-
get_ownership_code
Get the DNS TXT value that proves ownership before add_domain.
-
list_users
List mailbox addresses on the Purelymail account. The API returns at most 1000 addresses.
-
get_user
Get one mailbox user by full address, including reset methods and security flags. Does not return the password.
-
list_routing_rules
List routing rules (aliases and catch-alls) on the Purelymail account. Each rule includes id, domain, match, and targets.
-
list_password_reset_methods
List password reset methods (recovery email or phone) for one mailbox user.
-
create_user
Create a mailbox user. user_name is the local part only, not the full address. Do not repeat the password in later summaries.
-
modify_user
Change a mailbox user. Destructive: new_password replaces the current password and cannot be undone. user_name is the full address. Confirm with the user before changing a password, renaming, or requiring two-factor authentication.
-
delete_user
Permanently delete a mailbox user. Destructive and not reversible. user_name is the full address. Confirm with the user first.
-
upsert_password_reset
Create or replace a password reset method (email or phone) for a mailbox user.
-
delete_password_reset
Permanently remove a password reset method. Destructive. Confirm with the user first.
-
create_routing_rule
Create a routing rule (alias or catch-all). Set prefix to false for an exact local-part match. The rule must not reuse an existing user or prefix on that domain.
-
delete_routing_rule
Permanently delete a routing rule by routing_rule_id from list_routing_rules. Destructive. Confirm with the user first.
-
add_domain
Add a domain that already passes Purelymail DNS checks. Publish the ownership TXT from get_ownership_code first.
-
update_domain_settings
Update settings for an owned domain. The domain field is name, not domainName. Set recheck_dns to true to recheck MX, SPF, DKIM, and DMARC, then call list_domains for the new status.
-
delete_domain
Permanently delete a domain and its users and routing. Destructive and not reversible. The field is name, not domainName. Confirm with the user first.
-
create_app_password
Create an app password for a mailbox user. The response includes result.appPassword once. Show it to the user and do not store it. The hub does not keep app passwords.
-
delete_app_password
Permanently delete an app password. Destructive. Purelymail requires the app password secret itself, not an id. Confirm with the user first.
MCP endpoint:
https://stackgate.ai/mcp/purelymail
(HTTP) or via the
private gateway.