shipmail-mcp 0.7.2 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  import { ApiKeyScope } from 'shipmail/api-key-scopes';
2
2
 
3
3
  declare const MCP_CAPABILITY_VERSION = "1.0.0";
4
- declare const MCP_PERMISSION_GROUP_NAMES: readonly ["account_status", "mail_read", "drafts", "mail_organize", "send_mail", "calendar_read", "calendar_write", "booking_pages", "forwarding", "mailbox_rules", "webhooks", "credentials", "mailbox_export", "domain_admin", "mailbox_admin", "newsletters", "audiences", "suppressions", "partner_admin"];
4
+ declare const MCP_PERMISSION_GROUP_NAMES: readonly ["account_status", "automations", "mail_read", "drafts", "mail_organize", "send_mail", "calendar_read", "calendar_write", "booking_pages", "forwarding", "mailbox_rules", "webhooks", "credentials", "mailbox_export", "domain_admin", "mailbox_admin", "newsletters", "audiences", "suppressions", "partner_admin"];
5
5
  type McpPermissionGroupName = (typeof MCP_PERMISSION_GROUP_NAMES)[number];
6
- declare const MCP_MEMBER_PERMISSION_GROUP_NAMES: readonly ["account_status", "mail_read", "drafts", "mail_organize", "mailbox_rules", "send_mail", "calendar_read", "calendar_write"];
6
+ declare const MCP_MEMBER_PERMISSION_GROUP_NAMES: readonly ["account_status", "mail_read", "drafts", "mail_organize", "mailbox_rules", "send_mail", "calendar_read", "calendar_write", "automations"];
7
7
  type McpRole = "owner" | "member";
8
8
  type McpCapabilityEffect = "read" | "local_write" | "external_write" | "destructive";
9
9
  type McpRecipientControl = "none" | "server_derived" | "caller_supplied";
