# Smithery configuration for @misarmail/mcp
# Listed as: misar/misarmail-mcp  (https://smithery.ai/server/misar/misarmail-mcp)
#
# GENERATED by scripts/mcp/generate-distribution.mjs — do not edit by hand.
# The tool list below is derived from the server's real catalogue; the previous
# hand-written lists had drifted from what the servers actually served.
name: MisarMail MCP Server
description: >
  Send email, run campaigns, manage contacts and automations, A/B test, and audit deliverability — from any AI assistant.
  55 tools, 8 prompts, 4 resources.
homepage: https://www.misarmail.com
license: MIT
tags:
  - email
  - marketing
  - productivity
  - communication
  - automation
  - analytics
  - mcp-server
  - claude
  - cursor
  - windsurf
  - misar

startCommand:
  type: stdio
  configSchema:
    type: object
    properties:
      apiKey:
        type: string
        title: API Key
        description: >
          Your MisarMail API key (msk_…). Create one at https://mail.misar.io/developers
          — or leave blank and run the "login" tool to authenticate via browser.
        x-secret: true
      baseUrl:
        type: string
        title: Base URL
        description: Only needed for self-hosted instances.
        default: ""
    required: []
  commandFunction: |-
    (config) => ({
      command: "npx",
      args: ["-y", "@misarmail/mcp@latest"],
      env: {
        ...(config.apiKey ? { MISARMAIL_API_KEY: config.apiKey } : {}),
        ...(config.baseUrl ? { MISARMAIL_BASE_URL: config.baseUrl } : {}),
      },
    })

