/mailprotector:api-patternsfrom mailprotector
Documents Mailprotector MCP API patterns: gateway header auth, entity hierarchy (Provider→User), router-pattern tool surface, pagination, and error handling for email-security platform integrations.
Ships in mailprotector. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Mailprotector is an email-security platform for MSPs (products:
CloudFilter filtering, Bracket encryption, SafeSend outbound protection,
XtraMail continuity). The MCP server wraps its REST API at
https://emailservice.io/api/v1 and scopes every session to one
reseller — the MSP's own account.
The gateway passes two vendor headers to the MCP server:
| Header | Value |
|---|---|
X-Mailprotector-Api-Key | The Mailprotector API key (secret) |
X-Mailprotector-Reseller-Id | The MSP's reseller ID (not secret) |
The MCP server translates the API key into the upstream
Authorization: Bearer <api_key> header on every request to
emailservice.io — the raw Bearer form never appears at the gateway
boundary. In env mode (stdio/local) the same two values come from:
export MAILPROTECTOR_API_KEY="your-api-key"
export MAILPROTECTOR_RESELLER_ID="12345"
# optional, defaults to https://emailservice.io
export MAILPROTECTOR_BASE_URL="https://emailservice.io"
API keys are issued per manager role: in the Mailprotector console,
open your profile, pick the role, and choose "View API Key". Credential
validity is checked with GET /api/v1/resellers/{reseller_id} — a 200
means the key can see the bound reseller. Most keys can only read their
own reseller; provider-level operations (creating resellers) need a
provider-scoped key.
Provider → Reseller (the MSP) → Customer → Domain → User Group → User
In API responses both resellers and customers appear with
entity_type: "Account" — disambiguate by position, not by type name.
A compact first-class surface handles the common operations:
mailprotector_status, mailprotector_list_categories,
mailprotector_list_category_tools, mailprotector_execute_toolmailprotector_customers_list / _get / _createmailprotector_domains_list / _get / _createmailprotector_users_list / _get / _find_by_addressmailprotector_user_groups_listmailprotector_messages_list / _release / _release_manymailprotector_allow_block_rules_list / _create / _deletemailprotector_logs_list, mailprotector_configuration_getEverything else — updates, deletes, managers, statements, email
destinations/sources, user syncs, notification destinations, aliases,
domain move/verify, password resets, user-group services — is reachable
via mailprotector_execute_tool(category, tool, args). Discover the
long tail with mailprotector_list_categories then
mailprotector_list_category_tools. tools/list is identical and
deterministic for every caller.
Many operations exist at up to five levels of the hierarchy. Instead of five tools, one tool takes:
scope: reseller | customer | domain | user_group | userscope_id: the entity ID (defaults to the bound reseller when
scope=reseller)This applies to messages, allow_block_rules, and logs (all five scopes), configuration (reseller/customer/domain/user_group), statements (reseller/customer), email destinations/sources (domain/user_group), aliases (domain/user), and notification destinations (user/manager).
?first_name=Bob on users. Filter server-side rather than pulling
whole collections.page query param. Message listings cap at 50 per
page — a quiet first page does not mean an empty quarantine; walk
pages until a short page comes back.| Status | Meaning | Action |
|---|---|---|
| 200 / 201 | Success (201 on creates) | — |
| 204 | Success with empty body — deletes and single-message release | Do not treat the empty body as a failure |
| 401 | Missing or invalid API key | Re-check MAILPROTECTOR_API_KEY / gateway credential |
| 403 | Key valid but not permitted for this entity (e.g. another reseller's data, provider-only op) | Verify the entity is under your reseller |
| 404 | Unknown ID | Re-list from the parent entity to confirm |
| 422 | Validation failure on a create/update body | Fix the named field and retry |
delete_* — customer, domain, user, user group, reseller, manager,
allow/block rule, user sync, notification destination. Deleting a
customer cascades to its domains and users; deleting a user group
deletes its users.What SKILL.md sets; muted values are Claude Code's defaults
When working with Mailprotector authentication, entity hierarchy, tool routing, pagination, or error handling. Use when: mailprotector api, mailprotector authentication, mailprotector mcp, mailprotector token, emailservice.io, mailprotector pagination, mailprotector scope.
Three short reads, in order
npx claudepluginhub wyre-ai/msp-claude-plugins --plugin mailprotector5 skills in this plugin
/allow-block-rulesMailprotector Allow/Block RulesSender allow/block rules at all five scopes: downward inheritance (reseller rules apply to everything beneath), the listing that returns only directly-attached rules, create with `rule_type: allow|block` and address-or-domain values, and the flat delete endpoint.
/customers-and-domainsMailprotector Customers & DomainsCustomer lifecycle (create/edit/delete under the reseller), domain creation with the Pending → Active verification flow and verification_token, domain aliases, moving domains between customers, address discovery, and mail routing via email destinations and email sources.
/quarantine-and-messagesMailprotector Quarantine & MessagesQuarantine triage across all five scopes (reseller/customer/domain/ user_group/user): message fields (`quarantine_type`, `decision`, `score`, scoring `results`), releasing a single message via `/deliver`, bulk release via `/deliver_many` with its silent scope-mismatch skip and the `all_selected` release-everything switch, and the release permission flags in configuration.
/users-and-groupsMailprotector Users & GroupsUser groups as the service container (services get/update with its deactivate-what-you-omit semantics), user CRUD including create_many and find_by_address, user aliases, password resets, and user syncs — LDAP/AD source creation, Entra/Google console-only sources, sync schedules, and comparison-type filters.
Other plugins' skills for the same job