Skip to content

v0.2.5

Latest

Choose a tag to compare

@galatanovidiu galatanovidiu released this 24 Jul 15:02
· 12 commits to trunk since this release

Release Notes - Tools Validation and Linting Improvements

Overview

This release introduces a comprehensive validation infrastructure for MCP tools, improves code quality through enhanced linting, and adds new WP-CLI commands for tool validation and debugging.

🚀 New Features

WP-CLI Tool Validation Command

  • Added wp mcp validate-tools command for validating registered MCP tools
  • Support for specific tool validation with flexible options
  • Multiple validation levels (strict, extended, permissive)
  • Configurable output formats for different use cases
  • Comprehensive documentation with usage examples

Enhanced Validation System

  • New ValidateTool class providing comprehensive MCP tool validation
  • New SchemaValidator class for JSON schema loading and validation
  • Built-in caching mechanisms for improved performance
  • Detailed error handling and validation result reporting

JSON Schema Compliance

  • Complete JSON schema files for MCP tools specification
  • WordPress-specific schema extensions for plugin compatibility
  • Full compliance with Model Context Protocol standards
  • Support for schema caching and optimization

🔧 Improvements

Code Quality & Standards

  • Updated PHP compatibility from version 5.6 to 8.0
  • Enhanced PHPCS configuration with updated global prefixes and text domain
  • Added PHP linting scripts to package.json for automated code quality checks
  • Comprehensive code style improvements across the codebase

Validation Enhancements

  • Improved properties field validation supporting both array and object formats
  • Enhanced property name format checks for MCP compliance
  • Strengthened required fields validation with proper existence checking
  • Better error handling for edge cases in tool definitions

Method Signature Optimizations

  • Simplified method signatures by removing unused parameters:
    • list_resource_templates()
    • list_all_tools()
    • list_tokens()
    • get_user_info()
    • get_theme_info()
    • get_plugin_info()
    • get_site_settings()
  • Updated corresponding calls in McpTransportBase to reflect changes
  • Improved parameter naming for better code clarity

🐛 Bug Fixes

Plugin Initialization

  • Changed hook from plugins_loaded to init for better timing control
  • Renamed initialization function from init_wordpress_mcp to wordpress_mcp_init for consistency

Error Handling

  • Improved error logging using McpErrorHandler for consistent error management
  • Added PHPCS ignore comments for intentional usage of functions like base64_decode, file_get_contents, and error_log
  • Enhanced input sanitization for tool validation processes

Code Standards

  • Added translator comments for better internationalization support
  • Improved comment formatting with consistent periods for readability
  • Fixed strict comparison usage in status assignments

📚 Documentation

New Documentation

  • Comprehensive WP-CLI commands documentation in wp-cli-commands.md
  • Schema usage guide with validation levels and caching strategies
  • Detailed command options and examples for the validate-tools command

Updated Documentation

  • Enhanced inline documentation with translator comments
  • Improved exception documentation for resource callbacks
  • Better code comments for complex validation logic

🔄 Breaking Changes

  • Method signature changes may affect custom implementations extending base classes
  • Hook timing change from plugins_loaded to init may impact plugin load order dependencies
  • PHP version requirement updated from 5.6 to 8.0

🧪 Technical Details

Validation Levels

  • Strict: Full MCP specification compliance
  • Extended: WordPress-specific extensions allowed
  • Permissive: Flexible validation for development environments

Schema Structure

  • Base MCP tool schema for core functionality
  • WordPress extension schema for plugin-specific features
  • Caching system for improved validation performance

📋 Files Changed

  • 36 out of 38 files modified with comprehensive improvements
  • New utility classes: ValidateTool.php, SchemaValidator.php
  • New CLI command: ValidateToolsCommand.php
  • Updated core plugin file: wordpress-mcp.php
  • Enhanced build configuration: package.json, .phpcs.xml.dist

This release significantly enhances the development experience with robust validation tools, improved code quality standards, and comprehensive documentation for WordPress MCP plugin development.

Full Changelog: v0.2.4...v0.2.5

What's Changed

Full Changelog: v0.2.4...v0.2.5