@@ -22,6 +22,12 @@ declare const MCP_PERMISSION_GROUPS: readonly [{
22
22
  readonly description: "Check whether the Shipmail API is available.";
23
23
  readonly scopes: readonly [];
24
24
  readonly persistent: false;
25
+ }, {
26
+ readonly name: "automations";
27
+ readonly label: "Automations";
28
+ readonly description: "Read and manage persistent assistant automations.";
29
+ readonly scopes: readonly ["automations:read", "automations:write"];
30
+ readonly persistent: true;
25
31
  }, {
26
32
  readonly name: "mail_read";
27
33
  readonly label: "Read mail";
@@ -131,7 +137,7 @@ declare const MCP_PERMISSION_GROUPS: readonly [{
131
137
  readonly scopes: readonly ["partner:organizations:read", "partner:organizations:write", "partner:organizations:access", "partner:mailbox_credentials:issue", "partner:usage:read"];
132
138
  readonly persistent: true;
133
139
  }];
134
- declare const CAPABILITY_ROWS: readonly [readonly ["shipmail_status", "getStatus", "public"], readonly ["shipmail_create_domain", "createDomain", "domains:write"], readonly ["shipmail_list_domains", "listDomains", "domains:read"], readonly ["shipmail_get_domain", "getDomain", "domains:read"], readonly ["shipmail_get_domain_dns_records", "getDomainDnsRecords", "domains:read"], readonly ["shipmail_update_domain", "updateDomain", "domains:write"], readonly ["shipmail_delete_domain", "deleteDomain", "domains:write"], readonly ["shipmail_verify_domain", "verifyDomain", "domains:write"], readonly ["shipmail_search_domains", "searchDomains", "domains:read"], readonly ["shipmail_create_mailbox", "createMailbox", "mailboxes:write"], readonly ["shipmail_list_mailboxes", "listMailboxes", "mailboxes:read"], readonly ["shipmail_get_mailbox", "getMailbox", "mailboxes:read"], readonly ["shipmail_list_mailbox_app_passwords", "listMailboxAppPasswords", "mailbox_credentials:read"], readonly ["shipmail_create_mailbox_app_password", "createMailboxAppPassword", "mailbox_credentials:write"], readonly ["shipmail_revoke_mailbox_app_password", "revokeMailboxAppPassword", "mailbox_credentials:write"], readonly ["shipmail_suspend_mailbox", "suspendMailbox", "mailboxes:write"], readonly ["shipmail_resume_mailbox", "resumeMailbox", "mailboxes:write"], readonly ["shipmail_create_mailbox_export", "createMailboxExport", "mailboxes:export"], readonly ["shipmail_get_mailbox_export", "getMailboxExport", "mailboxes:export"], readonly ["shipmail_update_mailbox", "updateMailbox", "mailboxes:write"], readonly ["shipmail_delete_mailbox", "deleteMailbox", "mailboxes:write"], readonly ["shipmail_list_mailbox_folders", "listMailboxFolders", "mailboxes:read"], readonly ["shipmail_get_mailbox_rules", "getMailboxRules", "mailbox_rules:read"], readonly ["shipmail_set_mailbox_rules", "updateMailboxRules", "mailbox_rules:write"], readonly ["shipmail_create_mailbox_folder", "createMailboxFolder", "mailboxes:write"], readonly ["shipmail_update_mailbox_folder", "updateMailboxFolder", "mailboxes:write"], readonly ["shipmail_delete_mailbox_folder", "deleteMailboxFolder", "mailboxes:write"], readonly ["shipmail_list_mailbox_identities", "listMailboxIdentities", "mailboxes:read"], readonly ["shipmail_list_mailbox_inbox_messages", "listMailboxInboxMessages", "messages:read"], readonly ["shipmail_get_mailbox_inbox_message", "getMailboxInboxMessage", "messages:read"], readonly ["shipmail_list_mailbox_inbox_threads", "listMailboxInboxThreads", "messages:read"], readonly ["shipmail_get_mailbox_inbox_thread", "getMailboxInboxThread", "messages:read"], readonly ["shipmail_update_inbox_thread_reply_state", "updateMailboxInboxThreadReplyState", "messages:write"], readonly ["shipmail_create_inbox_reply_draft", "createMailboxInboxReplyDraft", "drafts:write"], readonly ["shipmail_send_inbox_reply_draft", "sendMailboxInboxReplyDraft", "messages:send"], readonly ["shipmail_reply_to_inbox_message", "replyToMailboxInboxMessage", "messages:send"], readonly ["shipmail_reply_to_inbox_thread", "replyToMailboxInboxThread", "messages:send"], readonly ["shipmail_update_inbox_message", "updateMailboxInboxMessage", "messages:write"], readonly ["shipmail_move_inbox_message", "moveMailboxInboxMessage", "messages:write"], readonly ["shipmail_delete_inbox_message", "deleteMailboxInboxMessage", "messages:write"], readonly ["shipmail_list_mailbox_forwarding", "listMailboxForwarding", "mailbox_forwarding:read"], readonly ["shipmail_create_mailbox_forwarding", "createMailboxForwarding", "mailbox_forwarding:write"], readonly ["shipmail_delete_mailbox_forwarding", "deleteMailboxForwarding", "mailbox_forwarding:write"], readonly ["shipmail_reset_mailbox_password", "resetMailboxPassword", "mailboxes:write"], readonly ["shipmail_set_auto_reply", "updateAutoReply", "mailboxes:write"], readonly ["shipmail_set_spam_filter", "updateSpamFilter", "mailboxes:write"], readonly ["shipmail_create_mailbox_import", "createMailboxImport", "mailboxes:write"], readonly ["shipmail_list_mailbox_imports", "listMailboxImports", "mailboxes:read"], readonly ["shipmail_get_mailbox_import", "getMailboxImport", "mailboxes:read"], readonly ["shipmail_cancel_mailbox_import", "cancelMailboxImport", "mailboxes:write"], readonly ["shipmail_undo_mailbox_import", "undoMailboxImport", "mailboxes:write"], readonly ["shipmail_inject_sandbox_inbound", "injectSandboxInbound", "messages:write"], readonly ["shipmail_list_messages", "listMessages", "messages:read"], readonly ["shipmail_list_message_analytics", "listMessageAnalytics", "messages:read"], readonly ["shipmail_compose_message_with_file", "prepareStagedAttachmentUpload", "messages:send"], readonly ["shipmail_prepare_staged_attachment_upload", "prepareStagedAttachmentUpload", "messages:send"], readonly ["shipmail_send_message", "sendMessage", "messages:send"], readonly ["shipmail_list_scheduled_messages", "listScheduledMessages", "messages:read"], readonly ["shipmail_get_scheduled_message", "getScheduledMessage", "messages:read"], readonly ["shipmail_update_scheduled_message", "updateScheduledMessage", "messages:send"], readonly ["shipmail_cancel_scheduled_message", "cancelScheduledMessage", "messages:send"], readonly ["shipmail_get_message", "getMessage", "messages:read"], readonly ["shipmail_reply_to_message", "replyToMessage", "messages:send"], readonly ["shipmail_list_threads", "listThreads", "threads:read"], readonly ["shipmail_get_thread", "getThread", "threads:read"], readonly ["shipmail_reply_to_thread", "replyToThread", "messages:send"], readonly ["shipmail_create_reply_scan", "createReplyScan", "messages:write"], readonly ["shipmail_get_reply_scan", "getReplyScan", "messages:read"], readonly ["shipmail_list_reply_scan_results", "listReplyScanResults", "messages:read"], readonly ["shipmail_create_webhook", "createWebhook", "webhooks:write"], readonly ["shipmail_list_webhooks", "listWebhooks", "webhooks:read"], readonly ["shipmail_get_webhook", "getWebhook", "webhooks:read"], readonly ["shipmail_update_webhook", "updateWebhook", "webhooks:write"], readonly ["shipmail_delete_webhook", "deleteWebhook", "webhooks:write"], readonly ["shipmail_rotate_webhook_secret", "rotateWebhookSecret", "webhooks:write"], readonly ["shipmail_test_webhook", "testWebhook", "webhooks:write"], readonly ["shipmail_list_webhook_deliveries", "listWebhookDeliveries", "webhooks:read"], readonly ["shipmail_get_webhook_delivery", "getWebhookDelivery", "webhooks:read"], readonly ["shipmail_replay_webhook_delivery", "replayWebhookDelivery", "webhooks:write"], readonly ["shipmail_list_suppressions", "listSuppressions", "suppressions:read"], readonly ["shipmail_remove_suppression", "removeSuppression", "suppressions:write"], readonly ["shipmail_create_audience", "createAudience", "audiences:write"], readonly ["shipmail_list_audiences", "listAudiences", "audiences:read"], readonly ["shipmail_get_audience", "getAudience", "audiences:read"], readonly ["shipmail_update_audience", "updateAudience", "audiences:write"], readonly ["shipmail_delete_audience", "deleteAudience", "audiences:write"], readonly ["shipmail_get_audience_feed", "getAudienceFeed", "audiences:read"], readonly ["shipmail_update_audience_feed", "updateAudienceFeed", "audiences:write"], readonly ["shipmail_rotate_audience_feed", "rotateAudienceFeedToken", "audiences:write"], readonly ["shipmail_revoke_audience_feed", "revokeAudienceFeedToken", "audiences:write"], readonly ["shipmail_add_subscriber", "addSubscriber", "audiences:write"], readonly ["shipmail_add_subscribers_batch", "addSubscribersBatch", "audiences:write"], readonly ["shipmail_list_subscribers", "listSubscribers", "audiences:read"], readonly ["shipmail_get_subscriber", "getSubscriber", "audiences:read"], readonly ["shipmail_get_subscriber_by_email", "getSubscriberByEmail", "audiences:read"], readonly ["shipmail_update_subscriber", "updateSubscriber", "audiences:write"], readonly ["shipmail_unsubscribe_subscriber", "unsubscribeSubscriber", "audiences:write"], readonly ["shipmail_resubscribe_subscriber", "resubscribeSubscriber", "audiences:write"], readonly ["shipmail_remove_subscriber", "removeSubscriber", "audiences:write"], readonly ["shipmail_list_newsletter_domains", "listNewsletterDomains", "newsletters:read"], readonly ["shipmail_list_newsletter_sender_identities", "listNewsletterSenderIdentities", "newsletters:read"], readonly ["shipmail_create_newsletter", "createNewsletter", "newsletters:write"], readonly ["shipmail_create_newsletter_from_changelog", "createNewsletterFromChangelog", "newsletters:write"], readonly ["shipmail_list_newsletters", "listNewsletters", "newsletters:read"], readonly ["shipmail_get_newsletter", "getNewsletter", "newsletters:read"], readonly ["shipmail_update_newsletter", "updateNewsletter", "newsletters:write"], readonly ["shipmail_list_newsletter_assets", "listNewsletterAssets", "newsletters:read"], readonly ["shipmail_register_newsletter_asset", "uploadNewsletterAsset", "newsletters:write"], readonly ["shipmail_preview_newsletter", "previewNewsletter", "newsletters:read"], readonly ["shipmail_run_newsletter_preflight", "runNewsletterPreflight", "newsletters:write"], readonly ["shipmail_send_newsletter_test", "sendNewsletterTest", "newsletters:write"], readonly ["shipmail_schedule_newsletter", "scheduleNewsletter", "newsletters:write"], readonly ["shipmail_cancel_newsletter", "cancelNewsletter", "newsletters:write"], readonly ["shipmail_resume_newsletter", "resumeNewsletter", "newsletters:write"], readonly ["shipmail_list_calendar_events", "listCalendarEvents", "calendar:read"], readonly ["shipmail_create_calendar_event", "createCalendarEvent", "calendar:write"], readonly ["shipmail_get_calendar_event", "getCalendarEvent", "calendar:read"], readonly ["shipmail_update_calendar_event", "updateCalendarEvent", "calendar:write"], readonly ["shipmail_delete_calendar_event", "deleteCalendarEvent", "calendar:write"], readonly ["shipmail_get_calendar_availability", "getCalendarAvailability", "calendar:read"], readonly ["shipmail_list_booking_pages", "listBookingPages", "booking_pages:read"], readonly ["shipmail_create_booking_page", "createBookingPage", "booking_pages:write"], readonly ["shipmail_get_booking_page", "getBookingPage", "booking_pages:read"], readonly ["shipmail_update_booking_page", "updateBookingPage", "booking_pages:write"], readonly ["shipmail_delete_booking_page", "deleteBookingPage", "booking_pages:write"], readonly ["shipmail_list_partner_organizations", "listPartnerOrganizations", "partner:organizations:read"], readonly ["shipmail_create_partner_organization", "createPartnerOrganization", "partner:organizations:write"], readonly ["shipmail_get_partner_organization", "getPartnerOrganization", "partner:organizations:read"], readonly ["shipmail_update_partner_organization", "updatePartnerOrganization", "partner:organizations:write"], readonly ["shipmail_resend_partner_ownership_invitation", "resendPartnerOwnershipInvitation", "partner:organizations:write"], readonly ["shipmail_suspend_partner_organization", "suspendPartnerOrganization", "partner:organizations:write"], readonly ["shipmail_resume_partner_organization", "resumePartnerOrganization", "partner:organizations:write"], readonly ["shipmail_offboard_partner_organization", "offboardPartnerOrganization", "partner:organizations:write"], readonly ["shipmail_list_partner_mailbox_credential_grants", "listPartnerMailboxCredentialGrants", "partner:mailbox_credentials:issue"], readonly ["shipmail_consume_partner_mailbox_credential_grant", "consumePartnerMailboxCredentialGrant", "partner:mailbox_credentials:issue"], readonly ["shipmail_get_partner_usage", "getPartnerUsage", "partner:usage:read"]];
140
+ declare const CAPABILITY_ROWS: readonly [readonly ["shipmail_status", "getStatus", "public"], readonly ["shipmail_list_automations", "listAutomations", "automations:read"], readonly ["shipmail_create_automation", "createAutomation", "automations:write"], readonly ["shipmail_get_automation", "getAutomation", "automations:read"], readonly ["shipmail_update_automation", "updateAutomation", "automations:write"], readonly ["shipmail_run_automation", "runAutomation", "automations:write"], readonly ["shipmail_create_domain", "createDomain", "domains:write"], readonly ["shipmail_list_domains", "listDomains", "domains:read"], readonly ["shipmail_get_domain", "getDomain", "domains:read"], readonly ["shipmail_get_domain_dns_records", "getDomainDnsRecords", "domains:read"], readonly ["shipmail_update_domain", "updateDomain", "domains:write"], readonly ["shipmail_delete_domain", "deleteDomain", "domains:write"], readonly ["shipmail_verify_domain", "verifyDomain", "domains:write"], readonly ["shipmail_search_domains", "searchDomains", "domains:read"], readonly ["shipmail_create_mailbox", "createMailbox", "mailboxes:write"], readonly ["shipmail_list_mailboxes", "listMailboxes", "mailboxes:read"], readonly ["shipmail_get_mailbox", "getMailbox", "mailboxes:read"], readonly ["shipmail_list_mailbox_app_passwords", "listMailboxAppPasswords", "mailbox_credentials:read"], readonly ["shipmail_create_mailbox_app_password", "createMailboxAppPassword", "mailbox_credentials:write"], readonly ["shipmail_revoke_mailbox_app_password", "revokeMailboxAppPassword", "mailbox_credentials:write"], readonly ["shipmail_suspend_mailbox", "suspendMailbox", "mailboxes:write"], readonly ["shipmail_resume_mailbox", "resumeMailbox", "mailboxes:write"], readonly ["shipmail_create_mailbox_export", "createMailboxExport", "mailboxes:export"], readonly ["shipmail_get_mailbox_export", "getMailboxExport", "mailboxes:export"], readonly ["shipmail_update_mailbox", "updateMailbox", "mailboxes:write"], readonly ["shipmail_delete_mailbox", "deleteMailbox", "mailboxes:write"], readonly ["shipmail_list_mailbox_folders", "listMailboxFolders", "mailboxes:read"], readonly ["shipmail_get_mailbox_rules", "getMailboxRules", "mailbox_rules:read"], readonly ["shipmail_set_mailbox_rules", "updateMailboxRules", "mailbox_rules:write"], readonly ["shipmail_create_mailbox_folder", "createMailboxFolder", "mailboxes:write"], readonly ["shipmail_update_mailbox_folder", "updateMailboxFolder", "mailboxes:write"], readonly ["shipmail_delete_mailbox_folder", "deleteMailboxFolder", "mailboxes:write"], readonly ["shipmail_list_mailbox_identities", "listMailboxIdentities", "mailboxes:read"], readonly ["shipmail_list_mailbox_inbox_messages", "listMailboxInboxMessages", "messages:read"], readonly ["shipmail_get_mailbox_inbox_message", "getMailboxInboxMessage", "messages:read"], readonly ["shipmail_list_mailbox_inbox_threads", "listMailboxInboxThreads", "messages:read"], readonly ["shipmail_get_mailbox_inbox_thread", "getMailboxInboxThread", "messages:read"], readonly ["shipmail_update_inbox_thread_reply_state", "updateMailboxInboxThreadReplyState", "messages:write"], readonly ["shipmail_create_inbox_reply_draft", "createMailboxInboxReplyDraft", "drafts:write"], readonly ["shipmail_send_inbox_reply_draft", "sendMailboxInboxReplyDraft", "messages:send"], readonly ["shipmail_reply_to_inbox_message", "replyToMailboxInboxMessage", "messages:send"], readonly ["shipmail_reply_to_inbox_thread", "replyToMailboxInboxThread", "messages:send"], readonly ["shipmail_update_inbox_message", "updateMailboxInboxMessage", "messages:write"], readonly ["shipmail_move_inbox_message", "moveMailboxInboxMessage", "messages:write"], readonly ["shipmail_delete_inbox_message", "deleteMailboxInboxMessage", "messages:write"], readonly ["shipmail_list_mailbox_forwarding", "listMailboxForwarding", "mailbox_forwarding:read"], readonly ["shipmail_create_mailbox_forwarding", "createMailboxForwarding", "mailbox_forwarding:write"], readonly ["shipmail_delete_mailbox_forwarding", "deleteMailboxForwarding", "mailbox_forwarding:write"], readonly ["shipmail_reset_mailbox_password", "resetMailboxPassword", "mailboxes:write"], readonly ["shipmail_set_auto_reply", "updateAutoReply", "mailboxes:write"], readonly ["shipmail_set_spam_filter", "updateSpamFilter", "mailboxes:write"], readonly ["shipmail_create_mailbox_import", "createMailboxImport", "mailboxes:write"], readonly ["shipmail_list_mailbox_imports", "listMailboxImports", "mailboxes:read"], readonly ["shipmail_get_mailbox_import", "getMailboxImport", "mailboxes:read"], readonly ["shipmail_cancel_mailbox_import", "cancelMailboxImport", "mailboxes:write"], readonly ["shipmail_undo_mailbox_import", "undoMailboxImport", "mailboxes:write"], readonly ["shipmail_inject_sandbox_inbound", "injectSandboxInbound", "messages:write"], readonly ["shipmail_list_messages", "listMessages", "messages:read"], readonly ["shipmail_list_message_analytics", "listMessageAnalytics", "messages:read"], readonly ["shipmail_compose_message_with_file", "prepareStagedAttachmentUpload", "messages:send"], readonly ["shipmail_prepare_staged_attachment_upload", "prepareStagedAttachmentUpload", "messages:send"], readonly ["shipmail_send_message", "sendMessage", "messages:send"], readonly ["shipmail_list_scheduled_messages", "listScheduledMessages", "messages:read"], readonly ["shipmail_get_scheduled_message", "getScheduledMessage", "messages:read"], readonly ["shipmail_update_scheduled_message", "updateScheduledMessage", "messages:send"], readonly ["shipmail_cancel_scheduled_message", "cancelScheduledMessage", "messages:send"], readonly ["shipmail_get_message", "getMessage", "messages:read"], readonly ["shipmail_reply_to_message", "replyToMessage", "messages:send"], readonly ["shipmail_list_threads", "listThreads", "threads:read"], readonly ["shipmail_get_thread", "getThread", "threads:read"], readonly ["shipmail_reply_to_thread", "replyToThread", "messages:send"], readonly ["shipmail_create_reply_scan", "createReplyScan", "messages:write"], readonly ["shipmail_get_reply_scan", "getReplyScan", "messages:read"], readonly ["shipmail_list_reply_scan_results", "listReplyScanResults", "messages:read"], readonly ["shipmail_create_webhook", "createWebhook", "webhooks:write"], readonly ["shipmail_list_webhooks", "listWebhooks", "webhooks:read"], readonly ["shipmail_get_webhook", "getWebhook", "webhooks:read"], readonly ["shipmail_update_webhook", "updateWebhook", "webhooks:write"], readonly ["shipmail_delete_webhook", "deleteWebhook", "webhooks:write"], readonly ["shipmail_rotate_webhook_secret", "rotateWebhookSecret", "webhooks:write"], readonly ["shipmail_test_webhook", "testWebhook", "webhooks:write"], readonly ["shipmail_list_webhook_deliveries", "listWebhookDeliveries", "webhooks:read"], readonly ["shipmail_get_webhook_delivery", "getWebhookDelivery", "webhooks:read"], readonly ["shipmail_replay_webhook_delivery", "replayWebhookDelivery", "webhooks:write"], readonly ["shipmail_list_suppressions", "listSuppressions", "suppressions:read"], readonly ["shipmail_remove_suppression", "removeSuppression", "suppressions:write"], readonly ["shipmail_create_audience", "createAudience", "audiences:write"], readonly ["shipmail_list_audiences", "listAudiences", "audiences:read"], readonly ["shipmail_get_audience", "getAudience", "audiences:read"], readonly ["shipmail_update_audience", "updateAudience", "audiences:write"], readonly ["shipmail_delete_audience", "deleteAudience", "audiences:write"], readonly ["shipmail_get_audience_feed", "getAudienceFeed", "audiences:read"], readonly ["shipmail_update_audience_feed", "updateAudienceFeed", "audiences:write"], readonly ["shipmail_rotate_audience_feed", "rotateAudienceFeedToken", "audiences:write"], readonly ["shipmail_revoke_audience_feed", "revokeAudienceFeedToken", "audiences:write"], readonly ["shipmail_add_subscriber", "addSubscriber", "audiences:write"], readonly ["shipmail_add_subscribers_batch", "addSubscribersBatch", "audiences:write"], readonly ["shipmail_list_subscribers", "listSubscribers", "audiences:read"], readonly ["shipmail_get_subscriber", "getSubscriber", "audiences:read"], readonly ["shipmail_get_subscriber_by_email", "getSubscriberByEmail", "audiences:read"], readonly ["shipmail_update_subscriber", "updateSubscriber", "audiences:write"], readonly ["shipmail_unsubscribe_subscriber", "unsubscribeSubscriber", "audiences:write"], readonly ["shipmail_resubscribe_subscriber", "resubscribeSubscriber", "audiences:write"], readonly ["shipmail_remove_subscriber", "removeSubscriber", "audiences:write"], readonly ["shipmail_list_newsletter_domains", "listNewsletterDomains", "newsletters:read"], readonly ["shipmail_list_newsletter_sender_identities", "listNewsletterSenderIdentities", "newsletters:read"], readonly ["shipmail_create_newsletter", "createNewsletter", "newsletters:write"], readonly ["shipmail_create_newsletter_from_changelog", "createNewsletterFromChangelog", "newsletters:write"], readonly ["shipmail_list_newsletters", "listNewsletters", "newsletters:read"], readonly ["shipmail_get_newsletter", "getNewsletter", "newsletters:read"], readonly ["shipmail_update_newsletter", "updateNewsletter", "newsletters:write"], readonly ["shipmail_list_newsletter_assets", "listNewsletterAssets", "newsletters:read"], readonly ["shipmail_register_newsletter_asset", "uploadNewsletterAsset", "newsletters:write"], readonly ["shipmail_preview_newsletter", "previewNewsletter", "newsletters:read"], readonly ["shipmail_run_newsletter_preflight", "runNewsletterPreflight", "newsletters:write"], readonly ["shipmail_send_newsletter_test", "sendNewsletterTest", "newsletters:write"], readonly ["shipmail_schedule_newsletter", "scheduleNewsletter", "newsletters:write"], readonly ["shipmail_cancel_newsletter", "cancelNewsletter", "newsletters:write"], readonly ["shipmail_resume_newsletter", "resumeNewsletter", "newsletters:write"], readonly ["shipmail_list_calendar_events", "listCalendarEvents", "calendar:read"], readonly ["shipmail_create_calendar_event", "createCalendarEvent", "calendar:write"], readonly ["shipmail_get_calendar_event", "getCalendarEvent", "calendar:read"], readonly ["shipmail_update_calendar_event", "updateCalendarEvent", "calendar:write"], readonly ["shipmail_delete_calendar_event", "deleteCalendarEvent", "calendar:write"], readonly ["shipmail_get_calendar_availability", "getCalendarAvailability", "calendar:read"], readonly ["shipmail_list_booking_pages", "listBookingPages", "booking_pages:read"], readonly ["shipmail_create_booking_page", "createBookingPage", "booking_pages:write"], readonly ["shipmail_get_booking_page", "getBookingPage", "booking_pages:read"], readonly ["shipmail_update_booking_page", "updateBookingPage", "booking_pages:write"], readonly ["shipmail_delete_booking_page", "deleteBookingPage", "booking_pages:write"], readonly ["shipmail_list_partner_organizations", "listPartnerOrganizations", "partner:organizations:read"], readonly ["shipmail_create_partner_organization", "createPartnerOrganization", "partner:organizations:write"], readonly ["shipmail_get_partner_organization", "getPartnerOrganization", "partner:organizations:read"], readonly ["shipmail_update_partner_organization", "updatePartnerOrganization", "partner:organizations:write"], readonly ["shipmail_resend_partner_ownership_invitation", "resendPartnerOwnershipInvitation", "partner:organizations:write"], readonly ["shipmail_suspend_partner_organization", "suspendPartnerOrganization", "partner:organizations:write"], readonly ["shipmail_resume_partner_organization", "resumePartnerOrganization", "partner:organizations:write"], readonly ["shipmail_offboard_partner_organization", "offboardPartnerOrganization", "partner:organizations:write"], readonly ["shipmail_list_partner_mailbox_credential_grants", "listPartnerMailboxCredentialGrants", "partner:mailbox_credentials:issue"], readonly ["shipmail_consume_partner_mailbox_credential_grant", "consumePartnerMailboxCredentialGrant", "partner:mailbox_credentials:issue"], readonly ["shipmail_get_partner_usage", "getPartnerUsage", "partner:usage:read"]];
135
141
  type McpToolName = (typeof CAPABILITY_ROWS)[number][0];
136
142
  type McpCapability = {
137
143
  readonly toolName: McpToolName;
@@ -3,6 +3,7 @@ import { API_KEY_SCOPES, apiKeyScopesGrant } from "shipmail/api-key-scopes";
3
3
  var MCP_CAPABILITY_VERSION = "1.0.0";
4
4
  var MCP_PERMISSION_GROUP_NAMES = [
5
5
  "account_status",
6
+ "automations",
6
7
  "mail_read",
7
8
  "drafts",
8
9
  "mail_organize",
@@ -30,7 +31,8 @@ var MCP_MEMBER_PERMISSION_GROUP_NAMES = [
30
31
  "mailbox_rules",
31
32
  "send_mail",
32
33
  "calendar_read",
33
- "calendar_write"
34
+ "calendar_write",
35
+ "automations"
34
36
  ];
35
37
  var MCP_PERMISSION_GROUPS = [
36
38
  {
@@ -40,6 +42,13 @@ var MCP_PERMISSION_GROUPS = [
40
42
  scopes: [],
41
43
  persistent: false
42
44
  },
45
+ {
46
+ name: "automations",
47
+ label: "Automations",
48
+ description: "Read and manage persistent assistant automations.",
49
+ scopes: ["automations:read", "automations:write"],
50
+ persistent: true
51
+ },
43
52
  {
44
53
  name: "mail_read",
45
54
  label: "Read mail",
@@ -175,6 +184,11 @@ var MCP_PERMISSION_GROUPS = [
175
184
  ];
176
185
  var CAPABILITY_ROWS = [
177
186
  ["shipmail_status", "getStatus", "public"],
187
+ ["shipmail_list_automations", "listAutomations", "automations:read"],
188
+ ["shipmail_create_automation", "createAutomation", "automations:write"],
189
+ ["shipmail_get_automation", "getAutomation", "automations:read"],
190
+ ["shipmail_update_automation", "updateAutomation", "automations:write"],
191
+ ["shipmail_run_automation", "runAutomation", "automations:write"],
178
192
  ["shipmail_create_domain", "createDomain", "domains:write"],
179
193
  ["shipmail_list_domains", "listDomains", "domains:read"],
180
194
  ["shipmail_get_domain", "getDomain", "domains:read"],
@@ -429,6 +443,7 @@ function permissionGroupFor(toolName, requiredScope) {
429
443
  if (requiredScope === "calendar:read") return "calendar_read";
430
444
  if (requiredScope === "calendar:write") return "calendar_write";
431
445
  if (requiredScope.startsWith("booking_pages:")) return "booking_pages";
446
+ if (requiredScope.startsWith("automations:")) return "automations";
432
447
  if (requiredScope.startsWith("webhooks:")) return "webhooks";
433
448
  if (requiredScope.startsWith("newsletters:")) return "newsletters";
434
449
  if (requiredScope.startsWith("audiences:")) return "audiences";
@@ -453,10 +468,11 @@ function recipientControlFor(toolName) {
453
468
  return "none";
454
469
  }
455
470
  function durationFor(toolName) {
471
+ if (toolName === "shipmail_run_automation") return "one_shot";
456
472
  if (toolName.includes("app_password") || toolName.includes("credential_grant") || toolName === "shipmail_rotate_webhook_secret") {
457
473
  return "credential";
458
474
  }
459
- if (toolName.includes("forwarding") || toolName.includes("mailbox_rules") || toolName.includes("webhook") || toolName.includes("booking_page")) {
475
+ if (toolName.includes("forwarding") || toolName.includes("mailbox_rules") || toolName.includes("webhook") || toolName.includes("booking_page") || toolName.includes("automation")) {
460
476
  return "persistent";
461
477
  }
462
478
  if (toolName === "shipmail_send_message" || toolName.includes("schedule_") || toolName.includes("scheduled_message")) {
package/dist/index.js CHANGED
@@ -115,7 +115,8 @@ var MCP_MEMBER_PERMISSION_GROUP_NAMES = [
115
115
  "mailbox_rules",
116
116
  "send_mail",
117
117
  "calendar_read",
118
- "calendar_write"
118
+ "calendar_write",
119
+ "automations"
119
120
  ];
120
121
  var MCP_PERMISSION_GROUPS = [
121
122
  {
@@ -125,6 +126,13 @@ var MCP_PERMISSION_GROUPS = [
125
126
  scopes: [],
126
127
  persistent: false
127
128
  },
129
+ {
130
+ name: "automations",
131
+ label: "Automations",
132
+ description: "Read and manage persistent assistant automations.",
133
+ scopes: ["automations:read", "automations:write"],
134
+ persistent: true
135
+ },
128
136
  {
129
137
  name: "mail_read",
130
138
  label: "Read mail",
@@ -260,6 +268,11 @@ var MCP_PERMISSION_GROUPS = [
260
268
  ];
261
269
  var CAPABILITY_ROWS = [
262
270
  ["shipmail_status", "getStatus", "public"],
271
+ ["shipmail_list_automations", "listAutomations", "automations:read"],
272
+ ["shipmail_create_automation", "createAutomation", "automations:write"],
273
+ ["shipmail_get_automation", "getAutomation", "automations:read"],
274
+ ["shipmail_update_automation", "updateAutomation", "automations:write"],
275
+ ["shipmail_run_automation", "runAutomation", "automations:write"],
263
276
  ["shipmail_create_domain", "createDomain", "domains:write"],
264
277
  ["shipmail_list_domains", "listDomains", "domains:read"],
265
278
  ["shipmail_get_domain", "getDomain", "domains:read"],
@@ -514,6 +527,7 @@ function permissionGroupFor(toolName, requiredScope) {
514
527
  if (requiredScope === "calendar:read") return "calendar_read";
515
528
  if (requiredScope === "calendar:write") return "calendar_write";
516
529
  if (requiredScope.startsWith("booking_pages:")) return "booking_pages";
530
+ if (requiredScope.startsWith("automations:")) return "automations";
517
531
  if (requiredScope.startsWith("webhooks:")) return "webhooks";
518
532
  if (requiredScope.startsWith("newsletters:")) return "newsletters";
519
533
  if (requiredScope.startsWith("audiences:")) return "audiences";
@@ -538,10 +552,11 @@ function recipientControlFor(toolName) {
538
552
  return "none";
539
553
  }
540
554
  function durationFor(toolName) {
555
+ if (toolName === "shipmail_run_automation") return "one_shot";
541
556
  if (toolName.includes("app_password") || toolName.includes("credential_grant") || toolName === "shipmail_rotate_webhook_secret") {
542
557
  return "credential";
543
558
  }
544
- if (toolName.includes("forwarding") || toolName.includes("mailbox_rules") || toolName.includes("webhook") || toolName.includes("booking_page")) {
559
+ if (toolName.includes("forwarding") || toolName.includes("mailbox_rules") || toolName.includes("webhook") || toolName.includes("booking_page") || toolName.includes("automation")) {
545
560
  return "persistent";
546
561
  }
547
562
  if (toolName === "shipmail_send_message" || toolName.includes("schedule_") || toolName.includes("scheduled_message")) {
@@ -2949,6 +2964,197 @@ var calendarAvailabilitySchema = z.object({
2949
2964
  timezone: z.string(),
2950
2965
  slots: z.array(calendarAvailabilitySlotSchema)
2951
2966
  });
2967
+ var automationTriggerSchema = z.discriminatedUnion("type", [
2968
+ z.object({ type: z.literal("email_received"), mailbox_ids: z.array(idSchema).min(1).max(100) }),
2969
+ z.object({
2970
+ type: z.literal("scheduled"),
2971
+ cron: noControlString(100, "cron").min(9),
2972
+ time_zone: noControlString(100, "time zone").min(1)
2973
+ }),
2974
+ z.object({ type: z.literal("manual"), mailbox_ids: z.array(idSchema).min(1).max(100) }),
2975
+ z.object({
2976
+ type: z.literal("thread_state"),
2977
+ mailbox_ids: z.array(idSchema).min(1).max(100),
2978
+ state: z.literal("no_reply_after"),
2979
+ duration_minutes: z.number().int().min(15).max(525600)
2980
+ })
2981
+ ]);
2982
+ var automationConditionSchema = z.discriminatedUnion("type", [
2983
+ z.object({ type: z.literal("sender_address"), addresses: z.array(emailSchema).min(1).max(100) }),
2984
+ z.object({
2985
+ type: z.literal("sender_domain"),
2986
+ domains: z.array(noControlString(253, "sender domain").min(1)).min(1).max(100)
2987
+ }),
2988
+ z.object({
2989
+ type: z.literal("subject_contains"),
2990
+ values: z.array(noControlString(200, "subject value").min(1)).min(1).max(100)
2991
+ }),
2992
+ z.object({ type: z.literal("has_attachment"), value: z.boolean() }),
2993
+ z.object({
2994
+ type: z.literal("semantic_positive_match"),
2995
+ instruction: noControlString(1e3, "semantic instruction").min(1),
2996
+ minimum_confidence: z.number().min(0.5).max(1)
2997
+ })
2998
+ ]);
2999
+ var automationActionSchema = z.discriminatedUnion("type", [
3000
+ z.object({
3001
+ type: z.literal("create_reply_draft"),
3002
+ instruction: noControlString(2e3, "draft instruction").min(1)
3003
+ }),
3004
+ z.object({
3005
+ type: z.literal("reply_to_trigger_sender"),
3006
+ instruction: noControlString(2e3, "reply instruction").min(1)
3007
+ }),
3008
+ z.object({ type: z.literal("archive_trigger_message") }),
3009
+ z.object({
3010
+ type: z.literal("move_trigger_message"),
3011
+ mailbox_id: idSchema,
3012
+ destination_folder_id: idSchema
3013
+ }),
3014
+ z.object({ type: z.literal("set_trigger_read_state"), is_read: z.boolean() }),
3015
+ z.object({ type: z.literal("set_trigger_star_state"), is_starred: z.boolean() }),
3016
+ z.object({
3017
+ type: z.literal("generate_mail_report"),
3018
+ metric: z.enum(["received", "sent", "unread"]),
3019
+ lookback_minutes: z.number().int().min(15).max(525600)
3020
+ })
3021
+ ]);
3022
+ var automationDefinitionSchema = z.object({
3023
+ trigger: automationTriggerSchema,
3024
+ conditions: z.array(automationConditionSchema).max(20),
3025
+ actions: z.array(automationActionSchema).min(1).max(10),
3026
+ mode: z.enum(["draft", "send"]),
3027
+ scope: z.object({
3028
+ mailbox_ids: z.array(idSchema).min(1).max(100),
3029
+ calendar_addresses: z.array(emailSchema).max(100)
3030
+ })
3031
+ }).superRefine((definition, context) => {
3032
+ const semantic = definition.conditions.some(
3033
+ (condition) => condition.type === "semantic_positive_match"
3034
+ );
3035
+ const placement = definition.actions.some(
3036
+ (action) => [
3037
+ "archive_trigger_message",
3038
+ "move_trigger_message",
3039
+ "set_trigger_read_state",
3040
+ "set_trigger_star_state"
3041
+ ].includes(action.type)
3042
+ );
3043
+ const messageAction = definition.actions.some(
3044
+ (action) => [
3045
+ "create_reply_draft",
3046
+ "reply_to_trigger_sender",
3047
+ "archive_trigger_message",
3048
+ "move_trigger_message",
3049
+ "set_trigger_read_state",
3050
+ "set_trigger_star_state"
3051
+ ].includes(action.type)
3052
+ );
3053
+ if (definition.mode === "send" && definition.trigger.type !== "email_received") {
3054
+ context.addIssue({
3055
+ code: "custom",
3056
+ message: "Send mode requires email_received.",
3057
+ path: ["mode"]
3058
+ });
3059
+ }
3060
+ if (definition.mode === "send" && semantic) {
3061
+ context.addIssue({
3062
+ code: "custom",
3063
+ message: "Send mode cannot use semantic conditions.",
3064
+ path: ["conditions"]
3065
+ });
3066
+ }
3067
+ if (definition.trigger.type === "email_received" && !semantic && placement) {
3068
+ context.addIssue({
3069
+ code: "custom",
3070
+ message: "Deterministic placement belongs in mailbox rules unless a semantic condition gates it.",
3071
+ path: ["actions"]
3072
+ });
3073
+ }
3074
+ if (messageAction && definition.trigger.type !== "email_received" && definition.trigger.type !== "thread_state") {
3075
+ context.addIssue({
3076
+ code: "custom",
3077
+ message: "Message actions need an email or thread-state trigger.",
3078
+ path: ["actions"]
3079
+ });
3080
+ }
3081
+ if (definition.trigger.type === "email_received" && definition.actions.some((action) => action.type === "generate_mail_report")) {
3082
+ context.addIssue({
3083
+ code: "custom",
3084
+ message: "Mail reports need a scheduled or manual trigger.",
3085
+ path: ["actions"]
3086
+ });
3087
+ }
3088
+ if (definition.mode === "send") {
3089
+ const replies = definition.actions.filter(
3090
+ (action) => action.type === "reply_to_trigger_sender"
3091
+ );
3092
+ if (replies.length !== 1 || definition.actions.length !== 1) {
3093
+ context.addIssue({
3094
+ code: "custom",
3095
+ message: "Send mode supports exactly one automatic reply action.",
3096
+ path: ["actions"]
3097
+ });
3098
+ }
3099
+ }
3100
+ });
3101
+ var automationRunSummarySchema = z.object({
3102
+ object: z.literal("automation_run"),
3103
+ id: z.string(),
3104
+ status: z.enum([
3105
+ "queued",
3106
+ "running",
3107
+ "completed",
3108
+ "failed",
3109
+ "degraded",
3110
+ "cancelled",
3111
+ "skipped"
3112
+ ]),
3113
+ error_code: z.string().nullable(),
3114
+ created_at: z.string()
3115
+ });
3116
+ var automationRunSchema = z.object({
3117
+ object: z.literal("automation_run"),
3118
+ id: z.string(),
3119
+ automation_id: z.string(),
3120
+ status: z.literal("queued")
3121
+ });
3122
+ var automationSchema = z.object({
3123
+ object: z.literal("automation"),
3124
+ id: z.string(),
3125
+ name: z.string(),
3126
+ status: z.enum(["active", "paused", "disabled"]),
3127
+ version_id: z.string(),
3128
+ version: z.number().int(),
3129
+ definition: automationDefinitionSchema,
3130
+ last_run: automationRunSummarySchema.nullable(),
3131
+ next_run_at: z.string().nullable(),
3132
+ created_at: z.string(),
3133
+ updated_at: z.string()
3134
+ });
3135
+ var automationByIdInputSchema = z.object({ id: idSchema });
3136
+ var createAutomationInputSchema = z.object({
3137
+ name: noControlString(100, "automation name").min(1),
3138
+ definition: automationDefinitionSchema,
3139
+ idempotency_key: idempotencyKeySchema
3140
+ });
3141
+ var updateAutomationInputSchema = z.object({
3142
+ id: idSchema,
3143
+ name: noControlString(100, "automation name").min(1).optional(),
3144
+ definition: automationDefinitionSchema.optional(),
3145
+ status: z.enum(["active", "paused", "disabled"]).optional(),
3146
+ idempotency_key: idempotencyKeySchema
3147
+ }).refine(
3148
+ (value) => value.name !== void 0 || value.definition !== void 0 || value.status !== void 0,
3149
+ "Provide name, definition, or status."
3150
+ );
3151
+ var runAutomationInputSchema = z.object({
3152
+ id: idSchema,
3153
+ idempotency_key: idempotencyKeySchema
3154
+ });
3155
+ var automationOutputSchema = z.object({ automation: automationSchema });
3156
+ var automationsOutputSchema = z.object({ data: z.array(automationSchema) });
3157
+ var automationRunOutputSchema = z.object({ automation_run: automationRunSchema });
2952
3158
  var bookingPageSchema = z.object({
2953
3159
  object: z.literal("booking_page"),
2954
3160
  id: z.string(),
@@ -4141,6 +4347,9 @@ var SESSION_LIMITS = {
4141
4347
  shipmail_create_booking_page: 20,
4142
4348
  shipmail_update_booking_page: 20,
4143
4349
  shipmail_delete_booking_page: 10,
4350
+ shipmail_create_automation: 20,
4351
+ shipmail_update_automation: 20,
4352
+ shipmail_run_automation: 20,
4144
4353
  shipmail_create_partner_organization: 20,
4145
4354
  shipmail_update_partner_organization: 50,
4146
4355
  shipmail_resend_partner_ownership_invitation: 20,
@@ -6861,6 +7070,103 @@ function registerTools(rawServer, client, allowedTools, grantedOrganizations = [
6861
7070
  )
6862
7071
  );
6863
7072
  });
7073
+ registerIfAllowed("shipmail_list_automations", () => {
7074
+ server.registerTool(
7075
+ "shipmail_list_automations",
7076
+ {
7077
+ title: "List Automations",
7078
+ description: "List assistant automations visible to this API key's mailbox constraints.",
7079
+ outputSchema: automationsOutputSchema,
7080
+ annotations: { readOnlyHint: true, openWorldHint: false }
7081
+ },
7082
+ async () => runTool(
7083
+ "shipmail_list_automations",
7084
+ automationsOutputSchema,
7085
+ () => client.automations.list()
7086
+ )
7087
+ );
7088
+ });
7089
+ registerIfAllowed("shipmail_get_automation", () => {
7090
+ server.registerTool(
7091
+ "shipmail_get_automation",
7092
+ {
7093
+ title: "Get Automation",
7094
+ description: "Fetch one assistant automation by ID.",
7095
+ inputSchema: automationByIdInputSchema,
7096
+ outputSchema: automationOutputSchema,
7097
+ annotations: { readOnlyHint: true, openWorldHint: false }
7098
+ },
7099
+ async ({ id }) => runTool("shipmail_get_automation", automationOutputSchema, async () => ({
7100
+ automation: await client.automations.get(id)
7101
+ }))
7102
+ );
7103
+ });
7104
+ registerIfAllowed("shipmail_create_automation", () => {
7105
+ server.registerTool(
7106
+ "shipmail_create_automation",
7107
+ {
7108
+ title: "Create Automation",
7109
+ description: "Create and activate an assistant automation from an explicit reviewed definition. This persists behavior until paused or disabled.",
7110
+ inputSchema: createAutomationInputSchema,
7111
+ outputSchema: automationOutputSchema,
7112
+ annotations: {
7113
+ readOnlyHint: false,
7114
+ destructiveHint: false,
7115
+ idempotentHint: true,
7116
+ openWorldHint: false
7117
+ }
7118
+ },
7119
+ async (args) => runTool("shipmail_create_automation", automationOutputSchema, async () => ({
7120
+ automation: await client.automations.create(
7121
+ stripIdempotencyKey(args),
7122
+ mutationOptions(args)
7123
+ )
7124
+ }))
7125
+ );
7126
+ });
7127
+ registerIfAllowed("shipmail_update_automation", () => {
7128
+ server.registerTool(
7129
+ "shipmail_update_automation",
7130
+ {
7131
+ title: "Update Automation",
7132
+ description: "Change an automation's name, reviewed definition, or status. Definition changes create and activate a new immutable version.",
7133
+ inputSchema: updateAutomationInputSchema,
7134
+ outputSchema: automationOutputSchema,
7135
+ annotations: {
7136
+ readOnlyHint: false,
7137
+ destructiveHint: false,
7138
+ idempotentHint: true,
7139
+ openWorldHint: false
7140
+ }
7141
+ },
7142
+ async (args) => runTool("shipmail_update_automation", automationOutputSchema, async () => {
7143
+ const { id, idempotency_key: _key, ...params } = args;
7144
+ return {
7145
+ automation: await client.automations.update(id, params, mutationOptions(args))
7146
+ };
7147
+ })
7148
+ );
7149
+ });
7150
+ registerIfAllowed("shipmail_run_automation", () => {
7151
+ server.registerTool(
7152
+ "shipmail_run_automation",
7153
+ {
7154
+ title: "Run Automation",
7155
+ description: "Queue one run of a manual automation.",
7156
+ inputSchema: runAutomationInputSchema,
7157
+ outputSchema: automationRunOutputSchema,
7158
+ annotations: {
7159
+ readOnlyHint: false,
7160
+ destructiveHint: false,
7161
+ idempotentHint: true,
7162
+ openWorldHint: false
7163
+ }
7164
+ },
7165
+ async (args) => runTool("shipmail_run_automation", automationRunOutputSchema, async () => ({
7166
+ automation_run: await client.automations.run(args.id, mutationOptions(args))
7167
+ }))
7168
+ );
7169
+ });
6864
7170
  registerIfAllowed("shipmail_list_booking_pages", () => {
6865
7171
  server.registerTool(
6866
7172
  "shipmail_list_booking_pages",
@@ -7168,7 +7474,7 @@ function registerTools(rawServer, client, allowedTools, grantedOrganizations = [
7168
7474
  }
7169
7475
 
7170
7476
  // src/version.ts
7171
- var VERSION = "0.7.2";
7477
+ var VERSION = "0.7.3";
7172
7478
 
7173
7479
  // src/server.ts
7174
7480
  var INSTRUCTIONS = `Shipmail MCP exposes the business email and calendar tools authorized by the connection's current Shipmail permissions.
package/dist/server.js CHANGED
@@ -18,7 +18,8 @@ var MCP_MEMBER_PERMISSION_GROUP_NAMES = [
18
18
  "mailbox_rules",
19
19
  "send_mail",
20
20
  "calendar_read",
21
- "calendar_write"
21
+ "calendar_write",
22
+ "automations"
22
23
  ];
23
24
  var MCP_PERMISSION_GROUPS = [
24
25
  {
@@ -28,6 +29,13 @@ var MCP_PERMISSION_GROUPS = [
28
29
  scopes: [],
29
30
  persistent: false
30
31
  },
32
+ {
33
+ name: "automations",
34
+ label: "Automations",
35
+ description: "Read and manage persistent assistant automations.",
36
+ scopes: ["automations:read", "automations:write"],
37
+ persistent: true
38
+ },
31
39
  {
32
40
  name: "mail_read",
33
41
  label: "Read mail",
@@ -163,6 +171,11 @@ var MCP_PERMISSION_GROUPS = [
163
171
  ];
164
172
  var CAPABILITY_ROWS = [
165
173
  ["shipmail_status", "getStatus", "public"],
174
+ ["shipmail_list_automations", "listAutomations", "automations:read"],
175
+ ["shipmail_create_automation", "createAutomation", "automations:write"],
176
+ ["shipmail_get_automation", "getAutomation", "automations:read"],
177
+ ["shipmail_update_automation", "updateAutomation", "automations:write"],
178
+ ["shipmail_run_automation", "runAutomation", "automations:write"],
166
179
  ["shipmail_create_domain", "createDomain", "domains:write"],
167
180
  ["shipmail_list_domains", "listDomains", "domains:read"],
168
181
  ["shipmail_get_domain", "getDomain", "domains:read"],
@@ -417,6 +430,7 @@ function permissionGroupFor(toolName, requiredScope) {
417
430
  if (requiredScope === "calendar:read") return "calendar_read";
418
431
  if (requiredScope === "calendar:write") return "calendar_write";
419
432
  if (requiredScope.startsWith("booking_pages:")) return "booking_pages";
433
+ if (requiredScope.startsWith("automations:")) return "automations";
420
434
  if (requiredScope.startsWith("webhooks:")) return "webhooks";
421
435
  if (requiredScope.startsWith("newsletters:")) return "newsletters";
422
436
  if (requiredScope.startsWith("audiences:")) return "audiences";
@@ -441,10 +455,11 @@ function recipientControlFor(toolName) {
441
455
  return "none";
442
456
  }
443
457
  function durationFor(toolName) {
458
+ if (toolName === "shipmail_run_automation") return "one_shot";
444
459
  if (toolName.includes("app_password") || toolName.includes("credential_grant") || toolName === "shipmail_rotate_webhook_secret") {
445
460
  return "credential";
446
461
  }
447
- if (toolName.includes("forwarding") || toolName.includes("mailbox_rules") || toolName.includes("webhook") || toolName.includes("booking_page")) {
462
+ if (toolName.includes("forwarding") || toolName.includes("mailbox_rules") || toolName.includes("webhook") || toolName.includes("booking_page") || toolName.includes("automation")) {
448
463
  return "persistent";
449
464
  }
450
465
  if (toolName === "shipmail_send_message" || toolName.includes("schedule_") || toolName.includes("scheduled_message")) {
@@ -2852,6 +2867,197 @@ var calendarAvailabilitySchema = z.object({
2852
2867
  timezone: z.string(),
2853
2868
  slots: z.array(calendarAvailabilitySlotSchema)
2854
2869
  });
2870
+ var automationTriggerSchema = z.discriminatedUnion("type", [
2871
+ z.object({ type: z.literal("email_received"), mailbox_ids: z.array(idSchema).min(1).max(100) }),
2872
+ z.object({
2873
+ type: z.literal("scheduled"),
2874
+ cron: noControlString(100, "cron").min(9),
2875
+ time_zone: noControlString(100, "time zone").min(1)
2876
+ }),
2877
+ z.object({ type: z.literal("manual"), mailbox_ids: z.array(idSchema).min(1).max(100) }),
2878
+ z.object({
2879
+ type: z.literal("thread_state"),
2880
+ mailbox_ids: z.array(idSchema).min(1).max(100),
2881
+ state: z.literal("no_reply_after"),
2882
+ duration_minutes: z.number().int().min(15).max(525600)
2883
+ })
2884
+ ]);
2885
+ var automationConditionSchema = z.discriminatedUnion("type", [
2886
+ z.object({ type: z.literal("sender_address"), addresses: z.array(emailSchema).min(1).max(100) }),
2887
+ z.object({
2888
+ type: z.literal("sender_domain"),
2889
+ domains: z.array(noControlString(253, "sender domain").min(1)).min(1).max(100)
2890
+ }),
2891
+ z.object({
2892
+ type: z.literal("subject_contains"),
2893
+ values: z.array(noControlString(200, "subject value").min(1)).min(1).max(100)
2894
+ }),
2895
+ z.object({ type: z.literal("has_attachment"), value: z.boolean() }),
2896
+ z.object({
2897
+ type: z.literal("semantic_positive_match"),
2898
+ instruction: noControlString(1e3, "semantic instruction").min(1),
2899
+ minimum_confidence: z.number().min(0.5).max(1)
2900
+ })
2901
+ ]);
2902
+ var automationActionSchema = z.discriminatedUnion("type", [
2903
+ z.object({
2904
+ type: z.literal("create_reply_draft"),
2905
+ instruction: noControlString(2e3, "draft instruction").min(1)
2906
+ }),
2907
+ z.object({
2908
+ type: z.literal("reply_to_trigger_sender"),
2909
+ instruction: noControlString(2e3, "reply instruction").min(1)
2910
+ }),
2911
+ z.object({ type: z.literal("archive_trigger_message") }),
2912
+ z.object({
2913
+ type: z.literal("move_trigger_message"),
2914
+ mailbox_id: idSchema,
2915
+ destination_folder_id: idSchema
2916
+ }),
2917
+ z.object({ type: z.literal("set_trigger_read_state"), is_read: z.boolean() }),
2918
+ z.object({ type: z.literal("set_trigger_star_state"), is_starred: z.boolean() }),
2919
+ z.object({
2920
+ type: z.literal("generate_mail_report"),
2921
+ metric: z.enum(["received", "sent", "unread"]),
2922
+ lookback_minutes: z.number().int().min(15).max(525600)
2923
+ })
2924
+ ]);
2925
+ var automationDefinitionSchema = z.object({
2926
+ trigger: automationTriggerSchema,
2927
+ conditions: z.array(automationConditionSchema).max(20),
2928
+ actions: z.array(automationActionSchema).min(1).max(10),
2929
+ mode: z.enum(["draft", "send"]),
2930
+ scope: z.object({
2931
+ mailbox_ids: z.array(idSchema).min(1).max(100),
2932
+ calendar_addresses: z.array(emailSchema).max(100)
2933
+ })
2934
+ }).superRefine((definition, context) => {
2935
+ const semantic = definition.conditions.some(
2936
+ (condition) => condition.type === "semantic_positive_match"
2937
+ );
2938
+ const placement = definition.actions.some(
2939
+ (action) => [
2940
+ "archive_trigger_message",
2941
+ "move_trigger_message",
2942
+ "set_trigger_read_state",
2943
+ "set_trigger_star_state"
2944
+ ].includes(action.type)
2945
+ );
2946
+ const messageAction = definition.actions.some(
2947
+ (action) => [
2948
+ "create_reply_draft",
2949
+ "reply_to_trigger_sender",
2950
+ "archive_trigger_message",
2951
+ "move_trigger_message",
2952
+ "set_trigger_read_state",
2953
+ "set_trigger_star_state"
2954
+ ].includes(action.type)
2955
+ );
2956
+ if (definition.mode === "send" && definition.trigger.type !== "email_received") {
2957
+ context.addIssue({
2958
+ code: "custom",
2959
+ message: "Send mode requires email_received.",
2960
+ path: ["mode"]
2961
+ });
2962
+ }
2963
+ if (definition.mode === "send" && semantic) {
2964
+ context.addIssue({
2965
+ code: "custom",
2966
+ message: "Send mode cannot use semantic conditions.",
2967
+ path: ["conditions"]
2968
+ });
2969
+ }
2970
+ if (definition.trigger.type === "email_received" && !semantic && placement) {
2971
+ context.addIssue({
2972
+ code: "custom",
2973
+ message: "Deterministic placement belongs in mailbox rules unless a semantic condition gates it.",
2974
+ path: ["actions"]
2975
+ });
2976
+ }
2977
+ if (messageAction && definition.trigger.type !== "email_received" && definition.trigger.type !== "thread_state") {
2978
+ context.addIssue({
2979
+ code: "custom",
2980
+ message: "Message actions need an email or thread-state trigger.",
2981
+ path: ["actions"]
2982
+ });
2983
+ }
2984
+ if (definition.trigger.type === "email_received" && definition.actions.some((action) => action.type === "generate_mail_report")) {
2985
+ context.addIssue({
2986
+ code: "custom",
2987
+ message: "Mail reports need a scheduled or manual trigger.",
2988
+ path: ["actions"]
2989
+ });
2990
+ }
2991
+ if (definition.mode === "send") {
2992
+ const replies = definition.actions.filter(
2993
+ (action) => action.type === "reply_to_trigger_sender"
2994
+ );
2995
+ if (replies.length !== 1 || definition.actions.length !== 1) {
2996
+ context.addIssue({
2997
+ code: "custom",
2998
+ message: "Send mode supports exactly one automatic reply action.",
2999
+ path: ["actions"]
3000
+ });
3001
+ }
3002
+ }
3003
+ });
3004
+ var automationRunSummarySchema = z.object({
3005
+ object: z.literal("automation_run"),
3006
+ id: z.string(),
3007
+ status: z.enum([
3008
+ "queued",
3009
+ "running",
3010
+ "completed",
3011
+ "failed",
3012
+ "degraded",
3013
+ "cancelled",
3014
+ "skipped"
3015
+ ]),
3016
+ error_code: z.string().nullable(),
3017
+ created_at: z.string()
3018
+ });
3019
+ var automationRunSchema = z.object({
3020
+ object: z.literal("automation_run"),
3021
+ id: z.string(),
3022
+ automation_id: z.string(),
3023
+ status: z.literal("queued")
3024
+ });
3025
+ var automationSchema = z.object({
3026
+ object: z.literal("automation"),
3027
+ id: z.string(),
3028
+ name: z.string(),
3029
+ status: z.enum(["active", "paused", "disabled"]),
3030
+ version_id: z.string(),
3031
+ version: z.number().int(),
3032
+ definition: automationDefinitionSchema,
3033
+ last_run: automationRunSummarySchema.nullable(),
3034
+ next_run_at: z.string().nullable(),
3035
+ created_at: z.string(),
3036
+ updated_at: z.string()
3037
+ });
3038
+ var automationByIdInputSchema = z.object({ id: idSchema });
3039
+ var createAutomationInputSchema = z.object({
3040
+ name: noControlString(100, "automation name").min(1),
3041
+ definition: automationDefinitionSchema,
3042
+ idempotency_key: idempotencyKeySchema
3043
+ });
3044
+ var updateAutomationInputSchema = z.object({
3045
+ id: idSchema,
3046
+ name: noControlString(100, "automation name").min(1).optional(),
3047
+ definition: automationDefinitionSchema.optional(),
3048
+ status: z.enum(["active", "paused", "disabled"]).optional(),
3049
+ idempotency_key: idempotencyKeySchema
3050
+ }).refine(
3051
+ (value) => value.name !== void 0 || value.definition !== void 0 || value.status !== void 0,
3052
+ "Provide name, definition, or status."
3053
+ );
3054
+ var runAutomationInputSchema = z.object({
3055
+ id: idSchema,
3056
+ idempotency_key: idempotencyKeySchema
3057
+ });
3058
+ var automationOutputSchema = z.object({ automation: automationSchema });
3059
+ var automationsOutputSchema = z.object({ data: z.array(automationSchema) });
3060
+ var automationRunOutputSchema = z.object({ automation_run: automationRunSchema });
2855
3061
  var bookingPageSchema = z.object({
2856
3062
  object: z.literal("booking_page"),
2857
3063
  id: z.string(),
@@ -4044,6 +4250,9 @@ var SESSION_LIMITS = {
4044
4250
  shipmail_create_booking_page: 20,
4045
4251
  shipmail_update_booking_page: 20,
4046
4252
  shipmail_delete_booking_page: 10,
4253
+ shipmail_create_automation: 20,
4254
+ shipmail_update_automation: 20,
4255
+ shipmail_run_automation: 20,
4047
4256
  shipmail_create_partner_organization: 20,
4048
4257
  shipmail_update_partner_organization: 50,
4049
4258
  shipmail_resend_partner_ownership_invitation: 20,
@@ -6764,6 +6973,103 @@ function registerTools(rawServer, client, allowedTools, grantedOrganizations = [
6764
6973
  )
6765
6974
  );
6766
6975
  });
6976
+ registerIfAllowed("shipmail_list_automations", () => {
6977
+ server.registerTool(
6978
+ "shipmail_list_automations",
6979
+ {
6980
+ title: "List Automations",
6981
+ description: "List assistant automations visible to this API key's mailbox constraints.",
6982
+ outputSchema: automationsOutputSchema,
6983
+ annotations: { readOnlyHint: true, openWorldHint: false }
6984
+ },
6985
+ async () => runTool(
6986
+ "shipmail_list_automations",
6987
+ automationsOutputSchema,
6988
+ () => client.automations.list()
6989
+ )
6990
+ );
6991
+ });
6992
+ registerIfAllowed("shipmail_get_automation", () => {
6993
+ server.registerTool(
6994
+ "shipmail_get_automation",
6995
+ {
6996
+ title: "Get Automation",
6997
+ description: "Fetch one assistant automation by ID.",
6998
+ inputSchema: automationByIdInputSchema,
6999
+ outputSchema: automationOutputSchema,
7000
+ annotations: { readOnlyHint: true, openWorldHint: false }
7001
+ },
7002
+ async ({ id }) => runTool("shipmail_get_automation", automationOutputSchema, async () => ({
7003
+ automation: await client.automations.get(id)
7004
+ }))
7005
+ );
7006
+ });
7007
+ registerIfAllowed("shipmail_create_automation", () => {
7008
+ server.registerTool(
7009
+ "shipmail_create_automation",
7010
+ {
7011
+ title: "Create Automation",
7012
+ description: "Create and activate an assistant automation from an explicit reviewed definition. This persists behavior until paused or disabled.",
7013
+ inputSchema: createAutomationInputSchema,
7014
+ outputSchema: automationOutputSchema,
7015
+ annotations: {
7016
+ readOnlyHint: false,
7017
+ destructiveHint: false,
7018
+ idempotentHint: true,
7019
+ openWorldHint: false
7020
+ }
7021
+ },
7022
+ async (args) => runTool("shipmail_create_automation", automationOutputSchema, async () => ({
7023
+ automation: await client.automations.create(
7024
+ stripIdempotencyKey(args),
7025
+ mutationOptions(args)
7026
+ )
7027
+ }))
7028
+ );
7029
+ });
7030
+ registerIfAllowed("shipmail_update_automation", () => {
7031
+ server.registerTool(
7032
+ "shipmail_update_automation",
7033
+ {
7034
+ title: "Update Automation",
7035
+ description: "Change an automation's name, reviewed definition, or status. Definition changes create and activate a new immutable version.",
7036
+ inputSchema: updateAutomationInputSchema,
7037
+ outputSchema: automationOutputSchema,
7038
+ annotations: {
7039
+ readOnlyHint: false,
7040
+ destructiveHint: false,
7041
+ idempotentHint: true,
7042
+ openWorldHint: false
7043
+ }
7044
+ },
7045
+ async (args) => runTool("shipmail_update_automation", automationOutputSchema, async () => {
7046
+ const { id, idempotency_key: _key, ...params } = args;
7047
+ return {
7048
+ automation: await client.automations.update(id, params, mutationOptions(args))
7049
+ };
7050
+ })
7051
+ );
7052
+ });
7053
+ registerIfAllowed("shipmail_run_automation", () => {
7054
+ server.registerTool(
7055
+ "shipmail_run_automation",
7056
+ {
7057
+ title: "Run Automation",
7058
+ description: "Queue one run of a manual automation.",
7059
+ inputSchema: runAutomationInputSchema,
7060
+ outputSchema: automationRunOutputSchema,
7061
+ annotations: {
7062
+ readOnlyHint: false,
7063
+ destructiveHint: false,
7064
+ idempotentHint: true,
7065
+ openWorldHint: false
7066
+ }
7067
+ },
7068
+ async (args) => runTool("shipmail_run_automation", automationRunOutputSchema, async () => ({
7069
+ automation_run: await client.automations.run(args.id, mutationOptions(args))
7070
+ }))
7071
+ );
7072
+ });
6767
7073
  registerIfAllowed("shipmail_list_booking_pages", () => {
6768
7074
  server.registerTool(
6769
7075
  "shipmail_list_booking_pages",
@@ -7071,7 +7377,7 @@ function registerTools(rawServer, client, allowedTools, grantedOrganizations = [
7071
7377
  }
7072
7378
 
7073
7379
  // src/version.ts
7074
- var VERSION = "0.7.2";
7380
+ var VERSION = "0.7.3";
7075
7381
 
7076
7382
  // src/server.ts
7077
7383
  var INSTRUCTIONS = `Shipmail MCP exposes the business email and calendar tools authorized by the connection's current Shipmail permissions.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shipmail-mcp",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "mcpName": "io.github.shipmail-to/shipmail-mcp",
5
5
  "description": "Official Model Context Protocol (MCP) server for Shipmail, a business email provider with REST API, webhooks, and custom-domain inboxes for AI agents.",
6
6
  "type": "module",
@@ -67,7 +67,7 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "@modelcontextprotocol/server": "2.0.0",
70
- "shipmail": "0.4.13",
70
+ "shipmail": "0.4.14",
71
71
  "zod": "4.4.3"
72
72
  },
73
73
  "devDependencies": {
package/server.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "https://github.com/shipmail-to/shipmail-mcp",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.7.2",
9
+ "version": "0.7.3",
10
10
  "websiteUrl": "https://shipmail.to/docs/mcp",
11
11
  "remotes": [
12
12
  {
@@ -27,7 +27,7 @@
27
27
  "registryType": "npm",
28
28
  "registryBaseUrl": "https://registry.npmjs.org",
29
29
  "identifier": "shipmail-mcp",
30
- "version": "0.7.2",
30
+ "version": "0.7.3",
31
31
  "transport": {
32
32
  "type": "stdio"
33
33
  },
package/smithery.yaml CHANGED
@@ -1,6 +1,6 @@
1
1
  # Smithery configuration file: https://smithery.ai/docs/build/project-config/smithery-yaml
2
2
  name: shipmail-mcp
3
- version: 0.7.2
3
+ version: 0.7.3
4
4
  description: Official Shipmail MCP server for AI-agent custom-domain business email inboxes with REST API and webhooks.
5
5
  author: Shipmail
6
6
  repository: https://github.com/shipmail-to/shipmail-mcp