Skip to content

Integration · Email

Connect Claude & ChatGPT to Mailgun

Ask your AI why a customer never got an email, how last week's sending went, or to add someone to a mailing list. It reads events, sending stats, domains, templates, mailing lists and the bounce, complaint and unsubscribe lists, and can send and resend email through your Mailgun domains. You trace delivery problems without digging through logs.

Connect Mailgun free

Free plan, no credit card. Takes about a minute.

Try asking

  • “Did the order confirmation to [email protected] get delivered?”

    The AI lists the events for that recipient on your domain and shows whether the email was accepted, delivered, failed or opened.

  • “How did our email perform last week?”

    It reads the sending stats for the week by day, with delivered, opened, clicked, bounced and complained counts and rates.

  • “Is [email protected] on our bounce list? If so, remove him.”

    It checks the domain's bounce list and removes the address, so Mailgun sends to it again.

What your AI can do

Sending and events

Send email with text, HTML or a stored template, resend stored messages, and trace each email through its events.

Domains, stats and templates

Check domain state and required DNS records, read sending stats by day, domain or tag, and read templates.

Lists and suppressions

Create mailing lists and add, update or remove members. Check and clear bounces, complaints and unsubscribes.

  • “Add [email protected] to [email protected].”

    It adds her as a member of that mailing list, or updates her if she is already on it.

  • “Resend yesterday's invoice email to the customer's new address.”

    It finds the email in the events, fetches the stored message and resends it to the new address.

  • “Which DNS records does mg.example.com still need?”

    It reads the domain with its state and the DNS records needed for sending and receiving.

23 tools for Mailgun

These tools are switched on when you connect. You can switch any of them off, or require your approval before it runs.

  • add_mailing_list_memberChanges dataAdd a member (email address, optional name and variables) to a mailing list. Set upsert to update an existing member.
  • create_mailing_listChanges dataCreate a mailing list with an email address (e.g. [email protected]), name and description.
  • delete_bounceDeletesRemove one address from a domain's bounce list so Mailgun will send to it again.
  • delete_complaintDeletesRemove one address from a domain's spam complaint list so it receives email again.
  • delete_unsubscribeDeletesRemove one address from a domain's unsubscribe list so it receives email again. Only do this when the person asked to be resubscribed.
  • get_domainGet one sending domain by name, including its state and the DNS records needed for sending and receiving.
  • get_mailing_listGet one mailing list by its address.
  • get_mailing_list_memberGet one member of a mailing list by email address.
  • get_sending_statsChanges dataGet sending statistics (delivered, opened, clicked, bounced, complained and rates) for a time range, grouped by day, domain or tag.
  • get_stored_messageGet the content of a stored email by domain and storage key (found in an event's storage field). Mailgun keeps messages for a few days.
  • get_templateGet one email template for a domain by name, optionally including its active version content.
  • list_bouncesList addresses that bounced for a domain and are blocked from receiving email. Filter by the start of the address.
  • list_complaintsList addresses that marked a domain's email as spam. Filter by the start of the address.
  • list_domainsList sending domains with their state (active, unverified, disabled). Filter by state or search by name.
  • list_eventsList email events for a domain (accepted, delivered, failed, opened, clicked, unsubscribed, complained). Filter by event, recipient, subject or time range. Use it to trace what happened to an email.
  • list_mailing_list_membersList members of a mailing list. Filter by subscribed status.
  • list_mailing_listsList mailing lists with their address, name and member count.
  • list_templatesList the email templates stored for a domain.
  • list_unsubscribesList addresses that unsubscribed from a domain's email. Filter by the start of the address.
  • remove_mailing_list_memberDeletesRemove one member from a mailing list. This cannot be undone.
  • resend_messageChanges dataResend a stored email to one or more recipients. This sends a real email.
  • send_emailChanges dataSend an email through one of your Mailgun domains. Give the sending domain, from, to, subject and text or html (or a stored template); the email goes out immediately and cannot be recalled.
  • update_mailing_list_memberChanges dataUpdate a mailing list member's name, variables or subscribed status.

Set up in three steps

  1. 1

    Pick the app

    Create a free PipMCP account and choose Mailgun from the app list.

  2. 2

    Paste your key

    Enter api as the username and paste your Mailgun private API key. In the Mailgun dashboard, open Account Settings > API Keys and copy your private API key, or create a new one.

  3. 3

    Add the link to your AI

    You get a personal MCP link. Add it to Claude, ChatGPT or Cursor:

    Click your name, then Settings › Connectors › Add custom connector. Paste your link as the Remote MCP server URL. Switch it on from the + menu in a chat.

Questions

What can the AI do in Mailgun?

The AI can read domains, events, stored messages, sending stats, templates, mailing lists and members, and the bounce, complaint and unsubscribe lists. It can send and resend email, create mailing lists, add, update and remove members, and remove addresses from the suppression lists.

Why is the username api?

Mailgun uses basic authentication with the fixed username api and your private API key as the password. PipMCP sends both with each call, so you only enter them once.

Does the AI see my Mailgun API key?

No. Your Mailgun private API key is encrypted at rest and never shown to the AI. Once saved, it is not shown again, not even to you. The AI only works through the tools you switch on.

Can I control what the AI is allowed to do?

Yes. You choose which tools are switched on, so you can start read-only. A sent email cannot be recalled, and removing an address from a bounce, complaint or unsubscribe list makes Mailgun send to it again. These actions can require your approval before they run. Every tool call is logged.

Does it work with ChatGPT?

Yes. In ChatGPT, go to Settings › Apps & Connectors › Advanced, turn on Developer mode and add your PipMCP link. Developer mode needs a paid ChatGPT plan: Plus, Pro, Business or Enterprise. The same link works in Claude under Settings › Connectors › Add custom connector, and in Cursor.

What does it cost?

PipMCP has a free plan, and you do not need a credit card to start. Paid plans bill per completed task, so you pay for work the AI actually finishes. You also need your own Mailgun account.

Let your AI work in Mailgun today.

Start free. Your key stays encrypted, and you decide what the AI may do.

Connect Mailgun free

PipMCP is not affiliated with Mailgun. Product names are trademarks of their owners.