这是indexloc提供的服务,不要输入任何密码
Skip to content

v0.3.0

Latest

Choose a tag to compare

@galatanovidiu galatanovidiu released this 06 Nov 15:51
· 1 commit to trunk since this release
653ca8d

Version 0.3.0 introduces significant architectural improvements with enhanced observability, streamlined transport infrastructure, and better error handling compliance.

Breaking Changes

Observability System Changes

Event Naming with Status Tags

All observability events now use unified names with a status tag instead of separate success/failure event names.

Before:
$handler->record_event('mcp.request.success', ['method' => 'tools/call']);
$handler->record_event('mcp.request.error', ['method' => 'tools/call']);

After:
$handler->record_event('mcp.request', ['status' => 'success', 'method' => 'tools/call']);
$handler->record_event('mcp.request', ['status' => 'error', 'method' => 'tools/call']);

Instance-Based Handlers

Observability handlers now use instance methods instead of static methods. If you have custom handlers implementing McpObservabilityHandlerInterface, update from static to instance methods:

// Before
class MyHandler implements McpObservabilityHandlerInterface {
    public static function record_event(string $event, array $tags = []): void { }
    public static function record_timing(string $metric, float $duration_ms, array $tags = []): void { }
}

// After
class MyHandler implements McpObservabilityHandlerInterface {
    public function record_event(string $event, array $tags = [], ?float $duration_ms = null): void {
        // Single method handles both events and timing
    }
}

Removed Method

McpObservabilityHelperTrait::record_error_event() has been removed. Use record_event() with status and error categorization instead.

Transport Layer Changes

Removed Transports

RestTransport and StreamableTransport have been removed and replaced by the unified HttpTransport class, which provides all functionality of both previous implementations with enhanced capabilities.

Migration:

All existing servers using these transports should update to use HttpTransport:

use WP\MCP\Transport\HttpTransport;

$adapter->create_server(
    'my-server',
    'namespace',
    'mcp',
    'Server Name',
    'Description',
    '1.0.0',
    [ HttpTransport::class ],  // Updated
    ErrorLogMcpErrorHandler::class
);

Hook Name Standardization

All WordPress filter/action names now use the mcp_adapter_ prefix for consistency:

// Before
add_filter('mcp_validation_enabled', $callback);

// After
add_filter('mcp_adapter_validation_enabled', $callback);## What's New

Unified HTTP Transport

The new HttpTransport class provides a modern, spec-compliant transport implementation with session management, streaming support, and enhanced error handling.

Enhanced Error Handling

Comprehensive refactoring to use WP_Error pattern throughout the codebase, replacing exceptions for better WordPress integration. All error responses now comply with the MCP specification format.

Metadata-Driven Observability

Observability events are now recorded centrally at the transport layer with automatic metadata extraction from handler responses, providing richer context and better performance tracking.

Improved Documentation

Updated guides covering transport permissions, custom transport implementation, error handling patterns, and comprehensive migration instructions.

Bug Fixes

  • Fixed metadata leaking into tool response content
  • Fixed null parameter handling in Prompts and Resources handlers
  • Fixed parameter handling for abilities without input schemas
  • Fixed WP_Error handling across all handler types
  • Fixed prompt input schema validation
  • Fixed WP-CLI initialization timing issues

Full Migration Guide

See docs/migration/v0.3.0.md for detailed migration instructions and examples.

What's Changed

New Contributors

Full Changelog: v0.1.0...v0.3.0