Skip to content

Conversation

@Jameswlepage
Copy link
Contributor

@Jameswlepage Jameswlepage commented Dec 19, 2025

CleanShot 2025-12-19 at 11 45 11@2x

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

  • MCP Server Management: Configure multiple MCP servers with customizable routes and transport options
  • Tool Discovery: Automatically expose WordPress abilities as MCP tools
  • Admin Dashboard: Full React-based admin UI for server configuration and monitoring
  • Client Configuration: Auto-generate config snippets for Claude Desktop, Cursor, Windsurf, VS Code, and JetBrains IDEs
  • Connection Testing: Built-in endpoint testing to verify server connectivity

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 DataViews
  • docs/experiments/mcp.md - Documentation

Test plan

  • Enable the MCP experiment in AI settings
  • Navigate to the MCP admin page
  • Verify server status shows as "Running"
  • Enable/disable specific tools via the tools table
  • Copy a client configuration and test in Claude Desktop or Cursor
  • Use the "Test connection" feature to verify endpoint

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
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 0.90498% with 657 lines in your changes missing coverage. Please review.
✅ Project coverage is 31.12%. Comparing base (7dbbc44) to head (04c167c).
⚠️ Report is 20 commits behind head on develop.

Files with missing lines Patch % Lines
includes/Experiments/MCP/Manager.php 0.00% 463 Missing ⚠️
includes/Experiments/MCP/REST/MCP_Controller.php 0.00% 126 Missing ⚠️
includes/Experiments/MCP/Admin_Page.php 0.00% 54 Missing ⚠️
includes/Experiments/MCP/MCP.php 26.31% 14 Missing ⚠️
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     
Flag Coverage Δ
unit 31.12% <0.90%> (-15.77%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

Copilot AI left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants