Appearance
Switch Tools On or Off from wp-config.php
The EASY_MCP_AI_TOOLS constant switches individual Easy MCP AI tools on or off from wp-config.php or an environment variable. A tool named there is locked on the admin screens, so nobody can change it from WordPress. With one extra entry, the same constant also keeps every tool a future plugin update adds switched off until you name it. This guide explains the format and when to use each form.
In this article
When to Use It
Use EASY_MCP_AI_TOOLS when the set of tools on a site must not depend on what is saved in the database:
- You manage many sites from one template or deployment pipeline and want the same tools on each.
- You want a privileged tool such as the search and replace tool switched on, but only from code. See Privileged Tools in Easy MCP AI.
- You want the tool list to stay exactly as you approved it, even after the plugin updates and adds new tools.
For a one-off change on a single site, find the tool under Easy MCP AI > Tools, enable or disable it, and click Save changes.
Name Tools On or Off
Add the constant to wp-config.php above the line /* That's all, stop editing! */:
php
define( 'EASY_MCP_AI_TOOLS', 'wp_delete_user=off,wp_privileged_files_read_query=on' );Or set an environment variable with the same name:
sh
EASY_MCP_AI_TOOLS="wp_delete_user=off,wp_privileged_files_read_query=on"The rules:
- Each entry is a tool name followed by
=onor=off. Separate entries with commas or new lines. - Names must match exactly. Wildcards are not supported, so
wp_delete_*=offswitches nothing off. - An entry that is neither
=onnor=off, such aswp_delete_userorwp_delete_user=yes, switches the tool off. A tool listed twice with different values is also off. A typo can therefore never leave a tool on by accident. - A name that matches no tool is ignored.
- The constant is read from
wp-config.phpfirst, then from the environment variable. It cannot be set from the database or by another plugin.
📝 Info: In wp-config.php you can also pass an array, such as array( 'wp_delete_user' => 'off', 'wp_privileged_files_read_query' => 'on' ), with 'on', 'off', true or false as values.
Keep New Tools Off After Updates
Without any extra entry, a tool that a later plugin update adds follows its own default, which is on for almost every tool. To keep your list complete instead, add *=off:
php
define( 'EASY_MCP_AI_TOOLS', 'wp_get_post=on,wp_list_posts=on,wp_update_post=on,*=off' );With *=off in the list:
- Every tool the list does not name is switched off, including plugin-integration tools, WordPress Ability tools and any tool a future update adds.
- No admin screen and no saved setting can switch an unnamed tool on.
- To allow a new tool after an update, add it to the list with
=on.
* always means "everything not named here is off". Writing *=on or * on its own has the same effect as *=off; it never switches every tool on.
⚠️ Warning: With *=off, any tool you forget to name stops working for every AI client. Review the list after each plugin update, and name every tool your clients rely on.
How It Works with the Admin Screens
EASY_MCP_AI_TOOLS decides first. For a tool it does not name, the usual settings apply in this order:
- Other applicable site-wide restrictions, including the legacy
EASY_MCP_AI_DISABLED_TOOLSdeployment constant. Ordinary saved tool choices are managed under Easy MCP AI > Tools, not in a Settings checkbox grid. - The tools an administrator switched on that are off by default, such as the privileged tools.
- The tool's own default.
On Easy MCP AI > Tools, a tool named in the constant shows its state and is locked, with a note naming the constant. With *=off every row is locked, and a tool the list does not name shows as off.
Separately, Easy MCP AI > Settings > Advanced > When plugins add tools controls whether newly discovered plugin tools are held for review before you enable them in Tools. This policy applies to new plugin tools; it does not replace or override a strict deployment list such as *=off.
The constant only decides whether a tool exists on the site. Each API token and OAuth connection still needs access to it; see Creating and Managing API Tokens and Managing OAuth Access.
EASY_MCP_AI_TOOLS is not included in the wp easy-mcp-ai config export command, and it does not appear in the Deployment-controlled settings list. For the other constants Easy MCP AI reads, see Configuring Easy MCP AI with wp-config.php Constants.
How AI Clients Find Switched-Off Tools
A switched-off tool is missing from the AI client's tool list, so on its own the client cannot tell a tool that is off from one that does not exist. Before it tells you a task cannot be done, it can call wp_list_disabled_tools. The tool lists what the site has switched off, including tools, plugin integrations, abilities and external data providers that are not connected, and says where each one is switched on.
For a tool you switched off in the admin, the answer names the admin screen. For a tool named in EASY_MCP_AI_TOOLS, it says only that the tool is off in the site's configuration and that only the site owner can switch it on, without naming the constant.
Every connection can call wp_list_disabled_tools, whatever tools it is allowed to use. It is read-only and switches nothing on. After you switch a tool on, start a new chat or reconnect so the AI client reads the tool list again.
Examples
Switch off one tool and switch on one privileged tool, leaving everything else as configured:
php
define( 'EASY_MCP_AI_TOOLS', 'wp_delete_user=off,wp_privileged_search_replace_run=on' );Allow only a fixed set of read tools, now and after every update:
php
define( 'EASY_MCP_AI_TOOLS', 'wp_get_post=on,wp_list_posts=on,wp_search=on,*=off' );Bring back one tool that EASY_MCP_AI_DISABLED_TOOLS switches off:
php
define( 'EASY_MCP_AI_TOOLS', 'wp_delete_post=on' );