MainWP — Claude Code MCP server: WordPress site management
Connect an AI client to MainWP to inspect a WordPress network, review updates, and manage sites. Destructive changes require approval by default.
claude mcp add mainwp-mcp -e MAINWP_URL=<MAINWP_URL> -e MAINWP_USER=<MAINWP_USER> -e MAINWP_APP_PASSWORD=<MAINWP_APP_PASSWORD> -- npx -y @mainwp/mcpWhat MainWP does
MainWP gives an MCP-compatible AI client access to a MainWP Dashboard. Use it to check site connectivity and pending updates, apply updates, manage plugins and themes, or review client records. The server runs on the same computer as your AI tool; nothing needs to be installed on the Dashboard or child sites.
Setup requires Node.js 20.19 or later, a MainWP Dashboard version 6.0 or later reachable over HTTPS, and a WordPress Application Password. In Claude Code, add the server with claude mcp add. Site, plugin, and theme deletions show a preview and wait for approval by default; safe mode blocks those actions outright. If you need unattended deletion, that default behavior matters.
What it helps with
- find sites with pending plugin updates
- check which child sites are disconnected
- apply overdue updates across a network
- prepare a report on a client's sites
- review site security across the network
Example prompts for the agent
- Show me the sites with pending plugin updates.
- Find child sites that are currently disconnected.
- Prepare an update plan for my MainWP network.
How to install MainWP
Platform CLI
claude mcp add mainwp-mcp -e MAINWP_URL=<MAINWP_URL> -e MAINWP_USER=<MAINWP_USER> -e MAINWP_APP_PASSWORD=<MAINWP_APP_PASSWORD> -- npx -y @mainwp/mcpReplace <…> with your own values
Platform CLI
codex mcp add mainwp --env MAINWP_URL=<MAINWP_URL> --env MAINWP_USER=<MAINWP_USER> --env MAINWP_APP_PASSWORD=<MAINWP_APP_PASSWORD> -- npx -y @mainwp/mcpReplace <…> with your own values
Config file
{
"mcpServers": {
"mainwp": {
"command": "npx",
"args": [
"-y",
"@mainwp/mcp"
],
"env": {
"MAINWP_URL": "<MAINWP_URL>",
"MAINWP_USER": "<MAINWP_USER>",
"MAINWP_APP_PASSWORD": "<MAINWP_APP_PASSWORD>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"mainwp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@mainwp/mcp"
],
"env": {
"MAINWP_URL": "<MAINWP_URL>",
"MAINWP_USER": "<MAINWP_USER>",
"MAINWP_APP_PASSWORD": "<MAINWP_APP_PASSWORD>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e MAINWP_URL=<MAINWP_URL> -e MAINWP_USER=<MAINWP_USER> -e MAINWP_APP_PASSWORD=<MAINWP_APP_PASSWORD> mainwp npx -y @mainwp/mcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about MainWP
How do I install MainWP in Claude Code?
Run `claude mcp add mainwp-mcp -e MAINWP_URL=<MAINWP_URL> -e MAINWP_USER=<MAINWP_USER> -e MAINWP_APP_PASSWORD=<MAINWP_APP_PASSWORD> -- npx -y @mainwp/mcp`. Replace the placeholders with your Dashboard address, username, and Application Password.
What does the MainWP MCP server do?
It lets an AI client manage WordPress sites through MainWP, including checking connectivity and updates, handling plugins and themes, and working with client records.
What does MainWP MCP require?
You need Node.js 20.19 or later, a MainWP Dashboard version 6.0 or later accessible over HTTPS, and a WordPress Application Password. Some tools need a newer Dashboard version.