Remote MCP is available at
https://migma.ai/mcp over Streamable HTTP. Add this URL. Your client opens Migma so you can sign in, approve access, and complete credential exchange through OAuth.Where this lives in Migma
Open My Brands, choose a brand, then open Tools. The app/mcp route redirects to the active brand’s Tools page.
OAuth and CLI keys appear in Settings → Developers → API Keys, where you can revoke them.
Choose connection type
Remote MCP
Tool profiles
https://migma.ai/mcp provides the OpenAI profile: email and brand workflows,
contacts, sending-domain setup, existing domain history, and account credit reads.
It excludes domain shopping and subscription checkout.
For domain shopping or subscription management in a general MCP client, connect
with https://migma.ai/mcp?profile=general. Local MCP also provides these tools.
Both hosted profiles use the same OAuth flow and permission checks. Refresh your
client’s tool list after changing its URL.
Recommended: OAuth connector setup
Use this path for clients that support OAuth connection, such as claude.ai custom connectors.- Add Migma as a custom connector with
https://migma.ai/mcp. - Follow the client sign-in flow. It opens Migma so you can review and approve access.
- On
migma.ai/connect/authorize, check the app name, return host, and requested scopes.email:sendpermits test/direct sends.campaign:writepermits campaign creation, send, and schedule. Migma marks both as delivery access. - Approve the connection. Migma gives the client a scoped API key automatically, so there is no key to copy or paste.
Claim-code fallback
If a direct client cannot complete an OAuth redirect/callback, fetchhttps://api.migma.ai/auth.md. The agent shows a claim link, you review and approve scopes in Migma, and the agent polls for its credential.
Use claim-code only when the direct client can keep claim_token and the returned credential out of chat, logs, shell history, and shared files. It does not repair a hosted connector whose OAuth callback failed.
Do not send an interactive user to Settings to copy a key.
CI and server automation
Manual bearer configuration remains available for CI, cron, or server automation:Local MCP
Local MCP is available withnpx -y @migma/mcp. Use it only when the client requires a command-based server. Run migma login first (the package reads ~/.migma/config.json), or set MIGMA_API_KEY for CI.
MIGMA_PROJECT_ID only for Local MCP when one brand is the default. Remote MCP clients should call migma_list_projects and pass projectId.
Remote MCP clients discover brands with migma_list_projects, then pass projectId.
For Claude CLI, add the local server with:
Client setup
Cursor
Add Migma MCP to Cursor.
Claude
Connect Claude.ai, Claude Code, or Claude Desktop. Visual setup: Claude tutorial.
ChatGPT
Use the public Migma plugin. Visual setup: ChatGPT tutorial.
Grok
Ask Grok Bot to add Migma Remote MCP, or connect Grok web and Grok Build directly.
Copilot
Connect GitHub Copilot to Migma MCP.
Codex CLI
Add Migma MCP to Codex CLI.
Windsurf
Connect Migma MCP to Windsurf.
Antigravity
Add Migma MCP to Google Antigravity.
Raycast
Use Migma MCP from Raycast AI.
VS Code
Connect Migma MCP to VS Code.
Verify the connection
Ask your client to show your Migma context.migma_get_context returns your workspaces, brands, plan and credits, sending domains, and suggested next actions in one call — pass a workspace id as organizationId to migma_list_projects to work in another workspace.
Agents can still use migma_get_capabilities on their own when they need the tool catalog, write/read rules, or guided workflows.
Common workflows
Design emails (show drafts first)
- Reuse the working brand and supplied brief or reference. List brands and choose
projectIdonly when needed; ask only for missing required details. Audience and sending-domain setup are not needed for drafts. - For researched work, build an exact source-backed fact checklist. Pass required facts in the prompt and up to five public HTTPS source-image URLs through structured
images; prompt-only URLs are not image inputs. - Create or design with one
migma_generate_emailcall (load that tool by exact name). For several emails passcount(max 12) and name each email’s job in the prompt. Do not call generate once per email. Then pollmigma_get_generation_status. Existing HTML or.emlusesmigma_import_htmlinstead of generate. - Show returned preview images and each canvas link immediately.
- After first show, verify every required fact and source image before claiming success. If a preview cannot be attached, show its canvas link and say visual verification is incomplete.
- After the first preview, handle requested edits, inbox checks, or campaign setup. Do not run validate or edit tools before that first show. Text-only edit cannot add structured source images; that requires replacement generation.
- Run
migma_validate_*when the user asks for checks, or as a last step before send.
Edit an email
migma_edit_email starts a queued edit and returns its IDs and status promptly. It keeps the existing emailId, prompt, label, and includeHtml arguments, and adds optional idempotency_key. The tool requires both email:write and email:read. includeHtml on the start call reminds the agent to request HTML on the subsequent status call; it does not make the start call wait.
These queued-edit tools require an MCP build that includes them. If they are missing after refreshing the client’s tool list, use the REST API:
POST /v1/emails/{emailId}/edit with async: true and a stable Idempotency-Key, then poll GET /v1/emails/{emailId}/edits/{editId}.- Call
migma_edit_emailonce with the targetemailIdand prompt. Keep the sameidempotency_keyif the start result is uncertain. - Poll the read-only
migma_get_email_edit_statustool withemailId,editId, and optionalincludeHtml. - Use that tool’s exact job status. Do not use conversation generation status to decide that the edit finished; a previous conversation turn may already be completed.
- Never resubmit an edit while it is pending or processing. On failure, inspect the stored email before starting another edit because changes may have been saved.
- When the status is completed, show the returned preview.
Convert existing HTML
- List brands and choose
projectId. - Call
migma_import_htmlonce with the HTML or.emlsource (orhtmlsfor several files). Optional instruction: keep it as-is, or apply the brand. - Poll
migma_get_generation_status, then show preview images and each canvas link. - Each result is one canvas slot with its own
emailId. Edit, send, and export use that id.
Save brand facts
- Call
migma_add_knowledge_basewhen the user shares lasting facts (tone, products, offers, policies). Do not list first.
Favorite an email for future designs
When the user says “I like this design,” “favorite this email,” or “save this style,” callmigma_save_reference with the exact email they chose:
migma_list_emails for the working brand. For a series, choose one slot’s emailId, not conversationId. Ask which email only when unclear. No HTML fetch, re-import, or duplicate knowledge-base entry is needed.
The tool requires project:write and sets the favorite to true. Retrying that same emailId is safe. Confirm only after the response contains favorite: true. Future generation for the same brand uses saved references by default unless disabled, and later saved edits to the favorite update the reference. A favorite is design guidance; current facts and send approval remain separate.
For an external email, the same tool accepts projectId + title + html, with an optional screenshotUrl. This creates a reference entry, so it does not share the favorite mode’s safe-repeat behavior. A screenshot alone cannot be saved through this tool. Check migma_get_capabilities if the tool is missing; it may require project:write access or refreshing the client’s cached tools.
Import a CSV audience
- Call
migma_create_contact_importonce with the full CSV text and an optional list tag. - Leave column mapping empty when headers look like email, first name, or last name.
- Prefer this over converting CSV rows into a JSON bulk import.
- The import can wait and return final counts in the same turn.
Import from Klaviyo, Mailchimp, or HubSpot
- Call
migma_list_provider_import_sourceswith the brand and provider to list audiences, lists, segments, and tags. - Call
migma_import_contacts_from_providerwith one to 25 sources and an optionalconsentMode(subscribed-onlyby default). - The tool can wait up to 45 seconds, then poll
migma_get_contact_importfor final counts, tag and segment IDs, andnon_sendablecontacts.
Export unsubscribers and reconcile a connected store
These workflows require a server release with the tools below. If tools are missing, refresh the client’s catalog and check granted scopes. Connected-store tools are available in the general profile (?profile=general).
- Choose the brand, then call
migma_create_contact_exportwithfilters: {status: "unsubscribed"}and a stableidempotency_key. Optional saved segment and grouped filters narrow the audience. This requiresaudience:read. - Poll
migma_get_contact_exportwith the returnedjobIdandprojectId. Onlycompletedincludes a private CSV download URL and actual exported count. Queued work is not a finished export; failure is not an empty audience. - The URL expires in one hour. Poll the same job for a fresh URL while it is retained, up to seven days. Retrying creation with the same key and body finds the same job.
- To inspect a connected store or CRM, use
migma_list_connected_tools, thenmigma_get_connected_toolfor the exact argument schema. Discovery requiresemail:read; execution requiresproject:write. - Obtain approval for the concrete external changes before
migma_call_connected_tool. Existing enabled-tool grants and approval settings remain enforced. A tool requiring interactive dashboard approval remains blocked here; review its permissions in the brand’s MCP Servers settings.
Out of credits
- On an out-of-credits error, call
migma_get_creditsand explain the limit briefly. Existing drafts and tasks that use no credits can continue. - In the general profile or local MCP, use
migma_get_upgrade_linkwhen the user asks to manage billing or accepts a relevant billing offer. New subscribers choose a plan before receiving a checkout link. Existing subscribers omitplanto review changes in the billing portal. - Passing
planfor an existing subscription can change it and charge a prorated payment immediately. Obtain explicit approval for that charge first. - Show the returned URL once and check updated credits before resuming blocked work. A link alone does not confirm payment. This tool is absent from the OpenAI profile.
Buy a domain
Use the general hosted profile or local MCP for domain shopping.- Search availability and yearly prices with
migma_search_buyable_domains. - Call
migma_buy_domainand show the returned checkout URL. The user pays in the browser. A free account can hold one purchased domain; account eligibility and current annual pricing are checked before checkout. The domain purchase renews annually. - Poll
migma_get_domain_purchasesuntil the domain is active. - Set it up for sending with
migma_setup_domain. When DNS is still required,migma_setup_domainandmigma_verify_domainreturn aconnectUrlthat opens one-click DNS setup in Migma.
Send or schedule
You approve every send in Migma. When the agent callsmigma_send_email, migma_send_campaign, or migma_schedule_campaign, Migma prepares the send and the agent shows you a summary: audience, recipient count, sender, subject, and timing, with a link to migma.ai.
- Open the link and sign in. You see the email and the same details.
- Click Send or Schedule, or Decline. Edit in Migma opens the campaign or email if you want to change it first.
migma_get_send_approval.
migma_send_email sends marketing email, so unsubscribed contacts are skipped and the email carries an unsubscribe link. transactional: true is only for a single recipient’s transactional message, such as a receipt, and needs a verified transactional sending identity (notify.<your domain>, set up with migma_provision_stream). Tag and segment sends are always marketing.
Other
- Open the email in Migma from the returned canvas link
- Fetch exact
emailIdvalues - Send a test email
- Create a campaign draft
- Export approved email to HTML, PNG, PDF, Klaviyo, Mailchimp, or HubSpot
- Read campaign metrics and logs
- Manage contacts, lists, segments, and sending domains
- Check the plan and remaining credits (
migma_get_credits); subscription management (migma_get_upgrade_link) is available in the general profile or local MCP - Track existing domains (
migma_get_domain_purchases); domain search and checkout (migma_search_buyable_domains,migma_buy_domain) are available in the general profile or local MCP, with payment in the user’s browser - Manage DNS records on domains bought in Migma (
migma_list_dns_records,migma_add_dns_record,migma_remove_dns_record): add A, AAAA, CNAME, MX, TXT, or NS records like Google Workspace MX or a site-verification TXT, and remove user-added records. Migma’s email sending records are protected, and the root and www names are reserved for domain forwarding
Security
IT and security reviewers: Review Migma MCP covers what the hosted server can do, how OAuth works, permissions includingemail:send, and how to revoke access.
- Prefer OAuth connection for clients that support it.
- Use scoped API keys.
- Review scopes before approval.
email:sendallows test/direct sends.campaign:writeallows campaign creation, send, and schedule. Only allow either when you trust the connector to deliver mail. - Revoke OAuth-created and manually created keys from Settings → Developers → API Keys.
- Keep human approval enabled before sends, exports, audience changes, and campaign changes.
- Send API keys through the documented authorization header.
- Treat MCP like direct API access. Tool calls use the same Migma permissions as SDK, CLI, and REST API requests.
Troubleshooting
Resources
MCP for IT admins
What the hosted server can do, permissions, and how to revoke access.
npm Package
Local MCP package.
Agent Registration
Let agents request scoped access.








