-
Notifications
You must be signed in to change notification settings - Fork 30
Add MCP (Model Context Protocol) experiment #152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Adds MCP server integration for WordPress: - Expose WordPress capabilities to AI assistants - REST API for MCP tool discovery - Admin UI for server configuration and testing
- Remove constructor property promotion (PHP 7.4 compatibility) - Use early exit pattern for cleaner code flow - Fix use statement alphabetical ordering - Remove unused imports - Replace short ternaries with full ternaries - Add phpcs:ignore for intentional timeout setting
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #152 +/- ##
==============================================
- Coverage 46.89% 31.12% -15.77%
- Complexity 208 346 +138
==============================================
Files 19 23 +4
Lines 1271 1934 +663
==============================================
+ Hits 596 602 +6
- Misses 675 1332 +657
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a comprehensive MCP (Model Context Protocol) experiment that enables AI assistants like Claude Desktop, Cursor, and VS Code to interact with WordPress capabilities via the Model Context Protocol. The implementation includes a full-stack solution with PHP backend management, React-based admin UI, REST API endpoints, and extensive configuration options.
Key Changes:
- Full MCP server management system with multi-server support and configurable routes
- React-based admin dashboard with DataViews for managing exposed abilities and server configuration
- REST API controller for server CRUD operations, tool management, and connection testing
- Auto-generated client configuration templates for popular MCP clients
Reviewed changes
Copilot reviewed 36 out of 36 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
webpack.config.js |
Adds entry point for admin/mcp-server bundle |
src/admin/mcp-server/types.ts |
TypeScript type definitions for MCP UI state |
src/admin/mcp-server/index.tsx |
Main React app component with state management |
src/admin/mcp-server/components/*.tsx |
React components for UI features (tools table, config generator, status cards) |
src/admin/mcp-server/style.scss |
Component styles and layout definitions |
src/admin/hooks/usePersistedView.ts |
Hook for persisting DataViews state |
src/admin/components/icons/*.tsx |
Provider icon components (AI, Anthropic, Google, etc.) |
src/admin/components/provider-icons.tsx |
Icon lookup utility |
src/admin/_dataviews.scss |
DataViews styling overrides |
src/admin/_common.scss |
Common admin page styles |
includes/Experiments/MCP/Manager.php |
Core PHP manager for MCP configuration and server lifecycle |
includes/Experiments/MCP/REST/MCP_Controller.php |
REST API endpoints for MCP operations |
includes/Experiments/MCP/Admin_Page.php |
Admin page registration and asset enqueuing |
includes/Experiments/MCP/MCP.php |
Experiment entry point and registration |
includes/Experiment_Loader.php |
Registers MCP experiment in loader |
docs/experiments/mcp.md |
Comprehensive documentation for the MCP experiment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Adds MCP server integration for WordPress, enabling AI assistants like Claude Desktop, Cursor, and VS Code to interact with WordPress capabilities via the Model Context Protocol.
Addresses #37
Features
Related
See also #63 (Abilities Explorer) - the MCP admin UI and Abilities Explorer share similar concepts around displaying and managing WordPress abilities. Future work could explore sharing components or patterns between them.
Changes
includes/Experiments/MCP/- PHP backend (Manager, Admin_Page, REST controller)src/admin/mcp-server/- React admin UI with DataViewsdocs/experiments/mcp.md- DocumentationTest plan