Secure file operations for WordPress via MCP.
Tested up to: 6.9 Stable tag: 1.0.6 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html
This add-on plugin exposes filesystem operations through MCP (Model Context Protocol). Your AI assistant can read plugin files, edit configuration, manage uploads - all through conversation. Security-hardened to prevent PHP injection and path traversal attacks.
Part of the MCP Expose Abilities ecosystem.
- WordPress 6.9+
- PHP 8.0+
- Abilities API plugin
- MCP Adapter plugin
- Install the required plugins (Abilities API, MCP Adapter)
- Download the latest release from Releases
- Upload via WordPress Admin → Plugins → Add New → Upload Plugin
- Activate the plugin
| Ability | Description |
|---|---|
filesystem/read-file |
Read file contents (text or binary) |
filesystem/write-file |
Write content to file (PHP blocked) |
filesystem/append-file |
Append content to existing file |
filesystem/delete-file |
Delete file (creates backup first) |
filesystem/delete-directory |
Delete directory (optional recursive delete) |
filesystem/copy-file |
Copy file to new location |
filesystem/move-file |
Move or rename file |
filesystem/list-directory |
List directory contents |
filesystem/create-directory |
Create new directory |
filesystem/file-info |
Get file metadata (size, dates, permissions) |
filesystem/get-changelog |
Get changelog from plugin/theme |
{
"ability_name": "filesystem/read-file",
"parameters": {
"path": "wp-content/plugins/my-plugin/config.json"
}
}{
"ability_name": "filesystem/write-file",
"parameters": {
"path": "wp-content/uploads/data/export.csv",
"content": "name,email\nJohn,john@example.com"
}
}{
"ability_name": "filesystem/list-directory",
"parameters": {
"path": "wp-content/uploads/2024/",
"recursive": false
}
}{
"ability_name": "filesystem/delete-file",
"parameters": {
"path": "wp-content/uploads/old-file.txt"
}
}Files are backed up to wp-content/mcp-backups/YYYY-MM-DD/ before deletion.
This plugin includes extensive security hardening:
- PHP Injection Detection - Blocks
<?php,<?=, and obfuscated PHP patterns - Encoding Bypass Protection - Detects UTF-7, UTF-16, and Base64 encoded PHP
- Path Traversal Protection - Blocks
../and absolute paths outside WordPress - Directory Restrictions - Limited to the WordPress root directory
- Automatic Backups - Files backed up before deletion
- 50+ Attack Vectors Tested - Comprehensive security testing
- Docs: expanded the WordPress-standard
readme.txtso the published ZIP now includes fuller requirements, abilities, use cases, and Devenia ecosystem links
- Added:
max_itemslimit for safer recursive directory listing - Added:
returnedandtruncatedoutput fields for list-directory
- Improve log append efficiency for filesystem operations
- Security: Restrict filesystem operations to the WordPress root directory
- Fixed: Use WP_Filesystem for backups and copy operations
- Fixed: Use WP_Filesystem API instead of native PHP functions
- Fixed: Proper sanitization of REMOTE_ADDR
GPL-2.0+
Devenia - We've been doing SEO and web development since 1993.