Cowboy MCP 1.6.5: a syntax check before every PHP write, and mu-plugins behind Power mode
Cowboy MCP 1.6.5 is a small release about one bad afternoon. A user asked their agent for a quick fix, the agent wrote a temporary must-use plugin, and the file that reached the disk was incomplete. WordPress loads everything in mu-plugins on every request, so the site went down, wp-admin went down, and so did the MCP endpoint that holds the undo journal that would have reversed it. The agent could not repair what it had broken, and the user fixed it by hand over SFTP. This release makes that sequence impossible from the file tool.
What this means for you
Two things now stand between an agent's payload and your server. First, every PHP file goes through PHP's own parser before a single byte is written; a cut-off or malformed file is refused with the line number, the agent sees exactly why, and nothing changes on disk. Second, the mu-plugins folder is off-limits unless an administrator has turned on Power mode in wp-admin. Regular plugins and themes are still fair game, because WordPress recovery mode can pause those when they fatal, and the undo journal can roll them back. Must-use plugins get neither safety net, which is why they now need a human's say-so. Neither guard adds noticeable latency: the syntax check takes about a millisecond per 80 KB of PHP.
We chose Power mode rather than a safe mode confirmation on purpose. A confirmation prompt is answered by the agent, not by you, so it would have changed nothing that day. And gating on safe mode would push people to switch safe mode off site-wide for one file, which loses far more than it protects. Power mode is the existing admin-only switch for exactly this kind of "I know what I am doing" job, and it leaves safe mode untouched.
What's new
- PHP syntax check on every write.
wp_write_filerefuses PHP content that does not parse and reports the error with its line number; the original file, if any, is untouched. CSS, JavaScript, and other files are not affected. mu-pluginsneeds Power mode. Writes anywhere underwp-content/mu-pluginsare refused unless Power mode is on. The refusal tells the agent to ship the code as a regular plugin and activate it withwp_activate_plugininstead, which is what it should have done in the first place.- Honest dry runs. A dry run of a file write now runs the same checks and says "would be refused" with the reason, rather than a generic preview.
- Short writes fail cleanly. If the disk is full or a quota hits mid-write, the tool reports a failure instead of renaming a truncated file into place.
- The agent is told up front. The connection instructions every MCP client receives now carry the rule, so a well-behaved agent never tries
mu-pluginson a site that has not opened it.
Try it
Ask your agent for something that used to be risky: "Add a small plugin that removes the WordPress version from the page head, activate it, and check the error log." The agent writes it under plugins/, the file is parsed before it lands, activation is fatal-safe, and the whole change sits in the undo journal.
Read the full 1.6.5 changelog on WordPress.org.