Skip to main content

Announcing StackOne Defender: leading open-source prompt injection guard for your agent Read More

Mailgun MCP Server
for AI Agents

Production-ready Mailgun MCP server with 81 extensible actions — plus built-in authentication, security, and optimized execution.

Mailgun logo
Mailgun MCP Server
Built by StackOne StackOne

Coverage

81 Agent Actions

Create, read, update, and delete across Mailgun — and extend your agent's capabilities with custom actions.

Authentication

Agent Tool Authentication

Per-user OAuth in one call. Your Mailgun MCP server gets session-scoped tokens with zero credentials stored on your infra.

Agent Auth →

Security

Agent Protection

Every Mailgun tool response scanned for prompt injection in milliseconds — 88.7% accuracy, all running on CPU.

Prompt Injection Defense →

Performance

Max Agent Context. Min Cost.

Free up to 96% of your agent's context window to enhance reasoning and reduce cost, on every Mailgun call.

Tools Discovery →

What is the Mailgun MCP Server?

A Mailgun MCP server lets AI agents read and write Mailgun data through the Model Context Protocol — Anthropic's open standard for connecting LLMs to external tools. StackOne's Mailgun MCP server ships with 81 pre-built actions, fully extensible via the Connector Builder — plus managed authentication, prompt injection defense, and optimized agent context. Connect it from MCP clients like Claude Desktop, Cursor, and VS Code, or from agent frameworks like OpenAI Agents SDK, LangChain, and Vercel AI SDK.

All Mailgun MCP Tools and Actions

Every action from Mailgun's API, ready for your agent. Create, read, update, and delete — scoped to exactly what you need.

Domains

  • Create Domain

    Add a new sending domain to the Mailgun account.

  • List Domains

    List all domains associated with the Mailgun account.

  • Get Domain

    Retrieve details and DNS verification status for a specific domain.

  • Update Domain

    Update configuration settings for an existing domain.

  • Delete Domain

    Permanently delete a domain from the Mailgun account.

Bounces

  • Create Bounce

    Manually add an email address to the bounce suppression list for a domain.

  • List Bounces

    List all bounce records for a domain's suppression list.

  • Get Bounce

    Retrieve the bounce record for a specific email address.

  • Delete Bounce

    Remove a specific email address from the bounce suppression list.

  • Delete Bounces

    Clear all bounce records from a domain's suppression list.

Complaints

  • Create Complaint

    Manually add an email address to the spam complaint suppression list.

  • List Complaints

    List all spam complaint records for a domain's suppression list.

  • Get Complaint

    Retrieve the spam complaint record for a specific email address.

  • Delete Complaint

    Remove a specific email address from the spam complaint suppression list.

  • Delete Complaints

    Clear all spam complaint records from a domain's suppression list.

Unsubscribes

  • Create Unsubscribe

    Manually add an email address to the unsubscribe suppression list.

  • List Unsubscribes

    List all unsubscribe records for a domain's suppression list.

  • Get Unsubscribe

    Retrieve the unsubscribe record for a specific email address.

  • Delete Unsubscribe

    Remove a specific email address from the unsubscribe suppression list.

  • Delete Unsubscribes

    Clear all unsubscribe records from a domain's suppression list.

Allowlist Entrys

  • Create Allowlist Entry

    Add an email address or domain to the bounce allowlist.

  • Get Allowlist Entry

    Retrieve a specific entry from the bounce allowlist.

  • Delete Allowlist Entry

    Remove a specific entry from the bounce allowlist.

Mailing Lists

  • Create Mailing List

    Create a new mailing list for bulk email distribution.

  • List Mailing Lists

    List all mailing lists associated with the Mailgun account.

  • Get Mailing List

    Retrieve details of a specific mailing list by its email address.

  • Update Mailing List

    Update the settings of an existing mailing list.

  • Delete Mailing List

    Permanently delete a mailing list and all its members.

