Skip to main content
Glama

wp_cli

Execute WP-CLI commands on configured WordPress sites, targeting local Docker containers or production environments via Terminus or SSH, with destructive command protection.

Instructions

Run a WP-CLI command against a configured WordPress site's local Docker container (default) or its remote production environment. Configuration is read from /.serena/wp-cli.conf, which may define one or MANY sites. Pass the WP-CLI command WITHOUT a leading 'wp' (e.g. args='plugin list --status=active'). When the conf defines multiple sites, pass 'site' = the site's top-level folder name; omit it to use the configured DEFAULT_SITE or the sole site. The production TRANSPORT is chosen by the site's conf: TERMINUS_SITE routes over terminus remote:wp (run on the host, Pantheon/Terminus); otherwise REMOTE_SSH routes over WP-CLI --ssh. For Terminus sites the environment is TERMINUS_ENV (conf default) unless overridden per-call with the 'env' arg. On production, destructive commands (db reset/import, post/user delete, search-replace without --dry-run, plugin/theme delete, etc.) are blocked unless confirm=true and the guard is enabled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
envNoTerminus environment override (e.g. 'dev', 'test', 'live') for target='production' on a Terminus site. Omit to use the site's TERMINUS_ENV default. Ignored for SSH and local targets.
argsYesThe WP-CLI command and its flags, without the leading 'wp'. Example: 'option get blogname' or 'plugin list --status=active --format=json'.
siteNoWhich configured site to target — matches a [site:NAME] section in wp-cli.conf. Omit to use DEFAULT_SITE, or the sole site if only one is configured.
targetNoWhere to run. 'local' = Docker container (default). 'production' = remote environment; transport (Terminus vs WP-CLI --ssh) is chosen by the site's conf.local
confirmNoRequired to run a destructive command on production when the guard is enabled. Default: false.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. Discloses destructive command blocking, production transport selection, and env override behavior. Lacks details on error states but covers major behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single dense paragraph efficiently covers all necessary aspects. Could be formatted with bullet points for readability, but no superfluous information present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers key aspects: configuration, target selection, destructive command protection. No output schema so return values not required. Lacks mention of error handling or output format, but acceptable for a CLI tool that returns raw WP-CLI output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% but description adds significant context beyond schemas, such as how to format args (without 'wp'), how site selection works, that env is ignored for SSH/local, and the role of confirm in destructive commands.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it runs WP-CLI commands against a WordPress site's local Docker container or remote production environment. It distinguishes from sibling tools (wp_copy_post, wp_copy_post_meta) which have different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance on when to use (run WP-CLI commands), how to configure via wp-cli.conf, how to pass args without leading 'wp', and handling multiple sites. Does not explicitly mention alternatives, but siblings are fundamentally different.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EarthmanWeb/mcp-wp-cli-terminus'

If you have feedback or need assistance with the MCP directory API, please join our Discord server