Connect AI agents to K2Mailer email marketing with the MCP server
Connect Claude, ChatGPT, or Cursor to K2Mailer through its OAuth-protected MCP server: setup steps, scopes, what agents can do, and the safeguards that stay on.
Quick answer: what is the K2Mailer MCP server?
The K2Mailer MCP server lets an AI agent such as Claude, ChatGPT, or Cursor work inside your K2Mailer account through a secure, OAuth-protected connection. The agent can read campaigns and statistics, write and edit drafts, build segments, run pre-send checks, send test emails you ask for, and schedule a campaign for a future time.
It cannot send immediately, delete anything, or change unsubscribes and suppressions. Those limits are enforced by the K2Mailer server, so they hold even if an agent is told to ignore them. You approve each connection and can revoke it at any time.
MCP stands for Model Context Protocol, an open standard that lets AI assistants use tools and data from other applications. K2Mailer runs a remote MCP server so any compatible client can connect after you authorize it.
Why connect an AI agent to your email marketing platform
Most email work is repetitive: pulling last month’s numbers, drafting the next newsletter, rebuilding the same segment, or double-checking a campaign before it goes out. An agent connected to K2Mailer can do that busywork from a single chat while you stay in charge of what actually gets sent.
Because the agent uses the same checks as the dashboard, you get speed without giving up control. The deterministic Campaign Preflight still decides whether a send is allowed, and consent, suppression, bounce, and complaint protections stay on.
- Ask for campaign, contact, bounce, and suppression information in plain language instead of clicking through reports.
- Turn a short brief into a full campaign draft that opens in the normal K2Mailer editor for review.
- Build and preview a segment such as “opened the last three campaigns but did not click” without hand-setting every filter.
- Run Content Analysis and Campaign Preflight on a draft and get a plain-English list of what to fix.
- Schedule an approved campaign for a future time with the pre-send checks re-run automatically.
Before you start
- An active K2Mailer account. You can start a 14-day free trial if you do not have one yet.
- Permission to authorize connected apps on the account. If you are not the account owner, ask an administrator.
- An AI client that supports remote MCP servers with OAuth, such as Claude, ChatGPT, Cursor, or VS Code with GitHub Copilot.
- The K2Mailer MCP server URL for your account. If you do not have it, contact K2Mailer support.
- A sending server, a verified sending domain, and at least one list if you plan to schedule real campaigns. See Configure a sending server and Add and verify a sending domain.
How to connect an AI agent to K2Mailer
- 1
Check the prerequisites above: an active K2Mailer account, permission to authorize apps, an MCP-capable AI client, and your K2Mailer MCP server URL.
- 2
Open the connectors or MCP settings in your AI client and add a remote MCP server. Paste the K2Mailer MCP server URL and give the connection a clear name such as K2Mailer.
- 3
When your client starts the OAuth flow, a K2Mailer sign-in page opens. Log in with your normal K2Mailer account. Nothing is copied into the agent as a static API key.
- 4
Review the scopes the agent requests and approve only what the job needs. Choose read-only access first if you only want reports and lookups.
- 5
Back in your AI client, run a read-only test such as “List my five most recent K2Mailer campaigns.” A correct answer confirms the connection works.
- 6
Move on to drafting. Ask the agent to write a campaign, build a segment, and run Content Analysis and Campaign Preflight, then review the draft in the K2Mailer editor yourself.
- 7
When you are happy with the result, approve a future send time. The scheduling tool re-runs Campaign Preflight and stops on any blocker.
No static API key to protect
The connection uses a standard OAuth 2.0 sign-in scoped to your account. There is no long-lived secret to paste into a chat, a config file, or a public repository.
Set up Claude, ChatGPT, Cursor, and other clients
- Claude
- Open Claude’s settings, go to Connectors, and add a custom connector using the K2Mailer MCP server URL. Approve the K2Mailer OAuth sign-in when it opens. Custom connectors depend on your Claude plan, so check which plan you need.
- ChatGPT
- Open ChatGPT’s settings for apps or connectors, turn on developer or custom connector support if your plan requires it, and add a new connector with the K2Mailer MCP server URL. Choose OAuth when asked how to authenticate.
- Cursor
- Add K2Mailer as a remote MCP server in Cursor’s MCP settings or in its mcp.json file using the server URL. Cursor opens a browser window for the OAuth sign-in the first time you use it.
- VS Code and GitHub Copilot
- Add the server with the MCP: Add Server command or an mcp.json entry that uses the HTTP server type and the K2Mailer URL, then authorize it when prompted.
- Other MCP clients
- Any client that supports remote MCP servers with OAuth can connect. Look for the option to add a remote or HTTP server and paste the same URL.
Menu names change between releases
AI clients rename and move their connector settings often. If a label differs from the names above, follow your client’s current MCP documentation and use the K2Mailer server URL.
Example configuration for JSON-based clients
Clients such as Cursor and VS Code accept remote servers in a small JSON file. Replace the placeholder with your K2Mailer MCP server URL. Do not add an API key; the client handles the OAuth sign-in for you.
{
"mcpServers": {
"k2mailer": {
"url": "YOUR_K2MAILER_MCP_SERVER_URL"
}
}
}Choose the right OAuth scopes
During sign-in you approve what the agent may do. Read access, draft and segment editing, and test-email sending are separate scopes, so you can give an agent exactly as much access as the task needs.
- Read-only
- Search and inspect campaigns, statistics, contacts, bounce evidence, and suppression status. Best for reporting and audits.
- Draft and segment editing
- Create, duplicate, and edit saved campaign drafts and define reusable segments. Best for content work.
- Test email
- Send a test email to addresses you name. Grant it only when you want the agent to send tests.
Start small and widen later
Approve read-only access first. You can reconnect with broader scopes once you trust the workflow.
What stays out of reach
The MCP integration does not expose immediate or manual sending outside the guarded scheduling tool, destructive operations, suppression-list changes, unsubscribe overrides, or direct contact mutations. Those boundaries are enforced by the server, not by agent behavior, so they hold even if an agent is instructed otherwise.
Scopes match the access you grant
Read-only access, draft and segment editing, and test-email sending are separate OAuth scopes. Approve only the scopes an agent actually needs.
Prompts to try after you connect
- Read-only: “Summarize my last five campaigns and tell me which one had the highest click rate.”
- Reporting: “Which of my recent campaigns had the most bounces, and what did the bounce evidence say?”
- Segments: “Build a segment of contacts who opened my last three campaigns but did not click, and preview how many people match.”
- Drafting: “Draft a short re-engagement email for that segment in a friendly tone with one clear call to action.”
- Quality check: “Run Content Analysis and Campaign Preflight on this draft and list anything I should fix before scheduling.”
- Scheduling: “Schedule this campaign for next Tuesday at 10:00 in my time zone, then confirm that preflight passed.”
A safe workflow from agent draft to scheduled send
- 1
Start with a read-only prompt so you can see what the agent can access.
- 2
Give the agent a clear brief: audience, goal, tone, required facts, links, and the call to action.
- 3
Let it create a draft and open the draft in the K2Mailer editor. Check every fact, link, merge tag, subject, and footer yourself.
- 4
Ask the agent to run Content Analysis and Campaign Preflight, then fix any blocker it reports.
- 5
Send a test email to yourself and review it on a real device.
- 6
Schedule for a future time. K2Mailer re-runs Campaign Preflight and stops on any blocker, so a failed check cannot slip through.
- 7
After the send, review results in campaign statistics and ask the agent for a summary.
AI output is a draft
You remain responsible for accuracy, compliance, and final approval. Read every campaign before it is scheduled, the same way you would review a draft from a colleague.
Troubleshooting
- The sign-in page does not open
- Check that your client supports OAuth for remote MCP servers, that pop-ups are allowed, and that you pasted the full server URL without extra spaces.
- The agent says it cannot see my data
- You may have approved read access for the wrong account or too few scopes. Disconnect, reconnect, and approve the scopes the task needs.
- Scheduling is refused
- The scheduling tool needs a future send time and a passing Campaign Preflight. Ask the agent to show the preflight result and fix any blocker. See Run Campaign Preflight before scheduling.
- The agent cannot unsubscribe or delete a contact
- This is intentional. Destructive actions, suppression changes, and unsubscribe overrides are not available to MCP clients. Make those changes in the K2Mailer dashboard.
- The connection stopped working
- Authorization may have been revoked or expired. Remove the connector in your AI client and add it again.
Revoke access
Remove the K2Mailer connector from your AI client when an agent no longer needs access, and revoke the authorization on the K2Mailer side as well. Access can be revoked at any time, and a revoked agent immediately loses the ability to read or change anything.
If you are not sure which connections are active, contact K2Mailer support and we will help you review them.
MCP, REST API, and in-app AI: which should you use?
- MCP server
- Best when you want an AI assistant to work in your account through conversation, with OAuth sign-in and guardrails that cannot be switched off.
- REST API
- Best for your own code and integrations. It uses scoped API keys and covers account, groups, lists, custom fields, contacts, and saved campaign content. See Use the K2Mailer REST API.
- In-app AI
- Best when you just want a draft inside the editor. See Create and edit campaigns with AI.
Frequently asked questions
- What is the K2Mailer MCP server?
- It is a remote Model Context Protocol server that lets AI agents such as Claude, ChatGPT, and Cursor work inside your K2Mailer account through an OAuth-protected connection, with guardrails the agent cannot switch off.
- How do I connect Claude, ChatGPT, or Cursor to K2Mailer?
- Add a remote MCP server in your AI client using the K2Mailer MCP server URL, sign in with your K2Mailer account when the OAuth page opens, and approve only the scopes you need. Then run a read-only test prompt to confirm it works.
- Does connecting an agent let it send campaigns immediately?
- No. Every scheduling action requires a future send time and a passing preflight check, and a human still initiated the connection and approved its scopes.
- Can an agent remove someone from a suppression list or force a resubscribe?
- No. Suppression, unsubscribe, and consent protections are not exposed to MCP clients.
- Do I need an API key?
- No. The MCP connection uses a standard OAuth 2.0 sign-in, so there is no static API key to copy into the agent. API keys are only used for the separate REST API.
- Which AI tools can connect?
- Any MCP client that supports OAuth-based remote servers, including current versions of Claude, ChatGPT, Cursor, and VS Code with GitHub Copilot.
- Is my contact data sent to an AI model?
- The agent can read data you authorize it to read, so approve only the scopes you need and review your AI provider’s data policy. K2Mailer’s own AI content analysis only sends the campaign subject and body to OpenAI, never contact names or email addresses.
- Can I limit what an agent can access?
- Yes. Read access, draft and segment editing, and test-email sending are separate OAuth scopes, and you can revoke the connection at any time.
Was this guide enough?
Contact support if your screen or result is different.