Mailing List Members

  • Create Mailing List Member

    Add a new member to a mailing list.

  • List Mailing List Members

    List all members of a specific mailing list.

  • Get Mailing List Member

    Retrieve the details of a specific mailing list member.

  • Update Mailing List Member

    Update the details or subscription status of an existing mailing list member.

  • Delete Mailing List Member

    Remove a member from a mailing list.

Account Templates

  • Create Account Template

    Create a new email template at the account level.

  • List Account Templates

    List all email templates stored at the account level.

  • Get Account Template

    Retrieve details of a specific account-level template.

  • Update Account Template

    Update the metadata of an existing account-level template.

  • Delete Account Template

    Permanently delete an account-level template and all its versions.

Account Template Versions

  • Create Account Template Version

    Add a new version to an existing account-level template.

  • List Account Template Versions

    List all versions of a specific account-level template.

  • Get Account Template Version

    Retrieve a specific version of an account-level template.

  • Update Account Template Version

    Update the content or status of a specific account template version.

  • Delete Account Template Version

    Delete a specific version of an account-level template.

Routes

  • Create Route

    Create a new inbound email routing rule.

  • List Routes

    List all inbound email routing rules configured on the account.

  • Get Route

    Retrieve the details of a specific inbound routing rule.

  • Update Route

    Update an existing inbound email routing rule.

  • Delete Route

    Permanently delete an inbound email routing rule.

Tags

  • List Tags

    Query analytics tags by name and optionally set a description.

  • Update Tag

    Update the description of an existing analytics tag.

  • Delete Tag

    Delete an analytics tag from the account.

IPs

  • List IPs

    List all IP addresses allocated to the Mailgun account.

  • Get IP

    Retrieve details for a specific IP address allocated to the account.

IP Pools

  • Create IP Pool

    Create a new IP pool to group dedicated IPs for a sending stream.

  • List IP Pools

    List all IP pools configured on the Mailgun account.

  • Get IP Pool

    Retrieve details of a specific IP pool.

SMTP Credentials

  • Create SMTP Credential

    Create a new SMTP login credential for a domain.

  • List SMTP Credentials

    List all SMTP credentials configured for a domain.

  • Update SMTP Credential

    Update the password for an existing SMTP credential.

  • Delete SMTP Credential

    Permanently delete an SMTP credential from a domain.

Users

  • List Users

    List all users associated with the Mailgun account.

  • Get User

    Retrieve the profile of a specific user by their user ID.

Subaccounts

  • Create Subaccount

    Create a new subaccount under the parent Mailgun account.

  • List Subaccounts

    List all subaccounts under the parent Mailgun account.

  • Get Subaccount

    Retrieve details of a specific subaccount.

Other (16)

  • Send Email

    Send an email message via Mailgun for the specified domain.

  • Send Email (MIME)

    Send an email in raw MIME format via Mailgun for the specified domain.

  • List Sending Queues

    Retrieve the current state of the sending queues for a domain.

  • Get Domain Tracking Settings

    Retrieve the click, open, and unsubscribe tracking settings for a domain.

  • List Allowlist

    List all entries in the bounce allowlist for a domain.

  • List Sending Metrics

    Query detailed email sending and engagement analytics metrics.

  • List Usage Metrics

    Query usage metrics for Mailgun services such as email validation and previews.

  • List Email Logs

    Query detailed email event logs for a time range with filtering support.

  • List Email Events

    Retrieve a log of email events for a domain within a time period.

  • Get Current User

    Retrieve the profile of the currently authenticated user.

  • Update Click Tracking

    Enable or disable click tracking for links in emails sent from a domain.

  • Update Open Tracking

    Enable or disable open tracking for emails sent from a domain.

  • Update Unsubscribe Tracking

    Enable or disable unsubscribe tracking and footer injection for a domain.

  • Verify Domain

    Trigger DNS verification for a domain to confirm DNS records are correctly configured.

  • Enable Subaccount

    Re-enable a previously disabled subaccount.

  • Disable Subaccount

    Disable a subaccount to suspend its ability to send email.

