Skip to content

Conversation

@Jameswlepage
Copy link
Contributor

@Jameswlepage Jameswlepage commented Sep 1, 2025

⚠️ Draft PR - Exploration Only

Depends on #32 - This PR will only show demo-specific changes after the core MCP client PR is merged.

This is an exploratory branch to demonstrate what a comprehensive demo plugin could look like. I'm uncertain about the best home for this demo code:

  • Should this be a standalone demo plugin in the WordPress repository?
  • Should it be included in this repository alongside the core adapter?
  • Should it be integrated into the AI Experiments plugin?

It's a pretty large draft PR because it includes both the core edition of client support and the demo plugin to allow for testing and review.

Summary

  • Complete demo plugin showcasing MCP adapter usage patterns
  • Admin interface for managing MCP servers and clients
  • Dashboard widget with real-time MCP status
  • Practical examples for developers
  • Interactive testing tools

Demo Features

  • Admin Interface: Settings page for MCP server/client management
  • Dashboard Widget: Live status monitoring and quick actions
  • Example Abilities: Demonstrates tool, resource, and prompt patterns
  • Real-world Integration: Working examples with external MCP services

Questions for Review

This branch serves as a complete reference implementation while we decide on the best approach for demo/example code. The demo provides significant value for developers learning MCP integration patterns (and adds consumer functionality, which may be helpful for a MCP Canonical Plugin), but may create maintenance overhead if included in the core repository.

- Add McpClient class for connecting to external MCP servers
- Extend McpAdapter to manage both servers and clients
- Auto-register remote MCP capabilities as WordPress abilities
- Support multiple authentication methods (Bearer, API Key, Basic)
- Maintain architectural consistency with existing server patterns
- Add comprehensive usage examples and documentation

Remote MCP tools, resources, and prompts become accessible as:
- mcp_{client_id}/tool-name
- mcp_{client_id}/resource/resource-name
- mcp_{client_id}/prompt/prompt-name

This enables WordPress to both serve and consume MCP capabilities,
creating a powerful bidirectional integration with the MCP ecosystem.
- Add functional MCP client that connects to WordPress Domains MCP server
- Fix ability naming to comply with WordPress Abilities API requirements (lowercase, dashes only)
- Register remote MCP tools as WordPress abilities with proper labels and schemas
- Add admin interface showing connected clients and registered abilities
- Create public WordPress abilities (get-site-info, get-posts, search-content, get-menu)
- Handle MCP session management for different server types
- Clean up verbose debug logging for production readiness
- Remove prompt-to-ability conversion (prompts handled by MCP infrastructure)
Core MCP Adapter (minimal additions to trunk):
- Add McpClient.php for connecting to external MCP servers
- Add client support methods to McpAdapter.php
- Add comprehensive test coverage for client functionality
- Remove demo-specific functionality from core plugin

Demo Plugin (new separate plugin):
- Extract admin interface to demo/includes/Admin/
- Move examples to demo/examples/
- Create standalone demo plugin with proper dependency handling
- Showcase MCP adapter usage without bloating core package

wp-env Configuration:
- Update to load both core adapter and demo plugin
- Proper plugin load order with dependency management

This creates a clean separation where the core adapter provides
infrastructure while the demo showcases comprehensive usage patterns.
- Fix undefined constant WP_MCP_DEMO_DIR in demo autoloader
- Remove invalid 'context' property from ability registration (not supported by Abilities API)
- Clean up demo examples to be focused and practical
- Resolve HTTP 500 errors in wp-env admin interface
- Add dashboard widget documentation to demo README
- Update docs README with MCP client integration section
- Enhance MCP client guide with implementation details and limitations
- Include new dashboard widget files and assets in demo structure
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