Skip to main content
The server accepts configuration through environment variables and a settings.json file. Environment variables take precedence, so you can keep a base file and override specific values at runtime.

Environment variables

* Required as a pair. This is the authentication method.
Authentication is MAINWP_USER + MAINWP_APP_PASSWORD. The Abilities API, which is the only API this server calls, authenticates through native WordPress and does not accept MainWP REST API bearer tokens. MAINWP_TOKEN is still read for compatibility and used when no Application Password credentials are present, but it will fail against the Abilities endpoints. Use an Application Password.

Configuration file

Create settings.json in one of these locations, checked in order:
  1. ./settings.json (the server’s working directory)
  2. ~/.config/mainwp-mcp/settings.json
Restrict permissions on any file holding credentials:
A JSON schema ships with the package as settings.schema.json for IDE autocompletion.

Field mapping

If both credential methods are present, the username plus Application Password pair takes precedence over apiToken.

Multiple Dashboards

Give each Dashboard its own folder containing its own settings.json, then point each MCP server entry at the right folder with cwd in your AI client’s configuration:
Because ./settings.json is checked first, each server instance picks up the credentials from its own working directory.

Behavior settings

  • safeMode blocks every destructive operation at the server. Explained on Safety & Permissions.
  • requireUserConfirmation controls the two-step preview/confirm flow for destructive operations (default on). Also on Safety & Permissions.
  • allowedTools / blockedTools filter the tool catalog. See Restrict Available Tools.
  • schemaVerbosity trades tool-description detail for context tokens. See Optimize Token Usage.
  • abilityNamespaces controls which plugins’ abilities are exposed. See Use Abilities from Other Plugins.
  • responseFormat switches tool response JSON between compact (default) and pretty.

Resource limits

These guard against runaway operations and oversized responses.

Retry logic

Transient errors (HTTP 5xx, HTTP 429, network resets) are retried with exponential backoff and jitter. Only read-only operations are retried, which preserves idempotency; writes fail immediately. Permanent errors (4xx other than 429, authentication failures) are never retried. Total time across retries never exceeds requestTimeout, and retries bypass the rate limiter to avoid deadlocks. Disable for automation or testing with retryEnabled: false.

SSL

The server verifies certificates and refuses plain HTTP by default. skipSslVerify and allowHttp exist for local development against self-signed or HTTP-only environments.
skipSslVerify disables certificate verification entirely and allowHttp sends credentials unencrypted. Use them only in isolated development environments, never in production or on untrusted networks.