tools:
  - name: send_email
    description: "Send a transactional email from a verified MisarMail account. `from.email` must match an email account you have already verified — use list_domains to check which sender domains are available. Returns the message ID and queue status."
  - name: list_emails
    description: "List emails from a mailbox folder with optional full-text search across subject and body. Use this for reading the unified inbox; use list_campaigns for marketing sends."
  - name: get_email
    description: "Read the full content of a single email by ID, including headers, body, and attachments metadata. Side effect: marks the email as read."
  - name: reply_to_email
    description: "Reply to an existing email thread. The sender address and threading headers are derived from the original message, so only the body is required."
  - name: archive_email
    description: "Move an email to the archive folder. Reversible — the message is not deleted."
  - name: validate_email
    description: "Validate an email address before sending: syntax, MX records, disposable-domain and role-account detection. Use this to protect sender reputation on imported lists."
  - name: list_campaigns
    description: "List email marketing campaigns with their status, audience size, and headline metrics. Filter by status to find drafts ready to send or campaigns still sending."
  - name: get_campaign
    description: "Get full details for one campaign: content, audience segment, schedule, and delivery statistics (sent, opened, clicked, bounced, complained)."
  - name: create_campaign
    description: "Create a new email marketing campaign as a draft. Creating never sends or schedules anything — once the content and audience are confirmed, call send_campaign to send it now or schedule it for later."
  - name: send_campaign
    description: "Send a campaign now, or schedule it for a future time by passing scheduled_at. This delivers real email to real recipients and cannot be undone once sending starts — confirm the audience with get_campaign first."
  - name: list_contacts
    description: "List contacts with their subscription status and engagement metrics. Filter by status to find unsubscribed or bounced addresses that should be excluded from sends."
  - name: create_contact
    description: "Add a single contact. Adding a contact records consent to email them — only add addresses that opted in, or the send will damage sender reputation and may breach CAN-SPAM/GDPR."
  - name: update_contact
    description: "Update an existing contact by email address, including changing subscription status. Setting status to unsubscribed immediately excludes them from every future campaign. Does not support tags, phone, company, or job title — the API has no fields for them."
  - name: import_contacts
    description: "Bulk-import up to 5,000 contacts in one call. By default, addresses that already exist are skipped rather than duplicated — pass update_existing: true to update them instead. Returns per-row results so you can see which rows were rejected and why."
  - name: get_contact_score
    description: "Get engagement score, engagement tier, and churn risk for one contact — or the lowest-engagement contacts across the list when contact_id is omitted. Use before a re-engagement campaign."
  - name: list_templates
    description: "List saved email templates with their variable placeholders, so you can pick one for a campaign or transactional send."
  - name: create_template
    description: "Create a reusable email template. Use {{variable}} placeholders for personalisation — they are substituted at send time and previewable via render_template."
  - name: render_template
    description: "Render a template with sample variables and return the resulting HTML and subject. Use this to preview personalisation before sending anything."
  - name: list_automations
    description: "List automation workflows (welcome series, re-engagement, drip sequences) with their trigger type and active state."
  - name: get_automation
    description: "Get one automation workflow in full: trigger, every step with its delay, and per-step completion stats."
  - name: create_automation
    description: "Create an automation workflow from a trigger, saved as a paused draft. The API's create endpoint only accepts a name and trigger — it has no fields for workflow steps or starting active; configure the step sequence in the MisarMail dashboard's visual builder, and use toggle_automation to activate once reviewed."
  - name: toggle_automation
    description: "Activate or pause an automation. Activating starts enrolling contacts and sending on the configured schedule."
  - name: list_ab_tests
    description: "List A/B tests with per-variant results and whether a winner has been selected yet."
  - name: create_ab_test
    description: "Create one A/B test variant on a campaign. The real API stores a single variant per call, so build a test by calling this once per variant (e.g. twice for a plain A/B split) using the same campaign_id and distinct `variant` labels. Each variant gets send_percent of the audience; auto_select_winner (with winner_wait_hours) can pick and send the winner automatically, or use select_ab_test_winner to do it manually."
  - name: select_ab_test_winner
    description: "Select the winning variant and send it to the remaining audience. This triggers a real send to everyone who was held back — it cannot be undone."
  - name: get_analytics
    description: "Get delivery and engagement analytics — sent, delivered, opened, clicked, bounced, and complained — for the account or one campaign, grouped by day/week/month."
  - name: get_analytics_timeline
    description: "Get a day/week/month breakdown of sent, delivered, opened, clicked, bounced, complained, replied, and unsubscribed — across every send medium (campaigns, inbox compose, API, MCP, SDKs, GraphQL, automations). The timeline counterpart to get_analytics's period totals."
  - name: generate_report
    description: "Generate a structured analytics report over a date range. Report types: campaign_performance, engagement_funnel, cohort_analysis, and send_time_heatmap (best hour/day to send)."
  - name: get_revenue_attribution
    description: "Attribute ecommerce revenue to email — revenue per campaign, per contact, and average order value from tracked conversions."
  - name: get_monetization_stats
    description: "Get newsletter monetization stats: paid subscribers, MRR, churn, and sponsorship revenue for the period."
  - name: get_deliverability_score
    description: "Get the account deliverability score (0–100) and letter grade (A–F) with the factors dragging it down. Start here when asked why emails are landing in spam."
  - name: run_deliverability_audit
    description: "Run a full deliverability audit across authentication (SPF/DKIM/DMARC), domain reputation, list hygiene, content signals, and blocklist status. Returns prioritized findings."
  - name: get_warmup_status
    description: "Get IP/domain warm-up progress and today's remaining send capacity. Exceeding warm-up capacity on a new domain is the fastest way to get throttled or blocklisted."
  - name: check_dmarc
    description: "Check live SPF, DKIM, and DMARC DNS records for a domain and report alignment problems with the exact record to publish. Works for any domain, not only your own."
  - name: list_domains
    description: "List sending domains with verification status and their DKIM/SPF/DMARC records. Check here first when a send fails with an unverified-sender error."
  - name: add_domain
    description: "Add a sending domain and return the DNS records to publish. The domain cannot send until those records are live and verify_domain succeeds."
  - name: verify_domain
    description: "Re-check a domain's DNS records and mark it verified if they resolve. Safe to retry — DNS propagation can take up to 48 hours."
  - name: configure_inbound_domain
    description: "Configure inbound email routing for a subdomain so replies land in the MisarMail unified inbox. Returns the MX record to publish."
  - name: list_forms
    description: "List signup forms with their embed status and conversion counts."
  - name: get_form
    description: "Get one signup form including its fields, embed code, and redirect behaviour."
  - name: get_form_submissions
    description: "List submissions for a signup form, including the submitted field values and timestamps."
  - name: create_landing_page
    description: "Create a hosted landing page with a single hero block (headline, subheadline, CTA). Returns the public URL. The real API stores pages as a page-builder block array with no dedicated headline/CTA fields, so this tool translates your inputs into one 'hero' block — for multi-block pages or a real CTA link, use the landing page editor in the MisarMail dashboard."
  - name: list_marketplace_items
    description: "Browse the MisarMail template marketplace for ready-made email and automation templates."
  - name: get_marketplace_item
    description: "Get one marketplace listing with its full preview, author, and install count."
  - name: list_inbox_conversations
    description: "List unified-inbox conversations (threads) with their status and detected intent. Use this for triage; use list_emails for individual messages in a folder."
  - name: get_inbox_conversation_messages
    description: "Get every message in one inbox conversation, oldest first, with sender and timestamps."
  - name: categorize_inbox_emails
    description: "Run AI categorisation over a batch of inbox emails to label intent and priority. Consumes AI credits — pass only the emails you actually need triaged."
  - name: list_api_keys
    description: "List API keys on the account with their scopes and last-used time. Key secrets are never returned — only metadata."
  - name: generate_subject_lines
    description: "Generate AI subject-line variants for a campaign topic, optionally tuned to a tone and audience. Good input for create_ab_test."
  - name: list_integrations
    description: "List connected third-party integrations and their sync status."
  - name: get_integration
    description: "Get one integration's configuration, scopes, and last sync result."
  - name: toggle_integration
    description: "Enable or disable an integration. Disabling stops all syncing but preserves the stored credentials."
  - name: list_sandbox_sends
    description: "List emails captured by sandbox mode. Sandbox intercepts sends instead of delivering them — use it to verify templates and automations without emailing anyone."
  - name: clear_sandbox
    description: "Delete every captured sandbox email. Affects only intercepted test messages, never real sent mail."
  - name: upgrade
    description: "Show the current MisarMail plan, how much of each quota is left, and what upgrading unlocks, with the link to upgrade. Call it any time — not only after hitting a limit. Reads only: it never changes the plan or takes payment; the user upgrades by following the link. On a local install, open=true also opens that link in the user's browser."

prompts:
  - name: compose_email
    description: "Draft a professional email and send it via MisarMail after confirmation."
  - name: campaign_performance_report
    description: "Analyse campaign performance and produce prioritized improvements."
  - name: contact_import_guide
    description: "Import and organise contacts safely, with consent and hygiene checks."
  - name: automation_builder_guide
    description: "Design and build an email automation workflow step by step."
  - name: deliverability_improvement_plan
    description: "Diagnose deliverability and produce a prioritized weekly action plan."
  - name: ab_test_plan
    description: "Design a statistically meaningful A/B test for a campaign."
  - name: list_hygiene_audit
    description: "Find and clean the contacts that are hurting sender reputation."
  - name: weekly_email_report
    description: "Produce a stakeholder-ready weekly email performance summary."
