Skip to main content
Migma MCP lets agents work with your Migma brands from an editor or agent client. Agents can prepare emails, fetch email IDs, validate output, create campaign drafts, send tests, export approved emails, manage contacts, and inspect results. For Grok Bot desktop, follow the Grok Bot connection guide to connect Migma, approve access in your browser, and verify your brand with a read-only request.
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

Use this path for clients that support OAuth connection, such as claude.ai custom connectors.
  1. Add Migma as a custom connector with https://migma.ai/mcp.
  2. Follow the client sign-in flow. It opens Migma so you can review and approve access.
  3. On migma.ai/connect/authorize, check the app name, return host, and requested scopes. email:send permits test/direct sends. campaign:write permits campaign creation, send, and schedule. Migma marks both as delivery access.
  4. Approve the connection. Migma gives the client a scoped API key automatically, so there is no key to copy or paste.
OAuth-created keys appear in Settings → Developers → API Keys and can be revoked there.

Claim-code fallback

If a direct client cannot complete an OAuth redirect/callback, fetch https://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:
Do not put API keys in URLs. Send them through the documented authorization header.

Local MCP

Local MCP is available with npx -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.
Optional environment variable:
Use 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)

  1. List brands and choose projectId.
  2. 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.
  3. Create or design with one migma_generate_email call (load that tool by exact name). For several emails pass count (max 12) and name each email’s job in the prompt. Do not call generate once per email. Then poll migma_get_generation_status. Existing HTML or .eml uses migma_import_html instead of generate.
  4. Show returned preview images and each canvas link immediately.
  5. 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.
  6. Only then offer edits, inbox checks, or a campaign. Do not run validate or edit tools before that first show. Text-only edit cannot add structured source images; that requires replacement generation.
  7. Run migma_validate_* when the user asks for checks, or as a last step before send.

Convert existing HTML

  1. List brands and choose projectId.
  2. Call migma_import_html once with the HTML or .eml source (or htmls for several files). Optional instruction: keep it as-is, or apply the brand.
  3. Poll migma_get_generation_status, then show preview images and each canvas link.
  4. Each result is one canvas slot with its own emailId. Edit, send, and export use that id.

Save brand facts

  • Call migma_add_knowledge_base when the user shares lasting facts (tone, products, offers, policies). Do not list first.

Import a CSV audience

  • Call migma_create_contact_import once 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.

Out of credits

  • On an out-of-credits error, call migma_get_credits to show the plan and remaining credits.
  • Call migma_get_upgrade_link and show the returned URL. The user opens it and pays in the browser. The tool call itself charges nothing.

Buy a domain

  1. Search availability and yearly prices with migma_search_buyable_domains.
  2. Call migma_buy_domain and show the returned checkout URL. The user pays in the browser. Buying needs a paid Migma plan, so offer an upgrade link if the account does not have one.
  3. Poll migma_get_domain_purchases until the domain is active.
  4. Set it up for sending with migma_setup_domain.

Other

  • Open the email in Migma from the returned canvas link
  • Fetch exact emailId values
  • Send a test email (ask before any live send)
  • 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, and get an upgrade link (migma_get_credits, migma_get_upgrade_link)
  • Search, buy, and track domains (migma_search_buyable_domains, migma_buy_domain, migma_get_domain_purchases); payment happens 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 including email:send, and how to revoke access.
  • Prefer OAuth connection for clients that support it.
  • Use scoped API keys.
  • Review scopes before approval. email:send allows test/direct sends. campaign:write allows 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.
Last modified on September 7, 2026