Set Up Your Mailgun MCP Server in Minutes

One endpoint. Any framework. Your agent is talking to Mailgun in under 10 lines of code.

MCP Clients

Agent Frameworks

Claude Desktop
{
  "mcpServers": {
    "stackone": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote@latest",
        "https://api.stackone.com/mcp?x-account-id=<account_id>",
        "--header",
        "Authorization: Basic <YOUR_BASE64_TOKEN>"
      ]
    }
  }
}

More Communication MCP Servers

Discord

145+ actions

Basecamp

118+ actions

Webex

100+ actions

SendGrid

99+ actions

Braze

98+ actions

JustCall

73+ actions

Freshdesk

71+ actions

Mailgun MCP Server FAQ

Mailgun MCP server vs direct API integration — what's the difference?
A Mailgun MCP server and direct API integration serve different use cases. Direct API integration is for software-to-software — backend code calling Mailgun. A Mailgun MCP server is for AI agents — MCP clients like Claude and Cursor, plus framework agents built with OpenAI, LangChain, or Vercel AI — discovering and calling Mailgun at runtime. StackOne provides both.
How does Mailgun authentication work for AI agents?
Mailgun authentication for AI agents works through a StackOne Connect Session. Create one via the dashboard or the SDK — you get an auth link and ready-to-paste config for Claude Desktop, Cursor, and other MCP clients. Your user authenticates their own Mailgun account; StackOne handles token exchange, storage, and refresh. Credentials never reach the LLM, and each user is isolated via origin_owner_id.
Are Mailgun MCP tools vulnerable to prompt injection?
Yes — Mailgun MCP tools can be vulnerable to indirect prompt injection. Any tool that reads user-written content — documents, messages, tickets, records, or free-text fields — is a potential vector. StackOne Defender scans every tool response before it enters the agent's context — regex patterns in ~1ms, then a MiniLM classifier in ~4ms. 88.7% accuracy, CPU-only.
What is the context bloat of a Mailgun agent and how do I avoid it?
Context bloat happens when Mailgun tool schemas and API responses eat your Mailgun agent's memory, preventing it from reasoning effectively. A single Mailgun query can return a massive JSON response, and connecting multiple tools compounds the problem. Tools Discovery and Code Mode reduce context bloat — loading only relevant tools per query and keeping raw responses out of the agent's context.
Can I limit which actions my Mailgun agent can access?
Yes — you can limit which actions your Mailgun agent can access directly from the StackOne dashboard. Toggle actions on or off, or restrict them to specific accounts, with no code changes to your agent. Session tokens can be scoped to exact actions so if one leaks, exposure stays contained.
Can I create custom agent actions for my Mailgun MCP server?
Yes — you can create custom agent actions for your Mailgun MCP server using Connector Builder. It's an integration agent your coding assistant (Claude Code, Cursor, or Copilot) can invoke to research Mailgun's API, generate production-ready connector YAML, test against the live API, and validate before you ship.
When should I NOT use a Mailgun MCP server?
Skip a Mailgun MCP server if your integration is purely software-to-software — direct Mailgun API integration is simpler when no AI agent is involved. For deterministic, compliance-critical operations (financial transactions, regulatory reporting), direct API gives you predictable behavior without agent-driven decision-making. MCP shines when AI agents need to dynamically discover and call Mailgun actions at runtime.
What AI frameworks and AI clients does the StackOne Mailgun MCP server support?
The StackOne Mailgun MCP server supports both. MCP clients (paste-and-go apps): Claude Desktop, Claude Code, Cursor, VS Code, Goose. Agent frameworks (code SDKs you build with): OpenAI Agents SDK, Anthropic, Vercel AI, Google ADK, CrewAI, Pydantic AI, LangChain, LangGraph, Azure AI Foundry.

Put your AI agents to work

All the tools you need to build and scale AI agent integrations, with best-in-class connectivity, execution, and security.