Using AI with OptiPub

Using AI with OptiPub

The OptiPub Model Context Protocol (MCP) servers enable AI-powered code editors like Cursor and Windsurf, plus general-purpose tools like Claude Desktop and ChatGPT, to interact directly with the OptiPub platform.

What is MCP?

Model Context Protocol (MCP) is an open standard that allows AI applications to securely access external data sources and tools. The following MCP servers are available:

ServerURLAuthPurpose
Documentationhttps://docs.optipub.com/mcpNoneSearch API reference and documentation
Platformhttps://mcp.optipub-mcp.com/mcp?app={domain}OAuth or Bearer TokenManage your OptiPub instance
Postmaster+https://postmasterplus.app/mcp/postmasterOAuth or Bearer TokenQuery your Postmaster+ data

Documentation MCP

The Documentation MCP gives your AI assistant access to the full OptiPub API reference and documentation. No authentication is required.

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "optipub-docs": {
      "url": "https://docs.optipub.com/mcp"
    }
  }
}

What you can do

  • Search the full OptiPub API reference
  • Look up endpoint details, parameters, and schemas
  • Get code examples for any API operation
  • Ask questions about OptiPub features and capabilities

Platform MCP

The Platform MCP gives your AI assistant direct access to manage your OptiPub instance — over 250 tools covering subscribers, segments, messages, pages, funnels, and more.

Prerequisites

  • An OptiPub application (e.g. yourapp.app.optipub.com)
  • An OptiPub API key (generated from your app's admin panel)

Authentication

The Platform MCP supports two authentication methods:

OAuth (preferred) — Clients like ChatGPT, Lovable, and Claude.ai connect via OAuth automatically. You'll be prompted to enter your API key through a secure authorization form. Tokens refresh automatically so you only authenticate once.

Bearer Token (fallback) — For clients that support custom headers (Cursor, Windsurf, Claude Code), you can pass your API key directly as a Bearer token. This is simpler to configure but requires you to manage the key in your config file.

Replace {your-app-domain} with your app's domain and YOUR_API_KEY with your API key in the examples below.

In ChatGPT settings, add the MCP server URL:

https://mcp.optipub-mcp.com/mcp?app=yourapp.app.optipub.com

ChatGPT will handle OAuth automatically — you'll be prompted to enter your API key through a secure form.

Available tools

CategoryToolsExamples
Core~80Subscribers, tags, groups, domains, templates, webhooks, users
Billing6Pricing plans, Discord roles, discounts
Contents~55Pages, authors, FAQs, forms, videos, resources
Marketing~50Ads, funnels, landing pages, partners, testimonials
Messaging~60Messages, segments, senders, auto responders, transactionals

Tool parameters

All tools accept the following parameter patterns:

  • Path parameters (e.g. id, segment, email) — required, used to build the API URL
  • params — optional object of query parameters for filtering and pagination
  • body — optional object (POST/PUT only) containing the request body

For detailed parameter schemas, refer to the OptiPub API documentation.

Postmaster+ MCP

The Postmaster+ MCP connects your AI assistant to your Postmaster+ account so it can query deliverability data, mailbox provider metrics, and other insights from the teams you have access to.

Prerequisites

  • A Postmaster+ account

Authentication

Postmaster+ MCP supports two authentication methods:

OAuth (preferred) — Clients like ChatGPT and Claude connect through browser-based OAuth. Sign in to your Postmaster+ account once and approve access. Refresh tokens are handled automatically.

Bearer Token (fallback) — For clients that support custom headers (Cursor, Windsurf, Claude Code), create an MCP API key from your MCP Access settings and pass it as a Bearer token.

MCP access uses your current user permissions and can read data from the teams you can already access.

In ChatGPT settings, add the MCP server URL:

https://postmasterplus.app/mcp/postmaster

ChatGPT will handle OAuth automatically — you'll be prompted to sign in to your Postmaster+ account.

Using multiple servers together

For the best experience, connect all the MCP servers relevant to your workflow. Your AI assistant can then reference the API documentation while simultaneously managing your OptiPub instance and querying Postmaster+ deliverability data — all in a single conversation.

Testing your setup

Once configured, restart your AI editor and try:

  • Documentation MCP: "What endpoints are available for managing subscribers?"
  • Platform MCP: "How many publications do I have?" or "List my segments"
  • Postmaster+ MCP: "How is my deliverability looking this week?" or "Show me Google Postmaster data for my domain"
  • All together: "Look up how to create a landing page, then create one called 'Spring Promo'"

Security

  • OAuth 2.1 with PKCE — Industry-standard authentication with 1-hour access tokens and 90-day refresh tokens
  • Domain validation — Only valid OptiPub domains are accepted (*.app.optipub.com and a small set of verified exceptions)
  • No open proxy — Requests to unrecognized domains are rejected
  • Encrypted credential storage — API keys are encrypted at rest using AES-256-GCM