NEW: The MainWP MCP Server lets AI assistants like Claude and Codex manage all your WordPress sites through your MainWP Dashboard.

Bring AI to Your WordPress Workflow with the MainWP MCP Server

Heads up: This page may include affiliate links. Read the full disclaimer.
AI Interprets intent. MainWP controls execution

Managing a fleet of WordPress sites involves a steady stream of questions and operational work: which sites need updates, which child sites are disconnected, what changed after a maintenance window, and where a remediation should begin.

MainWP MCP (Model Context Protocol) gives compatible AI clients a structured way to work with that information. You can ask in natural language while the server converts the selected action into a defined MainWP ability call.

The positioning is simple: AI interprets intent. MainWP controls execution.

The MainWP Dashboard Remains The Operational Authority

MainWP MCP sits between an AI client and the Abilities API on your MainWP Dashboard.

Each registered ability describes an operation, its accepted input, and relevant safety annotations. MainWP MCP discovers that catalog, converts the permitted abilities into MCP tools, and forwards validated tool calls to the Dashboard. The Dashboard applies WordPress permissions and its own business logic before running the handler.

This is not a fixed collection of generic WordPress REST wrappers. The available MCP tools come from the abilities registered on the Dashboard you connect.

Conversational Fleet Management

MCP-compatible clients such as Claude, Cursor, OpenAI Codex, and VS Code can launch MainWP MCP as a local stdio server. Once connected, the AI can reason over the exposed tool definitions and turn requests like these into structured calls:

  • “Which sites have pending plugin updates?”
  • “Sync everything tagged production and summarize the failures.”
  • “List the sites assigned to Acme Corp with their last sync time.”
  • “Show me the available updates before we plan the maintenance window.”

The AI handles interpretation and follow-up questions. MainWP MCP applies the configured boundary. The Dashboard performs the work and returns the result.

Start With a Narrow Tool Surface

You do not need to expose every available ability.

MAINWP_ALLOWED_TOOLS can create a focused allowlist for a reporting or maintenance workflow. MAINWP_BLOCKED_TOOLS can remove individual tools from discovery and execution. Namespace configuration limits which groups of Dashboard abilities are eligible to become MCP tools.

The policy is checked when tools are listed and again when a tool is called. This prevents an AI client from executing a tool that has since been removed from the permitted surface.

For a genuinely read-only configuration, allowlist only abilities you have verified as read-only. Safe Mode is narrower: it blocks destructive-classified operations, but non-destructive-classified writes such as updates, activations, and syncing may remain available.

Destructive Operations Fail Closed

MainWP MCP treats an ability as non-destructive only when its annotation explicitly says destructive: false. Missing or malformed annotations are treated as destructive.

When confirmation is required, a destructive ability must support a usable confirmation input. The first call uses confirm: true and returns a one-time token bound to the tool and its effective arguments.

If the underlying ability supports dry_run, the response includes its preview. If it does not, MainWP MCP says plainly that no preview is available and still requires the second confirmation call.

Execution requires the same effective arguments, user_confirmed: true, and the issued confirmation_token. The token expires after five minutes and cannot be reused.

The MCP server enforces the protocol. The AI client controls how it presents the request and obtains user approval, so untrusted clients should run with Safe Mode or a tool policy that removes destructive operations.

Privacy Has Two Separate Boundaries

MainWP MCP connects directly to the configured Dashboard; MainWP does not host a relay for those tool calls. The server uses the WordPress Application Password in the authenticated request without adding it to model-visible tool schemas or results.

The AI client can still send prompts, tool definitions, arguments, and results to its model provider. That provider’s retention and training policies are separate from MainWP MCP. Review them before exposing sensitive site or client information.

Create a dedicated WordPress user and a unique Application Password for each MCP integration or environment. This makes access easier to limit, audit, rotate, and revoke.

Bounded Requests and Structured Failures

MainWP MCP places deadlines and size limits around Dashboard traffic and the running session. Invalid input, policy denials, missing confirmation, timeouts, and oversized responses return structured failures instead of being presented as successful operations.

The running process keeps limited in-memory state for ability caching, confirmation tokens, and session accounting. It is not the system of record for your sites, and restarting it clears pending confirmation state.

Connect MainWP MCP

MainWP MCP is published on npm as @mainwp/mcp and requires Node.js 20.19 or later and MainWP Dashboard 6.0 or later.

A typical MCP client configuration looks like this:

mcp server coding

Learn how it works, what you can do and how to get started: Quick Start

Start with Safe Mode and a small allowlist. Verify the connection, inspect the tools your Dashboard exposes, and expand the permitted surface only when a workflow needs it.

MainWP Labs project, powered by MainWP

Leave the first comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share

Manage Unlimited WordPress Sites from One Dashboard!

  • Privacy-first, Open Source, Self-hosted
  • Easy Client Management
  • 15+ & 30 + Premium Add-ons
  • Bulk Plugins & Themes Management
Get Pro Now

Categories

Recent Posts

Search MainWP.com

[searchwp_form id="1"]