Connect an AI assistant over MCP

MailPoet for Gravity Forms can expose its MailPoet abilities to an AI assistant through MCP (the Model Context Protocol). Once connected, an assistant like Claude can manage your subscribers, work with your newsletters, and build newsletter drafts from your form entries, using the same abilities the plugin uses itself, behind the same access check.

The plugin never calls an AI on its own. The assistant only acts when you ask, and the actions that matter most are deliberate: a newsletter send defaults to a preview to a test address, and a person still reviews and sends a real newsletter in MailPoet.

Before you start

You need:

  • WordPress 6.9 or newer, which includes the Abilities API in core.
  • MailPoet, Gravity Forms, and MailPoet for Gravity Forms active on the same site.
  • A WordPress user who can manage the site (the abilities require the same capability you use to generate a digest).
  • An Application Password for that user (created below).
  • Node.js 18+ on the computer running the assistant. The setup uses a small helper that talks to your site.

Your site's MCP address

The plugin serves one MCP endpoint. Find your exact address in WordPress under Gravity Forms → Settings → MailPoet, shown as the Endpoint URL:

https://YOUR-SITE.com/wp-json/gf-mailpoet/v1/mcp   

You will paste this address into your assistant's settings.

The same settings page controls which MCP tools the endpoint offers, in three groups:

  • read (browse forms, lists, newsletters, and digest configuration)
  • write (create and edit drafts, manage subscribers)
  • send (send and schedule newsletters).

All three are on by default; turn a group off to keep those tools away from every connected assistant. Turning every group off takes the endpoint offline.

Step 1: Create an Application Password

The assistant signs in to your site with an Application Password. This is separate from your normal login password and can be revoked at any time without changing your account.

  1. In WordPress, go to Users → Profile (or Users → All Users and edit your user).
  2. Scroll to Application Passwords.
  3. Type a name you'll recognize, such as MCP – Claude   , and choose Add New Application Password.
  4. Copy the password that appears. WordPress shows it once. It looks like xxxx xxxx xxxx xxxx xxxx xxxx    (the spaces are part of it).

Keep this password somewhere safe. Treat it like a key to your site: anyone who has it can act as that user through the API.

Step 2: Connect your assistant

Pick the client you use.

Claude Desktop

  1. Open the config file:
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json   
  • Windows: %APPDATA%\Claude\claude_desktop_config.json   
  1. Add an entry under mcpServers    (keep any servers you already have):
{
  "mcpServers": {
    "gf-mailpoet": {
      "command": "npx",
      "args": ["-y", "@automattic/mcp-wordpress-remote@latest"],
      "env": {
        "WP_API_URL": "https://YOUR-SITE.com/wp-json/gf-mailpoet/v1/mcp",
        "WP_API_USERNAME": "your-username",
        "WP_API_PASSWORD": "xxxx xxxx xxxx xxxx xxxx xxxx"
      }
    }
  }
}
  1. Fill in your address, your WordPress username, and the Application Password from Step 1.
  2. Save the file and restart Claude Desktop.

Claude Code (command line)

Run this from a terminal, filling in your own values:

claude mcp add gf-mailpoet \
-e "WP_API_URL=https://YOUR-SITE.com/wp-json/gf-mailpoet/v1/mcp" \
-e "WP_API_USERNAME=your-username" \
-e "WP_API_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx" \
-- npx -y @automattic/mcp-wordpress-remote@latest

Add -s user    before --    if you want it available in every project rather than just the current one. Restart Claude Code so it picks up the new server.

Other MCP clients

Any client that can launch a stdio MCP server works. Point it at the same helper and pass the same three settings:

  • Command: npx -y @automattic/mcp-wordpress-remote@latest   
  • Environment: WP_API_URL   , WP_API_USERNAME   , WP_API_PASSWORD   

What you can do once connected

The assistant gains the plugin's full set of MailPoet tools, in three groups:

  • Subscribers: subscribe and unsubscribe, check who's subscribed to what, update a subscriber, delete one, and list your MailPoet lists.
  • Newsletters: list your newsletters (with open/click stats), send a preview to a test address, send to your lists, and schedule or unschedule a send.
  • Digest: read the entries a digest would include, write a summary for each, and generate a draft from a form's entries.

A typical ask: "List this week's entries for the community form, write a one-line summary for each, and generate a draft." Or: "Is jane@example.com subscribed? If not, add her to the Newsletter list."

Local or self-hosted sites with a self-signed certificate

If you are testing against a local site (for example a .test    domain) whose certificate isn't trusted, add one more environment setting so the helper can connect:

NODE_TLS_REJECT_UNAUTHORIZED=0   

Only use this for local development. Never set it for a live site, because it turns off certificate checking.

Verify it works

After restarting your client, ask it to list the available tools or list your digest configs. If it returns your feeds, you're connected.

Troubleshooting

  • "No route was found" / a 404 error. The address is wrong, or the plugin isn't active. Confirm all three plugins are active and that WP_API_URL    ends in /wp-json/gf-mailpoet/v1/mcp   . The older /wp-json/mcp/...    address is a different, built-in server and won't carry these abilities.
  • A 401 or 403 (unauthorized) error. Check the username and Application Password. Retype the password including its spaces, and make sure the user can manage the site.
  • The client connects but shows no tools. Restart the client after editing its config. New MCP servers are only picked up on start. Also confirm Node.js is installed and on your PATH.
  • Some tools are missing, or fewer than expected. Check which tool groups are enabled under Gravity Forms → Settings → MailPoet. A disabled group's tools are not offered at all. After enabling a group, reconnect or restart your client: assistants cache the tool list per connection.
  • The tools appear but return nothing. The signed-in user may lack the capability the abilities require. Use an account that can generate a digest.

Removing access

When you no longer need the connection, revoke the Application Password in Users → Profile → Application Passwords. That immediately cuts off the assistant without affecting your login.