A lightweight WordPress plugin that configures a custom Model Context Protocol (MCP) server using the WordPress MCP Adapter and Abilities API. This plugin acts as a configuration wrapper that creates an MCP server exposing abilities defined in the WP Abilities API Demo plugin.
This plugin serves as a thin configuration layer that:
- Initializes the WordPress MCP Adapter
- Creates a custom MCP server named "MCP Demo Server"
- Exposes specific abilities from the WP Abilities API Demo plugin as MCP tools
- Demonstrates how to configure a custom MCP server in WordPress
This plugin does not define any abilities itself. Instead, it:
- Checks for required plugins - Verifies that MCP Adapter and WP Abilities API Demo plugins are active
- Initializes MCP Adapter - Activates the MCP Adapter framework
- Creates a custom MCP server - Configures a server named "MCP Demo Server"
- Maps abilities to the server - Links abilities from WP Abilities API Demo plugin to the MCP server
The following abilities from the WP Abilities API Demo plugin are exposed through this MCP server:
- Site Info (site/site-info) - Retrieve comprehensive WordPress site information
- Debug Log Management (debug/read-log,debug/clear-log) - Read and clear WordPress debug logs
- Plugin List (plugins/get-plugins) - Retrieve a list of installed WordPress plugins
- Create Post (post/create-post) - Create new WordPress blog posts
- Security Check (security/check-security) - Perform security analysis on WordPress plugins
Note: The actual implementation of these abilities is in the WP Abilities API Demo plugin, not in this repository.
- Server Configuration: Lightweight wrapper that configures an MCP server
- Abilities Source: All abilities are defined in the WP Abilities API Demo plugin
- Transport: REST API-based HTTP communication (MCP 2025-06-18 compliant)
- Error Handling: WordPress error logging integration
- Observability: Null handler for minimal overhead
- WordPress 5.0 or higher
- PHP 7.4 or higher
- Required WordPress Plugins:
- MCP Adapter - Core MCP functionality
- WP Abilities API Demo - Provides the actual abilities
 
- Install Required Plugins
First, install and activate the required plugins:
# Clone and activate MCP Adapter
cd wp-content/plugins/
git clone https://github.com/WordPress/mcp-adapter.git
wp plugin activate mcp-adapter
# Clone and activate WP Abilities API Demo
git clone https://github.com/jonathanbossenger/wp-abilities-api-demo.git
cd wp-abilities-api-demo
composer install
wp plugin activate wp-abilities-api-demo- Install This Plugin
Clone this repository and activate it:
cd wp-content/plugins/
git clone https://github.com/jonathanbossenger/wp-mcp-server-demo.git
wp plugin activate wp-mcp-server-demoNote: This plugin does not require composer install as it has no Composer dependencies of its own. It only requires WPCS for development.
Once activated, the plugin exposes MCP endpoints at:
/wp-json/mcp-demo-server/mcp/
The following tools are available through the MCP server. For detailed parameter information and implementation details, refer to the WP Abilities API Demo repository.
Retrieves comprehensive information about the WordPress site.
Permissions: Requires manage_options capability
Read Log (debug/read-log) - Reads WordPress debug log entries
Clear Log (debug/clear-log) - Clears the WordPress debug log
Permissions: Requires manage_options capability
Retrieves a list of all installed WordPress plugins with metadata.
Permissions: Requires manage_options capability
Creates new WordPress blog posts with specified content.
Permissions: Requires publish_posts capability
Performs security analysis on WordPress plugins.
Permissions: Requires manage_options capability
Note: The Plugin Check plugin must be installed and active for this tool to work.
wp-mcp-server-demo/
├── wp-mcp-server-demo.php           # Main plugin file - MCP server configuration
├── composer.json                     # Development dependencies (WPCS)
├── .github/
│   └── copilot-instructions.md      # AI assistant instructions
└── README.md                        # This file
Note: This plugin does not contain an includes/ directory. All abilities are defined in the WP Abilities API Demo plugin.
This plugin is a configuration wrapper that:
- Checks if the MCP Adapter plugin is active and initializes it
- Checks if the WP Abilities API Demo plugin is active
- Creates a custom MCP server called "MCP Demo Server"
- Maps the following abilities from WP Abilities API Demo to the MCP server:
- site/site-info
- debug/read-log
- debug/clear-log
- plugins/get-plugins
- post/create-post
- security/check-security
 
This plugin demonstrates how to create a custom MCP server in WordPress. To create your own server:
- Hook into the mcp_adapter_initaction
- Call $adapter->create_server()with your configuration
- Specify which abilities to expose from available registered abilities
See wp-mcp-server-demo.php for the implementation example.
All abilities implement permission-based access control. Security features are implemented in the WP Abilities API Demo plugin:
- Post creation requires publish_postscapability
- Administrative functions require manage_optionscapability
- Input sanitization and validation on all endpoints
- Proper WordPress capability checks
This is an experimental plugin. To test:
- Ensure all required plugins are installed and activated
- Use tools like Postman or curl to test the MCP API endpoints
- Verify the server responds at /wp-json/mcp-demo-server/mcp/
- Test with proper WordPress authentication (application passwords recommended)
Example curl request:
curl -X POST https://your-site.com/wp-json/mcp-demo-server/mcp/ \
  -H "Content-Type: application/json" \
  -u username:application_password \
  -d '{"method":"tools/list"}'This plugin is licensed under the GPL-2.0-or-later license, same as WordPress.
Jonathan Bossenger
Email: [email protected]
- MCP Adapter - Core MCP functionality for WordPress
- WP Abilities API Demo - Provides the abilities exposed by this MCP server
- wp-coding-standards/wpcs: ^3.0- WordPress Coding Standards for PHPCS
- WordPress MCP Adapter - Core MCP functionality for WordPress
- WordPress Abilities API - Framework for defining abilities
- WP Abilities API Demo - Demo abilities used by this plugin
- Model Context Protocol - MCP specification
For issues and feature requests, please use the GitHub issue tracker.
This is an experimental demonstration plugin. If you'd like to contribute:
- Fork the repository
- Create a feature branch
- Make your changes following WordPress coding standards
- Test your changes thoroughly
- Submit a pull request